SORTING AND ANALYSE OF RESULTS
Place the following two scripts, 'golly_gosher.sh' and 'kcal_collect.pl' in the screening directory. The script 'kcal_collect.pl' must retain this name because it is used by 'golly_gosher.sh', unless you are going to edit 'golly_goshie.sh'. Run golly_gosher.sh by typing "./golly_gosher.sh". The script puts all of the log files into several folder inclusive files and then into one big text file, 'total-emnergy_list.txt', that is then parsed by 'kcal_collect.pl'. kcal_collect.pl then creates a list containing the the top score for each compound and its name as per the input file name.
golly_gosher.sh
#############
for t in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99;
do
cd $t
mkdir molecule_files
mv ZINC*.mol2 molecule_files/
mv ZINC*.pdbqt molecule_files/
for f in ZINC* ; do echo -e >>logs_3.txt;echo $f>>logs_3.txt; cat $f/log >> logs_3.txt; echo -e >>logs_3.txt; done
cp ../kcal_collect.pl kcal_collect.pl
./kcal_collect.pl logs_3.txt
cat energy_list.txt >> ../total-emnergy_list.txt
cd ..;
done;
#############
kcal_collect.pl
#############
#!/usr/bin/perl -w
$input = $ARGV [0];
open (TEXT, $input) || die;
@textfile = <TEXT>;
print "Opening input.";
chomp(@textfile);
close (TEXT);
$c = 1;
open (TEXT2, ">>energy_list.txt");
for ($c=1; $c<$#textfile+1; $c=$c+1 ){
if ($textfile [$c]=~/ZINC*/) {
$happy = $textfile[$c];
print(TEXT2 "$happy ");}
if ($textfile [$c]=~/ 1 / ){
print "Line ".$c." Read!";
$happy = $textfile[$c];
print (TEXT2 "$happy\n"); }
}
close (TEXT2);
#############
hit_collector_00.sh
#############
#!/bin/bash
mkdir "hits";
filename="$1";
while read -r line;
do
echo "$line read "
hit=$line
for t in 00 01 02 03 04 05 06 07 08 09 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99;
do
if [ -d $t ];
then
cd $t;
echo " in directory $t ";
if [ -d $hit ];
then
echo Processing "$hit"; cd $hit; vina_split --input out.pdbqt --ligand ${hit}"_M"; cd .. ;
cp -R "$hit" ../hits/
echo "found $hit";
fi
cd ..
fi
done;
done < $1;