Reaction mapping taking longer than specified timeout

38 views
Skip to first unread message

Daniel Lowe

unread,
Mar 2, 2012, 9:32:57 AM3/2/12
to indigo-bugs
I have identified a rare case where the automap function timeout
doesn't work. The timeout works as intended if the line which allows
the bond orders of any bond to be changed is excluded.

Here is the Java code to reproduce. On a modern system this runs for
many hours without completing!

Indigo indigo = new Indigo();
indigo.setOption("aam-timeout", 60000);
IndigoObject reaction = indigo.createReaction();
reaction.addProduct(indigo.loadMolecule("C(C)(C)
(C)N(C([O-])=O)C1(CC2(C1)OCCO2)C2=CC=C(C=C2)C2=NC=1C=CN3C(C1C=C2C2=CC=CC=C2)=NN=C3C=3N=CN(C3)C"));
reaction.addReactant(indigo.loadMolecule("CN1C=NC(=C1)C(=O)O"));
reaction.addReactant(indigo.loadMolecule("C(CCl)Cl"));
reaction.addReactant(indigo.loadMolecule("On1nnc2ccccc12"));
reaction.addReactant(indigo.loadMolecule("N(N)C1=C2C=C(C(=NC2=CC=N1)C1=CC=C(C=C1)C1(CC2(C1)OCCO2)NC(OC(C)
(C)C)=O)C2=CC=CC=C2"));
reaction.addReactant(indigo.loadMolecule("CC(O)=O"));

for (IndigoObject m: reaction.iterateMolecules()){
for (IndigoObject b: m.iterateBonds()){
reaction.setReactingCenter(b, Indigo.RC_UNCHANGED |
Indigo.RC_ORDER_CHANGED);
}
}
long start = System.currentTimeMillis();
reaction.automap("discard ignore_charges ignore_valence");
long elapsedTimeMillis = System.currentTimeMillis()-start;
System.out.println(elapsedTimeMillis);

Savelyev Alexander

unread,
Mar 25, 2012, 9:29:05 AM3/25/12
to indigo-bugs
Hi Daniel,

Thanks for the bug report. We have explored, that internal algorithm
may hang on certain molecules. I have fixed the behaviour already,
therefore, the fixed version will be available in the upcoming
release.

With best regards,
Alexander

Savelyev Alexander

unread,
Mar 30, 2012, 5:59:26 AM3/30/12
to indig...@googlegroups.com
Hello all,

The AAM fixed version is available in the indigo1.1-beta10 release

With best regards,
Alexander

daniel_...@yahoo.co.uk

unread,
Apr 14, 2012, 4:16:21 PM4/14/12
to indig...@googlegroups.com
1.1-beta10 fixed the majority of issues I was having. The following example still hangs though unless the timeout is set to something extremely low e.g. 100ms


Indigo indigo = new Indigo();
indigo.setOption("aam-timeout", 60000);
IndigoObject reaction = indigo.createReaction();
reaction.addProduct(indigo.loadMolecule("C(O)(=O)C=C.C(O)(=O)C=C.FC1(F)C2(C(F)(F)CO)C(F)(F)C3(F)C(F)(F)C(F)(C(F)(F)C1(C(F)(F)CO)C3(F)F)C2(F)F"));
reaction.addReactant(indigo.loadMolecule("FC1(F)C2(C(F)(F)CO)C(F)(F)C3(F)C(F)(F)C(F)(C(F)(F)C1(C(F)(F)CO)C3(F)F)C2(F)F"));
reaction.addReactant(indigo.loadMolecule("CCN(CC)CC"));
reaction.addReactant(indigo.loadMolecule("C(Cl)(=O)C=C"));
reaction.addReactant(indigo.loadMolecule("CCCCCC"));
reaction.automap("discard");

I've briefly compared the performance of beta10 to beta9.
Beta9 could find complete mappings for 2674 reactions. 21 of these were not mapped by beta10 whilst 3 more reactions became mappable. At least some of these appear to be caused by a bug e.g.:

Indigo indigo = new Indigo();
IndigoObject reaction = indigo.createReaction();
reaction.addProduct(indigo.loadMolecule("FC(F)(F)C(NCC(c1c2c(ccc(OC)c2)ccc1)CO)=O"));
reaction.addReactant(indigo.loadMolecule("NCC(c1c2c(ccc(OC)c2)ccc1)CO"));
reaction.addReactant(indigo.loadMolecule("CCN(CC)CC.FC(F)(F)C(OC(=O)C(F)(F)F)=O"));
reaction.automap("discard");
Exception in thread "main" com.ggasoftware.indigo.IndigoException: array: invalid index 7 (size=6)

Savelyev Alexander

unread,
Apr 17, 2012, 5:18:12 AM4/17/12
to indig...@googlegroups.com
Dear Daniel,

Thanks for the examples. With the 'aam-timeout' option the library tries to get current AAM solution and possibly increase it ( in contrast with the 'timeout' option, where an exception is raised if timeout has been reached). Therefore, some time period after a specified time is possible. I have fixed the hang and now it should work only constant time after a timeout. Also the issue with the array invalid index was resolved. The fixed version will be available in the upcoming release.

With best regards,
Alexander
1.1-beta10 fixed the majority of issues I was having. The following example still hangs though unless the timeout is set to something extremely low e.g. 100ms
Reply all
Reply to author
Forward
0 new messages