From fdf491c6c5e2f140c111542135de7bbdd210a2e6 Mon Sep 17 00:00:00 2001 From: KAPAKAYALA ANJI BABU Date: Mon, 11 Mar 2019 17:36:08 +0800 Subject: [PATCH 1/6] Update README.md --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3cb49d2..aabb5e7 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,12 @@ -**Enhaced_Sampling_Methods_Tutorials** +# Enhaced Sampling Methods Tutorials - - - - -* Molecular Dynamics(**MD**): Will be updated soon +* Molecular Dynamics(**MD**) : Will be updated soon * Umbrella Sampling([**US**](https://github.com/NNairIITK/Enhanced_Sampling_Methods_Tutorials/tree/master/Umbrella_Sampling)) : will be updated soon * Metadynamics([**METAD**](https://github.com/NNairIITK/Enhanced_Sampling_Methods_Tutorials/tree/master/Metadynamics)) : Will be updated soon * Replica Exchange MD([**REMD**](https://github.com/NNairIITK/Enhanced_Sampling_Methods_Tutorials/tree/master/Replica_Exchange_MD)) : Updated -* Well Sliced Metadynamics(**WS-METAD**) : Will be updated soon * Replica Exchange Solute Scaling([**REST2**](https://github.com/NNairIITK/Enhanced_Sampling_Methods_Tutorials/tree/master/REST2)) : Updated * Temperature Accelerated Sliced Sampling([**TASS**](https://github.com/NNairIITK/Enhanced_Sampling_Methods_Tutorials/tree/master/TASS)) : Updated @@ -20,10 +15,8 @@ - - - -** Keep looking at this page for more updates** + +**Keep looking at this page for more updates** Cheers !!! Anji Babu From 4e32033c55058f86588742bf650c2a7546aadfb2 Mon Sep 17 00:00:00 2001 From: KAPAKAYALA ANJI BABU Date: Fri, 5 Feb 2021 23:57:33 +0530 Subject: [PATCH 2/6] script to choose hot atoms --- REST2/Process_topology_REST2.sh | 71 +++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 REST2/Process_topology_REST2.sh diff --git a/REST2/Process_topology_REST2.sh b/REST2/Process_topology_REST2.sh new file mode 100644 index 0000000..76c1410 --- /dev/null +++ b/REST2/Process_topology_REST2.sh @@ -0,0 +1,71 @@ +#-------------------------------------------------------------------------------# +# Bash script to Process the topology for REST2 setup +# Selects the hot atoms for RESt2 +# +# Author: Anji Babu Kapakayala +# IIT Kanpur, India. +#-------------------------------------------------------------------------------# +#!/bin/bash +#file="unfolded.top" +file="$1" +resid=0 +while read line;do + +#----> +res=`echo $line|awk '{print $2}'` +if [ "$res" == 'residue' ] +then +resid=`echo $line|awk '{print $3}'` +resid_ref=$resid +fi +#<--- +resid_new=`echo $line|awk '{print $3}'` + +if [ "$line" != "" ];then + if [ "$resid_new" != "" ];then + if [ "$resid_new" == "$resid_ref" ];then + C1=`echo $line|awk '{print $1}'` + C2=`echo $line|awk '{print $2}'` + C4=`echo $line|awk '{print $4}'` + C5=`echo $line|awk '{print $5}'` + C6=`echo $line|awk '{print $6}'` + C7=`echo $line|awk '{print $7}'` + C8=`echo $line|awk '{print $8}'` + C9=`echo $line|awk '{print $9}'` + C10=`echo $line|awk '{print $10}'` + C11=`echo $line|awk '{print $11}'` + + if [ "$res" != 'residue' ] ;then +# echo " $C1 ${C2}_ $resid_new $C4 $C5 $C6 $C7 $C8 $C9 $C10 $C11 " >> unfolded_scaled.top + echo $C1$'\t'${C2}_$'\t'$resid_new$'\t'$C4$'\t'$C5$'\t'$C6$'\t'$C7$'\t'$C8$'\t'$C9$'\t'$C10$'\t' $C11 >> unfolded_scaled.top + else + echo $line >> unfolded_scaled.top + fi + else + echo $line >> unfolded_scaled.top + fi + else + echo $line >> unfolded_scaled.top + fi +else +echo $line >> unfolded_scaled.top +fi + +first=`echo $line|awk '{print $1}'` +if [ "$first" == "[" ];then +#resid_new="X" +resid_ref="Y" +fi +done<$file + + +#awk '{for(i=1; i<=NR; i++) +#{if($i=="; residue") print $0 + + + + +#}#if + +#}' $file + From afff4f42e811d9b31355b7457370d4959f347427 Mon Sep 17 00:00:00 2001 From: KAPAKAYALA ANJI BABU Date: Sat, 6 Feb 2021 12:08:17 +0530 Subject: [PATCH 3/6] Selects HOT atoms --- REST2/Process_topology_REST2.sh | 48 +++++++++++++++++---------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/REST2/Process_topology_REST2.sh b/REST2/Process_topology_REST2.sh index 76c1410..666118d 100644 --- a/REST2/Process_topology_REST2.sh +++ b/REST2/Process_topology_REST2.sh @@ -1,16 +1,25 @@ #-------------------------------------------------------------------------------# # Bash script to Process the topology for REST2 setup -# Selects the hot atoms for RESt2 +# Selects the HOT atoms for REST2 # # Author: Anji Babu Kapakayala # IIT Kanpur, India. +# +# USAGE : bash Process_topology_REST2.sh topol.top #-------------------------------------------------------------------------------# #!/bin/bash -#file="unfolded.top" -file="$1" +infile="$1" +#infile="trp_processed.top" resid=0 -while read line;do +#---> Setting output filename +fname=`echo "$infile"|cut -d "." -f1` +outfile="${fname}_processed.top" + +#---> Make lines starts with * to ;* +sed -i "s/\*/;\*/g" $infile + +while read line;do #----> res=`echo $line|awk '{print $2}'` if [ "$res" == 'residue' ] @@ -20,7 +29,6 @@ resid_ref=$resid fi #<--- resid_new=`echo $line|awk '{print $3}'` - if [ "$line" != "" ];then if [ "$resid_new" != "" ];then if [ "$resid_new" == "$resid_ref" ];then @@ -36,19 +44,18 @@ if [ "$line" != "" ];then C11=`echo $line|awk '{print $11}'` if [ "$res" != 'residue' ] ;then -# echo " $C1 ${C2}_ $resid_new $C4 $C5 $C6 $C7 $C8 $C9 $C10 $C11 " >> unfolded_scaled.top - echo $C1$'\t'${C2}_$'\t'$resid_new$'\t'$C4$'\t'$C5$'\t'$C6$'\t'$C7$'\t'$C8$'\t'$C9$'\t'$C10$'\t' $C11 >> unfolded_scaled.top + echo $C1$'\t'${C2}_$'\t'$resid_new$'\t'$C4$'\t'$C5$'\t'$C6$'\t'$C7$'\t'$C8$'\t'$C9$'\t'$C10$'\t' $C11 >> $outfile else - echo $line >> unfolded_scaled.top + echo $line >> $outfile fi else - echo $line >> unfolded_scaled.top + echo $line >> $outfile fi else - echo $line >> unfolded_scaled.top + echo $line >> $outfile fi else -echo $line >> unfolded_scaled.top +echo $line >> $outfile fi first=`echo $line|awk '{print $1}'` @@ -56,16 +63,11 @@ if [ "$first" == "[" ];then #resid_new="X" resid_ref="Y" fi -done<$file - - -#awk '{for(i=1; i<=NR; i++) -#{if($i=="; residue") print $0 - - - - -#}#if - -#}' $file +done<$infile +#---> Make lines starts with ;* to * +sed -i "s/;\*/\*/g" $infile +sed -i "s/;\*/\*/g" $outfile +#---------------------------------------------------------# +# <========== ANJI BABU KAPAKAYALA ==========> +#---------------------------------------------------------# From a2802fd3798b9d3372bad5164e467efcc5e897d7 Mon Sep 17 00:00:00 2001 From: KAPAKAYALA ANJI BABU Date: Sat, 6 Feb 2021 16:20:15 +0530 Subject: [PATCH 4/6] Update Process_topology_REST2.sh --- REST2/Process_topology_REST2.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/REST2/Process_topology_REST2.sh b/REST2/Process_topology_REST2.sh index 666118d..6f2fdde 100644 --- a/REST2/Process_topology_REST2.sh +++ b/REST2/Process_topology_REST2.sh @@ -6,6 +6,7 @@ # IIT Kanpur, India. # # USAGE : bash Process_topology_REST2.sh topol.top +# Equilant Command using vim :%s/\%V /_/g #-------------------------------------------------------------------------------# #!/bin/bash infile="$1" From a98f558f440e1c3cf30233e38fcf5845c677e332 Mon Sep 17 00:00:00 2001 From: KAPAKAYALA ANJI BABU Date: Wed, 10 Feb 2021 15:27:15 +0530 Subject: [PATCH 5/6] fixed format issue --- REST2/Process_topology_REST2.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/REST2/Process_topology_REST2.sh b/REST2/Process_topology_REST2.sh index 6f2fdde..9f2717a 100644 --- a/REST2/Process_topology_REST2.sh +++ b/REST2/Process_topology_REST2.sh @@ -6,7 +6,9 @@ # IIT Kanpur, India. # # USAGE : bash Process_topology_REST2.sh topol.top -# Equilant Command using vim :%s/\%V /_/g +# +# Equilant command in vim: :%s/\%V /_/g +# #-------------------------------------------------------------------------------# #!/bin/bash infile="$1" @@ -15,7 +17,7 @@ resid=0 #---> Setting output filename fname=`echo "$infile"|cut -d "." -f1` -outfile="${fname}_processed.top" +outfile="${fname}_hot.top" #---> Make lines starts with * to ;* sed -i "s/\*/;\*/g" $infile @@ -47,16 +49,16 @@ if [ "$line" != "" ];then if [ "$res" != 'residue' ] ;then echo $C1$'\t'${C2}_$'\t'$resid_new$'\t'$C4$'\t'$C5$'\t'$C6$'\t'$C7$'\t'$C8$'\t'$C9$'\t'$C10$'\t' $C11 >> $outfile else - echo $line >> $outfile + echo "$line" >> $outfile fi else - echo $line >> $outfile + echo "$line" >> $outfile fi else - echo $line >> $outfile + echo "$line" >> $outfile fi else -echo $line >> $outfile +echo "$line" >> $outfile fi first=`echo $line|awk '{print $1}'` From 57dbc48c215a7bc276f6643d7ce5885005ad5a6f Mon Sep 17 00:00:00 2001 From: KAPAKAYALA ANJI BABU Date: Thu, 11 Feb 2021 22:08:16 +0530 Subject: [PATCH 6/6] selection of range of residues are implemented --- REST2/process_for_resid.sh | 119 +++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 REST2/process_for_resid.sh diff --git a/REST2/process_for_resid.sh b/REST2/process_for_resid.sh new file mode 100644 index 0000000..c601cf7 --- /dev/null +++ b/REST2/process_for_resid.sh @@ -0,0 +1,119 @@ +#-------------------------------------------------------------------------------# +# Bash script to Process the topology for REST2 setup +# Selects the HOT atoms for REST2 +# +# Author: Anji Babu Kapakayala +# IIT Kanpur, India. +# +# USAGE : bash Process_topology_REST2.sh topol.top +# bash process_topology_REST2.sh toptl.top --resid 1-5 +# +# Equilant command in vim: :%s/\%V /_/g +# +#-------------------------------------------------------------------------------# +#!/bin/bash +infile="$1" +#infile="trp_processed.top" +resid=$3 + +#---> Setting output filename +fname=`echo "$infile"|cut -d "." -f1` +outfile="${fname}_hot.top" +touch $outfile + +#---> Make lines starts with * to ;* +sed -i "s/\*/;\*/g" $infile + +#-------------------------------------------------------------------------------# +function select_hot_atoms() { + +while read line;do + echo "Processing for Resid: $resid" +#----> +res=`echo $line|awk '{print $2}'` +if [ "$res" == 'residue' ] +then +#---> + if [ "$1" == "all" ];then + resid=`echo $line|awk '{print $3}'` + resid_ref=$resid + else + resid_ref=$1 + echo "Processing for Resid: $1" + fi +#<--- +fi +#<--- +resid_new=`echo $line|awk '{print $3}'` +if [ "$line" != "" ];then + if [ "$resid_new" != "" ];then + if [ "$resid_new" == "$resid_ref" ];then + C1=`echo $line|awk '{print $1}'` + C2=`echo $line|awk '{print $2}'` + C4=`echo $line|awk '{print $4}'` + C5=`echo $line|awk '{print $5}'` + C6=`echo $line|awk '{print $6}'` + C7=`echo $line|awk '{print $7}'` + C8=`echo $line|awk '{print $8}'` + C9=`echo $line|awk '{print $9}'` + C10=`echo $line|awk '{print $10}'` + C11=`echo $line|awk '{print $11}'` + + if [ "$res" != 'residue' ] ;then + echo $C1$'\t'${C2}_$'\t'$resid_new$'\t'$C4$'\t'$C5$'\t'$C6$'\t'$C7$'\t'$C8$'\t'$C9$'\t'$C10$'\t' $C11 >> $outfile + else + echo "$line" >> $outfile + fi + else + echo "$line" >> $outfile + fi + else + echo "$line" >> $outfile + fi +else +echo "$line" >> $outfile +fi + +first=`echo $line|awk '{print $1}'` +if [ "$first" == "[" ];then +#resid_new="X" +resid_ref="Y" +fi +done<$infile +} +#-------------------------------------------------------------------------------# +# <========================== MAIN CODE ====================================> +#-------------------------------------------------------------------------------# +if [ "$2" == "" ];then + echo "Processing All Residues" + select_hot_atoms all +else + case "$2" in + --resid|-r) echo "Resid : $resid" + if [ "$3" != "" ];then + r1=`echo $3|cut -d "-" -f1` + r2=`echo $3|cut -d "-" -f2` + echo "Initial Resid: $r1" + echo "Final Resid: $r2" + for i in `seq $r1 1 $r2`;do + select_hot_atoms $i + mv $outfile tmp + infile="tmp" + done + + else + echo "Invalid resid.";exit + fi + ;; + *) echo " Invalid Argument.";; + esac +fi + +#-------------------------------------------------------------------------------# +#---> Make lines starts with ;* to * +sed -i "s/;\*/\*/g" $infile +sed -i "s/;\*/\*/g" $outfile +mv tmp $outfile +#-------------------------------------------------------------------------------# +# <========== ANJI BABU KAPAKAYALA ==========> +#-------------------------------------------------------------------------------#