chemaxon.sss.search
Class MCS

java.lang.Object
  extended by chemaxon.sss.search.MCS
All Implemented Interfaces:
chemaxon.license.Licensable

Deprecated. As of JChem 5.4, use MCES instead

public class MCS
extends java.lang.Object
implements chemaxon.license.Licensable

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.

As of JChem 5.4, a new class MCES is introduced with almost the same functionality as this class, but it implements a more powerful and reliable algorithm.

Since:
JChem 3.0
Author:
Miklos Vargyas, Peter Kovacs (pkovacs84)

Field Summary
static int DEFAULT_MIN_COMMON_SIZE
          Deprecated. default minimum size of common structures, do not find smaller than this
static int MODE_EXACT
          Deprecated. Exact MCS search mode.
static int MODE_FAST
          Deprecated. A well balanced compromise between MODE_EXACT and MODE_TURBO.
static int MODE_TURBO
          Deprecated. Fastest search mode.
 
Constructor Summary
MCS()
          Deprecated. Creates a new object for common structure search.
 
Method Summary
 boolean findFirst()
          Deprecated. since 5.4
 boolean findNext()
          Deprecated. since 5.4
 int[] getResult()
          Deprecated. Gets the result of an MCS/MCES/SSS search.
 Molecule getResultAsMolecule()
          Deprecated. Gets the MCS/MCES as a structure represented by a Molecules object.
 java.lang.String getResultAsSmiles(boolean unique)
          Deprecated. Gets the MCS/MCES as structure represented as SMILES.
 int[] getResultQueryAtoms()
          Deprecated. Gets query atoms that are part of the MCS/MCES.
 MolBond[] getResultQueryBonds()
          Deprecated. Gets bonds of the query structure that are part of the MCS/MCES found.
 int getResultSize()
          Deprecated. Gets the size (number of atoms) of the MCS/MCES (and SSS) found.
 int[] getResultTargetAtoms()
          Deprecated. Gets target atoms that are part of the MCS/MCES.
 MolBond[] getResultTargetBonds()
          Deprecated. Gets bonds of the target structure that are part of the MCS/MCES found.
 boolean isLicensed()
          Deprecated. Returns information about the licensing of the product.
 boolean search()
          Deprecated. Performs graph matching.
 void setDontBreakRingBonds(boolean dontBreakRingBond)
          Deprecated. since 5.4
 void setFastSearch(boolean fastSearch)
          Deprecated. use setMode(MODE_TURBO) instead
 void setIgnoreAtomType(boolean ignore)
          Deprecated. Sets atom type matching mode.
 void setIgnoreBondType(boolean ignore)
          Deprecated. Sets bond type matching mode.
 void setIgnoreCharge(boolean ignore)
          Deprecated. Sets atom formal charge matching mode.
 void setIgnoreHybridization(boolean ignore)
          Deprecated. Sets atom hybridization matching mode.
 void setIgnoreIsotopes(boolean ignore)
          Deprecated. Sets isotope matching mode.
 void setIgnoreQueryProperties(boolean ignore)
          Deprecated. since 5.0
 void setLicenseEnvironment(java.lang.String env)
          Deprecated. Sets the license environment.
 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)
          Deprecated. Sets the minimum required size of the MCS found.
 void setMode(int mcsMode)
          Deprecated. since 5.4
 void setMolecules(Molecule query, Molecule target)
          Deprecated. Sets the two molecular structure graphs to be matched.
 void setQuery(Molecule query)
          Deprecated. Sets the query molecule.
 void setSSSMode(boolean sssMode)
          Deprecated. Substructure search is not supported by MCS form version 5.0
 void setTarget(Molecule target)
          Deprecated. Sets the target molecule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MIN_COMMON_SIZE

public static final int DEFAULT_MIN_COMMON_SIZE
Deprecated. 
default minimum size of common structures, do not find smaller than this

See Also:
Constant Field Values

MODE_EXACT

public static final int MODE_EXACT
Deprecated. 
Exact MCS search mode.

See Also:
Constant Field Values

MODE_TURBO

public static final int MODE_TURBO
Deprecated. 
Fastest search mode.

See Also:
Constant Field Values

MODE_FAST

public static final int MODE_FAST
Deprecated. 
A well balanced compromise between MODE_EXACT and MODE_TURBO.

See Also:
Constant Field Values
Constructor Detail

MCS

public MCS()
Deprecated. 
Creates a new object for common structure search.

Method Detail

isLicensed

public boolean isLicensed()
Deprecated. 
Returns information about the licensing of the product.

Specified by:
isLicensed in interface chemaxon.license.Licensable
Returns:
true if the product is correctly licensed

setLicenseEnvironment

public void setLicenseEnvironment(java.lang.String env)
Deprecated. 
Sets the license environment.

Specified by:
setLicenseEnvironment in interface chemaxon.license.Licensable

setMolecules

public void setMolecules(Molecule query,
                         Molecule target)
Deprecated. 
Sets the two molecular structure graphs to be matched.

Parameters:
query - query molecule
target - target molecule

setQuery

public void setQuery(Molecule query)
Deprecated. 
Sets the query molecule.

Parameters:
query - query molecule

setTarget

public void setTarget(Molecule target)
Deprecated. 
Sets the target molecule.

Parameters:
target - target molecule

setMinimumCommonSize

public void setMinimumCommonSize(int minMCSsize)
Deprecated. 
Sets the minimum required size of the MCS found. Common parts below this size limit are ignored.

Parameters:
minMCSsize - minimum size of MCS

setIgnoreAtomType

