Open main menu

Changes

Let us select residue based on a criterion that is the same model which are fit.
 
Tip: You can copy the lines, and in the relax prompt, select "Paste Plus".
<source lang="python">
resi_models = []
for resiob spin, spin_id in cdp.mol[0].resspin_loop(return_id=True, skip_desel=True): resi_models.append(resiob.spin[0].model) 
print resi_models
# Count resi_models
dublicates = mapprint dict(lambda val: (vali, [resi_models.count(i )) for i in xrange(len(resi_models)) if resi_models[i] == val]), resi_models)for dub in dublicates: print dub[0], len(dub[1])
# We see that "NS 2-site expanded" is most represented
# We now cluster these residues
sel_residues = []
for resiob spin, spin_id in cdp.mol[0].resspin_loop(return_id=True, skip_desel=True): if resiob.spin[0].model == 'NS 2-site expanded': sel_residues.append( [resiob.spin[0].num, resiob.spin[0]._res_index_res_num, resiob.spin[0]._res_name, resiob.spin[0]._res_nummodel, resiob.spin[0].model num ] )
for p in sel_residues: print p
 
</source>
Now we want to cluster the residues.<br>
Since we have our selected list from above, it is faster to do:
<source lang="python">
for spin_nu, res_indresi, resn, resimodel, model spini in sel_residues:
relax_disp.cluster('NS2_cluster', ":%s@N"%resi)
 
cdp.clustering
</source>
Trusted, Bureaucrats
1,382

edits