Probleme with Molecule()

User 862a6449fe

27-03-2005 14:07:26

Hi,





I continu to learn Java and Marvin and I would like to try one of your exemple and I have a probleme with the Class ElementalAnalyser : what I have to put in
Code:
     MolImporter mi = new MolImporter(input.smiles);


     Molecule mol = null;



input is a Molecule object I think, but I have only the smile string for that molecule. And in the methode I have not found the way to tell to the mol object that mol = "string smile".





Can you help me ?


Than you,


Jean-Marie

ChemAxon 7c2d26e5cf

29-03-2005 08:54:42

Try this one:


Code:
MolImporter importer = new MolImporter("input.smiles");


Molecule mol = importer.read();


// to generate atom coordinates


if(mol.getDim() == 0) {


    mol.clean(2, "O1");


}



In the above example, "input.smiles" is the name of file which includes one or more SMILES. MolImporter read the first structure into a Molecule object.


If your structure is in a string (not in a file), you should user MolImporter.importMol(String):


Code:
String smilesstr; // the smiles string


...


Molecule mol = MolImporter.importMol(smilesstr);


// to generate atom coordinates


if(mol.getDim() == 0) {


    mol.clean(2, "O1");


}



About MolImporter, you can find more details in its apidoc:


http://www.chemaxon.com/marvin/doc/api/chemaxon/formats/MolImporter.html

User 862a6449fe

29-03-2005 17:42:00

Thanks you for your reply !





But I would like to work only with the Marvin and even after a long search in the API of Marvin I have not find the method
Quote:
MolImporter
, but I found it in the Jchem API.





Did I have a solution ?

ChemAxon 7c2d26e5cf

30-03-2005 12:22:12

MarvinBeans.jar includes chemaxon.formats.MolImporter. You can find it in the Marvin Beans package.


I do not understand your question.
schneiderj wrote:
Did I have a solution ?

ChemAxon 43e6884a7a

30-03-2005 12:39:20

schneiderj wrote:
... even after a long search in the API of Marvin I have not found the method MolImporter...
It wasn't long enough :-)


Try it again: http://www.chemaxon.com/marvin/doc/api/index.html

User 862a6449fe

30-03-2005 16:55:08

Thanks you for your reply.


On the page you give me the adresse I find the MolImpoter without problem, but on the API doc I have on my computer not !


I download Marvinbeans, and do the doc and now I can find the MolImporter !





jean-marie

ChemAxon 43e6884a7a

30-03-2005 17:06:37

schneiderj wrote:
... on the API doc I have on my computer not ...
Marvin Applets contain applets only. The API is only for JavaScript calls from a browser. You need the Beans for accessing Marvin functionalities outside a browser.

User 862a6449fe

01-04-2005 15:44:57

I am a very new to the Java programmation...





Thank you for your reply even if my question was surprinsing.





Jean-Marie