Skip to content

Commit

Permalink
Turbo mode MCS search added Signed-off-by: Syed Asad Rahman <s9asad@g…
Browse files Browse the repository at this point in the history
…mail.com>

Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
asad authored and rajarshi committed May 17, 2010
1 parent ea4960c commit 8ac67bf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
Expand Up @@ -146,6 +146,9 @@ private void chooseAlgorithm(int rBondCount, int pBondCount) {
case VFLibMCS:
vfLibMCSAlgorithm(rBondCount, pBondCount);
break;
case TURBOMCS:
vfLibTurboMCSAlgorithm(rBondCount, pBondCount);
break;
}
}

Expand Down Expand Up @@ -225,6 +228,20 @@ private void vfLibMCS() {
allAtomMCS.addAll(mcs.getAllAtomMapping());
}

private void vfLibTurboMCS() {
VFlibMCSHandler mcs = null;
mcs = new VFlibMCSHandler();
mcs.set(rMol, pMol);
mcs.searchMCS();

clearMaps();
firstSolution.putAll(mcs.getFirstMapping());
allMCS.addAll(mcs.getAllMapping());

firstAtomMCS.putAll(mcs.getFirstAtomMapping());
allAtomMCS.addAll(mcs.getAllAtomMapping());
}

private void singleMapping() {
SingleMappingHandler mcs = null;

Expand Down Expand Up @@ -307,6 +324,14 @@ private void vfLibMCSAlgorithm(int rBondCount, int pBondCount) {
}
}

private void vfLibTurboMCSAlgorithm(int rBondCount, int pBondCount) {
if (rBondCount >= 6 && pBondCount >= 6) {
vfLibTurboMCS();
} else {
mcsPlusAlgorithm();
}
}

private void setTime(boolean bondTypeFlag) {
if (bondTypeFlag) {
TimeOut tmo = TimeOut.getInstance();
Expand Down Expand Up @@ -377,6 +402,7 @@ public void init(IAtomContainer Reactant, IAtomContainer Product, boolean remove
this.pMol = new MolHandler(Product, false, removeHydrogen);
init(rMol, pMol, removeHydrogen);
}

/**
* Initialize the query and target mol via mol files
* @param sourceMolFileName
Expand Down
7 changes: 5 additions & 2 deletions src/main/org/openscience/cdk/smsd/interfaces/Algorithm.java
Expand Up @@ -41,7 +41,6 @@
* @cdk.githash
* @author Syed Asad Rahman <asad@ebi.ac.uk>
*/

@TestClass("org.openscience.cdk.smsd.interfaces.AlgorithmTest")
public enum Algorithm {

Expand All @@ -61,10 +60,14 @@ public enum Algorithm {
* CDK UIT MCS.
*/
CDKMCS(3, "CDK UIT MCS"),
/**
* Turbo Mode based MCS search.
*/
TURBOMCS(4, "Turbo Mode based MCS search"),
/**
* Turbo Mode based Substructure search.
*/
SubStructure(4, "Turbo Mode based Substructure search");
SubStructure(5, "Turbo Mode based Substructure search");
private final int type;
private final String description;

Expand Down

0 comments on commit 8ac67bf

Please sign in to comment.