From 4be08f7bdd77991e9e453c1cda863c3f20c338d5 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Thu, 2 Jul 2020 20:48:33 +0530 Subject: initial commit --- scripts/dock-and-score.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 scripts/dock-and-score.sh (limited to 'scripts/dock-and-score.sh') diff --git a/scripts/dock-and-score.sh b/scripts/dock-and-score.sh new file mode 100644 index 0000000..c71baef --- /dev/null +++ b/scripts/dock-and-score.sh @@ -0,0 +1,51 @@ +if [ -z "$1" ] + then + echo "CSV path not provided! 😠" + exit +fi +input="$1" +echo "Reading ligands from $input" + +targets=() + +for file in ./configs/* +do + targets+=($file) +done + +total=$(wc -l $input | awk '{print $1}') +file=1 +while IFS= read -r line +do + mails=$(echo $line | tr "," "\n") + i=0 + code="" + echo "Structure $file of $total" + for a in $mails; do + i=$((i+1)) + if ((i == 1)) + then + echo $a + for target in ${targets[@]}; do + echo "Docking $(basename $target .txt) and $a" + vina --config $target --ligand ligands/$a.pdbqt + sentence=$(awk '{if(NR==2) print $0}' ./ligands/$(echo $a)_out.pdbqt) + mkdir -p ./Reports/$(basename $target .txt)/$(echo $a)/ + mkdir ./$(basename $target .txt)/ + cp ligands/$(echo $a)_out.pdbqt ./$(basename $target .txt)/ + mv ligands/$(echo $a)_out.pdbqt ./Reports/$(basename $target .txt)/$(echo $a)/$(echo $a).pdbqt + f=1 + for word in $sentence; do + if ((f == 4)) + then + echo "$(echo $a),$word" >> $(basename $target .txt).csv + fi + f=$((f+1)) + done + done + fi + done + file=$((file+1)) +done < "$input" + + -- cgit v1.2.3