Open main menu

Changes

<source lang="python">
from pipe_control.mol_res_spin import spin_loop
 
# Open file for writing
f = open('cluster_residues.txt', 'w')
 
resi_models = []
for spin, spin_id in spin_loop(return_id=True, skip_desel=True):
resi_models.append(spin.model)
# Count resi_models
c_resi_models = dict((i,resi_models.count(i)) for i in resi_models)
print c_resi_models
print resi_models# Count resi_modelsWrite resultprint dictfor key, val in c_resi_models.items(): f.write(i,resi_models.count"# " + str(ikey)+ " " + str(val) for i in resi_models+ "\n" )</source>
We see that '''CR72''' is most represented. <br>We make a list # Write models to cluster these residues, and write them to a file '''cluster_residues.txt'''.<source lang="python">model_crit = 'CR72'sel_residues = []
for spin, spin_id in spin_loop(return_id=True, skip_desel=True):
if spinf.model == model_crit: sel_residues.appendwrite( str( [spin_id, spin.model]f = open('cluster_residues.txt', 'w')for p in sel_residues: s = + " "+ str(spin.join( map(str, p) model) + "\n" print s, f.write( s )
f.close()
</source>
Trusted, Bureaucrats
1,382

edits