On Tue, Jul 19, 2011 at 12:43 PM, Noel O'Boyle <[email protected]> wrote:
> On 19 July 2011 11:34, Martin Kamp Jensen <[email protected]> > wrote: > > On Tue, Jul 19, 2011 at 11:13 AM, Noel O'Boyle <[email protected]> > wrote: > >> > >> We really could do with a MD guy on the team. Hint hint. It might just > >> take a few minutes to patch up xtcformat.cpp. Nudge nudge. :-) > > > > I'm not an MD guy, I'm not even a biochemist. I'm just a computer > scientist > > trying to help biochemists :) > > Even better of course. :-) > > > At least I now discovered that to make it work, you first have to read a > PDB > > file and convert it into an OBMol object. Then you can read an XTC for > that > > PDB into the same OBMol object and that object then contains all the > > conformers. So I guess no patching is necessary. Maybe I just needed a > line > > or two of documentation to point my in the right direction. After getting > it > > to work I realize that it makes sense to have to read in a "full > molecule" > > first because the XTC only contains atom coordinates. Oh well :) > > It still looks like a bug. I don't know anything about the XTC format, > but presumbly Open Babel should perceive the molecule structure from > the coordinates as best it can. > Well, now I found out that Open Babel's XTC support is broken. Some of the atom coordinates from the frames of the trajectory are garbage. One might not notice at first because the garbage become some (random) numbers and you can work with your molecule/conformations. For completeness, and if others need to use an XTC file, here is a (maybe not so nice) workaround: I am now using the GROMACS XTC Library (libxdrfile) to get the coordinates of all atoms for all frames of an XTC file. I can then, frame by frame, assign those coordinates to the atoms in an OBMol created from the original PDB file to get the individual conformations. Also, by using Java Native Access (JNA) it was pretty easy to use libxdrfile from Java. Regards, Martin. > > >> > >> On 18 July 2011 13:50, Martin Kamp Jensen <[email protected] > > > >> wrote: > >> > Hello, > >> > I am trying to read an XTC file generated by GROMACS with no luck. > >> > > >> > From the command line, > >> >> > >> >> obabel path/totraj.xtc -O test.pdb > >> > > >> > results in > >> >> > >> >> *** Open Babel Warning in OpenBabel::XTCFormat::ReadMolecule > >> >> Error: number of atoms in the trajectory (X) doesn't match the > number > >> >> of > >> >> atoms in the supplied molecule (0). > >> >> 0 molecules converted > >> > > >> > where X is the actual number of atoms in the molecules of the > trajectory > >> > (I > >> > tried two different trajectory with no luck). > >> > It also does not work using code (which is the way I would like it to > >> > work, > >> > using the command line above was just a test): > >> > > >> >> OBConversion conversion = new OBConversion(); > >> >> conversion.SetInFormat("xtc"); > >> >> OBMol molecule = new OBMol(); > >> >> conversion.ReadFile(molecule, "path/to/traj.xtc"); > >> >> System.out.println(molecule.NumConformers()); // Prints 0, should > print > >> >> 1001 according to gmxcheck -f path/to/traj.xtc > >> > > >> > Regards, > >> > Martin. > >> > > >> > > ------------------------------------------------------------------------------ > >> > AppSumo Presents a FREE Video for the SourceForge Community by Eric > >> > Ries, the creator of the Lean Startup Methodology on "Lean Startup > >> > Secrets Revealed." This video shows you how to validate your ideas, > >> > optimize your ideas and identify your business strategy. > >> > http://p.sf.net/sfu/appsumosfdev2dev > >> > _______________________________________________ > >> > OpenBabel-discuss mailing list > >> > [email protected] > >> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > >> > > >> > > > > > >
------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________ OpenBabel-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
