[Chimera-users] clustering models of a single pdb

Elaine Meng meng at cgl.ucsf.edu
Tue Sep 29 09:50:59 PDT 2020


Hi Subhrangshu,
When I use Ensemble Cluster on PDB 1plx (60 models #0.1,#0.2 ... #0.60) and choose all rows and click the Save button, I get a text file with the following lines, which includes all of the clusters and all of the models in each cluster:

# one cluster per line; first model on each line is representative
#0.11 #0.1 #0.22 #0.28 #0.26 #0.14 #0.30 #0.6 #0.23 #0.8 #0.19 #0.5 #0.3 #0.25 #0.4 #0.27 #0.29 #0.10 #0.21 #0.7 #0.12 #0.13 #0.24 #0.15 #0.17 #0.20 #0.31 #0.32 #0.34 #0.36 #0.39 #0.40 #0.41 #0.42 #0.43 #0.44 #0.46 #0.47 #0.48 #0.49 #0.50 #0.51 #0.52 #0.53 #0.54 #0.55
#0.59 #0.2 #0.57 #0.58 #0.61 #0.62 #0.63 #0.67 #0.68 #0.71 #0.72 #0.73 #0.75 #0.76 #0.79 #0.80
#0.66 #0.64 #0.69 #0.74 #0.77 #0.78
#0.37 #0.9 #0.33 #0.35 #0.45
#0.38 #0.16 #0.18
#0.56 #0.60
#0.65
#0.70

I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.                       
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco


> On Sep 29, 2020, at 12:05 AM, Subhrangshu Das <subhrangshu73das at gmail.com> wrote:
> 
> Thank you Eric sir. It was very helpful. But what i finally need, is all the members of the largest cluster. No while using Ensemble Cluster instead of MD Movie, the saved output is only showing representative structure from each cluster. Although in "Model Panel" (on click), the members of any cluster is there, yet panel is not being saved into a text file.
> 
> On Mon, Sep 28, 2020 at 11:09 PM Eric Pettersen <pett at cgl.ucsf.edu> wrote:
> Hi Subhrangshu,
> 	You would need to be pretty good with Python to do this.  First, you would want to look at this: Very Basic Chimera Programming Primer to get an idea of how to write a script for Chimera to process many data files.
> 	Second, scripting the MD Movie dialog is almost impossible, so I think you want to use the Ensemble Cluster dialog instead.  Your workflow would basically be:
> 
> 1) Open 100 pdb files.
> 2) Delete the parts you don't want in the clustering calculation (e.g hydrogens)
> 3) Bring up a Ensemble Cluster dialog for your files.
> 4) Save the clustering
> 5) Close your files and the dialog and repeat as necessary
> 
> Tips on the above:
> 
> #2: There aren't commands that exactly match what the Movie dialog does.  "del solvent" and "del H" will delete solvent and hydrogens.  "del ions" will delete all ions, so if there are particular metals you would want to preserver, for instance magnesium, you would have to modify that to "del ions & ~ Mg".
> 
> #3: You are going to need to bring up the dialog using Python code, because you will need a Python reference to the dialog.  The code for that is:
> 
> from EnsembleMatch import EnsembleCluster
> d = EnsembleCluster(chimera.openModels.list(), "")
> 
> #4: In order to save the clustering, you are going to have to replicate the code for _SaveClusteringInfo.Apply (which uses the dialog instance) found in EnsembleMatch/base.py, which is in <your Chimera installation>/share (or Chimera.app/Contents/Resources/share on a Mac).
> 
> #5: Close the dialog with d.Quit()
> 
> --Eric
> 
> 	Eric Pettersen
> 	UCSF Computer Graphics Lab
> 
>> On Sep 25, 2020, at 12:40 PM, Subhrangshu Das <subhrangshu73das at gmail.com> wrote:
>> 
>> Dear sir,
>> 
>> I have 100 pdb files. named as output.1.pdb to output.100.pdb
>> what i do manually for clustering is as follows
>> 
>> 1. select 100 pdbs ->  open in chimera -> golto File -> save PDB.. -> Save Multiple Models as PDB File (renamed as all.pdb)
>> 2. open chimera -> goto Tools -> MD/Ensemble Analysis -> MD Movie
>> 3. in Get Ensemble Info dialogue box set -> Trajectory format : PDB 
>>                                                                       PDB frames contained in: single file
>>                                                                       Browse to select File <all.pdb> 
>>                                                                       Use frames first through last
>> 
>> 4. on click OK, a dialogue box pops out, MD Movie: PDB trajectory from all.pdb, in which, goto Analysis -> Cluster...
>> 
>> 5.. on click Cluster, a dialogue box pops out, Get Clustering Parameters, in which I set  Cluster trajectory as:
>> Starting frame:  1
>> step size:  1
>> Ending frame: 100
>> Cluster based on current selection, if any: true
>> Ignore solvent and non metal ions: true
>> Ignore hydrogens: true
>> Ignore metal ions:  alkali
>> 
>> 6. on click OK, after some RMSD calculation, i get the Clustering result, which I save to a text file <cluster> 
>> 
>> Now, as I need to do this for multiple times, I want to automate these steps by a python script. Can you please help with a scipt or some command help for the aforesaid tasks. Any help will be helpful in these regard.
>> 








More information about the Chimera-users mailing list