Posts

Showing posts from June, 2021

Python script to plot 2D FEL

Image
 The basic instructions remain same as  FEL 3D plots .  These plots are published in  Interplay among Structural Stability, Plasticity, and Energetics Determined by Conformational Attuning of Flexible Loops in PD-1 Fel2d.py ## FEL using plot_surface import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import random from matplotlib import cm from scipy.interpolate import griddata from scipy.interpolate import Rbf from numpy import linspace #from matplotlib.ticker import LinearLocator, FormatStrFormatter import matplotlib from scipy import interpolate import matplotlib.mlab as ml fig = plt.figure(figsize=None, dpi=300, facecolor=None, edgecolor=None, linewidth=0.0, frameon=None, subplotpars=None, tight_layout=None) ax = fig.add_subplot(111) ### input file with x,y,z coordinates x,y,z = np.loadtxt('5wt9gibbs.txt').T  X,Y = np.unique(x),np.unique(y) xi = linspace(min(X),max(X),len(X)) yi = linspace(min(Y),max(Y),len(Y)) xi,yi = ...

PCA and FEL through gromacs

  Principal component analysis and Free energy landscapes of protein systems in gromacs. >gmx covar -f md_t14cnopbc.xtc -s md_t14c.tpr -o eigenval.xvg -v eigenvect.trr -xpm covara.xpm [least squares fit:c-alpha; covariance: c alpha] >gmx xpm2ps -f covara.xpm -o covara.eps -do covar.m2p >gmx anaeig -v eigenvect.trr -f md_t14cnopbc.xtc -s md_t14c.tpr -first 1 -last 2 -proj proj_eig.xvg -2d 2d_proj.xvg >gmx sham -f 2d_proj.xvg -ls gibbs.xpm -notime #for free energy, "sham" module uses PC1 and PC2 file gmx xpm2ps -f gibbs.xpm  -o gibbs.eps -rainbow red python xpm2txt.py -f gibbs.xpm -o gibbs.txt  #xpm2txt.py is mentioned here. Just copy and paste this script. Run in command line as mentioned above #!/usr/bin/env python import sys """ Utility tool to convert xpm files generated by GROMACS to a 3-column text file. """ USAGE = "USAGE: xpm2txt.py -f <input xpm file> -o <output txt file> [-s]\n" USAGE+= "Options:\n...

Python script to plot 3D FEL plots

Image
  # To plot FEL in 3D use this python script and run as python2.7 fel3d.py. Here the file uses gibbs.txt. therefore before running the script make sure u have the gibbs.txt in the same folder of this script or else provide the location of the script.  I have attached some images from my research article using the same script for 3D FEL plot These plots are published in  Interplay among Structural Stability, Plasticity, and Energetics Determined by Conformational Attuning of Flexible Loops in PD-1 The 2D FEL scripts are also mentioned in the next blog:  Python script to plot 2D FEL Another point to consider is: when u r plotting FEL plots for multiple systems, make sure your color bar/gradient should be same in all the plots. So u can  change the values in vmax,  ax.set_zlim(0, 18),  ticks=range(0, 21, 2)) in the script below.  Like in my case the highest value was 18 in gibbs free energy (the z axis) in all the axis. therefore i mentioned 18 there...

From AMBER topology to gromacs topology

ParmEd supports reading and writing to a broad variety of file types, including Amber topology and coordinate files, CHARMM PSF, parameter, topology, and coordinate files, and Tinker parameter, topology, and coordinate files. (Ref: https://github.com/ParmEd/ParmEd) installing ParmED 1. download from https://github.com/ParmEd/ParmEd.git  or type this command in the terminal: wget https://github.com/ParmEd/ParmEd/archive/refs/heads/master.zip 2. cd parmedED-master 3. python2.7 setup.py install 4. python setup.py install --prefix=$AMBERHOME 5. source $AMBERHOME/amber.sh python2.7 >>>import parmed as pmd >>> amber=pmd.load_file('pro_solv.prmtop', 'pro_solv.inpcrd') >>> amber.save('prosolv.top') >>> amber.save('prosolv.gro') vmd >>> save .trr trajectory file  OR  trajout .xtc file in cpptraj It can also convert various files to other formats such as: 1. convert GROMACS topology to AMBER format 2. convert AMBER to...