Skip to content

Commit

Permalink
Moved files to the src/MolecularDockingKit folder and corrected the i…
Browse files Browse the repository at this point in the history
…nformation in the README file.
  • Loading branch information
kumaranu committed May 1, 2024
1 parent 1d48e79 commit 9946541
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 61 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
# MolecularDockingKit

A simple python tool to perform molecular docking computations.

-------------------------------------- Outline of the program ---------------------------------------------
Main script to run:
make.bash

Supplementary scripts:
1) main.py
2) getSmilesFromFile.py
3) xyzFromSmiles.py
4) getScores.tcsh
5) call_combine.tcsh
6) combine.py
7) run.slurm inside a directory named energy_protein
8) getEnergy.py
9) run_template.slurm

Files and directories needed from the user:
1) A file named "drugs.txt" which contains the initial data from the website given in the problem.
2) A file named "3sxr_dasatinib_removed.pdb" containing the protein without dasatinib. I could have
removed this user input but kept it this way.
3) A directory named "energy_protein" that contains a slurm script run.py which would submit the job
for protein.py such as run.slurm
4) A template file named 'prm-template.prm' for the prm input file to be used for docking calculations.

-------------------------------------- Summary of the program ---------------------------------------------
All of the scripts contain comments to clarify their purpose in the program. A brief summary is provided below:
1) The bash script main.bash calls main.py.
- main.py extracts the smiles formats for the drugs from the file called drugs.txt.
- A directory structure is created for the docking calculations which looks like:
|---- rDock_inputs/
| |----MoleculeName/
- xyz coordinates are generated from the smiles using the script xyzFromSmiles
- .prm input files are generated from the prm-template.prm and are stored as moleculeName_rdock.prm as:
|---- rDock_inputs/
| |----MoleculeName/
| | |----moleculeName_rdock.prm
2) A 10 runs-per-ligand rDock job is submitted for each drug molecule.
3) getScores.tcsh is called to extract the scores from the docking output files.
4) The scores and the molecule names are put in a file and molecule are sorted according to their docking scores.
5) A shell script call_combine is called which submits slurm jobs for binding energy calculations.
6) Energy calculations are submitted for the protein without ligand.
7) A python script getEnergy.py is called to extract energies and return binding energies in kcal/mol.
8) Molecules are sorted according to their binding energies to get their ranking.
__________________________________________________________________________________________________________


44 changes: 0 additions & 44 deletions README.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions combine.py → src/MolecularDockingKit/combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

#Saving the energies for the (ligand + protein) and the ligand only geometry in a file
np.savetxt('energies.txt', [res[0][1], res1[0][1]])
os.chdir('../')
os.chdir('../')
os.chdir('../../../')
os.chdir('../../../')


File renamed without changes.
10 changes: 5 additions & 5 deletions getEnergy.py → src/MolecularDockingKit/getEnergy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#######################################################################


os.chdir('moleculeLists')
os.chdir('../../moleculeLists')
molList = open('fileList.txt', 'r').readlines()
molList = [mol.strip() for mol in molList]
os.chdir('../')
os.chdir('../../../')

e1 = np.loadtxt('energy_protein/energies.txt')

Expand All @@ -24,9 +24,9 @@
try:
eCombined = np.loadtxt('energies.txt')
print("%s, %3f, %3f, %3f, %3f, %3f" % (mol, eCombined[0], eCombined[1], e1, (eCombined[0] - eCombined[1] - e1), (eCombined[0] - eCombined[1] - e1)*627.503))
os.chdir('../')
os.chdir('../../../')
except:
os.chdir('../')
os.chdir('../../../')
continue
print(mol, 'skipped due to some error')
os.chdir('../')
os.chdir('../../../')
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def getSmilesFromFile(fileName):

#Writing the names of molecules in a file inside a separate directory
#for future calculations
if not os.path.exists('moleculeLists'):
os.mkdir('moleculeLists')
os.chdir('moleculeLists')
if not os.path.exists('../../moleculeLists'):
os.mkdir('../../moleculeLists')
os.chdir('../../moleculeLists')
with open("fileList.txt", 'w') as file:
file.write('\n'.join(molNames))

Expand Down
11 changes: 4 additions & 7 deletions main.py → src/MolecularDockingKit/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import getSmilesFromFile
from rdkit import Chem
from rdkit.Chem import AllChem
from src.MolecularDockingKit import getSmilesFromFile, xyzFromSmiles
import os
import xyzFromSmiles

############################################################
# #
Expand All @@ -20,7 +17,7 @@
os.chdir('rDock_inputs')

#Loading a prm file template to be edited later for each molecule
f = open('prm-template.prm', 'r').read()
f = open('../../prm-template.prm', 'r').read()

for i in range(len(molNames)):
#Creating a separate directory for each drug's calculation
Expand All @@ -38,6 +35,6 @@
file1.write(f1)
file1.close()

os.chdir('../')
os.chdir('../')
os.chdir('../../../')
os.chdir('../../../')

File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added src/__init__.py
Empty file.

0 comments on commit 9946541

Please sign in to comment.