Thank you! That answers my question. I agree that an OBAtom::GetAtomID() would be a useful addition. -JB ________________________________________ From: Stefano Forli <fo...@scripps.edu> Sent: Friday, February 24, 2017 4:22:42 PM To: openbabel-discuss@lists.sourceforge.net Subject: Re: [Open Babel] determine in code the pdb atom name of an OBAtom
Hi John, you didn't specify which language you're using, but in Python you can get it with something like this: ================= import pybel ob = pybel.ob import sys mol = pybel.readfile('mol2', sys.argv[1]).next() obmol = mol.OBMol for res in ob.OBResidueIter(obmol): for atom in ob.OBResidueAtomIter(res): atName = res.GetAtomID(atom) print "Atom name:", atName # i.e., CA ================= Every once in a while this question pops in the mailing list. Does any of the main developers think that there would be some use for a dedicated function at the atom level?Maybe mapping the same residue function to the OBAtom object?, something like: OBAtom::GetAtomID() S On 02/24/2017 02:14 PM, John Baxter wrote: > Hello, openbabel-discuss! > > For a project I need to be able to tell which atom of a protein residue is > the carbon alpha atom (" CA " in a PDB file). I can't figure out how to query > an OBAtom for this data; is there a way to do this? > > Thank you very much. > -John Baxter > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > > -- Stefano Forli, PhD Assistant Professor of ISCB Molecular Graphics Laboratory Dept. of Integrative Structural and Computational Biology, MB-112A The Scripps Research Institute 10550 North Torrey Pines Road La Jolla, CA 92037-1000, USA. tel: +1 (858)784-2055 fax: +1 (858)784-2860 email: fo...@scripps.edu http://www.scripps.edu/~forli/ ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss