From 9946541b06f76dbe2ea76fdcb17b48c02c8a0c12 Mon Sep 17 00:00:00 2001 From: Anup Kumar Date: Wed, 1 May 2024 00:04:56 -0700 Subject: [PATCH] Moved files to the src/MolecularDockingKit folder and corrected the information in the README file. --- README.md | 46 +++++++++++++++++++ README.txt | 44 ------------------ .../3sxr_dasatinib_removed.pdb | 0 .../MolecularDockingKit/call_combine.tcsh | 0 .../MolecularDockingKit/combine.py | 4 +- .../MolecularDockingKit/drugs.txt | 0 .../MolecularDockingKit/getEnergy.py | 10 ++-- .../MolecularDockingKit/getScores.tcsh | 0 .../MolecularDockingKit/getSmilesFromFile.py | 6 +-- main.py => src/MolecularDockingKit/main.py | 11 ++--- .../MolecularDockingKit/make.bash | 0 .../MolecularDockingKit/run_template.slurm | 0 .../MolecularDockingKit/xyzFromSmiles.py | 0 src/__init__.py | 0 14 files changed, 60 insertions(+), 61 deletions(-) delete mode 100644 README.txt rename 3sxr_dasatinib_removed.pdb => src/MolecularDockingKit/3sxr_dasatinib_removed.pdb (100%) rename call_combine.tcsh => src/MolecularDockingKit/call_combine.tcsh (100%) rename combine.py => src/MolecularDockingKit/combine.py (97%) rename drugs.txt => src/MolecularDockingKit/drugs.txt (100%) rename getEnergy.py => src/MolecularDockingKit/getEnergy.py (89%) rename getScores.tcsh => src/MolecularDockingKit/getScores.tcsh (100%) rename getSmilesFromFile.py => src/MolecularDockingKit/getSmilesFromFile.py (87%) rename main.py => src/MolecularDockingKit/main.py (87%) rename make.bash => src/MolecularDockingKit/make.bash (100%) rename run_template.slurm => src/MolecularDockingKit/run_template.slurm (100%) rename xyzFromSmiles.py => src/MolecularDockingKit/xyzFromSmiles.py (100%) create mode 100644 src/__init__.py diff --git a/README.md b/README.md index 95749b7..eaebbb8 100644 --- a/README.md +++ b/README.md @@ -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. +__________________________________________________________________________________________________________ + + diff --git a/README.txt b/README.txt deleted file mode 100644 index d36187a..0000000 --- a/README.txt +++ /dev/null @@ -1,44 +0,0 @@ --------------------------------------- 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. -__________________________________________________________________________________________________________ - diff --git a/3sxr_dasatinib_removed.pdb b/src/MolecularDockingKit/3sxr_dasatinib_removed.pdb similarity index 100% rename from 3sxr_dasatinib_removed.pdb rename to src/MolecularDockingKit/3sxr_dasatinib_removed.pdb diff --git a/call_combine.tcsh b/src/MolecularDockingKit/call_combine.tcsh similarity index 100% rename from call_combine.tcsh rename to src/MolecularDockingKit/call_combine.tcsh diff --git a/combine.py b/src/MolecularDockingKit/combine.py similarity index 97% rename from combine.py rename to src/MolecularDockingKit/combine.py index 038ad85..d5e589d 100644 --- a/combine.py +++ b/src/MolecularDockingKit/combine.py @@ -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('../../../') diff --git a/drugs.txt b/src/MolecularDockingKit/drugs.txt similarity index 100% rename from drugs.txt rename to src/MolecularDockingKit/drugs.txt diff --git a/getEnergy.py b/src/MolecularDockingKit/getEnergy.py similarity index 89% rename from getEnergy.py rename to src/MolecularDockingKit/getEnergy.py index 5c7008b..8c8118c 100644 --- a/getEnergy.py +++ b/src/MolecularDockingKit/getEnergy.py @@ -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') @@ -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('../../../') diff --git a/getScores.tcsh b/src/MolecularDockingKit/getScores.tcsh similarity index 100% rename from getScores.tcsh rename to src/MolecularDockingKit/getScores.tcsh diff --git a/getSmilesFromFile.py b/src/MolecularDockingKit/getSmilesFromFile.py similarity index 87% rename from getSmilesFromFile.py rename to src/MolecularDockingKit/getSmilesFromFile.py index 3d45361..b2b5d13 100644 --- a/getSmilesFromFile.py +++ b/src/MolecularDockingKit/getSmilesFromFile.py @@ -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)) diff --git a/main.py b/src/MolecularDockingKit/main.py similarity index 87% rename from main.py rename to src/MolecularDockingKit/main.py index 0f02df6..5dfa943 100644 --- a/main.py +++ b/src/MolecularDockingKit/main.py @@ -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 ############################################################ # # @@ -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 @@ -38,6 +35,6 @@ file1.write(f1) file1.close() - os.chdir('../') -os.chdir('../') + os.chdir('../../../') +os.chdir('../../../') diff --git a/make.bash b/src/MolecularDockingKit/make.bash similarity index 100% rename from make.bash rename to src/MolecularDockingKit/make.bash diff --git a/run_template.slurm b/src/MolecularDockingKit/run_template.slurm similarity index 100% rename from run_template.slurm rename to src/MolecularDockingKit/run_template.slurm diff --git a/xyzFromSmiles.py b/src/MolecularDockingKit/xyzFromSmiles.py similarity index 100% rename from xyzFromSmiles.py rename to src/MolecularDockingKit/xyzFromSmiles.py diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29