Hi,
I have a protein structure in a .pdb file. In my program (using the
> C++ API), I load it (with obConversion.ReadFile) in a OBMol. What I am
> trying to do next, is to get data from the residues and the atom types
> of the pdb file. For example, let's say I have this line in my file:
>
> ATOM 4 CD PRO A 1 20.835 45.525 -5.625 1.00 0.00
> C
>
> I am looking for a function which will tell me that atom 4 is a CD
> atom from a proline. Perhaps something like:
>
> for (unsigned int j=1; j<=obMol.NumAtoms() ; j++ ) {
> OpenBabel::OBAtom *atom;
> atom = obMol.GetAtom(j);
> atom->GetAminoAcid();
> atom->GetTypeFromPDB();
> ...
> }
>
>
Sorry, I don't know about doing it in C++ (furthermore,I didn't find
"GetTypeFromPDB" in the API, if you can give me the link? thanks !), but
with pybel, you can try:
for mol in pybel.readfile("pdb", filename):
for res in openbabel.OBResidueIter(mol.OBMol):
for atom in openbabel.OBResidueAtomIter(res):
print res.GetName(), res.GetAtomID(atom), res.GetSerialNum(atom)
Output e.g.
PRO CD 806
I guess it could easily be translated in C++.
Best,
Pascal
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss