#!/usr/bin/python
import sys
import os
f1=open('1tfz.p db','r')
residue=[]
for line in f1:
if line.startswith ('ATOM') or line.startswith ('HETATM'):
res_number=line[22-26]
if res_number not in residue and line[17-20]!='HOH' and line[17-20]!='WAT':
residue.append( res_number)
else:
continue
else:
continue
f1.close()
res_total=len(r esidue)
if res_total>=50 and res_total<=1000 :
B=res_total
else:
B='NO'
# please can anyone explain me what's wrong with this codes. as the output i want to know number of residues in this pdb file
import sys
import os
f1=open('1tfz.p db','r')
residue=[]
for line in f1:
if line.startswith ('ATOM') or line.startswith ('HETATM'):
res_number=line[22-26]
if res_number not in residue and line[17-20]!='HOH' and line[17-20]!='WAT':
residue.append( res_number)
else:
continue
else:
continue
f1.close()
res_total=len(r esidue)
if res_total>=50 and res_total<=1000 :
B=res_total
else:
B='NO'
# please can anyone explain me what's wrong with this codes. as the output i want to know number of residues in this pdb file
Comment