Skip to content

Instantly share code, notes, and snippets.

@JonasR
Created Aug 31, 2012
Embed
What would you like to do?
Create all the base data for the MD runs
#!/usr/bin/perl
use strict;
my $file=shift;
my $refFile;
my $outName=shift;
my $fileName=$file . "_md";
$refFile= $file . "_solv.pdb";
$file= $file . "_md.xtc";
`trjconv -f $file -s $refFile -pbc nojump -o traj_nojump.xtc <<EOF\n0\nEOF`;
`trjconv -f traj_nojump.xtc -s $refFile -center -o traj_center.xtc <<EOF\n1\n0\nEOF`;
`trjconv -f traj_center.xtc -s $refFile -fit rot+trans -o traj_norot.xtc <<EOF\n1\n0\nEOF`;
`trjconv -f traj_norot.xtc -s $refFile -o $outName.pdb <<EOF\n1\nEOF`;
`g_filter -f traj.pdb -s $refFile -ol filtered.pdb -fit -nf 5 <<EOF\n1\nEOF`;
`echo 1 1| g_rms -f traj_nojump.xtc -s $fileName.tpr -o $outName.rmsd-allProt-atom-vs-start.xvg`;
`echo 3 3| g_rms -f traj_nojump.xtc -s $fileName.tpr -o $outName.rmsd-ca-vs-start.xvg`;
`echo 1 0 | g_sas -f traj_nojump.xtc -s $fileName.tpr -o $outName.SAS.xvg -oa $outName.atomSAS.xvg -or $outName.resSAS.xvg`;
`echo 1 1 | g_hbond -f traj_nojump.xtc -s $fileName.tpr -num $outName.hBondsP2P.xvg`;
`echo 1 12 | g_hbond -f traj_nojump.xtc -s $fileName.tpr -num $outName.hBondsP2W.xvg`;
`g_rama -f traj_nojump.xtc -s $fileName.tpr -o $outName.ramaPlot.xvg`;
# RMSD protein protein
`echo 1 1 | g_rms -s $fileName.tpr -f traj_nojump.xtc -f2 traj_nojump.xtc -m rmsd-matrix.xpm`;
`xpm2ps -f rmsd-matrix.xpm -o $outName.PP.rmsd-matrix.eps -rainbow blue`;
`echo 1 1 | g_cluster -s $fileName.tpr -f traj_norot.xtc -dm rmsd-matrix.xpm -dist $outName.PP.rmsd-dist.xvg -o $outName.PP.clusters.xpm -sz $outName.PP.cluster-sizes.xvg -tr $outName.PP.cluster-transitions.xpm -ntr $outName.PP.cluster-transitions.xvg -clid $outName.PP.cluster-id-over-time.xvg -cl $outName.PP.clusters.pdb -cutoff 0.1 -method gromos`;
# RMSD mainchain+MCB twice
`echo 6 6 | g_rms -s $fileName.tpr -f traj_nojump.xtc -f2 traj_nojump.xtc -m rmsd-matrix.xpm`;
`xpm2ps -f rmsd-matrix.xpm -o $outName.MCB.rmsd-matrix.eps -rainbow blue`;
`echo 6 6 | g_cluster -s $fileName.tpr -f traj_norot.xtc -dm rmsd-matrix.xpm -dist $outName.MCB.rmsd-dist.xvg -o $outName.MCB.clusters.xpm -sz $outName.MCB.cluster-sizes.xvg -tr $outName.MCB.cluster-transitions.xpm -ntr $outName.MCB.cluster-transitions.xvg -clid $outName.MCB.cluster-id-over-time.xvg -cl $outName.MCB.clusters.pdb -cutoff 0.1 -method gromos`;
`echo 13 0 | g_energy -f $fileName.edr -o $outName.pressure.xvg`;
system("echo -e '9 0' | g_energy -f $fileName.edr -o $outName.potential.xvg");
`echo 12 0 | g_energy -f $fileName.edr -o $outName.temperature.xvg`;
`echo 11 0 | g_energy -f $fileName.edr -o $outName.totalEnergy.xvg`;
`echo 1 0 | q_mindist -f $fileName.xtc -s $fileName.tpr -od $outName.minPeriodicDist.xvg -pi`;
`echo 3 0 | q_mindist -f $fileName.xtc -s $fileName.tpr -od $outName.minPeriodicDistOnlyCA.xvg`;
`echo 1 0 | g_rmsf -f $fileName.xtc -s $fileName.tpr -ox $outName.prot.avg.pdb -oq $outName.prot.bFactor.pdb -o $outName.prot.rmsf.xvg -res`;
`echo 3 0 | g_rmsf -f $fileName.xtc -s $fileName.tpr -ox $outName.ca.avg.pdb -oq $outName.ca.bFactor.pdb -o $outName.ca.rmsf.xvg -res`;
`echo 1 0 |g_gyrate -f $fileName.xtc -s $fileName.tpr -o $outName.prot.gyration.xvg`;
`echo 3 0 |g_gyrate -f $fileName.xtc -s $fileName.tpr -o $outName.ca.gyration.xvg`;
`echo 1 | trjconv -f traj_nojump.xtc -s $fileName.tpr -o protein.xtc`;
`echo 1 1 | g_rms -f protein.xtc -s $outName.prot.avg.pdb -o $outName.rmsd-all-atom-vs-average.xvg`;
`echo 3 3 |g_rms -f protein.xtc -s $outName.ca.avg.pdb -o $outName.rmsd-ca-vs-average.xvg`;
`rm traj_*`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment