User Tools

Site Tools


surface_area_of_lipid

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
surface_area_of_lipid [2019/03/14 23:56] – [Compressibility Modulus] editsurface_area_of_lipid [2023/02/05 10:39] (current) admin
Line 3: Line 3:
 ==== Overall Average SA/Lipid ==== ==== Overall Average SA/Lipid ====
  
-(author: Xiaohong Zhuang)+(authors: Xiaohong Zhuang & Jeffery Klauda)
  
-If you are looking for multi lipid system, go to bottom.+=== Introduction ===
  
-** Note: ** The gnuplot assumes you have standard truetype fonts If you are doing analysis on DT2.  Add the following to your .cshrc.mine file:+This simple analysis is used to estimate the overall average surface area (SA) per lipid. If you are analyzing a single component membrane then this is equivalent to the component's SA/lipidOtherwise, this is the average of all lipids.
  
-<code> # modify the environment by add it to the font search path +Those at UMD should use the ZT1 path: **/afs/shell.umd.edu/project/energybio/shared/jbklauda/scripts/area_1_lipid**
-setenv GDFONTPATH /local/X11/fonts/TrueType </code>+
  
 +Outside of UMD a sample script is given in the gzip file: {{ :area_1_lipid.gz |}}
  
-1. The brief instruction to obtain and plot SA/lipid of __**single lipid system**__\\+Example of analysis result in an Excel File: {{ :e.g._sa_1_lipid.xlsx |}}
  
-Example of analysis: {{ :e.g._sa_1_lipid.xlsx |}}+=== Instructions ===
  
-This scripts that you need to calculate single lipid surface area per lipid using the gzip file: {{ :area_1_lipid.gz |}}+1. Copy the folder //area_1_lipid// from the path highlighted above to your directory has contains all dyn files. //area_1_lipid// should become a subdirectory of your folder with the dyn*.dcd files.
  
-DT2 path: +1.1 **Update area2.scr**:  Change the 100 in line 23 (''area=($2*$2)/100'') to your system value for the # lipid per leaflet
-**/lustre/ewang125/scripts/area_1_lipid**+
  
-1Copy the folder //area_1_lipid// from the path highlighted above to your directory has contains all dyn files+2The next set of instructions assume that you are running commands from the command line in the //area_1_lipid// folder.
  
-**1.1 Update the 100 (or 36 if using the *.gz file not DT2 filesin area2.scr (line 23) to # lipid per leaflet**+2.1. '' 1_run_area.scr '': This script is used to calculate the surface area per lipid starting from beginning (all dyns). The key steps of 1_run_area.scr file are shown below:
  
-2Go to the //area_1_lipid// folder and run the following scripts in PuTTY command line.+<code> # Run area2.scr to obtain the area starting from beginning in time step 
 +./area2.scr
  
-2.1. It is used to calculate the surface area per lipid starting from beginning (all dyns).Run the script by command:  '' 1_run_area.scr '+# Convert times steps to ns (assume 2fs/time which is always the case), and calculate the accumutive average of area 
 +awk '{time=($1)*0.000001} {printf "%i\t%2.3lf\t%.2lf\t%.2lf\n",$1,time,$2,(p+=$2)/NR}area_all_ns.dat > area_time_acc.dat
  
-in order to find the dyn that the system reaches equilibriumThe key steps of 1_run_area.scr file is shown below:+# Generate the data file for plotting in excel 
 +sed -n '1~50p' area_time_acc.dat > area_time_acc_excel.dat 
 +</code>
  
-# To make files executable +  * area2.scr is used to obtain the areas from the the first dyn file (likely dyn1.xst) to the end 
-''chmod u+x area2.scr'',  +  * The ''awk'' line creates of time series of the area assuming time is in fs 
-''chmod u+x area-block.exe''+  * the ''sed'' line reduces the printing of data (every 50 lines) in a reduced file...this may not be needed if the printout is not frequent.
  
-# Run ''area2.scr'' to obtain the area starting from beginning in time step +You will need to run the scr file with type the following on the command line: ''./1_run_area.scr''
- +
-''area2.scr'' +
- +
-# Convert times steps to ns (Assume 2fs/step, xstFreq 1000, these can be found in your //dyn-2.inp// file (Please refer to the note in the end for more details about this)), and calculate the cumulative (running) average of surface area/lipid, which is the average of all the existing area data +
-<code> awk 'BEGIN{l=0}; {if($1!=";")print l*0.002,$2,(p+=$2)/NR;l=l+1}area_all_ns.dat > area_time_acc.dat </code> +
- +
-# Generate the data file with reduced the number of the data points (1/50 of original) for plotting in excel. +
- +
-# The purpose of the reduction of data points is to avoid Excel clash to loading larger data points. +
-<code> sed -n '1~50parea_time_acc.dat > area_time_acc_excel.dat </code>+
  
 After run **1_run_area.scr**, the files //area_time_acc.dat// and //area_time_acc_excel.dat// will be generated. For //area_time_acc.dat//, the first column is time in nanosecond (ns), the 2nd column is the surface area per lipid at each time (step), and the 3rd column is the cumulative average of surface area per lipid. After run **1_run_area.scr**, the files //area_time_acc.dat// and //area_time_acc_excel.dat// will be generated. For //area_time_acc.dat//, the first column is time in nanosecond (ns), the 2nd column is the surface area per lipid at each time (step), and the 3rd column is the cumulative average of surface area per lipid.
  
 +2.2. Generate the plot of area vs. time in order to estimate the time the system reaches equilibrium with respect to the SA/lipid.
  
-2.2. Generate the plot of area vs. time in order to find the dyn that the system reaches equilibrium +2.2.1. Using GnuPlot on LINUX:  ''./2_plot_sa.scr'' command is to use Gnuplot to generate plot //2_sa.tif//. An example of the plot is shown below.
- +
-2.2.1. If you are using WinSCP, you may run the script by command:  ''2_plot_sa.scr'' to use Gnuplot to generate plot //2_sa.tif//. And then you can open and view the image in WinSCP by right-click on the file. Plot using Gnuplot I personally think is convenient in the linux system but it is optional. An example of the plot is shown below.+
    
 {{:fig1exsaplip.png?200|}} {{:fig1exsaplip.png?200|}}
 Figure 1. Example surface area per lipid plot Figure 1. Example surface area per lipid plot
  
-2.2.2. If you don’t use WinSCP,or if you are not comfortable with Gnuplot, you can also use Excel to plot //area_time_acc_excel.dat// in Excel. The example of the plot in Excel is attached.+It is recommended to adjust the GnuPlot script to adjust the axis scale to best represent your dataUsing nano or vim as an editor of //2_sa.gnu//
  
-Based on the area plot, we can determine when (at which dyn) the system reaches equilibrium. +<code> 
-The equilibrium dyn number is the dyn file number that your cumulative (or running) average surface area per lipid (sa/lip) (red data points in Fig.1) becomes constant for around 20-30ns (i.e 10-15 dynrefer to note)Since the running average including the beginning high values,we will also determine equilibrium based on the area per lipid (blue data points in Fig.1) that fluctuate around the same center line).+# show margin 
 +plot [0:100] [35:50] \ 
 +'area_time_acc.dat' using 2:3 with point  pt 2 ps 2 lw 4 lc rgb 'blue' title '{/DejaVuSerif-Bold=45 Area/Lip.}'
 +'area_time_acc.dat' using 2:4 with point  pt 6 ps 3 lw 4 lc rgb 'red'  title '{/DejaVuSerif-Bold=45 CmAvg.}' 
 +</code>
  
