User a9d76a1173
20-01-2012 15:39:33
I tried to generate Unique smiles with following code..Is there any other way to generate SMILES??
class Test{
public void marvinWrite()
{
try
{
FileInputStream fileInputStream = new FileInputStream("allNoSalt.sdf");
FileOutputStream os = new FileOutputStream("allfixed.sdf");
MolImporter molImporter = new MolImporter(fileInputStream);
MolExporter molExporter = new MolExporter(os, "sdf");
Molecule molecule;
System.out.println("Start Fixing SDF");
while ((molecule = molImporter.read()) != null) {
molecule.ungroupSgroups();
molecule.hydrogenize(true);
molecule.clean(2, null);
String smile = molecule.toFormat("smiles:u");
molecule.setProperty("MOLFIND_CHEMAXON_SMILES", smile);
molExporter.write(molecule);
}
molImporter.close();
molExporter.close();
System.out.println("Done !");
}
catch (Exception e)
{
e.printStackTrace();
}
}
Print Stack Trace
Some features of [#6]C(=O)N[C@H]1C([#133])O[C@H](COS(O)(=O)=O)[C@@H](O[C@@H]2O[C@@H]([C@@H](O[C@H]3O[C@H](CO)[C@@H](O[C@@H]4O[C@H]([C@@H](O[#133])[C@H](O)[C@H]4OS(O)(=O)=O)C(O)=O)[C@H](OS(O)(=O)=O)[C@H]3NS(O)(=O)=O)[C@H](O)[C@H]2OS(O)(=O)=O)C(O)=O)[C@@H]1O cannot be converted to the given format. Try mrv format.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at chemaxon.marvin.util.JavaLangUtil.newThrowable(Unknown Source)
at chemaxon.marvin.util.JavaLangUtil.newIllegalArgumentException(Unknown Source)
at chemaxon.struc.Molecule.toFormat(Unknown Source)
at testmarvin.Test.marvinWrite(TestMarvin.java:43)
at testmarvin.TestMarvin.main(TestMarvin.java:24)
Caused by: chemaxon.marvin.io.MolExportException:
Some features of [#6]C(=O)N[C@H]1C([#133])O[C@H](COS(O)(=O)=O)[C@@H](O[C@@H]2O[C@@H]([C@@H](O[C@H]3O[C@H](CO)[C@@H](O[C@@H]4O[C@H]([C@@H](O[#133])[C@H](O)[C@H]4OS(O)(=O)=O)C(O)=O)[C@H](OS(O)(=O)=O)[C@H]3NS(O)(=O)=O)[C@H](O)[C@H]2OS(O)(=O)=O)C(O)=O)[C@@H]1O cannot be converted to the given format. Try mrv format.
at chemaxon.marvin.io.formats.smiles.SmilesExport.throwMolExportException(Unknown Source)
at chemaxon.marvin.io.formats.smiles.SmilesExport.generateSmilesString(Unknown Source)
at chemaxon.marvin.io.formats.smiles.SmilesExport.singleMolToSMILES(Unknown Source)
at chemaxon.marvin.io.formats.smiles.SmilesExport.toSMILES(Unknown Source)
at chemaxon.marvin.io.formats.smiles.SmilesExport.convert(Unknown Source)
at chemaxon.struc.Molecule.exportToObject(Unknown Source)
at chemaxon.struc.Molecule.exportToObject(Unknown Source)
at chemaxon.struc.Molecule.exportToFormat(Unknown Source)