How to determine if structural coordinates are zero

User d68ef9d5a9

03-01-2006 15:32:28

Hi,





I am creating a mol file from a SMILES.





MolHandler mh=new MolHandler();


mh.setMolecule("c1ccccc1Cl");


Molecule mole=mh.getMolecule();


//mole.clean(2,null)


String molFile=mole.toFormat("mol");





The mol file from this algorithm has no coordinates (all coordinates are zero) unless I call the clean method before I obtain the molFile. But I can only find this if I look into the mol file itself.





My question is: how can I programmatically tell whether the coordinates of the molecule object are zero or not?





Thank you.





Ben Li


Neurogen Corporation

ChemAxon 7c2d26e5cf

03-01-2006 16:08:44

Try this:


Code:
Molecule mole=mh.getMolecule();


if(mole.getDim() < 2) {


    mole.clean(2,null);


}

User d68ef9d5a9

03-01-2006 16:27:26

Hi,





I found solution for my own question.





int dim=mole.getDim();





if dim is zero, that means the melecule has not been cleaned in 2D or 3D.





Correct me if I am wrong.





Ben Li

ChemAxon 7c2d26e5cf

03-01-2006 16:35:49

Exactly.