@Deprecated public final class Isomorphism extends AbstractMCS implements Serializable
This class implements the Isomorphism- a multipurpose structure comparison tool. It allows users to, i) find the maximal common substructure(s) (MCS); ii) perform the mapping of a substructure in another structure, and; iii) map two isomorphic structures.
It also comes with various published algorithms. The user is free to choose his favorite algorithm to perform MCS or substructure search. For example 0: Isomorphism algorithm, 1: MCSPlus, 2: VFLibMCS, 3: CDKMCS, 4: Substructure
It also has a set of robust chemical filters (i.e. bond energy, fragment count, stereo & bond match) to sort the reported MCS solutions in a chemically relevant manner. Each comparison can be made with or without using the bond sensitive mode and with implicit or explicit hydrogens.
If you are using Isomorphism, please cite Rahman et.al. 2009 (Rahman, S.A. et. al.. Journal of Cheminformatics. 2009. 1). The Isomorphism algorithm is described in this paper.
An example for Substructure search:
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
// Benzene
IAtomContainer A1 = sp.parseSmiles("C1=CC=CC=C1");
// Napthalene
IAtomContainer A2 = sp.parseSmiles("C1=CC2=C(C=C1)C=CC=C2");
//Turbo mode search
//Bond Sensitive is set true
Isomorphism comparison = new Isomorphism(Algorithm.SubStructure, true);
// set molecules, remove hydrogens, clean and configure molecule
comparison.init(A1, A2, true, true);
// set chemical filter true
comparison.setChemFilters(false, false, false);
if (comparison.isSubgraph()) {
//Get similarity score
System.out.println("Tanimoto coefficient: " + comparison.getTanimotoSimilarity());
System.out.println("A1 is a subgraph of A2: " + comparison.isSubgraph());
//Get Modified AtomContainer
IAtomContainer Mol1 = comparison.getReactantMolecule();
IAtomContainer Mol2 = comparison.getProductMolecule();
// Print the mapping between molecules
System.out.println(" Mappings: ");
for (Map.Entry <Integer, Integer> mapping : comparison.getFirstMapping().entrySet()) {
System.out.println((mapping.getKey() + 1) + " " + (mapping.getValue() + 1));
IAtom eAtom = Mol1.getAtom(mapping.getKey());
IAtom pAtom = Mol2.getAtom(mapping.getValue());
System.out.println(eAtom.getSymbol() + " " + pAtom.getSymbol());
}
System.out.println("");
}
An example for MCS search:
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
// Benzene
IAtomContainer A1 = sp.parseSmiles("C1=CC=CC=C1");
// Napthalene
IAtomContainer A2 = sp.parseSmiles("C1=CC2=C(C=C1)C=CC=C2");
//{ 0: Default Isomorphism Algorithm, 1: MCSPlus Algorithm, 2: VFLibMCS Algorithm, 3: CDKMCS Algorithm}
//Bond Sensitive is set true
Isomorphism comparison = new Isomorphism(Algorithm.DEFAULT, true);
// set molecules, remove hydrogens, clean and configure molecule
comparison.init(A1, A2, true, true);
// set chemical filter true
comparison.setChemFilters(true, true, true);
//Get similarity score
System.out.println("Tanimoto coefficient: " + comparison.getTanimotoSimilarity());
System.out.println("A1 is a subgraph of A2: " + comparison.isSubgraph());
//Get Modified AtomContainer
IAtomContainer Mol1 = comparison.getReactantMolecule();
IAtomContainer Mol2 = comparison.getProductMolecule();
// Print the mapping between molecules
System.out.println(" Mappings: ");
for (Map.Entry <Integer, Integer> mapping : comparison.getFirstMapping().entrySet()) {
System.out.println((mapping.getKey() + 1) + " " + (mapping.getValue() + 1));
IAtom eAtom = Mol1.getAtom(mapping.getKey());
IAtom pAtom = Mol2.getAtom(mapping.getValue());
System.out.println(eAtom.getSymbol() + " " + pAtom.getSymbol());
}
System.out.println("");
| Constructor and Description |
|---|
Isomorphism(Algorithm algorithmType,
boolean bondTypeFlag)
Deprecated.
This is the algorithm factory and entry port for all the MCS algorithm in the Isomorphism
supported algorithm
Algorithm types:
0: Default,
1: MCSPlus,
2: VFLibMCS,
3: CDKMCS,
4: SubStructure
|
| Modifier and Type | Method and Description |
|---|---|
List<Map<IAtom,IAtom>> |
getAllAtomMapping()
Deprecated.
Returns all plausible mappings between query and target molecules
Each map in the list has atom-atom equivalence of the mappings
between query and target molecule i.e.
|
List<Map<IBond,IBond>> |
getAllBondMaps()
Deprecated.
|
List<Map<Integer,Integer>> |
getAllMapping()
Deprecated.
Returns all plausible mappings between query and target molecules
Each map in the list has atom-atom equivalence index of the mappings
between query and target molecule i.e.
|
double |
getBondInSensitiveTimeOut()
Deprecated.
get timeout in mins for bond insensitive searches
|
double |
getBondSensitiveTimeOut()
Deprecated.
get timeout in mins for bond sensitive searches
|
Double |
getEnergyScore(int key)
Deprecated.
Returns summation energy score of the disorder if the MCS is removed
from the target and query graph.
|
double |
getEuclideanDistance()
Deprecated.
Returns Euclidean Distance between query and target molecule.
|
Map<IAtom,IAtom> |
getFirstAtomMapping()
Deprecated.
Returns one of the best matches with atoms mapped.
|
Map<IBond,IBond> |
getFirstBondMap()
Deprecated.
|
Map<Integer,Integer> |
getFirstMapping()
Deprecated.
Returns one of the best matches with atom indexes mapped.
|
Integer |
getFragmentSize(int key)
Deprecated.
Returns number of fragment generated in the solution space,
if the MCS is removed from the target and query graph.
|
IAtomContainer |
getProductMolecule()
Deprecated.
Returns modified target molecule on which mapping was
performed.
|
IAtomContainer |
getReactantMolecule()
Deprecated.
Returns modified query molecule on which mapping was
performed.
|
Integer |
getStereoScore(int key)
Deprecated.
Returns a number which denotes the quality of the mcs.
|
double |
getTanimotoAtomSimilarity()
Deprecated.
|
double |
getTanimotoBondSimilarity()
Deprecated.
|
double |
getTanimotoSimilarity()
Deprecated.
Returns Tanimoto similarity between query and target molecules
(Score is between 0-min and 1-max).
|
void |
init(IAtomContainer reactant,
IAtomContainer product,
boolean removeHydrogen,
boolean cleanAndConfigureMolecule)
Deprecated.
initialize query and target molecules.
|
void |
init(IQueryAtomContainer reactant,
IAtomContainer product)
Deprecated.
initialize query and target molecules.
|
void |
init(String sourceMolFileName,
String targetMolFileName,
boolean removeHydrogen,
boolean cleanAndConfigureMolecule)
Deprecated.
Initialize the query and targetAtomCount mol via mol files
|
boolean |
isMatchBonds()
Deprecated.
|
boolean |
isStereoMisMatch()
Deprecated.
Returns true if mols have different stereo
chemistry else false if no stereo mismatch.
|
boolean |
isSubgraph()
Deprecated.
Checks if query is a subgraph of the target.
|
boolean |
isTimeOut()
Deprecated.
|
static Map<IBond,IBond> |
makeBondMapOfAtomMap(IAtomContainer ac1,
IAtomContainer ac2,
Map<IAtom,IAtom> mapping)
Deprecated.
Returns bond map between source and target molecules based on the atoms
|
static List<Map<IBond,IBond>> |
makeBondMapsOfAtomMaps(IAtomContainer ac1,
IAtomContainer ac2,
List<Map<IAtom,IAtom>> mappings)
Deprecated.
Returns bond maps between source and target molecules based on the atoms
|
void |
resetTimeOut()
Deprecated.
|
void |
setBondInSensitiveTimeOut(double bondInSensitiveTimeOut)
Deprecated.
set timeout in mins (default 1.00 min) for bond insensitive searches
|
void |
setBondSensitiveTimeOut(double bondSensitiveTimeOut)
Deprecated.
set timeout in mins (default 0.10 min) for bond sensitive searches
|
void |
setChemFilters(boolean stereoFilter,
boolean fragmentFilter,
boolean energyFilter)
Deprecated.
initialize query and target molecules.
|
void |
setMatchBonds(boolean matchBonds)
Deprecated.
|
public Isomorphism(Algorithm algorithmType, boolean bondTypeFlag)
Algorithm types:
algorithmType - AlgorithmbondTypeFlag - public static List<Map<IBond,IBond>> makeBondMapsOfAtomMaps(IAtomContainer ac1, IAtomContainer ac2, List<Map<IAtom,IAtom>> mappings)
ac1 - source moleculeac2 - target moleculemappings - mappings between source and target molecule atomspublic static Map<IBond,IBond> makeBondMapOfAtomMap(IAtomContainer ac1, IAtomContainer ac2, Map<IAtom,IAtom> mapping)
ac1 - source moleculeac2 - target moleculemapping - mappings between source and target molecule atomspublic boolean isTimeOut()
public void resetTimeOut()
public void init(IQueryAtomContainer reactant, IAtomContainer product) throws CDKException
AbstractMCSinit in class AbstractMCSreactant - product - CDKExceptionpublic void init(IAtomContainer reactant, IAtomContainer product, boolean removeHydrogen, boolean cleanAndConfigureMolecule) throws CDKException
init in class AbstractMCSreactant - product - removeHydrogen - true if remove H (implicit) before mappingcleanAndConfigureMolecule - eg: percieveAtomTypesAndConfigureAtoms, detect aromaticity etcCDKExceptionpublic void init(String sourceMolFileName, String targetMolFileName, boolean removeHydrogen, boolean cleanAndConfigureMolecule) throws CDKException
sourceMolFileName - source mol file nametargetMolFileName - target mol file nameremoveHydrogen - set true to make hydrogens implicit before searchcleanAndConfigureMolecule - eg: percieveAtomTypesAndConfigureAtoms, detect aromaticity etcCDKExceptionpublic void setChemFilters(boolean stereoFilter,
boolean fragmentFilter,
boolean energyFilter)
setChemFilters in class AbstractMCSstereoFilter - set true to rank the solutions as per stereo matchesfragmentFilter - set true to return matches with minimum fragmentsenergyFilter - set true to return matches with minimum bond changes
based on the bond breaking energypublic Integer getFragmentSize(int key)
getFragmentSize in class AbstractMCSkey - Index of the mapping solutionpublic Integer getStereoScore(int key)
getStereoScore in class AbstractMCSkey - Index of the mapping solutionpublic Double getEnergyScore(int key)
getEnergyScore in class AbstractMCSkey - Index of the mapping solutionpublic Map<Integer,Integer> getFirstMapping()
getFirstMapping in class AbstractMCSpublic List<Map<Integer,Integer>> getAllMapping()
getAllMapping in class AbstractMCSpublic Map<IAtom,IAtom> getFirstAtomMapping()
getFirstAtomMapping in class AbstractMCSpublic List<Map<IAtom,IAtom>> getAllAtomMapping()
getAllAtomMapping in class AbstractMCSpublic IAtomContainer getReactantMolecule()
getReactantMolecule in class AbstractMCSpublic IAtomContainer getProductMolecule()
getProductMolecule in class AbstractMCSpublic double getTanimotoSimilarity()
throws IOException
getTanimotoSimilarity in class AbstractMCSIOExceptionpublic double getTanimotoAtomSimilarity()
throws IOException
IOExceptionpublic double getTanimotoBondSimilarity()
throws IOException
IOExceptionpublic boolean isStereoMisMatch()
isStereoMisMatch in class AbstractMCSpublic boolean isSubgraph()
isSubgraph in class AbstractMCSpublic double getEuclideanDistance()
throws IOException
getEuclideanDistance in class AbstractMCSIOExceptionpublic double getBondSensitiveTimeOut()
getBondSensitiveTimeOut in class AbstractMCSpublic void setBondSensitiveTimeOut(double bondSensitiveTimeOut)
setBondSensitiveTimeOut in class AbstractMCSbondSensitiveTimeOut - the bond Sensitive Timeout in mins (default 0.10 min)public double getBondInSensitiveTimeOut()
getBondInSensitiveTimeOut in class AbstractMCSpublic void setBondInSensitiveTimeOut(double bondInSensitiveTimeOut)
setBondInSensitiveTimeOut in class AbstractMCSbondInSensitiveTimeOut - the bond insensitive Timeout in mins (default 0.15 min)public boolean isMatchBonds()
public void setMatchBonds(boolean matchBonds)
matchBonds - the matchBonds to setCopyright © 2021. All rights reserved.