Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20240801 complete fred docking #18

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
69f6740
add fred docking scripts
apayne97 Aug 12, 2024
c8c1ab8
update cluster script test
apayne97 Aug 16, 2024
f672c96
add test_import_speed test
apayne97 Aug 21, 2024
c88f6ea
add updated submission scripts
apayne97 Sep 3, 2024
ff5f650
add scripts for calculting rmsd
apayne97 Sep 3, 2024
6332a46
add script for creating cached lig dir
apayne97 Sep 3, 2024
6e4a861
add command for splitting up the 3d files
apayne97 Sep 5, 2024
612d93c
make executable
apayne97 Sep 5, 2024
e328f6d
update file names
apayne97 Sep 5, 2024
a3960f3
use correct input ligand files
apayne97 Sep 5, 2024
0fd9367
fix typo
apayne97 Sep 5, 2024
37594ad
update cluster script
apayne97 Oct 11, 2024
67f14dc
use any nodes in cpuqueue
apayne97 Oct 11, 2024
0eadc42
add ben deduplication code
apayne97 Oct 11, 2024
8a9c5d6
Merge remote-tracking branch 'origin/20240801_complete_fred_docking' …
apayne97 Oct 11, 2024
1eb92b8
add updated molecule filtering code
apayne97 Oct 11, 2024
68685c4
add updated molecule filtering code
apayne97 Oct 11, 2024
80d7f92
add updated molecule filtering code
apayne97 Oct 11, 2024
133ca55
add new fragalysis p series prep
apayne97 Oct 18, 2024
05b1509
add spruce reprepped fred script
apayne97 Oct 22, 2024
495ff6d
update rmsd calculation and filtering script
apayne97 Oct 22, 2024
297d93e
examine missing structures
apayne97 Oct 22, 2024
e3b7688
examine missing structures
apayne97 Oct 22, 2024
509ac3d
update cluster submission script
apayne97 Nov 13, 2024
5cebb2e
update ligand rmsd array analysis
apayne97 Nov 13, 2024
09bfa71
fix example submission
apayne97 Nov 13, 2024
e1b7d3b
fix calculation script
apayne97 Nov 13, 2024
dfdf075
fix calculation script
apayne97 Nov 13, 2024
424aea9
fix rmsd calculation output
apayne97 Nov 15, 2024
50da7b9
update rmsd calculation script time
apayne97 Nov 15, 2024
a0a9e09
update rmsd calculation script time
apayne97 Nov 21, 2024
3895dd0
update analysis processing
apayne97 Dec 5, 2024
86fe77a
add chemical similarity csv to repo
apayne97 Dec 5, 2024
e5ce8c8
remove call to 'bar' in mpi
apayne97 Dec 5, 2024
2b14e9c
add fred analysis
apayne97 Dec 13, 2024
8291228
analyze results
apayne97 Jan 7, 2025
9c7eb4f
test prepping and figure out the error
apayne97 Jan 7, 2025
2b573fc
add slurm script for iris
apayne97 Jan 10, 2025
ee85418
use iris paths
apayne97 Jan 10, 2025
74ae153
change partition
apayne97 Jan 10, 2025
5fdd69f
update slurm prep script to correctly parallelize
Jan 13, 2025
486019b
add cross docking array script
apayne97 Jan 13, 2025
830085c
add iris ligand cache splitting script
apayne97 Jan 13, 2025
f629df4
update lig directory creation
apayne97 Jan 13, 2025
2d96298
troubleshoot fixing P0097 automatically
apayne97 Jan 13, 2025
8c1e31b
update prep cache for docking scripts
apayne97 Jan 13, 2025
05063be
update prep cache for docking scripts
apayne97 Jan 13, 2025
1f522b8
update prep cache for docking scripts
apayne97 Jan 13, 2025
170c810
update prep cache for docking scripts
apayne97 Jan 13, 2025
52858d1
update prep cache for docking scripts
apayne97 Jan 13, 2025
ca91229
update prep cache for docking scripts
apayne97 Jan 13, 2025
3d2549c
update prep cache for docking scripts
apayne97 Jan 13, 2025
dc29bc5
update prep cache for docking scripts
apayne97 Jan 13, 2025
39cd55d
update prep cache for docking scripts
apayne97 Jan 13, 2025
8b3fb45
update prep cache for docking scripts
apayne97 Jan 13, 2025
269c68e
update prep cache for docking scripts
apayne97 Jan 13, 2025
765af2f
update prep cache for docking scripts
apayne97 Jan 13, 2025
cabc668
update slurm script
apayne97 Jan 13, 2025
fad7cce
update slurm script
apayne97 Jan 13, 2025
b2ef4d0
update slurm script
apayne97 Jan 13, 2025
0923ab6
update slurm command with editable asapdiscovery repo and new cli
Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_args():
"-i",
"--input_cache",
type=Path,
help="Path to input cache generated by the asapdiscovery-data package",
help="Path to input cache generated by the asapdiscovery-data package. This shouldn't contain any json files except for the cache.json file.",
)
parser.add_argument(
"--flatten",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""This script fixes some bespoke errors with the prepped fragalysis cache"""
from pathlib import Path
from asapdiscovery.modeling.protein_prep import PreppedComplex
from asapdiscovery.data.backend.openeye import sdf_string_to_oemol
from asapdiscovery.data.schema.ligand import Ligand
import argparse
from asapdiscovery.data.util.logging import FileLogger
import rdkit

def get_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"-i",
"--input_cache",
type=Path,
help="Path to input cache generated by the asapdiscovery-data package.",
)
return parser.parse_args()

def main():
args = get_args()
cache = args.input_cache
logger = FileLogger(
"prep_cache_for_docking", cache, logfile="prep_cache_for_docking.log"
).getLogger()
if not cache.exists():
raise FileNotFoundError(f"Cache file {cache} not found")

# fix ligand in P0097
prepped_directories = list(cache.glob("*P0097*"))
logger.info(f"Found {len(prepped_directories)} prepped directories in the cache: '{cache}'")
for prepped_directory in prepped_directories:
ligand = prepped_directory / "MAT-POS-5d65ec79-1.sdf"
if not ligand.exists():
raise FileNotFoundError(f"Ligand file {ligand} not found")
ligand = Ligand.from_sdf(ligand)
# get rid of 2nd ligand
rdmol = ligand.to_rdkit()

# delete second fragment if it exists
frags = [frag for frag in rdkit.Chem.GetMolFrags(rdmol)]
if len(frags) == 2:
frag_to_delete = frags[1]
editable = rdkit.Chem.EditableMol(rdmol)

# need to change index as we delete
# since the indices are already sorted, each time we delete one, the next will
# have a lower index
for i, idx in enumerate(frag_to_delete):
idx = idx - i
editable.RemoveAtom(idx)
new_mol = editable.GetMol()
rdkit.Chem.rdmolops.SanitizeMol(new_mol, sanitizeOps=rdkit.Chem.rdmolops.SANITIZE_ALL)
sdf_str = rdkit.Chem.rdmolfiles.MolToMolBlock(new_mol)
oemol = sdf_string_to_oemol(sdf_str)
ligand = Ligand.from_oemol(oemol, compound_name=ligand.compound_name)
ligand.to_sdf(prepped_directory / "MAT-POS-5d65ec79-1.sdf")

# overwrite old json file
json_file = list(prepped_directory.glob('*.json'))[0]
prepped_complex = PreppedComplex.from_json_file(json_file)
prepped_complex.ligand = ligand
prepped_complex.to_json_file(json_file)

# Mpro-P2243_0B
# Mpro-P2214_0B

if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,6 @@
"len(possible_pairs)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7ffaa579-ffa1-4e2b-b8f4-28f109e4ae09",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "5669a910-a36e-453c-a0de-6756a92071ea",
Expand Down

Large diffs are not rendered by default.

Loading