if atm_type == 0: atm_type = a.babel_type atm_type = converter.clean_atom_type(atm_type) a.babel_cov_rad = babel_elements[atm_type]['cov_rad'] a.babel_bond_ord_rad = babel_elements[atm_type]['bond_ord_rad'] a.babel_max_bonds = babel_elements[atm_type]['max_bonds'] if __name__ == '__main__': import pdb, sys from atomTypes import AtomHybridization from cycle import RingFinder from MolKit.pdbParser import NewPdbParser parser = NewPdbParser("/tsri/pdb/struct/%s.pdb"%sys.argv[1]) mols = parser.parse() mol = mols[0] mol.buildBondsByDistance() allAtoms = mol.chains.residues.atoms bonds = allAtoms.bonds[0] print "assigning atom types" babel = AtomHybridization() babel.assignHybridization(allAtoms) print "looking for rings" rings = RingFinder() rings.findRings(allAtoms, bonds) print "assigning bond order"
if not hasattr(self, 'rings'): return i = 0 for r in self.rings: print 'RING ',i for j in range(len(r['atoms'])): a = r['atoms'][j] b = r['bonds'][j] print '%10s %4d %s'%(a.name, a.number, repr(b)) i = i + 1 if __name__ == '__main__': import pdb, sys from MolKit.pdbParser import NewPdbParser parser = NewPdbParser("/tsri/pdb/struct/%s.pdb"%sys.argv[1]) mols = parser.parse() mol = mols[0] mol.buildBondsByDistance() allAtoms = mol.chains.residues.atoms print 'Looking for rings' r = RingFinder() bonds = (allAtoms.bonds)[0] r.findRings(allAtoms, bonds) r.printRings() from MolKit.pdbParser import NewPdbqParser parser = NewPdbqParser("./txp.pdbq") mols = parser.parse()