Re: [Open Babel] Java API: setting OBConformerScore will crash application
It seems not possible to create a simple application were this issue happens. As a context I'm reading in molecules, generating 3D coordinates and then generate the Spectrophore. In a simple script-like snippet this works. In the complete application the results are written to an output file, there are cli-options but fundamentally it does not do anything different and the code for conformer searching is the same. But here it always fails with a java error. And commenting conformerSearch.SetScore(score); reproducibly fixes the issue. I will investigate further to try to find a simple example to demonstrate this. -- View this message in context: http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4656960.html Sent from the General discussion mailing list archive at Nabble.com. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Java API: setting OBConformerScore will crash application
Just a hint: one common problem with the forcefield code is that you forgot to check that Setup was successful (Setup can fail with crazy molecules that are not supported by a particular forcefield). This can result in any number of interesting segfaults if you call any other forcefield methods afterwards. - Noel On 2 December 2013 09:18, Joos Kiener wrote: > It seems not possible to create a simple application were this issue happens. > As a context I'm reading in molecules, generating 3D coordinates and then > generate the Spectrophore. In a simple script-like snippet this works. > > In the complete application the results are written to an output file, there > are cli-options but fundamentally it does not do anything different and the > code for conformer searching is the same. But here it always fails with a > java error. And commenting > > conformerSearch.SetScore(score); > > reproducibly fixes the issue. > > I will investigate further to try to find a simple example to demonstrate > this. > > > > -- > View this message in context: > http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4656960.html > Sent from the General discussion mailing list archive at Nabble.com. > > -- > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > ___ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Java API: setting OBConformerScore will crash application
The code for generating the conformers is as below: private void generateConformers(OBMol mol) { OBConformerSearch conformerSearch = new OBConformerSearch(); OBConformerScore score = new OBEnergyConformerScore(); conformerSearch.SetScore(score); if (!conformerSearch.Setup(mol, nrOfConformers, nrOfChildren, mutability, convergence)) { String message = "Generating conformers failed."; throw new MoleculeInitializationException(message, mol); } conformerSearch.Search(); conformerSearch.GetConformers(mol); } In the calling code the exception is caught. And I can actually use this same code (class) above in a more simplified script and it works fine. So I'm kind of lost...The simpler script does not write any result to a file. -- View this message in context: http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4656962.html Sent from the General discussion mailing list archive at Nabble.com. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
[Open Babel] (no subject)
Hello, Thank you all who are helping me with this openbabel. I have difficultieswith conversion of pwscf files.Colleague of mine had the same problem, but was able to fix it. But now we cannot reproduce this "fix". But back to case, when I am wanted to convert a valid pwscf file like this: babel -i pwscf pw.out -o xyz out.xyz the result is always: 0 molecules converted 2 audit log messages I obtained from git repository, compiled with g++ with support of eigen2. Its version 2.3.90. What i am missing, What are those audit log messages. How can I view them. Regards! -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] (no subject)
PWSCF is a relatively new addition to the parser. So it's possible that it's a new type of file that isn't read correctly. Can you send me an example file or two? Thanks very much, -Geoff On Dec 2, 2013, at 8:41 AM, Otto Kohulák wrote: > Hello, > > Thank you all who are helping me with this openbabel. I have difficulties > with conversion of pwscf files. Colleague of mine had the same problem, but > was able to fix it. But now we cannot reproduce this "fix". But back to case, > when I am wanted to convert a valid pwscf file like this: > > babel -i pwscf pw.out -o xyz out.xyz > > the result is always: > > 0 molecules converted > 2 audit log messages > > I obtained from git repository, compiled with g++ with support of eigen2. Its > version 2.3.90. What i am missing, What are those audit log messages. How can > I view them. > > Regards! > > > -- > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk___ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] (no subject)
On Mon, Dec 2, 2013 at 5:41 AM, Otto Kohulák wrote: > > babel -i pwscf pw.out -o xyz out.xyz > > the result is always: > > 0 molecules converted > 2 audit log messages > Can you convert from or to other formats? For example, can you do this? echo "CCO" | obabel -i smi -o sdf By the way, the "babel" program is old. You should read about the newer "obabel" program, which is very similar but handles command-line arguments better. Try "obabel -H". Craig -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Java API: setting OBConformerScore will crash application
I can reproduce this on a different PC also running windows 7. The Windows Event viewer generates an entry for this: Faulting application name: java.exe, version: 7.0.450.18, time stamp: 0x525404d0 Faulting module name: ntdll.dll, version: 6.1.7601.18205, time stamp: 0x51db96c5 Exception code: 0xc374 Fault offset: 0x000c385b Faulting process id: 0x1f38 Faulting application start time: 0x01ceef76378d42e8 Faulting application path: C:\Windows\system32\java.exe Faulting module path: C:\Windows\SYSTEM32\ntdll.dll Report Id: 766a7dc8-5b69-11e3-a4f4-083e8e9dc95b Not sure if this helps at all. The whole issue is kind of confusing as again, the exact same code works when called from a simpler snippet that does not write results to a file and does not allow any options to be set. -- View this message in context: http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4656966.html Sent from the General discussion mailing list archive at Nabble.com. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Java API: setting OBConformerScore will crash application
> Not sure if this helps at all. The whole issue is kind of confusing as > again, the exact same code works when called from a simpler snippet that > does not write results to a file and does not allow any options to be set. When you say "does not allow any options to be set," do you mean the OBConformerScore isn't set? Also, as a temporary work-around, have you looked at the Monte-Carlo conformer searching (i.e., weighted rotor search)? Thanks, -Geoff -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Java API: setting OBConformerScore will crash application
Geoff Hutchison wrote > When you say "does not allow any options to be set," do you mean the > OBConformerScore isn't set? No I meant that the options are not exposed as cli parameters and hence it runs with default parameters (eg. nr of conformers, nr of children, mutability,...) -- View this message in context: http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4656968.html Sent from the General discussion mailing list archive at Nabble.com. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
[Open Babel] count polar and non polar atoms
Dear list, I have a bunch of .mol2 files. I would like to count the number of atoms in each file as: total number of atoms, number of polar atoms, number of non polar atoms. Is there a way to do this rather easily with Open Babel? Thanks a lot, Francois. PS: I am not a chemist -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Java API: setting OBConformerScore will crash application
This is confusing. This issue is some weird memory issue. At the end of this post is the most simple code I could come up with that reproduces the problem for me. I can make the code work by removing or commenting just any of the following lines (only one of them is enough): - conformerSearch.SetScore(score); // will then use default OBRMSDConformerScore - String str = StringUtils.join(strArray, ','); For the StringUtils part, the length of the array matters. 5000 still works, 8000 does not. However in my original application I completely removed that and it still has the issue. This tells me it is some weird memory problem that can be caused by generating long strings (but not limited to this). This issue then breaks OBEnergyConformerScore but not the default OBRMSDConformerScore. The error code from event viewer according to my google search means heap corruption. See below the mentioned code. It has a dependency on org.apache.commons.lang3. package conformergenerator; import org.apache.commons.lang3.StringUtils; import org.openbabel.OBBuilder; import org.openbabel.OBConformerScore; import org.openbabel.OBConformerSearch; import org.openbabel.OBConversion; import org.openbabel.OBEnergyConformerScore; import org.openbabel.OBMol; public class App { public static void main(String[] args) { System.loadLibrary("openbabel_java"); System.out.println("Create OBMol from smiles"); OBConversion conv = new OBConversion(); OBMol mol = new OBMol(); conv.SetInFormat("smi"); boolean hasNext = conv.ReadFile(mol, "mols.smi"); String[] strArray = buildArray(1); while (hasNext) { System.out.println("Adding Hydrogens"); mol.AddHydrogens(); System.out.println("Generate 3D coordinates"); OBBuilder builder = new OBBuilder(); builder.Build(mol); System.out.println("Generate Conformers"); OBConformerSearch conformerSearch = new OBConformerSearch(); OBConformerScore score = new OBEnergyConformerScore(); conformerSearch.SetScore(score); if (!conformerSearch.Setup(mol)) { String message = "Generating conformers failed."; throw new IllegalArgumentException(message); } conformerSearch.Search(); conformerSearch.GetConformers(mol); String str = StringUtils.join(strArray, ','); // the idea would be to add this as property to mol // but not required for the code to fail hasNext = conv.Read(mol); } System.out.println("Success!!!"); } private static String[] buildArray(int numElements) { String[] a = new String[numElements]; for (int i = 0; i < numElements; i++) { a[i] = "a"; } return a; } } -- View this message in context: http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4656970.html Sent from the General discussion mailing list archive at Nabble.com. -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss