Skip to content

Instantly share code, notes, and snippets.

@yukimya
Created July 22, 2014 04:54
Show Gist options
  • Save yukimya/d5f0537e0954546593fc to your computer and use it in GitHub Desktop.
Save yukimya/d5f0537e0954546593fc to your computer and use it in GitHub Desktop.
make Mutant structure
#!/bin/sh
# GPL v. 3
# Program mkMu: 01mkVacPSF.sh
#
# This program uses: lProam.py, getSegment.py
#
# written by Naoyuki Miyashita 7/22/2014
# Input
inputfile="00_mutant.pdb"
outputPrefix="01_dd"
tag1="div"
tag2="psf"
numberOfMoleculeSP=2
selectionOfMolecules_0="'segment P and resid 289:450'"
selectionOfMolecules_1="'segment W and name OH2 and within 6.0 of (resid 289:450 and segment P)'"
selectionOfMolecules=("$selectionOfMolecules_0" "$selectionOfMolecules_1")
segment_0="P"
first_0="first NTER"
last_0="last CTER"
auto_0=""
segment_1="W"
first_1="first NONE"
last_1="last NONE"
auto_1="auto none"
segment=("$segment_0" "$segment_1")
first=("$first_0" "$first_1")
last=("$last_0" "$last_1")
auto=("$auto_0" "$auto_1")
numberOfTopology=2
topology_0="../../par/top_prot_wation.rtf"
topology_1="../../par/top_all36_na.rtf"
topology=("$topology_0" "$topology_1")
outTempPrefix="tmp_01"
# runfile
#psfgen_cmd="#/home/miya/src/src_namd/NAMD_CVS-2013-02-26_Linux-x86_64-multicore-CUDA/psfgen << ENDMOL"
#psfgen_cmd="/home/miya/src/src_namd/NAMD_CVS-2013-04-08_Linux-x86_64-multicore/psfgen << ENDMOL"
psfgen_cmd="psfgen << ENDMOL"
vmd_cmd="~/bin/bin_vmd/vmd -dispdev text -e $Outfile.inp > $Outfile.log"
# make input
# dvide files
num=0
i=0
line_0="python getSegment.py $inputfile $outputPrefix.$i.pdb ${selectionOfMolecules[$i]} 'non' 10"
echo $line_0 > $outputPrefix.$tag1.sh
i=$((i+1))
while [ $i -lt $numberOfMoleculeSP ]
do
line_0="python getSegment.py $inputfile $outputPrefix.$i.pdb ${selectionOfMolecules[$i]} 'non' 10"
echo $line_0 >> $outputPrefix.$tag1.sh
i=$((i+1))
done
# genpsf
echo $psfgen_cmd > $outputPrefix.$tag2.sh
line_1="package require psfgen"
echo $line_1 >> $outputPrefix.$tag2.sh
i=0
while [ $i -lt $numberOfTopology ]
do
topf=${topology[$i]}
line_1="topology $topf"
echo $line_1 >> $outputPrefix.$tag2.sh
num=$((num+1))
i=$((i+1))
done
i=0
while [ $i -lt $numberOfMoleculeSP ]
do
line_0="segment ${segment[$i]} {"
line_1="${first[$i]}"
line_2="${last[$i]}"
line_3="${auto[$i]}"
line_4="pdb $outputPrefix.$i.pdb"
line_5="}"
echo $line_0 >> $outputPrefix.$tag2.sh
echo $line_1 >> $outputPrefix.$tag2.sh
echo $line_2 >> $outputPrefix.$tag2.sh
echo $line_3 >> $outputPrefix.$tag2.sh
echo $line_4 >> $outputPrefix.$tag2.sh
echo $line_5 >> $outputPrefix.$tag2.sh
i=$((i+1))
done
i=0
while [ $i -lt $numberOfMoleculeSP ]
do
line_0="coordpdb $outputPrefix.$i.pdb ${segment[$i]}"
echo $line_0 >> $outputPrefix.$tag2.sh
i=$((i+1))
done
line_0="guesscoord"
echo $line_0 >> $outputPrefix.$tag2.sh
line_0="writepdb $outputPrefix.pdb"
line_1="writepsf $outputPrefix.psf"
echo $line_0 >> $outputPrefix.$tag2.sh
echo $line_1 >> $outputPrefix.$tag2.sh
line_0="ENDMOL"
echo $line_0 >> $outputPrefix.$tag2.sh
# run
sh $outputPrefix.$tag1.sh
sh $outputPrefix.$tag2.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment