|
#!/bin/bash |
|
# This script need 3 arguments: |
|
# 1. ligand input file |
|
# 2. protein input file |
|
# 3. box radius |
|
|
|
echo "#############################################################################" |
|
echo "The script help to build a leap.in file and run the tleap for the complex." |
|
echo "First parameter is the ligand file name ABC" |
|
echo "Second is the protein file name" |
|
echo "Third is the radius of TIP3P box." |
|
# echo -n "Enter anything to continue....." |
|
# read |
|
echo "#############################################################################" |
|
|
|
if [ -z ${AMBERHOME} ]; then |
|
# echo "ERROR:The AMBERHOME var is not set! Check it!" |
|
# echo "ERROR:Be sure the tleap could be run!" |
|
# exit |
|
|
|
# If no define AMBERHOME, source the ambertools |
|
source ~/AmberTools/amber.sh |
|
fi |
|
|
|
ligfile=$1 |
|
if [ -z $1 ];then |
|
ligfile="ligand.mol2" |
|
echo "Set ligand file name to default: ligand.mol2" |
|
fi |
|
|
|
profile=$2 |
|
if [ -z $2 ];then |
|
profile="protein.pdb" |
|
echo "Set protein file name to default: protein.pdb" |
|
fi |
|
|
|
boxradius=$3 |
|
if [ -z $3 ]; then |
|
boxradius="10" |
|
echo "Set box radius to default: 10" |
|
fi |
|
|
|
basename1=${ligfile%.*} |
|
exdname1=`echo "${ligfile##*.}" | tr A-Z a-z` |
|
|
|
if [ ! -f ${basename1}.frcmod ];then |
|
echo "No ligand parameters file (ligandfile_prefix.frcmod)!" |
|
exit 1 |
|
fi |
|
|
|
# other options: |
|
# loadamberprep ligand.prep |
|
# list |
|
|
|
echo "source leaprc.ff14SB |
|
source leaprc.gaff |
|
loadamberparams ${basename1}.frcmod">leap.in |
|
|
|
if [ exdname1 = "mol2" ];then |
|
echo "lig=loadmol2 $ligfile" >>leap.in |
|
# no recommend with pdb file for ligand, no charge |
|
elif [ exdname1 = "pdb" ];then |
|
echo "lig=loadpdb $ligfile" >>leap.in |
|
fi |
|
|
|
echo "check lig |
|
saveamberparm lig lig.top lig.crd |
|
pro=loadpdb $profile |
|
saveamberparm pro pro.top pro.crd |
|
com=combine {lig pro} |
|
saveamberparm com com.top com.crd |
|
check com |
|
addions com Na+ 0 |
|
addions com Cl- 0 |
|
solvatebox com TIP3PBOX $boxradius |
|
check com |
|
saveamberparm com complex.top complex.crd |
|
quit" >>leap.in |
|
|
|
tleap -s -f leap.in |
|
ambpdb -p complex.top < complex.crd > complex_out.pdb |
|
|
|
echo "###############################################################################" |
|
echo "Note: Finish!" |
|
echo "Note: Check the residues num for the restrain in minimization and heat step in MD!" |