Class SSSearcher


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

      • SSSearcher

        public SSSearcher()
        Instantiates a SSSearcher object for running sub-structure searches with one or more sub-structure fragments on one or more molecules. The search is a pure graph matching algorithm. For fast sub-structure searches involving an index based pre-screening use the class SSSearcherWithIndex. For a more high-level structure search supporting multiple cores, sub-structure-, similarity-, exact-, or tautomer-search use class StructureSearch and related classes.
      • SSSearcher

        public SSSearcher​(int matchMode)
        Instantiates a SSSearcher object for running sub-structure searches with one or more sub-structure fragments on one or more molecules. The search is a pure graph matching algorithm. For fast sub-structure searches involving an index based pre-screening use the class SSSearcherWithIndex. For a more high-level structure search supporting multiple cores, sub-structure-, similarity-, exact-, or tautomer-search use class StructureSearch and related classes.
        Parameters:
        matchMode - combination of cMatchAtomCharge, cMatchAtomMass, cMatchDBondToDelocalized, cMatchAromDBondToDelocalized
    • Method Detail

      • setMol

        public void setMol​(StereoMolecule fragment,
                           StereoMolecule molecule)
        Defines fragment and molecule before calling isFragmentInMolecule(...) or findFragmentInMolecule(...).
        Parameters:
        fragment -
        molecule -
      • setMolecule

        public void setMolecule​(StereoMolecule molecule)
        Defines the molecule to be used in isFragmentInMolecule(...) or findFragmentInMolecule(...).
        Parameters:
        molecule -
      • setFragment

        public void setFragment​(StereoMolecule fragment)
        Defines the fragment to be used in isFragmentInMolecule(...) or findFragmentInMolecule(...).
        Parameters:
        fragment -
      • getMatchList

        public java.util.ArrayList<int[]> getMatchList()
        If the match count mode is one of cCountModeFirstMatch, cCountModeOverlapping, cCountModeRigorous then this method returns an arraylist of all counted matches, i.e. int arrays mapping fragment atoms to molecule atoms. Atoms being part of a matched bridge bond are naturally not covered by the mapping.
        Note: If some query fragment atoms are marked as exclude group, then the respective matchlist values are -1.
        Returns:
        list of distinct counted matches.
      • isFragmentInMolecule

        public boolean isFragmentInMolecule()
        Fastest check, whether the molecule contains the fragment. This method uses cCountModeExistance and therefore does not create any retrievable match list, i.e. mapping from fragment atoms to molecule atoms. The match mode used is cDefaultMatchMode, unless defined otherwise when instantiating the SSSearcher.
        Returns:
        whether fragment was found as sub-structure in molecule
      • isFragmentInMolecule

        public boolean isFragmentInMolecule​(int matchMode)
        Fastest check, whether the molecule contains the fragment. This method uses cCountModeExistance and therefore does not create any retrievable match list, i.e. mapping from fragment atoms to molecule atoms.
        Parameters:
        matchMode - cDefaultMatchMode or combination of cMatchAtomCharge, cMatchAtomMass, cMatchDBondToDelocalized, cMatchAromDBondToDelocalized
        Returns:
        whether fragment was found as sub-structure in molecule
      • findFragmentInMolecule

        public int findFragmentInMolecule()
        Locates all matches of the fragment in the molecule that result in distinguishable sets of molecule atoms. Multiple matches involving the same atoms, e.g. with a benzene ring, are counted and listed only once. Atom mapping from fragment to molecule is collected and can be retrieved with getMatchList().
        Returns:
        count of sub-structure matches of fragment in molecule
      • findFragmentInMolecule

        public int findFragmentInMolecule​(int countMode,
                                          int matchMode)
        Locates all matches of the fragment in the molecule that result in distinguishable sets of molecule atoms. Multiple matches involving the same atoms, e.g. with a benzene ring, are counted and listed only once. If count mode is different from cCountModeExistance, then an atom mapping from fragment to molecule is collected and can be retrieved with getMatchList().
        Parameters:
        countMode - one of cCountModeExistance, cCountModeFirstMatch, cCountModeOverlapping, cCountModeRigorous
        matchMode - cDefaultMatchMode or combination of cMatchAtomCharge, cMatchAtomMass, cMatchDBondToDelocalized, cMatchAromDBondToDelocalized
        Returns:
        count of sub-structure matches of fragment in molecule
      • findFragmentInMolecule

        public int findFragmentInMolecule​(int countMode,
                                          int matchMode,
                                          boolean[] atomExcluded)
        Locates all matches of the fragment in the molecule that result in distinguishable sets of molecule atoms that are not flagged to be excluded from matching. Multiple matches involving the same atoms, e.g. with a benzene ring, are counted and listed only once. If count mode is different from cCountModeExistance, then an atom mapping from fragment to molecule is collected and can be retrieved with getMatchList(). If the query fragment does not contain atoms other than exclude group atoms, then no match is returned.
        Parameters:
        countMode - one of cCountModeExistance, cCountModeFirstMatch, cCountModeOverlapping, cCountModeRigorous
        matchMode - cDefaultMatchMode or combination of cMatchAtomCharge, cMatchAtomMass, cMatchDBondToDelocalized, cMatchAromDBondToDelocalized
        atomExcluded - defines atoms of molecule to be excluded from sub-structure matching
        Returns:
        count of sub-structure matches of fragment in molecule
      • areAtomsSimilar

        public boolean areAtomsSimilar​(int moleculeAtom,
                                       int fragmentAtom)
      • areBondsSimilar

        public boolean areBondsSimilar​(int moleculeBond,
                                       int fragmentBond)
        Parameters:
        moleculeBond - flag list of fragment bond features (features present)
        fragmentBond - flag list of molecule bond features (features allowed)
        Returns:
        true if all molecule bond features are present in fragment bond
      • setupAtomAndBondFeatures

        public void setupAtomAndBondFeatures​(int matchMode)