João, The function you're looking for is:
void ObjectMoleculeAddSeleHydrogens(ObjectMolecule * I, int sele, int state) in layer2/ObjectMolecule.c line 3629 (or thereabouts). PyMOL has a connectivity table that determines which atoms are bound to which others. Read over that function and see if that clarifies things for you. Good luck, -- Jason On Thu, Jul 1, 2010 at 10:54 AM, João Rodrigues <anar...@gmail.com> wrote: > Hey Jason! > > Thanks for the reply, no problem at all with the delay :) > > I got my hands around the code and I *think* I got it to add hydrogens to a > protein (including checking that random effect). > > My only question is, how PyMol determines which atoms lack hydrogens. I > checked the hetatm.py and protein.py files and they seems to compare the > structure with a pre-defined database of bonds for each residue. However, > this works for proteins only right? > > How does it work for methane? How does it recognize that is lacks 4 atoms? > If you can point me to the file where that part is described, that would be > amazing! I've lost two weeks trying to figure it out already and I can't... > > Best! > > João > -- Jason Vertrees, PhD PyMOL Product Manager Schrodinger, LLC (e) jason.vertr...@schrodinger.com (o) +1 (603) 374-7120 ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net