User Tools

Site Tools


Writing /users/jbklauda/pub/wiki/data/cache/6/6193a558dc90ed4c190004bf67ecff70.captchaip failed
pairwise_2d-rdf_and_clustering

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pairwise_2d-rdf_and_clustering [2020/07/26 13:15] – editpairwise_2d-rdf_and_clustering [2022/10/23 21:33] (current) – [Pairwise 2D-RDF and Clustering Analysis] edit
Line 4: Line 4:
  
 Author: Yalun Yu (alanyu17@terpmail.umd.edu; yalun.research@gmail.com) Author: Yalun Yu (alanyu17@terpmail.umd.edu; yalun.research@gmail.com)
 +
 +Bug fix log:
 +
 +08/24/2020: An asymmetric membrane only bug found in clustering.py (line # 757); status: code fixed and updated, example not updated.
  
 {{ :cluster.tar.gz |}} {{ :cluster.tar.gz |}}
Line 13: Line 17:
 **Background** **Background**
  
-Different lipids have different sizes, so that we want to allow pair/lipid-specific Dcuts. You can compare this to LJ radius, where Rmin = Rmin(a)/2 + Rmin(b)/2 (we call this combination rule. Apparently, this is **atom-specific**). Or, if you are using a NBFIX (**pair-specific** interaction) for the LJ interactions between atom type a & b, Rmin=Rmin (NBFIX between a & b). The concept of NBFIX can be found at:+Different lipids have different sizes, so that we want to allow pair/lipid-specific Dcuts. You can compare this to LJ radius, where Rmin = Rmin(a)/2 + Rmin(b)/2 (we call this combination rule. Apparently, this is **atom-specific**). Or, if you are using a NBFIX (**pair-specific** interaction) for the LJ interaction between atom type a & b, Rmin=Rmin (NBFIX between a & b). The concept of NBFIX can be found at:
  
 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2853947/  https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2853947/ 
Line 23: Line 27:
 The DBSCAN algorithm used in the old clustering code uses the XY coordinates as inputs. However, DBSCAN also allows distance matrix as inputs, which means we can scale the elements in the real distance matrix as we want. For example, we have a matrix: The DBSCAN algorithm used in the old clustering code uses the XY coordinates as inputs. However, DBSCAN also allows distance matrix as inputs, which means we can scale the elements in the real distance matrix as we want. For example, we have a matrix:
  
-  [Particle] A           B          C     ...+  [Particle] A           B         C     ...
   A          0           1.5       1.5   A          0           1.5       1.5
   B          1.5         0         2   B          1.5         0         2
Line 42: Line 46:
 conda create -n cluster -c omnia python=3.6 openmm mdtraj numpy scikit-learn matplotlib conda create -n cluster -c omnia python=3.6 openmm mdtraj numpy scikit-learn matplotlib
  
-Using this command, we created a conda environment (env) called "cluster" and installed several packages into that environment. To use this env, type "source activate cluster" in the command line, and you should see your command line changing from **[login-1 ~]$ ...** to **(cluster) [login-1 ~]$ ...**+Using this command, we created a conda environment (env) called "cluster" and installed several packages into that environment. To use this env, type "conda activate cluster" in the command line, and you should see your command line changing from **[login-1 ~]$ ...** to **(cluster) [login-1 ~]$ ...**
  
  
Line 55: Line 59:
  
 Note this RDF code also allows self-RDF (just make the two atom selection words the same). Note this RDF code also allows self-RDF (just make the two atom selection words the same).
 +
 +
  
 (3) The clustering code (3) The clustering code
Line 98: Line 104:
 * use lower case for head group name but upper case for atom name. * use lower case for head group name but upper case for atom name.
  
-b. In **run_cluster.py**, the pair specific Dcut can be implemented by the **clfix** argument when creating a ClusterLip instance (see the code and you will know what I mean). The minimum number of lipids in a cluster can be modified using the **min_lipids** argument. Other changes should follow the instructions in the code. +b. In **run_cluster.py**, the pair specific Dcut can be implemented by the **clfix** argument when creating a ClusterLip instance (see the code and you will know what I mean). The minimum number of lipids in a cluster can be modified using the **min_lipids** argument. 
  
-Submit the clustering analysis by "sbatch run_cluster.sh"+c. Include ALL lipids in your system.  
 + 
 +d. Other changes should follow the instructions in the code.  
 + 
 + 
 + 
 +(4) The util.py 
 + 
 +a. Make corresponding edits in util.py (could copy from run_cluster.py) before submitting job 
 + 
 +b. Submit the clustering analysis by "sbatch run_cluster.sh"
  
 **Check the results:** **Check the results:**
Line 112: Line 128:
 * in topsize.png / botsize.png, you can find the distribution of the cluster size. * in topsize.png / botsize.png, you can find the distribution of the cluster size.
  
-c. If you want to visualize the clusters, please use the visualize.py file. Usually it takes about 10 seconds to generate two cluster pictures (upper&lower leaflets) for one frame, so that I won't use slurm. So, just type python visualize.py and wait for a while (remember to activate the conda env you created). However, if you want to create pictures for more than 10 frames, please consider using slurm. Again, the instructions are within the code.+(5) Visualization 
 + 
 +If you want to visualize the clusters, please use the visualize.py file.  
 + 
 +a. activate conda environment  
 + 
 +b. Make corresponding edits in visualize.py 
 + 
 +c. define colors for different headgroups at the beginning of clustering.py.  
 + 
 +<code> 
 +def color_(head): 
 +    # used for cluster visualization 
 +    if head == 'pe': 
 +        return 'yellow' 
 +    elif head == 'pc': 
 +        return 'yellow' 
 +    elif head == 'pg': 
 +        return 'yellow' 
 +    elif head == 'pi': 
 +        return 'yellow' 
 +    elif head == 'ps': 
 +        return 'yellow' 
 +    elif head == 'sito': 
 +        return 'b' 
 +    elif head == 'cer': 
 +        return 'r' 
 +</code> 
 + 
 +* Could also use //"else:"// command to minimize repetitive line entry for colors of lipids not of our interest 
 + 
 +d. You can define what's included in the cluster plot by editing the //top_res_info// and //bot_res_info// in visualize.py. (Note: the code structure is identical to that in //run_cluster.py//, but you do not have to include all lipids in the system and just the lipids of interest.) 
 + 
 +e. Usually it takes about 10 seconds to generate two cluster pictures (upper&lower leaflets) for one frame, so that I won't use slurm. So, just type python visualize.py and wait for a while (remember to activate the conda env you created). However, if you want to create pictures for more than 10 frames, please consider using slurm. Again, the instructions are within the code.
pairwise_2d-rdf_and_clustering.1595783754.txt.gz · Last modified: 2020/07/26 13:15 by edit