""" pygl/mmdb_util.py: CCP4MG Molecular Graphics Program Copyright (C) 2001-2005 University of York, CCLRC This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. """ from point_funcs import * class AtomInfo: def __init__(self,atom): S = ptrcreate("char",'a',50) label = atom.GetAtomID(S) self.label = label self.modelid = int(label.split("/").pop(1)) self.chainid = label.split("/").pop(2) self.resid = int(label.split("/").pop(3).split("(").pop(0)) self.resname = label.split("/").pop(3).split("(").pop(1).split(")").pop(0) self.atomid = label.split("/").pop(4).split("[").pop(0) self.elid = label.split("/").pop(4).split("[").pop(1).split("]").pop(0) ptrfree(S) def GetCID(self): return self.label def GetModelID(self): return self.modelid def GetChainID(self): return self.chainid def GetResidueID(self): return self.resid def GetResidueName(self): return self.resname def GetAtomID(self): return self.atomid def GetElementID(self): return self.elid