MolConvert

User b22f714996

20-05-2005 06:59:51

Hello...





I have (again) a short and simple question.


I would like to generate a PDB from a SMILES. I know there exists the molconvert command-line tool and I used this to generate the PDB:





Code:



molconvert -3:S{fast} pdb test.smi -o test.pdb








Now I would like to generate the PDB using the MolConverter class in your API. Therefore I have to specify the format. What is the syntax for that?





Thanks a lot for your help,





tobias

ChemAxon 7c2d26e5cf

23-05-2005 19:10:43

The simplest way is the following:


Code:
String[] args = {"-3:S{fast}", "pdb", "test.smi", "-o", "test.pdb" };


...


int n = 0;


OutputStream[] theOut = new OutputStream[1];


int[] theVerboseargs = new int[1];


MolConverter conv = MolConverter.createMolConverter(null, null, args,


                                             theOut, theVerboseargs);


try {


    while(conv.convert()) {


         ++n;


    }


    if(theOut[0] != System.out) {


         theOut[0].close();


    }


    if(n == 0) {


         System.err.println("no structure found");


    }


} catch(Exception ex) {


    ex.printStackTrace();


}