|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.clustering.LibraryMCS
public class LibraryMCS
The 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.
It is not one subgraph common to all or to the majority of input molecules
that the algorithm determines but the set of
the most frequently occuring common substructures. The more
diverse the set to be analysed is the larger the number of the frequent common
substructures is, while in case of a more focused set with limited structural
diversity, the number of frequent common substructures is smaller.
The algorithm is capable of going one or more level further in this kind of scaffold analysis by finding the MCS
of the frequent common substructures - and so on in a hierarchical manner.
Practically speaking structures are clustered based on their MCSs (not on their similarities etc.) in a
hierarchical clustering procedure.
This class implements the 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.
This class also provides a simple command line interface for batch processing
of MCS search for a set of structures, as well as a simple graphical
user interface for easy navigation through clusters of structures.
| Nested Class Summary | |
|---|---|
class |
LibraryMCS.ClusterEnumerator
The ClusterEnumerator is the right way to obtain results of a LibraryMCS clustering. |
| Field Summary | |
|---|---|
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_KEEP_RINGS
ring bonds are not broken (rings are kept intact) by default |
static int |
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 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 Summary | |
|---|---|
LibraryMCS()
Creates an new LibraryMCS instance. |
|
| Method Summary | |
|---|---|
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()
Deatailed 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. |
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)
Stes 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 |
setDissimCutoff(float dissimCutoff)
Deprecated. This method has no affect from version 0.7 of LibraryMCS (JChem version 5.0.1) due to internal incompatibilities. |
void |
setFastSearch(boolean toggleFastSearch)
Deprecated. Use setMCSMode(MCS.MODE_FAST) or setMCSMode(MCS.MODE_TURBO) instead, this method has no effect form version 5.0 of JChem. |
void |
setKeepRings(boolean b)
Sets the matching mode for rings. |
void |
setMCSMode(int mode)
Sets MCS search strategy. |
void |
setMCSSimilarityThreshold(float mcsSimilarityThreshold)
Deprecated. The similarity threshold is not used from version 0.7 of LibraryMCS |
void |
setMinimalSimilarityMeasurement(float minSimilarity)
Deprecated. Minimal similarity measurement is not used from version 0.7 |
void |
setMinimumMCSSize(int mcsSize)
Sets the minimum size of any MCS found. |
void |
setMode(int mode)
Deprecated. Use setMCSMode instead. |
void |
setRequiredClusterCount(int requiredClusterCount)
Sets the nember of required clusters on the top level of hierarchy. |
boolean |
step()
Adds one more level to the exsisting cluster hierarchy. |
| 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_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 int DEFAULT_MCS_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_KEEP_RINGS
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()
| Constructor Detail |
|---|
public LibraryMCS()
| Method Detail |
|---|
public void reset()
public void setDissimCutoff(float dissimCutoff)
dissimCutoff - dissimilarity threshold for MCS searchpublic void setMCSSimilarityThreshold(float mcsSimilarityThreshold)
mcsSimilarityThreshold - public void setMinimalSimilarityMeasurement(float minSimilarity)
minSimilarity - 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 setFastSearch(boolean toggleFastSearch)
setMCSMode(MCS.MODE_FAST) or setMCSMode(MCS.MODE_TURBO) instead, this method has no effect form version 5.0 of JChem.
toggleFastSearch - turn fast search on/offpublic void setMCSMode(int mode)
mode - mode flagpublic void setMode(int mode)
setMCSMode instead.
mode - public void setMinimumMCSSize(int mcsSize)
mcsSize - minimum required size of any MCSpublic 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 setKeepRings(boolean b)
b - flags if atom types are considered (true) or ignored (false)public void addMolecule(Molecule mol)
MoleculeGraph.calcHybridization()
before calling this function.
mol - a molecular structure
public boolean search()
throws java.lang.InterruptedException
getStopCause() can be invoked to get the termination code (see
constants TERMINATION* ).
java.lang.InterruptedExceptionpublic 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 enumerated
public LibraryMCS.ClusterEnumerator getClusterEnumerator(boolean leavesOnly,
boolean selectedOnly)
LibraryMCS.ClusterEnumerator object.
leavesOnly - leaf nodes or all clusters are enumeratedselectedOnly - selected clusters and leaf nodes are listed
public 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||