Class SimilarityGraphBasedReactionMapper


  • public class SimilarityGraphBasedReactionMapper
    extends java.lang.Object
    • Constructor Detail

      • SimilarityGraphBasedReactionMapper

        public SimilarityGraphBasedReactionMapper()
    • Method Detail

      • map

        public void map​(Reaction rxn)
        Entirely maps the given reaction by setting all reactant's and product's mapping numbers. If the reaction already contains manually mapped atoms, then these are untouched and used as seed atoms when building the mapping graph.
        Parameters:
        rxn - reaction with proper atom coordinates
      • map

        public void map​(StereoMolecule reactant,
                        StereoMolecule product,
                        int[] reactantMapNo,
                        int[] productMapNo)
        Entirely maps the given reaction by setting all reactant's and product's mapping numbers.
        Parameters:
        reactant - all reactants merged into one molecule; may contain seed mapping
        product - all products merged into one molecule; may contain seed mapping
        reactantMapNo - array to receive the created mapping numbers
        productMapNo - array to receive the created mapping numbers
      • getGraphMapNoCount

        public int getGraphMapNoCount()
        Returns:
        number of atoms that could be mapped by graph similarity matching (no reaction center mapping)
      • getAtomPairSequenceCount

        public int getAtomPairSequenceCount()
        Returns:
        number of atom pair sequences tried in the course of the last mapping run
      • getScore

        public float getScore()
        Calculates and returns a score <= 0 for the current mapping. Higher value (closer to 0) are better. The score adds about -2 for every broken or added bond, and about -1 for every changed bond order. It also adds a penalty for every inverted stereo center.
        Returns:
      • mergeReactantsAndProducts

        public void mergeReactantsAndProducts​(Reaction rxn)
        Copies all reactant/product molecules into one StereoMolecule for easier processing Use getReactant() and getProduct() from outside to access these.
        Parameters:
        rxn -
      • copyMapNosToReaction

        public void copyMapNosToReaction​(Reaction rxn,
                                         int[] reactantMapNo,
                                         int[] productMapNo,
                                         int graphMapNoCount)
        Copies the generated mapping numbers from the merged reactant/product molecules into the original reaction.
        Parameters:
        rxn -
      • hasOxo

        public static boolean hasOxo​(StereoMolecule mol,
                                     int atom)
      • hasOxo

        public static boolean hasOxo​(StereoMolecule mol,
                                     int atom,
                                     int notThisAtom)
      • hasNonCarbonNeighbour

        public static boolean hasNonCarbonNeighbour​(StereoMolecule mol,
                                                    int atom)
      • hasNonCarbonNeighbour

        public static boolean hasNonCarbonNeighbour​(StereoMolecule mol,
                                                    int atom,
                                                    int notThisAtom)