-e.g. For in Fig.1, the cumulative average area (redindicate that system reach equlibrium at around 30ns, and the areas (blue) fluctuate around the same center line, so we use the data from 50-100ns (dyn 26-50) or 60-100ns(dyn 31-50)  to calculate the average area/lip.+The ranges after the //plot// command can be adjusted for the time (in ns) and SA. The other lines can be adjusted to format personally desired.
  
 +2.2.2. You can also use Excel to plot //area_time_acc_excel.dat// in Excel. The example of the plot in Excel is attached.
  
-3.  Based on equilibrated dyn range on step 2, select the data points from equilibrated dyn to the end to calculate the block-average surface areas +2.3. Estimating time for equilibration.
-3.1 In 3_cal_avg_std.scr, please update the numbers of data points to remove (30000= ( # of unequilibrated dyn) * (data points per dyn) based on your equilibrated dyn and data points range in line +
- <code> sed '1,30000 d' area_time_acc.dat | awk '{print $1,$2}'> area.dat </code>+
  
-If we want to use dyn from 31 to the endthen remove the area data of first 30 dynsIf you run 1000000 time steps per dyn and xstFreq is 1000, (which are the usual setup for lipid simulation), then each dyn has 1000 data points. So the data points to remove =   (# of not equlibrated dyn * 1000in the example caseit is 30*1000=30000.+Based on the area plotyou can determine when (at which dyn) the system reaches equilibrium. 
 +The equilibrium dyn number is the dyn file number that your cumulative (or running) average surface area per lipid (sa/lip(red data points in Fig.1) becomes constant (i.e 10-15 dyn, refer to note). Since the running average including the beginning high valueswe will also determine equilibrium based on the area per lipid (blue data points in Fig.1) that fluctuate around the same center line).
  
 +For in Fig.1, the cumulative average area (red) indicate that system reach equlibrium at around 30ns, and the areas (blue) fluctuate around the same center line, so we use the data from 50-100ns (dyn 26-50) or 60-100ns(dyn 31-50) to calculate the average area/lip. You will need to do the same for your system.
  
-# This following command calculates the block average, the output file name (//area_avg_std.dat//) and the block size (1000) in time steps i.e. each dyn is treat as a block+3Obtaining Statistics of SA/Lipid 
  
-3.Calculate the block-average surface areas by command: ''3_cal_avg_std.scr''+Based on equilibrated dyn range determined in Step 2.3, select the data points from equilibrated dyn to the end to calculate the block-average surface areas. 
  
-# Store the output file name (//area_avg_std.dat//) and the block size (1000) in time steps into a file //area-block.inp//, which is the input data file for //area-block.exe// +3.1 ''3_cal_avg_std.scr''
-<code> echo area_avg_std.dat 1000 > area-block.inp                       +
-area-block.exe < area-block.inp </code> +
-Note: For  //#define MAX_R 100000//  in area-block.c, you might have to change the number to a larger one (larger than your # data points) and recompile it.+
  
-As you can see, the output average area data are saved in area_avg_std.dat. The result is given in average+- population standard deviation+Update the total number of last dyn*.dcd files to calculated the averages
  
-4. Calculate averages, sample standard deviation, and standard error of block averages by command: ''4_run_calc_stderr.scr'' + <code> set Ndyn = 20 </code>
-The file //avg_stderr.dat// will be generated that will show the final values that we need, which are the average of the block averages and the standard error of the block averages, i.e. SA_avg/lip +- Standard error. You may refer to the attached Excel file which also demonstrate how the standard error is calculated if you are interested.+
  
 +The example states that you want to do the averages from the last 20 dyn*dcd files. Let's say you have 50 dyn*.dcd files, then the first 30 files are ignored. If each file had 2ns of data, then you are calculating the average from 60-100ns.
  
-Note: +3.2 Calculate the block-average surface areas by command''./3_calc_avg_std.scr''
-The corresponding nanosecond are based on the "number steps" and "timestep" that we set  +
-For example, in the //dyn-2.inp// file, we see  there a code line "numsteps            1000000           ; +
-# run stops when this step is reached"       +
-    +
-and another code line:  <code> timestep            2.0  ;# fs/step </code> +
-So you multiple 2fs/step  with 1,000,000  steps per dyn file,  which makes is 2ns per dyn file(since 1fs=10^(-15) s, 1ns==10^(-9) s )+
  
-==== Get the equilibrium data (test====+**Note: **For  //#define MAX_R 1000000//  in area-block.c, you might have to change the number to a larger one (larger than your # data pointsand recompile it.
  
-(author: Yalun Yu,  email:alanyu17@terpmail.umd.edu / yalun.research@gmail.com) +As you can see, the output average area data are saved in //area_avg_std.dat//The result is given in average+- population standard deviation
-  +
-< Email me if anything is wrong > +
- +
-This is a brief instruction to obtain the time range of equilibrium (and also the minimum block size can be used for standard error calculation). Based on these, calculation of SA/lipid and Ka is done automatically for your lipid only system. Run Xiao's //1_run_area.scr// before doing this. Please put the scripts in the same folder as you run //1_run_area.scr//. You will need pymbar package (in python) for this: +
- +
-1. Install Anaconda (https://www.anaconda.com/distribution/). +
-   a) Download the python3.7 version for Linux [I used the '64-Bit (x86) Installer (652.5 MB)']  +
-   and put the .sh installer in your home directory (or any other place you can access and execute it) on DT2. +
-   b) make the .sh file an executable (chmod u+x $NameOfInstaller.sh) +
-   c) Install by running "./$NameOfInstaller.sh", keep in mind where you have installed it. +
- +
-2. Make sure the Anaconda installation path is included (see below) in your ~/.cshrc.mine (if using csh) or ~/.bashrc.mine (if using bash) and source the .mine file. +
-    +
-   In ~/.cshrc.mineadd this line: +
-   set path = ($HOME/anaconda3/bin $path) +
-   or in ~/.bashrc.mine, add this line: +
-   export PATH="$HOME/anaconda3/bin:$PATH" (may differ depending on where Anaconda is installed, see 1(c)] +
-    +
- +
-3. Install the pymbar package. +
-   conda install -c omnia pymbar +
- +
-Download the script: {{ :KA.tar.gz |}} +
- +
-Change the temperature and number of lipids per leaflet in //pymbar_area_ka.scr//: +
-   set temp=323.15 +
-   set nlip=36 +
- +
-Change the initial guess (or your preference) for block size (in ns) and the steps size (in ns) of your output (usually 1ps): +
-  area_handling.py 10 0.001 >& all.dat +
- +
-After running //pymbar_area_ka.scr//, you'll see //all.dat//, SA/lipid is in angstrom^2 and Ka is in N/m.+
  
 +3.3 Standard Errors from Block Average
  
 +Calculate averages, sample standard deviation, and standard error of block averages by command: ''./4_run_calc_sterr.scr''
 +The file //avg_stderr.dat// will be generated that will show the final values that we need, which are the average of the block averages and the standard error of the block averages, i.e. SA_avg/lip +- Standard error. You may refer to the attached Excel file which also demonstrate how the standard error is calculated if you are interested.
  
  
surface_area_of_lipid.1552622219.txt.gz · Last modified: 2019/03/14 23:56 by edit