The documentation for GetNumAtoms says it takes an optional parameter:

   onlyHeavy: (optional) include only heavy atoms (not Hs) defaults to 1


In testing it with the attached SD file I found that it included the four 
hydrogens with mass difference of 1

    6.0300   -2.1729    0.0000 H   1  0  0  0  0  0  0  0  0  0  0  0
    7.7794    0.0209    0.0000 H   1  0  0  0  0  0  0  0  0  0  0  0
    7.2965   -3.1829    0.0000 H   1  0  0  0  0  0  0  0  0  0  0  0
    9.0460   -0.9892    0.0000 H   1  0  0  0  0  0  0  0  0  0  0  0
    8.8045   -2.5911    0.0000 H   1  0  0  0  0  0  0  0  0  0  0  0

It should have reported 28 heavy atoms (defined as non-hydrogens) and not 33.

This was from

> <PUBCHEM_COMPOUND_CID>
6914095

> <PUBCHEM_OPENEYE_ISO_SMILES>
[2H]C1=C(C(=C(C(=C1[2H])[2H])C2=NC(C(=O)N(C3=C2C=C(C=C3)Cl)[Si](C)(C)C)O[Si](C)(C)C)[2H])[2H]

My guess is that it treats the deuterium as explicit hydrogens but doesn't take 
that into account when doing the heavy atom calculations.

I'm assuming the problem is from ROMol::getNumAtoms

    int res = boost::num_vertices(d_graph);
    if (!onlyHeavy) {
      // if we are interested in hydrogens as well add them up from 
      // each heavy atom
      ConstAtomIterator ai;
      for (ai = beginAtoms(); ai != endAtoms(); ai++) {
        res += (*ai)->getTotalNumHs();
      }
    }
    return res;

where the if (onlyHeavy) case does not remove count of any verticies which are 
hydrogens.



Attachment: problem.sdf
Description: Binary data



                                Andrew
                                [email protected]


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to