Skip to content

Commit

Permalink
Cleaned up getScores.tcsh.
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranu committed May 1, 2024
1 parent ea32a72 commit 7ada264
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions src/MolecularDockingKit/getScores.tcsh
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
#!/bin/tcsh

#################################################################
# #
# This script extracts the docking scores for all the drugs and #
# sorts them. #
# #
#################################################################
###################################################################
# #
# This script extracts the docking scores for all the drugs and #
# sorts them. #
# #
###################################################################

# Remove existing allScores.txt file
rm -f allScores.txt

# Navigate to the rDock_inputs directory
cd rDock_inputs/
foreach mol(`cat ../moleculeLists/fileList.txt | xargs`)

# Loop through each molecule in the fileList.txt
foreach mol (`cat ../moleculeLists/fileList.txt | xargs`)
cd $mol
set score = `grep -iwA1 "<SCORE>" "$mol"_docking_out_sorted.sd | tail -1`
echo "$mol $score" >> ../../allScores.txt

# Extract the docking score for the current molecule
set score = `grep -iwA1 "<SCORE>" "${mol}_docking_out_sorted.sd" | tail -1`

# Write the molecule name and its score to allScores.txt
echo "$mol $score" >> ../../allScores.txt

cd ..
end
end

# Navigate back to the main directory
cd ..

# Sort the allScores.txt file based on the docking scores and save it to sorted_allScores.txt
sort -k2g allScores.txt > sorted_allScores.txt


0 comments on commit 7ada264

Please sign in to comment.