[Open Babel] Reg: Conformer Search Write Conformers as SDF File
Dear OpenBabelers I am using OpenBabel in my Java application.I would like to generate set of conformers for my molecule using Openbabel and write the generated conformers to an output file (SDF format). I am able to generate the conformers using GetConformers method in OBConformerSearch class, Since, the return type of the method is void, I am not able to get hold of the generated conformers and write them to the output file. It would be great if I can have a list of generated conformers which I can later write them in an SDF file? Below is the java code, by the way with this code, writes only one generated conformer to the output file. System.loadLibrary("openbabel_java"); OBMol mol = new OBMol(); OBConformerSearch conformer = new OBConformerSearch(); OBConversion conv = new OBConversion(); conv.ReadFile(mol,"input.mol"); conv.SetOutFormat("sdf"); conformer.Setup(mol,5); conformer.GetConformers(mol); conv.WriteFile(mol, "conformers.sdf"); I have seen a similar post ( http://forums.openbabel.org/Generating-a-diverse-set-of-conformers-td4656011.html ) in python but there seems to be no answer. Any suggestion in the right direction is highly appreciated. Thank you. -- Regards Vinothkumar Mohanakrishnan -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Reg: Conformer Search Write Conformers as SDF File
Dear Noel Thanks a lot for your valuable hint and it works, I created a loop and wrote the conformers as individual SDF file (code below), then I combine all the individual SDF files into one using Openbabel GUI (not an ideal way to do), conformer.Setup(mol,5); conformer.GetConformers(mol); for(int i=1;i<6;i++) { mol.SetConformer(i); String fileName = "fileName"+ i +".sdf"; conv.WriteFile(mol,fileName); // } Is there a way that I could do it programmatically to combine all the individual files into a single SDF file? any hints? Thank you. On Wed, Dec 20, 2017 at 2:12 PM, Noel O'Boyle wrote: > Have you tried SetConformer(int n)? This switches the coordinates of the > molecule between the available conformers. > > On 20 December 2017 at 12:35, Vinothkumar Mohanakrishnan < > kmvin...@gmail.com> wrote: > >> Dear OpenBabelers >> >> I am using OpenBabel in my Java application.I would like to generate set >> of conformers for my molecule using Openbabel and write the generated >> conformers to an output file (SDF format). >> >> I am able to generate the conformers using GetConformers method in >> OBConformerSearch class, Since, the return type of the method is void, I am >> not able to get hold of the generated conformers and write them to the >> output file. It would be great if I can have a list of generated conformers >> which I can later write them in an SDF file? >> >> Below is the java code, by the way with this code, writes only one >> generated conformer to the output file. >> >> System.loadLibrary("openbabel_java"); >> >> OBMol mol = new OBMol(); >> >> OBConformerSearch conformer = new OBConformerSearch(); >> >> OBConversion conv = new OBConversion(); >> >> conv.ReadFile(mol,"input.mol"); >> >> conv.SetOutFormat("sdf"); >> >> conformer.Setup(mol,5); >> >> conformer.GetConformers(mol); >> >> conv.WriteFile(mol, "conformers.sdf"); >> >> >> I have seen a similar post >> >> ( >> http://forums.openbabel.org/Generating-a-diverse-set-of-conf >> ormers-td4656011.html >> ) >> in python but there seems to be no answer. >> Any suggestion in the right direction is highly appreciated. Thank you. >> >> -- >> Regards >> Vinothkumar Mohanakrishnan >> >> >> -------- >> -- >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> ___ >> OpenBabel-discuss mailing list >> OpenBabel-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss >> >> > -- Regards Vinothkumar Mohanakrishnan -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
[Open Babel] Reg: Packing openbabel along with my Java application
Dear OpenBabel Users I am developing a Java application (GUI) which uses OpenBabel in the backend. I want to pack this application so that users can use in different operating systems like Windows, Linux, MacOS. Right now, In my development environment, I am using System.loadlibrary("openbabel_java"). This works fine. This will break down when I pack my application (myapp.jar) for another computer or another operating system (in spite of having OpenBabel.jar in my application). I would like to know how can one pack OpenBabel in a third party application? I am pretty sure I am not the first one to have this question, any hints in the right direction(like some workflow) are highly appreciated. Just a small suggestion, It would be a nice idea to have a page describing, packing OpenBabel along with custom application in the documentation of OpenBabel.Thank you. -- Regards Vinothkumar Mohanakrishnan -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
[Open Babel] Java bindings undefined symbol: _ZTVN9OpenBabel30OBMinimizingRMSDConformerScoreE
Dear OPenBabel Users I am using OpenBabel in my (Java) application and want to pack this application and use it in different operating systems like Windows, Linux, and MacOs. I have compiled JAVA bindings for OpenBabel using the command *sudo cmake /home/vin/openbabel2.4-DCMAKE_INSTALL_PREFIX=~/Tools-DCMAKE_BUILD_TYPE=DEBUG-DJAVA_BINDINGS=ON-DEIGEN3_INCLUDE_DIR=/home/vin/Eigen3-DSWIG_EXECUTABLE=/usr/bin/swig-DRUN_SWIG=ONsudo make* The compilation went well and took the libopenbabel_java.so and libopenbabel.so from the build directory and packed it along with my application in the directory (app/rescources) and specified the path to the app/resources directory in the source code (system.load("/home/vin/app/resources/libopenbabel_java.so")) of my application for performing an openbabel task. When I run my application jar file (app.jar) and perform an openbabel task (generate conformers) I am getting the below error Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /home/praktikant/OPAS_ALPHA_1.0/resources/libopenbabel_java.so: */home/vin/app_ALPHA_1.0/resources/libopenbabel_java.so: undefined symbol: _ZTVN9OpenBabel30OBMinimizingRMSDConformerScoreE* By the way, my application runs perfectly fine where OpenBabel is already installed (like in my development environment). Any hints in the right direction is highly appreciated. Thank you. -- Regards Vinothkumar Mohanakrishnan -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss