On Tue, Jul 31, 2012 at 6:12 AM, Чугунов Антон <batc...@yandex.ru> wrote:
> Dear open babel users,
> I'm adding hydrogens in python script using pep.OBMol.AddHydrogens(False,
> True, 7) function (where pep is pybel molecule). But after saving this to
> PDB file I've got a problem: all hydrogens are written AFTER all heavy
> atoms, but I don't want this. I'd like to have common representation where
> all hydrogens follow the atom where they are connected to.
> Is there a simple way to do this?
>
That's an odd request. Before you try to fix this, you might ask why it
matters. Most connection-table type formats have arbitrary atom ordering.
You're not supposed to put any meaning into the order in which atoms and
bonds are listed. These file formats aren't really supposed to be human
readable, so who cares how atoms and bonds are ordered?
The problem is that if you do assume a particular ordering, it's almost
guaranteed that other applications will mess it up.
That said, the answer is that most OpenBabel file formats write the atoms
and bonds in their input order. If you want a particular order, you could
probably build a copy of your molecule by adding the atoms in the order you
want. But even then, there's no guarantee that the atoms will always be
written out the same way.
Craig
> Thanks,
>
> Chugunov Anton.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss