Problem with Molecule.fuse()

User f05f6b8c05

08-10-2013 02:20:53

Hi,


The attached java program and mol file reproduce a problem we're having with Molecule.fuse().  When we fuse one particular structure (A) with a parent molecule, the coordinates of A all become (0,0).


Is there something we are doing incorrectly?


Thanks for any advice.


We are using jchem 5.11.2.


Best,


Andrew 

ChemAxon fc046975bc

08-10-2013 08:28:19

Hi,


the problem comes from the different dimension of mol imported from fuse.mol and molsalt imported from a smiles string. While the first molecule is 2 dimensional, the second one is 0 dimensional that means all of its atom is in (0,0) coordinates. When exporting 0 dimensional molecule to MOL format coordinates are generated to the atoms. Nonetheless, the MolAtom object in this molecule has (0,0) coordinates. However, after fusing a 0 dimensional molecule to a 2 dim one, the resulting molecule will remain 2 dimensional, hence no coordinate generation will happen during the export.


We recommend you to have the molecules the same dimension before fuse. You can use Molecule.setDim() or Cleaner.clean.


Please let us know if you still have some problem!


Best Regards,
Peter

User f05f6b8c05

08-10-2013 13:50:19

Thank you for the quick reply.


Are all smiles considered dimension 0?  Or how did you know that the smiles was 0 dimensional?


Thanks.


Andrew

ChemAxon fc046975bc

08-10-2013 14:19:23

Yes, all smiles/smarts are 0 dimensional as it cannot store the coordinates of an atom.

User f05f6b8c05

08-10-2013 15:11:24

Hi,


I've tried to implement setDim(2) [see below], but I get same results as previously.  Am I using the call incorrectly?


Thanks.


 



  MolImporter mi = new MolImporter(new File("fuse.mol"), "mol");


        Molecule mol = mi.read();


        System.out.println("ORIGINAL PARENT");


        System.out.println(mol.toFormat("mol"));


 


        Molecule molsalt = MolImporter.importMol("O=C(C(F)(F)F)O", "smiles");


        molsalt.setDim(2); // ADDED TO CORRECT FOR 0-DIM SMILES


        System.out.println("SALT BEFORE FUSE");


        System.out.println(molsalt.toFormat("mol"));


 


        mol.fuse((Molecule)(molsalt.clone()));


        System.out.println("BOTH AFTER FUSE");


        System.out.println(mol.toFormat("mol"));


        mi.close();



ChemAxon fc046975bc

09-10-2013 08:57:59

Hi,


setDim() does not calculate coordinates. It just sets the dimension. Use setDim(0) if you want to convert the 2 dimensional molecule to 0 dimensional. Otherwise, if you want generate coordinates for the 0 dimensional molecule, use Cleaner.clean(mol, 2, null).


Sorry if my answer was not clear enough.


Peter

User f05f6b8c05

09-10-2013 13:49:11

Perfect! .. thanks for the clarification


Andrew