convert smile format molecules into individual .pdb files

User 53b9950b3b

05-02-2012 23:45:41

Hi


I have an excel sheet with 1st column containing the name of the molecule and 2nd column containing the structures of each respective molecule in smile format .


May i request for some help with converting each molecule into individual pdb file in a batch mode.


Will greatly appreciate your help.


Best


Rinku


 

ChemAxon 25dcd765a3

06-02-2012 15:31:20

Hi,


First of all export you excel sheet to text file such a way that the first column contains the SMILES and the second column is the molecule name (I guess you would like to keep the molecule name also) separated by space character.


Eg. pdbexcel.smi:


CCCC name
CCC name2

After you have this file (pdbexcel.smi), give it as a parameter to the attached java program (to run this program you need the chemaxon library: eg files in MarvinBeans/lib ). The code will export each line of the smi file into separate pdb file with the filename containing the line number in the smi followed by the .pdb extension.


As you read the molecule from smiles I have included a 3D cleaning for the molecule (I guess you don't want pdb file with every atom sitting at the origin). This 3D cleaning may be slow.


You can compile and run it from the MarvinBeans directory:


javac -cp ".:./lib/MarvinBeans-beans.jar" ConvertToPdb.java

java -cp ".:./lib/MarvinBeans-beans.jar" ConvertToPdb pdbexcel.smi

I hope this helps.

User a0ee4512d1

13-02-2012 00:58:40

I am looking for such java programs converting smiles to pdb file. Where can I get the ConvertToPDB.java file?


 


Thanks.

User a0ee4512d1

13-02-2012 01:07:08

After I reloaded the web page, I found the file. Please ignore my post. Thanks.

User 27e9d6a50b

19-03-2013 22:42:33

Hello


 


I have tried this as it is exactly what I need, but it doesn't work. I follow the steps and it says:


$ javac -cp "MarvinBeans-beans.jar" ConvertToPdb.java

Note: ConvertToPdb.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


When I try to run the next line it says:



$ java -cp "MarvinBeans-beans.jar" ConvertToPdb test.smi 

Exception in thread "main" java.lang.NoClassDefFoundError: ConvertToPdb

Caused by: java.lang.ClassNotFoundException: ConvertToPdb

at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


I have no idea what to do! Can someone help please? Thank you in advance.

ChemAxon fc046975bc

20-03-2013 08:19:43

Hi you should add the current directory to the classpath as well:




java -cp ".:MarvinBeans-beans.jar" ConvertToPdb test.smi

 



Best Regards,

Peter

User 27e9d6a50b

26-03-2013 20:14:04

Thanks! Are the conversions accurate?

ChemAxon e49cf225c6

28-03-2013 09:59:51

You can find information about PDB export on this page:


http://www.chemaxon.com/marvin/help/formats/pdb-doc.html

User b4f15198ac

22-03-2014 01:57:51

Hi, I was excited to find this script... it is exactly what I need! However I cannot get it to compile... it seems I am missing some dependencies? the main error seems to read chemaxon.formats does not exist.  I have MarvinBeans and JChem installed, machnine is 32 bit Linux.  The classpath and path set as follows:


#.jars go below


export CLASSPATH=$/home/aiden/ChemAxon/MarvinBeans/lib/*:


 


#executables go below


export PATH=${PATH}:/home/aiden/ChemAxon/MarvinBeans/bin/*:/home/aiden/Desktop/openMAXWELL/FDA/*:.


 


and here is the full output of the error


 


aiden@aiden-ThinkPad-T400:~/Desktop/openMAXWELL/FDA$ javac -cp ".:./lib/MarvinBeans-beans.jar" ConvertToPdb.java


ConvertToPdb.java:4: error: package chemaxon.formats does not exist


import chemaxon.formats.MolExporter;


                       ^


ConvertToPdb.java:5: error: package chemaxon.formats does not exist


import chemaxon.formats.MolFormatException;


                       ^


ConvertToPdb.java:6: error: package chemaxon.formats does not exist


import chemaxon.formats.MolImporter;


                       ^


ConvertToPdb.java:7: error: package chemaxon.struc does not exist


import chemaxon.struc.Molecule;


                     ^


ConvertToPdb.java:32: error: cannot find symbol


    public static void main(String[] args) throws MolFormatException, IOException {


                                                  ^


  symbol:   class MolFormatException


  location: class ConvertToPdb


ConvertToPdb.java:40: error: cannot find symbol


        MolImporter mi = new MolImporter(new FileInputStream(args[0]), "smiles");


        ^


  symbol:   class MolImporter


  location: class ConvertToPdb


ConvertToPdb.java:40: error: cannot find symbol


        MolImporter mi = new MolImporter(new FileInputStream(args[0]), "smiles");


                             ^


  symbol:   class MolImporter


  location: class ConvertToPdb


ConvertToPdb.java:41: error: cannot find symbol


        Molecule m = null;


        ^


  symbol:   class Molecule


  location: class ConvertToPdb


ConvertToPdb.java:45: error: cannot find symbol


            MolExporter exporter = new MolExporter(filename, "pdb");


            ^


  symbol:   class MolExporter


  location: class ConvertToPdb


ConvertToPdb.java:45: error: cannot find symbol


            MolExporter exporter = new MolExporter(filename, "pdb");


                                       ^


  symbol:   class MolExporter


  location: class ConvertToPdb


10 errors


Thanks in advance! any help would be most appreciated

ChemAxon d26931946c

24-03-2014 07:54:04

Hi Aiden,


You should use the MarvinBeans.jar instead of MarvinBeans-beans.jar:


~/Desktop/openMAXWELL/FDA$ javac -cp ".:./lib/MarvinBeans.jar" ConvertToPdb.java


BRs,


Peter

User b4f15198ac

25-03-2014 17:26:57

Hi Peter, 


Thank you for your quick reply. I tried executing the modified command you gave me,  but still no luck. The exact same error message prints. Upon searching my system for the packages listed in the error message, nothing is found except html pages describing the packages. Should these be jars in the lib file? (ie MolFormatException)? I have both JChem and MarvinBeans installed so i am baffled these packages are still missing. Best regards, 


Aiden

ChemAxon d26931946c

25-03-2014 19:09:53

Hi Aiden,


I've downoladed the MarvinBeans-6.2.1.sh from our website and run it.


It created a ChemAxon folder in my home. In the folder ~/ChemAxon/MarvinBeans/lib there should be several jars with names like com.chemaxon-* and MarvinBeans*. You should include the MarvinBeans.jar from there.


The command should be something like:


~/Desktop/openMAXWELL/FDA$ javac -cp ".:/home/aiden/ChemAxon/MarvinBeans/lib/MarvinBeans.jar" ConvertToPdb.java


I've just tried it and it worked for me. I think something may be missing from the classpath.


BR, 


Peter

User b4f15198ac

26-03-2014 01:57:44

it was indeed a classpath error. I was using the wildcard incorrectly. Thanks for your time!

User 11d0d45ac1

16-02-2016 07:27:46

 


javac -cp ".:/lib/MarvinBeans-beans.jar" ConvertToPdb.java


javac: file not found: ConvertToPdb.java


Usage: javac <options> <source files>


 


javac -cp ".:/lib/MarvinBeans-beans.jar" ConvertToPdb test.smi


error: Class names, 'ConvertToPdb,test.smi', are only accepted if annotation processing is explicitly requested


 


1 error


the above error persists for me.... could anyone help me to sort it out 

ChemAxon 044c6721bc

16-02-2016 07:59:28

Hi,


Did you try to use the MarvinBeans.jar instead of MarvinBeans-beans.jar and the full path of ConvertToPdb.java?

User 11d0d45ac1

16-02-2016 09:40:36

thanks for your reply,


but even after trying with full path it didn't work for me 


javac -cp ".:/Applications/ChemAxon/MarvinBeans/lib/MarvinBeans-beans.jar"  ConvertToPdb.java


javac: file not found: ConvertToPdb.java


 

ChemAxon 044c6721bc

16-02-2016 10:09:22

Try this in the folder containing the ConvertToPdb file:


javac -cp ".:/Applications/ChemAxon/MarvinBeans/lib/MarvinBeans.jar"  ConvertToPdb.java

User 11d0d45ac1

16-02-2016 11:00:40

DearJkendi,


I tried as you suggested but .still the error persists ..


javac -cp ".:./Applications/ChemAxon/MarvinBeans/lib/MarvinBeans.jar"  ConvertToPdb.java


javac: file not found: ConvertToPdb.java


Usage: javac <options> <source files>



ChemAxon 044c6721bc

16-02-2016 12:02:43

It seems, this is a javac usage problem, not a problem with our API. I don't have any idea, try to get some personal help from somebody who is familiar with javac.


 


You can also try molconvert:


https://docs.chemaxon.com/display/docs151214/Molecule+File+Conversion+with+MolConverter

User 11d0d45ac1

18-02-2016 18:01:22

hi,


I got one new error 


javac -cp ".:./MarvinBeans.jar" ConvertToPdb c.smi 


error: Class names, 'ConvertToPdb,c.smi', are only accepted if annotation processing is explicitly requested


 


1 error


could you help with it ....

ChemAxon 044c6721bc

19-02-2016 09:37:00


javac -cp ".:./MarvinBeans.jar" ConvertToPdb.java

java -cp ".:./MarvinBeans.jar" ConvertToPdb c.smi


 


First, you have to compile the source with javac and then using the java (not javac) to run the program.


This may help: 


http://www.codejava.net/java-core/tools/using-javac-command


http://stackoverflow.com/questions/11965818/how-to-run-java-program-in-command-prompt