User 0cd5667845
23-07-2015 00:31:45
Hi,
In converting a large number of SMILES to InChI, I found that the InChI calculation for the complex SMILES given below never ends. I have tried leaving it running for several hours and it does not end.
Because I am regularly processing files containing a large number of SMILES to InChI, I would like to be able to either terminate each InChI calculation after a certain amount of time and move on with my main code, or alternatively provide a time limit each time I call the export function. However, I can't find any capability to do this in the documentation. I also tried spawning a separate thread for my InChI calculation, and then terminating the thread after my time has expired. However, the InChI calculation is not responding to my thread interruption; my main code proceeds, but my spawned thread will not terminate.
Is there any way that I can implement or request a time out of the InChI calculation?
More detail:
String preferredInchiFormat = "inchi:SAbs,AuxNone";
String smiles = "PPS(PP(S(PP)(=PP)=PP)S(=PP(S(PP)(=PP)=PP)S(PP)(=PP)=PP)(=PP(S(PP)(=PP)=PP)S(PP)(=PP)=PP)P(P(P(P=S)P(S(=PP(S(PP)(=PP)=PP)S(PP)(=PP)=PP)(=PP(S(PP)(=PP)=PP)S(PP)(=PP)=PP)P(P(S(PP)(=PP)=PP)S(PP)(=PP)=PP)S(PP)(=PP)=PP)S(=PP(S(PP)(=PP)=PP)S(PP)(=PP)=PP)(=PP(S(PP)(=PP)=PP)S(PP)(=PP)=PP)P(P(S(PP)(=PP)=PP)S(PP)(=PP)=PP)S(PP)(=PP)=PP)P(S(PP)(=PP)=PP)S(PP)(=PP)=PP)S(=PP(S(PP)(=PP)=PP)S(PP)(=PP)=PP)(=PP(S(PP)(=PP)=PP)S(PP)(=PP)=PP)P(P(S(PP)(=PP)=PP)S(PP)(=PP)=PP)S(PP)(=PP)=PP)(=PP)=PP";
Molecule mol = MolImporter.importMol(smiles, "smiles");
String inchi = MolExporter.exportToFormat(smiles, preferredInchiFormat); //never ends for the SMILES provided above