User Tools

Site Tools


Writing /users/jbklauda/pub/wiki/data/cache/6/6193a558dc90ed4c190004bf67ecff70.captchaip failed
2d_rdfs

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
2d_rdfs [2021/06/02 11:32] – admin2d_rdfs [2026/09/24 00:24] (current) – [1) Edit Necessary Files] edit
Line 1: Line 1:
-[[Analysis]]+{{:sample_rdf_plots.png?200|}}[[Analysis]]
  
-**Brief instructions to obtain 2D radial distribution function (RDF)**\\ +=====Brief instructions to obtain 2D radial distribution function (RDF)===== 
-Authors: Xiaohong Zhuang, Viviana Monje, Dr. Jeffery B. Klauda+Authors: Xiaohong Zhuang, Viviana Monje, Dr. Jeffery B. Klauda\\ 
 +Refactored by Eric Zhang (2026): handles any membrane system
  
-This is the brief instructions to calculate the radial distribution function (RDF), also known as a pair correlation function. +These are the brief instructions to calculate the radial distribution function (RDF), also known as a pair correlation function. New users should use the modern Python scripts. they have been backtested and validated against the legacy scripts, and run 95% faster. It's also easier to use. 
- +
-Downloaded Scripts: {{ :2d-rdf.tar.gz |}}+
  
 +Legacy Scripts: {{ :2d-rdf.tar.gz |}}\\
 **Note**: The example is made in DT2. It is provided for reference purpose.  **Note**: The example is made in DT2. It is provided for reference purpose. 
  
-The scripts are on DT2 path:  **/lustre/jbklauda/scripts/2d-rdf**\\+The legacy scripts are also on ZT1 path:  **/afs/shell.umd.edu/project/energybio/shared/jbklauda/scripts/2d-rdf**\\ 
 + 
 +Modern Python Scripts: {{ :2d-rdf-asym.tar.gz |}} (Recommended) 
 +=====Legacy Bilayer 2D RDF Workflow=====
  
 === Part I. === === Part I. ===
Line 112: Line 115:
 8. The final averaged RDF data are in rdf.dat file, Plot the data with RDF vs. radial distance r. 8. The final averaged RDF data are in rdf.dat file, Plot the data with RDF vs. radial distance r.
  
 +=====Modern Python 2D RDF Workflow=====
 +This workflow automates the entire process and runs much faster. If any steps aren't clear, reach out to ezhang32@umd.edu.
 +
 +====1) Edit Necessary Files====
 +a) Open ''config.py'' and read the comments I left throughout. Then, adjust the fields to work for your membrane system. I would not recommend you change num_blocks (which is set at 1 by default) because it is already highly optimized and can process 20 dcds in under a minute. There's no point in trying to parallelize the workflow further. Also, custom_grouping_dict should only be modified if you have non segid MEMB lipids (check psf). 
 +<code>
 +# Example config_dict: a complex sphingolipid membrane with some of my own custom patched NAAA lipids
 +config_dict = {
 +    'MEMB':['AIPE','AMPG','DPPC','CER160','CER221','LSM','BSM'],
 +    'NAAA':['LLL',],
 +}
 +
 +# corresponding custom_grouping_dict which handles non-memb lipids like LLL, where LLL is grouped under an arbitrary label called OL
 +custom_grouping_dict = {
 +    'OL':['LLL'],
 +}
 +
 +# Example of a simple POPE/POPG membrane which have segid MEMB because they are native lipids
 +config_dict = {
 +    'MEMB':['POPE','POPG',],
 +}
 +
 +# corresponding custom_grouping_dict which is empty since you only have normal memb lipids
 +custom_grouping_dict = {
 +}
 +</code>
 +
 +====2) Run Scripts====
 +a) Run ''./0_setup.py''. If you set recenter_dir = None in config.py, you should see a recenter dir/scripts get generated. Everyone should see rdf.csh and system_info.txt be generated. If there are errors, simply fix config.py and rerun (I added error handling, so you should see some error messages in the terminal for common mistakes).
  
 +b) Run ''./1_rdf.scr''. The first time you run it, it will take a minute to set up the Python virtual environment and install MDAnalysis. Then, it will execute the RDF Slurm job. The entire run should take less than a minute, or longer for really big systems.
  
 +c) Once the slurm job finishes, run ''./2_analysis.py'' and ''./3_plot_rdf.py''. You should now see .dat files and a combined figure stored inside the results directory. Feel free to adjust the plot settings if you're familiar with matplotlib, or take the .dat files into Excel or any other software and plot them differently. It also averages the top and bottom leaflets and plots the averages automatically if you specified symmetric = True in config.py.
2d_rdfs.1622647934.txt.gz · Last modified: 2021/06/02 11:32 by admin