|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.sss.search.MCS
public class MCS
The MCS class find the largest substructure common to two molecular structures.
It supports various options when the two molecules' graphs are matched against each other: it can either ignore or
take atom type, bond type, charge, hybridization into account.
The present implementation searches for the connected MCES (maximum common edge subgraph).
The class provides a simple command-line interface too. It takes two molecular structures and calculates (and outputs) their MCES.
| Field Summary | |
|---|---|
static int |
DEFAULT_MIN_COMMON_SIZE
default minimum size of common structures, do not find smaller than this |
static int |
MODE_EXACT
Exact MCS search mode. |
static int |
MODE_FAST
A well balanced compromise between MODE_EXACT and MODE_TURBO. |
static int |
MODE_TURBO
Fastest search mode. |
| Constructor Summary | |
|---|---|
MCS()
Creates a new object for common structure search. |
|
| Method Summary | |
|---|---|
boolean |
findFirst()
Performs graph matching according to the mode set. |
boolean |
findNext()
Searches for the next hit. |
int[] |
getResult()
Gets the result of an MCS/MCES/SSS search. |
Molecule |
getResultAsMolecule()
Gets the MCS/MCES as a structure represented by a Molecules
object. |
java.lang.String |
getResultAsSmiles(boolean unique)
Gets the MCS/MCES as structure represented as SMILES. |
int[] |
getResultQueryAtoms()
Gets query atoms that are part of the MCS/MCES. |
MolBond[] |
getResultQueryBonds()
Gets bonds of the query structure that are part of the MCS/MCES found. |
int |
getResultSize()
Gets the size (number of atoms) of the MCS/MCES (and SSS) found. |
int[] |
getResultTargetAtoms()
Gets target atoms that are part of the MCS/MCES. |
MolBond[] |
getResultTargetBonds()
Gets bonds of the target structure that are part of the MCS/MCES found. |
static void |
main(java.lang.String[] args)
Simple command line interface mainly for testing purposes. |
boolean |
search()
Performs graph matching according to the mode set. |
void |
setDontBreakRingBonds(boolean dontBreakRingBond)
|
void |
setFastSearch(boolean fastSearch)
Deprecated. use setMode(MODE_TURBO) instead |
void |
setIgnoreAtomType(boolean ignore)
Sets atom type matching mode. |
void |
setIgnoreBondType(boolean ignore)
Sets bond type matching mode. |
void |
setIgnoreCharge(boolean ignore)
Sets atom formal charge matching mode. |
void |
setIgnoreHybridization(boolean ignore)
Sets atom hybridization matching mode. |
void |
setIgnoreIsotopes(boolean ignore)
Sets isotope matching mode. |
void |
setIgnoreQueryProperties(boolean ignore)
Deprecated. Since version 5.0 query properties are not supported by the MCS search. |
void |
setMCESMode(boolean mcesMode)
Deprecated. MCES is the only structure matching mode supported by the MCS class from version 5.0. |
void |
setMCSMode(boolean mcsMode)
Deprecated. Strict MCS (vs. MCES) is not available from version 5.0 |
void |
setMinimumCommonSize(int minMCSsize)
Sets the minimum required size of the MCS found. |
void |
setMode(int mcsMode)
Sets searching strategy for the MCS search. |
void |
setMolecules(Molecule query,
Molecule target)
Sets the two molecular structure graphs to be matched. |
void |
setQuery(Molecule query)
Sets the two molecular structure graphs to be matched. |
void |
setSSSMode(boolean sssMode)
Deprecated. Substructure search is not supported by MCS form version 5.0 |
void |
setTarget(Molecule target)
Sets the two molecular structure graphs to be matched. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MIN_COMMON_SIZE
public static final int MODE_EXACT
public static final int MODE_TURBO
setFastSearch( false ) which is the default
anyway.
public static final int MODE_FAST
MODE_EXACT and MODE_TURBO.
| Constructor Detail |
|---|
public MCS()
| Method Detail |
|---|
public void setQuery(Molecule query)
query - query moleculepublic void setTarget(Molecule target)
target - target moleculepublic void setMinimumCommonSize(int minMCSsize)
minMCSsize - minimum size of MCSpublic void setIgnoreAtomType(boolean ignore)
ignore - ignore atom type (true) or take it into account (false)
public void setMolecules(Molecule query,
Molecule target)
query - query moleculetarget - target moleculepublic void setIgnoreCharge(boolean ignore)
ignore - ignore atom charge (true) or take it into account (false)public void setIgnoreHybridization(boolean ignore)
ignore - ignore atom hybridization (true) or take it into account (false)public void setIgnoreIsotopes(boolean ignore)
ignore - ignore isotopes (true) or take them into account (false)public void setIgnoreBondType(boolean ignore)
ignore - ignore bond type (true) or take it into account (false)public void setIgnoreQueryProperties(boolean ignore)
ignore - ignore/consider query propertiespublic void setDontBreakRingBonds(boolean dontBreakRingBond)
public void setMCSMode(boolean mcsMode)
mcsMode - search for maximum common subgraphpublic void setMCESMode(boolean mcesMode)
mcesMode - search for maximum common edge subgraphpublic void setSSSMode(boolean sssMode)
sssMode - substructure searchpublic void setMode(int mcsMode)
MODE_EXACT - exhaustive searchMODE_FAST - fester search allowing heuristic pruning, optimum solution is not guaranteed
to be found but it's very likelyMODE_TURBO - heuristic search, which is the fastest but there are cases when optimum solution
is not found
mcsMode - search strategy for maximum common substructurepublic void setFastSearch(boolean fastSearch)
setMode(MODE_TURBO) instead
setFastSearch( false ) which is the default anyway.
fastSearch - fast or normal search speedpublic boolean search()
public boolean findFirst()
search() except that it allows the
subsequent call of findNext().
public boolean findNext()
findFirst().
public int[] getResult()
public int getResultSize()
public java.lang.String getResultAsSmiles(boolean unique)
unique - indicates if unique smiles are required to be returned
public Molecule getResultAsMolecule()
Molecules
object.
Moleculepublic int[] getResultQueryAtoms()
public int[] getResultTargetAtoms()
public MolBond[] getResultQueryBonds()
public MolBond[] getResultTargetBonds()
public static void main(java.lang.String[] args)
args - command line arguments (filenames, flags, options)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||