public void setIgnoreAtomType(boolean ignore)
Deprecated. 
Sets atom type matching mode. By default atom types are considered (not ignored) in matching.

Parameters:
ignore - ignore atom type (true) or take it into account (false)

setIgnoreBondType

public void setIgnoreBondType(boolean ignore)
Deprecated. 
Sets bond type matching mode. By default bond types are considered (not ignored) in matching, that is, a double bond does not match a single bond etc.

Parameters:
ignore - ignore bond type (true) or take it into account (false)

setIgnoreCharge

public void setIgnoreCharge(boolean ignore)
Deprecated. 
Sets atom formal charge matching mode. By default atom charges are ignored (not considered) in matching.

Parameters:
ignore - ignore atom charge (true) or take it into account (false)

setIgnoreHybridization

public void setIgnoreHybridization(boolean ignore)
Deprecated. 
Sets atom hybridization matching mode. By default atom hybridization states are ignored (not considered) in matching.

Parameters:
ignore - ignore atom hybridization (true) or take it into account (false)

setIgnoreIsotopes

public void setIgnoreIsotopes(boolean ignore)
Deprecated. 
Sets isotope matching mode. By default, isotopes of the same element match each other, that is, the mass number is ignored (not considered) in matching.

Parameters:
ignore - Ignore isotope checking (true) or take them into account (false).

setIgnoreQueryProperties

public void setIgnoreQueryProperties(boolean ignore)
Deprecated. since 5.0

Sets query mode.


setDontBreakRingBonds

public void setDontBreakRingBonds(boolean dontBreakRingBond)
Deprecated. since 5.4

Sets ring breaking mode.


setMCSMode

public void setMCSMode(boolean mcsMode)
Deprecated. Strict MCS (vs. MCES) is not available from version 5.0

Sets matching mode to Maximimum Common Subgraph. In this implementation MCS is always one connected component.
This method does not change atom and bond matching mode flags.

Parameters:
mcsMode - search for maximum common subgraph

setMCESMode

public void setMCESMode(boolean mcesMode)
Deprecated. MCES is the only structure matching mode supported by the MCS class from version 5.0.

Sets matching mode to Maximimum Common Edge Subgraph. This is often reffered to as the induced subgraph in the literature. In most cheminformatics applications MCES is saught for rather than MCS, though often MCES is ment when MCS is said.
This is the default matching mode.
In this implementation MCES is one connected component.
This method does not change atom and bond matching mode flags.

Parameters:
mcesMode - search for maximum common edge subgraph

setSSSMode

public void setSSSMode(boolean sssMode)
Deprecated. Substructure search is not supported by MCS form version 5.0

Sets matching mode to SubStructure Search. In this mode the role of the query graph and the target graph is not symmetrical and NOT interchangeble.
This method sets atom type and bond type related flags to take atom type, charge and bond type into account in search (however, isotope types are not considered).

Parameters:
sssMode - substructure search

setMode

public void setMode(int mcsMode)
Deprecated. since 5.4

Sets searching strategy for the MCS search. Accepted values are:

Parameters:
mcsMode - search strategy for maximum common substructure

setFastSearch

public void setFastSearch(boolean fastSearch)
Deprecated. use setMode(MODE_TURBO) instead

Sets fast search mode. Fast search mode is an approximate search that in some cases does not find the exact solution. In particular simmetrical structures are affected. Use with caution, mainly to obtain first insight into the dateset and then carry out a more thorough 'slow search' (ie. setFastSearch( false ) which is the default anyway.

Parameters:
fastSearch - fast or normal search speed

search

public boolean search()
Deprecated. 
Performs graph matching.

Returns:
solution found or not

findFirst

public boolean findFirst()
Deprecated. since 5.4

Performs graph matching according to the mode set. This method does the same as search() except that it allows the subsequent call of findNext().

Returns:
solution found or not

findNext

public boolean findNext()
Deprecated. since 5.4

Searches for the next hit. This method should be called after findFirst().

Returns:
next solution found or not

getResult

public int[] getResult()
Deprecated. 
Gets the result of an MCS/MCES/SSS search. The resultis the mapping from query graph atoms to target graph atoms. Internal atom indexes are used, the array returned is indexed by query graph atom indices.

Returns:
mapping between query and target graph atoms

getResultSize

public int getResultSize()
Deprecated. 
Gets the size (number of atoms) of the MCS/MCES (and SSS) found.

Returns:
number of atoms of the MCS

getResultAsSmiles

public java.lang.String getResultAsSmiles(boolean unique)
Deprecated. 
Gets the MCS/MCES as structure represented as SMILES.

Parameters:
unique - indicates if unique smiles are required to be returned
Returns:
MCS as SMILES string

getResultAsMolecule

public Molecule getResultAsMolecule()
Deprecated. 
Gets the MCS/MCES as a structure represented by a Molecules object.

Returns:
MCS/MCES as a Molecule

getResultQueryAtoms

public int[] getResultQueryAtoms()
Deprecated. 
Gets query atoms that are part of the MCS/MCES.

Returns:
query atoms found in the MCS

getResultTargetAtoms

public int[] getResultTargetAtoms()
Deprecated. 
Gets target atoms that are part of the MCS/MCES.

Returns:
target atoms found in the MCS

getResultQueryBonds

public MolBond[] getResultQueryBonds()
Deprecated. 
Gets bonds of the query structure that are part of the MCS/MCES found.

Returns:
query structure bonds in the MCS

getResultTargetBonds

public MolBond[] getResultTargetBonds()
Deprecated. 
Gets bonds of the target structure that are part of the MCS/MCES found.

Returns:
target structure bonds in the MCS