diff options
Diffstat (limited to 'scripts/convert-smile.sh')
-rw-r--r-- | scripts/convert-smile.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/convert-smile.sh b/scripts/convert-smile.sh new file mode 100644 index 0000000..a86f675 --- /dev/null +++ b/scripts/convert-smile.sh @@ -0,0 +1,38 @@ +if [ -z "$1" ] + then + echo "CSV path not provided! 😠" + exit +fi +input="$1" + +echo "Reading ligands from $input" + +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 + code=$(echo "$a") + fi + if ((i == 2)) + then + echo "===========================================" + echo "Generating Structure for $a" + fi + if ((i == 3)) + then + echo "obabel -:"$a" --gen3d -opdbqt -O$code.pdbqt" + obabel -:"$a" --gen3d -opdbqt -O$code.pdbqt + echo "===========================================" + fi + mv $code.pdbqt ligands/ + done + file=$((file+1)) +done < "$input" |