Difference between revisions of "Pdb to movie.py"
Jump to navigation
Jump to search
import>Mp466 |
import>Mp466 |
||
Line 53: | Line 53: | ||
cby=cy |
cby=cy |
||
cbz=cz |
cbz=cz |
||
+ | |||
− | |||
if residue.has_id("O"): |
if residue.has_id("O"): |
||
o=residue["O"] |
o=residue["O"] |
||
Line 61: | Line 61: | ||
oy=o.get_coord()[1] |
oy=o.get_coord()[1] |
||
oz=o.get_coord()[2] |
oz=o.get_coord()[2] |
||
+ | |||
− | |||
print "CA: %8.3f %8.3f %8.3f CB: %8.3f %8.3f %8.3f OX: %8.3f %8.3f %8.3f" % (cx,cy,cz,cbx,cby,cbz,ox,oy,oz) |
print "CA: %8.3f %8.3f %8.3f CB: %8.3f %8.3f %8.3f OX: %8.3f %8.3f %8.3f" % (cx,cy,cz,cbx,cby,cbz,ox,oy,oz) |
Revision as of 19:24, 8 May 2009
#! /usr/bin/env python """ Calculates the movieseg from a given PDB file arguments: PDBfile - the PDB file to score 50 format('CA: ',3(f8.3,1x),'CB: ',3(f8.3,1x),'Ox: ', 3(f8.3,1x)) 334 format(4(i8,1x),' nmres nmcrd numpro nmsnap') """ import sys import string from Bio.PDB.PDBParser import PDBParser PDBfile='1uzc' pars = PDBParser(PERMISSIVE = 1) struct = pars.get_structure(PDBfile.rstrip('.pdb'), PDBfile) model = struct.child_list[0] chain = model.child_list[0] print " 69 3 1 1 nmres nmcrd numpro nmsnap" for residue in chain: cx=0.0 cy=0.0 cz=0.0 cbx=0.0 cby=0.0 cbz=0.0 ox=0.0 oy=0.0 oz=0.0 if residue.has_id("CA"): ca=residue["CA"] cx=ca.get_coord()[0] cy=ca.get_coord()[1] cz=ca.get_coord()[2] if residue.has_id("CB"): cb=residue["CB"] # print "CB" # print cb.get_coord() cbx=cb.get_coord()[0] cby=cb.get_coord()[1] cbz=cb.get_coord()[2] else: cbx=cx cby=cy cbz=cz if residue.has_id("O"): o=residue["O"] # print " O" # print o.get_coord() ox=o.get_coord()[0] oy=o.get_coord()[1] oz=o.get_coord()[2] print "CA: %8.3f %8.3f %8.3f CB: %8.3f %8.3f %8.3f OX: %8.3f %8.3f %8.3f" % (cx,cy,cz,cbx,cby,cbz,ox,oy,oz)