Skip to content

Commit

Permalink
Updated Knotscope to return more information
Browse files Browse the repository at this point in the history
  • Loading branch information
monteirotorres committed Jul 4, 2018
1 parent a24874a commit 774c88b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Structuralia/KnotScope.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,18 @@ def get_knots(pdb, cutoff, cluster_cutoff, genpdb, verbosity):
with open('KnotScope.log', 'a') as log:
log.write('[K'+str(n)+'-RES],'+','.join([str(a) for a in cluster_residues])+'\n')
log.write('[K'+str(n)+'-LEN],'+str(len(cluster_residues))+'\n')
if clusterdict:
nknots = len(set(list(clusterdict.values())))
else:
nknots = 0
maxklength = max(k_lengths)
with open('KnotScope.log', 'a') as log:
log.write('[SUM],str,'+pdb+',ca_clash,'+str(len(core))+',nknots,'+str(len(set(clusters[-1])))+',longest,'+str(max(k_lengths))+'\n')
return clusterdict
log.write('[SUM],str,'+pdb+',ca_clash,'+str(len(core))+',nknots,'+str(nknots)+',maxklength,'+str(maxklength)+'\n')
return clusterdict, nknots, maxklength
else:
print(clrs['g']+'No CA distances under '+str(cutoff)+' angstrons found'+clrs['n']+'!\n')
with open('KnotScope.log', 'a') as log:
log.write('[SUM],str,'+pdb+',ca_clash,0,nknots,0,longest,0\n')
log.write('[SUM],str,'+pdb+',ca_clash,0,nknots,0,maxklength,0\n')

del pdb_name, structure, nchains, contacts
elif pdb.startswith('CONTACTS-'):
Expand Down Expand Up @@ -262,6 +267,7 @@ def main():
cutoff = args.cutoff
cluster_cutoff = args.cluster_cutoff
genpdb = args.genpdb

if genpdb == 1:
genpdb = True
elif genpdb == 0:
Expand Down

0 comments on commit 774c88b

Please sign in to comment.