Re: [Open Babel] Invalid memory access during OBConversion.WriteFile()
Hi, You should probably test the result from SetInAndOutFormats, just to be sure. If that step failed, you're in trouble. Do you get the error regardless of what format you're using for output? Kind regards, Fredrik 4 dec 2012 kl. 10:16 skrev mpillong max.pill...@pharma.ethz.ch: Hmmm, sorry about that, I was using the raw Tag here ... but here's the original text. Hey everyone, I am currently running OpenBabel on a MacOSX 10.6.8 in Eclipse with Java. Recently, I encountered the following exception during using the WriteFile() Method in OBConversion: 'Invalid memory access of location 0xfffb25991558 rip=0x7fff888cb683' I have used the same method to write molecules before, the code looks like this: public static void writeOBMolecule(OBMol mol, String output, String format){ OBConversion obc=new OBConversion(); obc.SetInAndOutFormats(format, format); obc.WriteFile(mol, output); } I have tried multiple *.pdb files, the same error occurs every time (although the location does change every time). Any thoughts on this? Thanks in advance! Max -- View this message in context: http://forums.openbabel.org/Invalid-memory-access-during-OBConversion-WriteFile-tp4655729p4655731.html Sent from the General discussion mailing list archive at Nabble.com. -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Invalid memory access during OBConversion.WriteFile()
Hey Fredrik, thanks for the input. The SetInAndOutFormat returns true, so I'm guessing there's nothing worng here. I've experienced this error with several inputfiles of varying format (pdb, sdf, mol2). Best regards, Max -- View this message in context: http://forums.openbabel.org/Invalid-memory-access-during-OBConversion-WriteFile-tp4655729p4655735.html Sent from the General discussion mailing list archive at Nabble.com. -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Invalid memory access during OBConversion.WriteFile()
Ah yes, my bad! Of course, I have also tried different output formats, but the error remains the same! -- View this message in context: http://forums.openbabel.org/Invalid-memory-access-during-OBConversion-WriteFile-tp4655729p4655737.html Sent from the General discussion mailing list archive at Nabble.com. -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Invalid memory access during OBConversion.WriteFile()
Can you provide a complete program that exhibits the problem? Please make it as small as possible. On 4 December 2012 10:06, mpillong max.pill...@pharma.ethz.ch wrote: Ah yes, my bad! Of course, I have also tried different output formats, but the error remains the same! -- View this message in context: http://forums.openbabel.org/Invalid-memory-access-during-OBConversion-WriteFile-tp4655729p4655737.html Sent from the General discussion mailing list archive at Nabble.com. -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Invalid memory access during OBConversion.WriteFile()
Sure thing! Is the code sufficient, or would you need a runnable jar? package TestClasses; import org.openbabel.OBConversion; import org.openbabel.OBMol; public class TestOBWriteFile { public static void main(String[] args) { System.load(/Applications/OpenBabel/openbabel-2.2.3/scripts/java/libopenbabel.jnilib); OBMol mol=new OBMol(); OBConversion obc=new OBConversion(); boolean SetSuccessful=obc.SetInAndOutFormats(pdb, pdb); if (SetSuccessful) { obc.ReadFile(mol, /Users/max/propane.pdb); obc.WriteFile(mol, /Users/max/propaneOut.pdb); } } } Thank you so much for your help! Best, Max -- View this message in context: http://forums.openbabel.org/Invalid-memory-access-during-OBConversion-WriteFile-tp4655729p4655739.html Sent from the General discussion mailing list archive at Nabble.com. -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Smiles conversion problems with Ion and Zwitterion
Hi Chris, Thanks for your reply and apologies for the delayed response. Converting the cif to xyz and viewing the molecule shows the correct structure but converting the xyz file to smi and then generating coordinates and viewing shows the addition of a H atom. The correct smiles is: C(=O)(O)C[C@@H](C(=O)[O-])[N]1C=C[N+]=C1 The other smiles is:C(=O)([C@@H](CC(=O)O)N1C=CNC1)O One strange feature is that there doesn't appear to be a double bond between the N atom in the ring and the C atom, leaving the C atom with only three bonds. The smiles conversion seems to want to add a H here to get the correct bonding. Similarly for an ion, using smiles conversion results in the addition of H's. I've attached the cif file. Many thanks, Scott On 30 November 2012 14:53, Chris Morley c.mor...@gaseq.co.uk wrote: On 30/11/2012 12:03, scott_m wrote: Dear all, The conversion of (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate from a .cif file to .smi and subsequent generation of coordinates from the .smi file results in the addition of an extra H to one of the ring C atoms. The original cif formula is C7H8N2O4 but this changes to C7H9N2O4, which is no longer a zwitterion. I also noticed that converting an ion to smi and then from smi to xyz resulted in the addition of hydrogen atoms. Can this be avoided? Is the smi conversion of ions and zwitterions known to cause problems? Getting added hydrogens right is a recurrent issue. However the conversion from SMILES to xyz (and other formats) seems ok. Your problem may be in the conversion of the cif file, but you will need to append it for somebody (probably not me) to debug. obabel -:C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1 (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate -oxyz --gen3D --title --append formula 21 C7H8N2O4 C 2.456020.705701.56344 O 3.445920.485862.25208 O 1.436561.466702.00415 C 2.263560.114370.19030 C 3.145460.74947 -0.88078 H 2.848310.31396 -1.84634 C 2.830382.27406 -0.99631 O 1.670902.60592 -0.61087 O 3.794412.97728 -1.40748 N 4.601370.42805 -0.71225 C 5.359000.947620.25841 N 6.587890.461240.10334 H 7.339920.616600.75954 C 6.69161 -0.15933 -1.12882 C 5.43119 -0.14873 -1.66026 H 0.845361.765801.27272 H 1.204390.19509 -0.08254 H 2.46795 -0.957670.27113 H 5.047741.616431.05753 H 7.65241 -0.48371 -1.46628 H 5.01646 -0.45579 -2.60586 1 molecule converted Chris -- Keep yourself connected to Go Parallel: TUNE You got it built. Now make it sing. Tune shows you how. http://goparallel.sourceforge.net ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss SOXGES.search2.cif Description: Binary data -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Smiles conversion problems with Ion and Zwitterion
Scott Your correct smiles is not right. The sum of the bond orders to the charged nitrogen should be 4, and is only 3 (it has no H attached). The correct SMILES is in my post below. Even with it, the round trip via xyz: obabel -:C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1 -oxyz --gen3D | obabel -ixyz -osmi --append formula 1 molecule converted C(=O)(O)C[C@@H](C(=O)[O])N1CNC=C1 C7H8N2O4 1 molecule converted gives a di-radical rather than a zwitterion because xyz does not represent charges (or even bonds) and so OpenBabel didn't get any hints. xyz format is poor choice of format for general use. The round trip works ok with formats like mol or cml. Chris On 04/12/2012 10:51, Scott McKechnie wrote: Hi Chris, Thanks for your reply and apologies for the delayed response. Converting the cif to xyz and viewing the molecule shows the correct structure but converting the xyz file to smi and then generating coordinates and viewing shows the addition of a H atom. The correct smiles is: C(=O)(O)C[C@@H](C(=O)[O-])[N]1C=C[N+]=C1 The other smiles is:C(=O)([C@@H](CC(=O)O)N1C=CNC1)O One strange feature is that there doesn't appear to be a double bond between the N atom in the ring and the C atom, leaving the C atom with only three bonds. The smiles conversion seems to want to add a H here to get the correct bonding. Similarly for an ion, using smiles conversion results in the addition of H's. I've attached the cif file. Many thanks, Scott On 30 November 2012 14:53, Chris Morley c.mor...@gaseq.co.uk mailto:c.mor...@gaseq.co.uk wrote: On 30/11/2012 12:03, scott_m wrote: Dear all, The conversion of (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate from a .cif file to .smi and subsequent generation of coordinates from the .smi file results in the addition of an extra H to one of the ring C atoms. The original cif formula is C7H8N2O4 but this changes to C7H9N2O4, which is no longer a zwitterion. I also noticed that converting an ion to smi and then from smi to xyz resulted in the addition of hydrogen atoms. Can this be avoided? Is the smi conversion of ions and zwitterions known to cause problems? Getting added hydrogens right is a recurrent issue. However the conversion from SMILES to xyz (and other formats) seems ok. Your problem may be in the conversion of the cif file, but you will need to append it for somebody (probably not me) to debug. obabel -:C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1 (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate -oxyz --gen3D --title --append formula 21 C7H8N2O4 C 2.456020.705701.56344 O 3.445920.485862.25208 O 1.436561.466702.00415 C 2.263560.114370.19030 C 3.145460.74947 -0.88078 H 2.848310.31396 -1.84634 C 2.830382.27406 -0.99631 O 1.670902.60592 -0.61087 O 3.794412.97728 -1.40748 N 4.601370.42805 -0.71225 C 5.359000.947620.25841 N 6.587890.461240.10334 H 7.339920.616600.75954 C 6.69161 -0.15933 -1.12882 C 5.43119 -0.14873 -1.66026 H 0.845361.765801.27272 H 1.204390.19509 -0.08254 H 2.46795 -0.957670.27113 H 5.047741.616431.05753 H 7.65241 -0.48371 -1.46628 H 5.01646 -0.45579 -2.60586 1 molecule converted Chris -- Keep yourself connected to Go Parallel: TUNE You got it built. Now make it sing. Tune shows you how. http://goparallel.sourceforge.net ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net mailto:OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Smiles conversion problems with Ion and Zwitterion
Your problem is the incorrect conversion of a cif file, but you haven't shown one yet. (Not that I know much about cif files, but others may.) Conversions in OB go through an internal data structure, OBMol. It sound like the problem is in the cif to OBMol part, not in the OBMol to SMILES. Chris On 04/12/2012 15:34, Scott McKechnie wrote: Thanks Chris for the helpful comments. Sorry to keep on but I'm still left with the problem on going from cif to smiles where the original number of elements is not conserved. What I want is to be able to reliably represent the original cif molecule as a smiles string and from there recreate the molecule with gen3d. The problem at the moment is that the number of H atoms is changing. Any work around for this? On 4 December 2012 15:05, Chris Morley c.mor...@gaseq.co.uk mailto:c.mor...@gaseq.co.uk wrote: Scott Your correct smiles is not right. The sum of the bond orders to the charged nitrogen should be 4, and is only 3 (it has no H attached). The correct SMILES is in my post below. Even with it, the round trip via xyz: obabel -:C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1 -oxyz --gen3D | obabel -ixyz -osmi --append formula 1 molecule converted C(=O)(O)C[C@@H](C(=O)[O])N1CNC=C1 C7H8N2O4 1 molecule converted gives a di-radical rather than a zwitterion because xyz does not represent charges (or even bonds) and so OpenBabel didn't get any hints. xyz format is poor choice of format for general use. The round trip works ok with formats like mol or cml. Chris On 04/12/2012 10:51, Scott McKechnie wrote: Hi Chris, Thanks for your reply and apologies for the delayed response. Converting the cif to xyz and viewing the molecule shows the correct structure but converting the xyz file to smi and then generating coordinates and viewing shows the addition of a H atom. The correct smiles is: C(=O)(O)C[C@@H](C(=O)[O-])[N]1C=C[N+]=C1 The other smiles is:C(=O)([C@@H](CC(=O)O)N1C=CNC1)O One strange feature is that there doesn't appear to be a double bond between the N atom in the ring and the C atom, leaving the C atom with only three bonds. The smiles conversion seems to want to add a H here to get the correct bonding. Similarly for an ion, using smiles conversion results in the addition of H's. I've attached the cif file. Many thanks, Scott On 30 November 2012 14:53, Chris Morley c.mor...@gaseq.co.uk mailto:c.mor...@gaseq.co.uk mailto:c.mor...@gaseq.co.uk mailto:c.mor...@gaseq.co.uk wrote: On 30/11/2012 12:03, scott_m wrote: Dear all, The conversion of (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate from a .cif file to .smi and subsequent generation of coordinates from the .smi file results in the addition of an extra H to one of the ring C atoms. The original cif formula is C7H8N2O4 but this changes to C7H9N2O4, which is no longer a zwitterion. I also noticed that converting an ion to smi and then from smi to xyz resulted in the addition of hydrogen atoms. Can this be avoided? Is the smi conversion of ions and zwitterions known to cause problems? Getting added hydrogens right is a recurrent issue. However the conversion from SMILES to xyz (and other formats) seems ok. Your problem may be in the conversion of the cif file, but you will need to append it for somebody (probably not me) to debug. obabel -:C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1 (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate -oxyz --gen3D --title --append formula 21 C7H8N2O4 C 2.456020.705701.56344 O 3.445920.485862.25208 O 1.436561.466702.00415 C 2.263560.114370.19030 C 3.145460.74947 -0.88078 H 2.848310.31396 -1.84634 C 2.830382.27406 -0.99631 O 1.670902.60592 -0.61087 O 3.794412.97728 -1.40748 N 4.601370.42805 -0.71225 C 5.359000.947620.25841 N 6.587890.461240.10334 H 7.339920.616600.75954 C 6.69161 -0.15933 -1.12882 C
Re: [Open Babel] Intro to using Open Babel
Very nice ... thanks for doing this. Things like this should be available in the OB documentation as a resource for those starting new projects or trying to make a presentation to their management. Craig On Tue, Dec 4, 2012 at 3:31 AM, Noel O'Boyle baoille...@gmail.com wrote: Hi all, Here are some introductory slides to features and usage of Open Babel: http://baoilleach.blogspot.co.uk/2012/12/intro-to-open-babel.html Regards, Noel -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Re: [Open Babel] Smiles conversion problems with Ion and Zwitterion
Apologies, it was attached in the e-mail before last but had an identifier name (SOXGES.search2.cif) and so may have caused confusion. I've attached it again in this e-mail. As a general question, is it possible to convert coordinates to smiles that will always preserve the elements present (but may not get the bonding correct)? Best wishes, Scott On 4 December 2012 16:54, Chris Morley c.mor...@gaseq.co.uk wrote: Your problem is the incorrect conversion of a cif file, but you haven't shown one yet. (Not that I know much about cif files, but others may.) Conversions in OB go through an internal data structure, OBMol. It sound like the problem is in the cif to OBMol part, not in the OBMol to SMILES. Chris On 04/12/2012 15:34, Scott McKechnie wrote: Thanks Chris for the helpful comments. Sorry to keep on but I'm still left with the problem on going from cif to smiles where the original number of elements is not conserved. What I want is to be able to reliably represent the original cif molecule as a smiles string and from there recreate the molecule with gen3d. The problem at the moment is that the number of H atoms is changing. Any work around for this? On 4 December 2012 15:05, Chris Morley c.mor...@gaseq.co.uk mailto:c.mor...@gaseq.co.uk wrote: Scott Your correct smiles is not right. The sum of the bond orders to the charged nitrogen should be 4, and is only 3 (it has no H attached). The correct SMILES is in my post below. Even with it, the round trip via xyz: obabel -:C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1 -oxyz --gen3D | obabel -ixyz -osmi --append formula 1 molecule converted C(=O)(O)C[C@@H](C(=O)[O])N1CNC=C1 C7H8N2O4 1 molecule converted gives a di-radical rather than a zwitterion because xyz does not represent charges (or even bonds) and so OpenBabel didn't get any hints. xyz format is poor choice of format for general use. The round trip works ok with formats like mol or cml. Chris On 04/12/2012 10:51, Scott McKechnie wrote: Hi Chris, Thanks for your reply and apologies for the delayed response. Converting the cif to xyz and viewing the molecule shows the correct structure but converting the xyz file to smi and then generating coordinates and viewing shows the addition of a H atom. The correct smiles is: C(=O)(O)C[C@@H](C(=O)[O-])[N]1C=C[N+]=C1 The other smiles is:C(=O)([C@@H](CC(=O)O)N1C=CNC1)O One strange feature is that there doesn't appear to be a double bond between the N atom in the ring and the C atom, leaving the C atom with only three bonds. The smiles conversion seems to want to add a H here to get the correct bonding. Similarly for an ion, using smiles conversion results in the addition of H's. I've attached the cif file. Many thanks, Scott On 30 November 2012 14:53, Chris Morley c.mor...@gaseq.co.uk mailto:c.mor...@gaseq.co.uk mailto:c.mor...@gaseq.co.uk mailto:c.mor...@gaseq.co.uk wrote: On 30/11/2012 12:03, scott_m wrote: Dear all, The conversion of (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate from a .cif file to .smi and subsequent generation of coordinates from the .smi file results in the addition of an extra H to one of the ring C atoms. The original cif formula is C7H8N2O4 but this changes to C7H9N2O4, which is no longer a zwitterion. I also noticed that converting an ion to smi and then from smi to xyz resulted in the addition of hydrogen atoms. Can this be avoided? Is the smi conversion of ions and zwitterions known to cause problems? Getting added hydrogens right is a recurrent issue. However the conversion from SMILES to xyz (and other formats) seems ok. Your problem may be in the conversion of the cif file, but you will need to append it for somebody (probably not me) to debug. obabel -:C(=O)(O)C[C@@H](C(=O)[O-])n1c[nH+]cc1 (S)-3-carboxy-2-(imidazol-3-ium-1-yl)propanoate -oxyz --gen3D --title --append formula 21 C7H8N2O4 C 2.456020.705701.56344 O 3.445920.485862.25208 O 1.436561.466702.00415 C 2.263560.114370.19030 C 3.145460.74947 -0.88078 H