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.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| pairwise_2d-rdf_and_clustering [2020/07/26 12:32] – [Pairwise 2D-RDF and Clustering Analysis] edit | pairwise_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; | Author: Yalun Yu (alanyu17@terpmail.umd.edu; | ||
| + | |||
| + | 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. | ||
| + | |||
| + | {{ : | ||
| + | {{ : | ||
| This new code allows pair-specific " | This new code allows pair-specific " | ||
| Line 10: | Line 17: | ||
| **Background** | **Background** | ||
| - | Different lipids have different sizes, so that we want to allow pair/ | + | Different lipids have different sizes, so that we want to allow pair/ |
| https:// | https:// | ||
| Line 20: | 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 | + | [Particle] A |
| A 0 | A 0 | ||
| B 1.5 | B 1.5 | ||
| Line 32: | Line 39: | ||
| numpy, mdtraj, scikit-learn, | numpy, mdtraj, scikit-learn, | ||
| + | |||
| + | I recommend using **bash** instead of csh to avoid glitches when using conda! On DT2, you can change to bash by just typing " | ||
| A quick one step command could be (after installing conda): | A quick one step command could be (after installing conda): | ||
| Line 37: | 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 command, we created a conda environment (env) called " | + | Using this command, we created a conda environment (env) called " |
| + | |||
| (2) The RDF code | (2) The RDF code | ||
| - | Two versions of the RDF code are in the " | + | Two versions of the RDF code are in the " |
| To run the rdf analysis between any two selections, update the corresponding parts in the run_rdf.py file and submit the job by " | To run the rdf analysis between any two selections, update the corresponding parts in the run_rdf.py file and submit the job by " | ||
| Line 48: | 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 91: | 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**, | + | b. In **run_cluster.py**, |
| - | Submit the clustering analysis by " | + | 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 " | ||
| **Check the results:** | **Check the results:** | ||
| Line 105: | Line 128: | ||
| * in topsize.png / botsize.png, | * in topsize.png / botsize.png, | ||
| - | c. If you want to have visualization of the code, please use the visualize.py file. Usually it takes about 10 seconds to generate cluster pictures | + | (5) Visualization |
| + | |||
| + | If you want to visualize | ||
| + | |||
| + | a. activate conda environment | ||
| + | |||
| + | b. Make corresponding edits in visualize.py | ||
| + | |||
| + | c. define colors | ||
| + | |||
| + | < | ||
| + | def color_(head): | ||
| + | # used for cluster visualization | ||
| + | | ||
| + | return ' | ||
| + | elif head == ' | ||
| + | return ' | ||
| + | elif head == ' | ||
| + | return ' | ||
| + | elif head == ' | ||
| + | return ' | ||
| + | elif head == ' | ||
| + | return ' | ||
| + | elif head == ' | ||
| + | return ' | ||
| + | elif head == ' | ||
| + | return ' | ||
| + | </ | ||
| + | |||
| + | * Could also use //" | ||
| + | |||
| + | d. You can define what's included in the cluster plot by editing the // | ||
| + | e. Usually it takes about 10 seconds to generate two cluster pictures (upper& | ||
pairwise_2d-rdf_and_clustering.1595781153.txt.gz · Last modified: 2020/07/26 12:32 by edit