@PublicAPI public class LibraryMCS extends java.lang.Object implements chemaxon.license.Licensable
LibraryMCS
class computes the maximum common substructure (MCS)
of a set of compounds. It can suggest scaffolds of a library, in particular VHTS hit sets.
Typical size of such input structure set is a few thousand molecules, but LibraryMCS can cope with 10,000s of
molecules.
ClusterEnumberator
class which
allows clients to retieve the hierarchy. The tree of clusters as well as
data associated with nodes in this tree can be accessed along with various code values
that help reconstruct the hierarchy in custom applications.
Modifier and Type | Class and Description |
---|---|
class |
LibraryMCS.ClusterEnumerator
The
ClusterEnumerator is the right way to obtain results of a LibraryMCS clustering. |
Modifier and Type | Field and Description |
---|---|
static int |
ATOM_COUNT_UPPER_BOUND
structures above this size are not searched for pair-wise mcs as it would take to long to calculate the MCS
|
static int |
DEFAULT_ALLOWED_LEVEL_COUNT
maximum number of levels in the hierarchy
|
static boolean |
DEFAULT_ATOM_TYPE_MATCH
atom types are matched by default
|
static boolean |
DEFAULT_BOND_TYPE_MATCH
bond types are matched by default
|
static boolean |
DEFAULT_CHARGE_MATCH
atom formal charges are matched by default
|
static boolean |
DEFAULT_ISOTOPE_MATCH
atom isotopes are not matched by default
|
static boolean |
DEFAULT_KEEP_RINGS_MODE
Rings are not broken by default
|
static SearchMode |
DEFAULT_MCS_MODE
default MCS search mode
|
static int |
DEFAULT_MIN_MCS_SIZE
default MCS size limit, the algorithm does not search for an MCS below this limit
|
static boolean |
DEFAULT_RADICAL_MATCH
atom radicals are not matched by default
|
static int |
DEFAULT_REQUIRED_CLUSTER_COUNT
minimum number of top-level clusters
|
static int |
MAX_LEVEL_COUNT
maximum allowed number of hierarchy levels
|
static int |
TERMINATION_CANCEL
last search terminated due to user cancellation
|
static int |
TERMINATION_CLUSTER_COUNT
last search terminated because the required top level cluster count was reached
|
static int |
TERMINATION_ERROR
last search terminated due to an error, solution is not found
|
static int |
TERMINATION_LEVEL_COUNT
last search terminated because the predefined allowed level count was reached
|
static int |
TERMINATION_MCS_SIZE_LIMIT
last search terminated becasue the allowed minimum MCS size was reached
|
static int |
TERMINATION_SAME_PARAMETERS
last attempt to cluster one level failed as the clustering paramters were the same as one the last level
|
static int |
TERMINATION_STEP_NOT_ALLOWED
invalid call of method
step() |
static int |
TERMINATION_UNKNOWN
last search terminated for an unknown reason, solution may not be found
|
Constructor and Description |
---|
LibraryMCS()
Creates an new LibraryMCS instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addMolecule(Molecule mol)
Adds a new molecule to the set of structures to be clustered.
|
LibraryMCS.ClusterEnumerator |
getClusterEnumerator(boolean leavesOnly)
Gets a new
LibraryMCS.ClusterEnumerator object. |
LibraryMCS.ClusterEnumerator |
getClusterEnumerator(boolean leavesOnly,
boolean selectedOnly)
Gets a new
LibraryMCS.ClusterEnumerator object. |
int |
getInputStructureCount()
Retrieves the total number of input structures clustered.
|
int |
getLevelCount()
Retrieves the total number of levels in the hierarchy.
|
int |
getStopCause()
Internal code of last termination condition.
|
java.lang.String |
getStopCauseExplanation()
Detailed explanation why last search terminated.
|
int |
getTopLevelClusterCount()
Gets the number of clusters on the highest level of the hierarchy.
|
int |
getTotalClusterCount()
Gets the total number of clusters in the hierarchy.
|
boolean |
isLicensed() |
static void |
main(java.lang.String[] args)
Simple command line interface for batch processing.
|
void |
reset()
Resets the internal state to the initial values.
|
boolean |
search()
Performs hierarchical maximum common substructure search.
|
void |
setAllowedLevelCount(int allowedLevelCount)
Sets the maximum number of hierarchy levels allowed in clustering.
|
void |
setAtomCountUpperBound(int atomCountUpperBound)
Sets the maximum structure size for pairwise mcs search.
|
void |
setAtomTypeMatch(boolean b)
Sets the matching mode for atom types.
|
void |
setBondTypeMatch(boolean b)
Sets the matching mode for bond types.
|
void |
setChargeMatch(boolean b)
Sets the matching mode for atom formal charges.
|
void |
setIsotopeMatch(boolean b)
Sets the matching mode for isotopes.
|
void |
setKeepRings(boolean keepRings)
Sets whether rings should be kept or they can be broken.
|
void |
setLicenseEnvironment(java.lang.String string) |
void |
setMCSMode(SearchMode mode)
Sets MCS search strategy.
|
void |
setMinimumMCSSize(int mcsSize)
Sets the minimum size of any MCS found.
|
void |
setRadicalMatch(boolean b)
Sets the matching mode for radicals on atoms.
|
void |
setRequiredClusterCount(int requiredClusterCount)
Sets the minimal number of clusters required on the top level of hierarchy.
|
boolean |
step()
Adds one more level to the exsisting cluster hierarchy.
|
public static final int DEFAULT_REQUIRED_CLUSTER_COUNT
public static final int DEFAULT_ALLOWED_LEVEL_COUNT
public static final int ATOM_COUNT_UPPER_BOUND
public static final int MAX_LEVEL_COUNT
public static final SearchMode DEFAULT_MCS_MODE
public static final boolean DEFAULT_KEEP_RINGS_MODE
public static final boolean DEFAULT_ATOM_TYPE_MATCH
public static final boolean DEFAULT_BOND_TYPE_MATCH
public static final boolean DEFAULT_CHARGE_MATCH
public static final boolean DEFAULT_RADICAL_MATCH
public static final boolean DEFAULT_ISOTOPE_MATCH
public static final int DEFAULT_MIN_MCS_SIZE
public static final int TERMINATION_UNKNOWN
public static final int TERMINATION_ERROR
public static final int TERMINATION_LEVEL_COUNT
public static final int TERMINATION_CLUSTER_COUNT
public static final int TERMINATION_MCS_SIZE_LIMIT
public static final int TERMINATION_CANCEL
public static final int TERMINATION_SAME_PARAMETERS
public static final int TERMINATION_STEP_NOT_ALLOWED
step()
public LibraryMCS() throws chemaxon.license.LicenseException
chemaxon.license.LicenseException
- when no valid license foundpublic final boolean isLicensed()
isLicensed
in interface chemaxon.license.Licensable
public final void setLicenseEnvironment(java.lang.String string)
setLicenseEnvironment
in interface chemaxon.license.Licensable
public void reset()
public void setRequiredClusterCount(int requiredClusterCount)
requiredClusterCount
- number of top level clusterspublic void setAllowedLevelCount(int allowedLevelCount)
allowedLevelCount
- number of hierarchy levels allowed (tree depth)public void setAtomCountUpperBound(int atomCountUpperBound)
atomCountUpperBound
- public void setMCSMode(SearchMode mode)
mode
- mode flagpublic void setMinimumMCSSize(int mcsSize)
mcsSize
- minimum required size of any MCSpublic void setKeepRings(boolean keepRings)
keepRings
- false if rings can be broken.public void setAtomTypeMatch(boolean b)
b
- flags if atom types are considered (true) or ignored (false)public void setBondTypeMatch(boolean b)
b
- flags if bond types are considered (true) or ignored (false)public void setChargeMatch(boolean b)
b
- flags if atom charges are considered (true) or ignored (false)public void setRadicalMatch(boolean b)
b
- flags if atom radicals are considered (true) or ignored (false)public void setIsotopeMatch(boolean b)
b
- flags if atom isotopes are considered (true) or ignored (false)public void addMolecule(Molecule mol)
mol
object is not copied thus its value on output is different form the input value.mol
- a molecular structure to be clusteredpublic boolean search() throws java.lang.InterruptedException
getStopCause()
can be invoked to get the termination code (see
constants TERMINATION*
).java.lang.InterruptedException
public boolean step()
search()
must be called prior to
this method and it has to return true
. Beside, clustering options (typically, the allowed minimum
size of the MCS, see setMinimumMCSSize(int)
) must be changed, otherwise step()
has no effect (since termination conditions were reached when previous search()
terminated).public LibraryMCS.ClusterEnumerator getClusterEnumerator(boolean leavesOnly)
LibraryMCS.ClusterEnumerator
object.leavesOnly
- leaf nodes or all clusters are enumeratedpublic LibraryMCS.ClusterEnumerator getClusterEnumerator(boolean leavesOnly, boolean selectedOnly)
LibraryMCS.ClusterEnumerator
object.leavesOnly
- leaf nodes or all clusters are enumeratedselectedOnly
- selected clusters and leaf nodes are listedpublic int getStopCause()
search()
or
step()
.TERMINATION*
public java.lang.String getStopCauseExplanation()
search()
or
step()
.public int getInputStructureCount()
public int getLevelCount()
public int getTotalClusterCount()
public int getTopLevelClusterCount()
public static void main(java.lang.String[] args)
-h
flag in its commandline to get a brief list of command line syntax and options available.args
- command line arguments