Hi Daniel,

On Thursday 04 January 2007 11:03, Daniel Gottstein wrote:
> I'm a Bioinformatics student from Frankfurt and currently working on a
> project in which I need to add Hydrogens to a PDBfile. The problem I'm
> experiencing is that the HydrogenAdder() Class object seems to be adding
> too many Hydrogens to the Molecule I've extracted from the pdbfile.
> Assuming I've extracted the first model from the 1fjs.pdb file.
>
> InputStream pdbfile =
> this.getClass().getClassLoader().getResourceAsStream("1FJS.pdb");

<snip>

The code is generally OK, except for one thing...

> This is my output
>
> before h2add:
> 2475
> after h2add:
> 5927

PDB files normally do not have bonds defined, and basically consist of a cloud 
of atoms. The HydrogenAdder, however, assumes things to be bonded. For 
example, an unbonded oxygen will get 2 hydrogen (to form water), which will 
likely be the carbonyl-oxygen of the backbone with zero hydrogens!

> I compared these results with the pymol h_add() method and received the
> following...:
>
> PyMOL>print cmd.count_atoms()
> 2475
> PyMOL>cmd.h_add()
> PyMOL>print cmd.count_atoms()
> 5062
>
> ... meaning my java code must be adding about 900 additional Hydrogens
> (assuming the correctness of the pymol results).
>
> Is there a mistake in my java code? Or have I forgotten something?

You should run the RebondTool [1] prior to adding hydrogens. This tool 
requires vanderwaals radii to be assigned to the atoms, so the full use looks 
like this:

    RebondTool rebonder = new RebondTool(2.0, 0.5, 0.5);
    Molecule methane = new Molecule();
    methane.addAtom(new Atom("C", new Point3d(0.0, 0.0, 0.0)));
    methane.addAtom(new Atom("H", new Point3d(0.6, 0.6, 0.6)));
    methane.addAtom(new Atom("H", new Point3d(-0.6, -0.6, 0.6)));
    methane.addAtom(new Atom("H", new Point3d(0.6, -0.6, -0.6)));
    methane.addAtom(new Atom("H", new Point3d(-0.6, 0.6, -0.6)));

    try {
      // configure atoms
      AtomTypeFactory factory =
        AtomTypeFactory.getInstance(
          "org/openscience/cdk/config/data/jmol_atomtypes.txt",
          methane.getBuilder()
        );
      for (int i=0; i<methane.getAtomCount(); i++) {
        factory.configure(methane.getAtom(i));
      }
      // rebond
      rebonder.rebond(methane);
    } catch (Exception exception) {
      fail()
    }

(taken from cdk.test.graph.rebond.RebondToolTest).

> I'd be thankful for every hint I can get.

Please let me know, how many hydrogens are added *after* the use of the 
RebondTool.

Egon

1.http://cdk.sourceforge.net/api/org/openscience/cdk/graph/rebond/RebondTool.html

-- 
[EMAIL PROTECTED]
Cologne University Bioinformatics Center (CUBIC)
Blog: http://chem-bla-ics.blogspot.com/
GPG: 1024D/D6336BA6

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to