Posts

Showing posts from April, 2012

2D Contour plot in Matlab

Image
2D CONTOUR PLOT IN MATLAB %This .m file will generate 2D contour plot clear all; close all; L1 = load('dataset1.dat'); % [Let say the data set has 220 X co-ordinate data, and 6 Y co-ordinate data, and for these X and Y coordinate combinations Z coordinate values are there. Now, one has to form a matrix to get contour plot which will be generated in the following way] N1=6;      N2=220; k = 1; for i = 1 : 1 : N1   for j = 1 : 1: N2      k = (i - 1) * N2 + j;     X1(j,i)  = L1(k, 1);     Y1(j,i)  = L1(k, 2);     Z1(j,i)  = L1(k, 3);   end  end  contourf(X1, Y1, Z1); lighting gouraud xlim([0.0 0.6]) ylim([0.04 0.09]) set(gca, 'xtick', 0.0:0.1:0.6,'Fontsize', 15) set(gca, 'ytick', 0.04:0.01:0.09,'Fontsize', 15) xlabel('xlabel text','Fontsize', 20); ylabel('ylabel text','FontSize', 20);

Inset Plot in GRACE (Xmgrace)

Image
Grace is an opensource data-analysis/plotting software. Grace runs on practically any version of Unix-like OS. As well, it has been successfully ported to Win9*/NT/2000/XP (some minor functionality may be missing, though). The inset plot can be generated by following way: Give command in terminal: xmgrace dataset1.dat , (or import data by Data -> Import -> ASCII in other platforms) will create the plot of dataset1.dat in the main window (call it Graph1). Now for creating inset of another dataset let say dataset2.dat in the same graph please follow the following steps. Data -> Import -> ASCII to open the " Grace:Read Sets " dialogue box.  Graph 1 created in step 1 , is labelled G0 . In the " Read to Graph " section the " (+) G0 " graph is selected by default.  Right-click on the " (+) G0 " to open the pop-up menu (see the image).  Select " Create new ". It will create ' (+) G1 ' empty graph. 

Alphabets of GROMACS

Few basic commands: After successful installation you are ready to go with GROMACS. A basic tutorial for simulating Lysozyme in water can be found here . Here, I will compile few necessary commands in one page. Execute .pdb file to generate initial .gro file pdb2gmx -f initial.pdb -o processed.gro If you do not have topology file of your molecule, you can generate one by using g_x2top -f file.gro -o topol.top -ff select -name ABC -noparam -pbc   In the above command line 'ABC ' is your molecule NAME, e.g. if you are simulating carbon nanotube and you are calling carbon nanotube as CNT, then ABC = CNT Define your simulation box using editconf: editconf -f processed.gro -o newbox.gro -c -d 1.0 -bt cubic Solvation of defined box genbox -cp newbox.gro -cs spc216.gro -o newbox_solv.gro -p topol.top Include ions if necessary: grompp -f ions.mdp -c newbox_solv.gro -p topol.top -o ions.tpr genion -s ions.tpr -o newbox_solv_ions.gro -p topol.top -pname NA -