User 6f58eb8616
10-11-2009 17:27:00
JChem Version: 5.2.3_1
Hi,
I have encountered some unexpected behaviour when importing Molfiles and outputting them as SMILES. It seems the asterisk "*" wildcard character is not interpreted correctly:
final String molfile = "\n\n\n" +
" 2 1 0 0 0 0 0 0 0 0999 V2000\n" +
" 0.5100 1.5300 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" -0.5100 1.5300 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" 1 2 1 0 0 0 0\n" +
"M END\n";
Molecule molecule = MolImporter.importMol(molfile,"mol");
assertEquals("C*",molecule.toFormat("smiles:u"));
This brings back:
java.lang.IllegalArgumentException:
Some features of [#6]-[#114] cannot be converted to the given format. Try mrv format.
However if I change the atom type in Molfile from "*" to an unknown symbol like "ZZZ" I get back my expected result (when I would have expected an error):
final String molfile = "\n\n\n" +
" 2 1 0 0 0 0 0 0 0 0999 V2000\n" +
" 0.5100 1.5300 0.0000 ZZZ 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" -0.5100 1.5300 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" 1 2 1 0 0 0 0\n" +
"M END\n";
Molecule molecule = MolImporter.importMol(molfile,"mol");
assertEquals("C*",molecule.toFormat("smiles:u"));
Obviously not a huge problem but just seems a bit odd to code round it, or have I missed something? - Should I be usign the "enc" parameter of ImportMol?
Thanks in advance
Derek