Skip to content

Commit

Permalink
Merge pull request #34 from RobertArbon/fix_nosubmit
Browse files Browse the repository at this point in the history
fix: nosubmit runs with default cluster config
  • Loading branch information
philbiggin authored Nov 3, 2024
2 parents eeee0c1 + e0dc26b commit d96444e
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ Snakemake

#temp test out
examples/CyclophilinD_data/abfe/
examples/abfe_out*
examples/abfe_*out*
examples/output
/src/abfe/_version.py
34 changes: 34 additions & 0 deletions environment_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: abfe
channels:
- bioconda
- openbiosim
- conda-forge
- defaults
dependencies:
- python>=3.8
- pip
- conda-build

- snakemake=7.8.5
- tabulate=0.8.10

- gromacs>=2022.2

- matplotlib
- numpy=1.22.4
- scipy=1.7.3
- pandas

- mdanalysis
- parmed
- pdbfixer
- biosimspace
- openff-toolkit
- openff-interchange
- black

- pip:
- alchemlyb==2.0.0
- pymbar==4.0.1
- MDRestraintsGenerator

29 changes: 17 additions & 12 deletions src/abfe_cli/ABFECalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,25 @@ def main():

sdf_paths = glob.glob(args.ligand_sdf_dir + "/*.sdf")

if (args.nosubmit):
if (args.nogpu):
cluster_config = json.load(open(f"{default_slurm_config_path}", "r"))
cluster_config["Snakemake_job"]["queue_job_options"]["cpus-per-task"] = int(args.number_of_parallel_receptor_jobs)
cluster_config["Sub_job"]["queue_job_options"]["cpus-per-task"] = int(args.number_of_cpus_per_ligand_job)

else:
cluster_config = json.load(open(f"{default_slurm_config_path}", "r"))
cluster_config["Snakemake_job"]["queue_job_options"]["cpus-per-task"] = int(args.number_of_parallel_receptor_jobs)
cluster_config["Sub_job"]["queue_job_options"]["cpus-per-task"] = int(args.number_of_parallel_ligand_jobs)
cluster_config["Sub_job"]["queue_job_options"]["partition"] = "gpu"
if args.nogpu:
cluster_config = json.load(open(f"{default_slurm_config_path}", "r"))
cluster_config["Snakemake_job"]["queue_job_options"]["cpus-per-task"] = int(
args.number_of_parallel_receptor_jobs
)
cluster_config["Sub_job"]["queue_job_options"]["cpus-per-task"] = int(
args.number_of_cpus_per_ligand_job
)

else:
cluster_config = None
cluster_config = json.load(open(f"{default_slurm_config_path}", "r"))
cluster_config["Snakemake_job"]["queue_job_options"]["cpus-per-task"] = int(
args.number_of_parallel_receptor_jobs
)
cluster_config["Sub_job"]["queue_job_options"]["cpus-per-task"] = int(
args.number_of_parallel_ligand_jobs
)
cluster_config["Sub_job"]["queue_job_options"]["partition"] = "gpu"


res = calculate_abfe(protein_pdb_path=args.protein_pdb_path, ligand_sdf_paths=sdf_paths, out_root_folder_path=args.output_dir_path,
cofactor_sdf_path=args.cofactor_sdf_path, approach_name=args.project_name,
Expand Down
29 changes: 17 additions & 12 deletions src/abfe_cli/ABFECalculatorGmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,24 @@ def main():

args = parser.parse_args()

if args.nosubmit:
cluster_config = None
if args.nogpu:
cluster_config = json.load(open(f"{default_slurm_config_path}", "r"))
cluster_config["Snakemake_job"]["queue_job_options"]["cpus-per-task"] = int(
args.number_of_parallel_receptor_jobs
)
cluster_config["Sub_job"]["queue_job_options"]["cpus-per-task"] = int(
args.number_of_parallel_ligand_jobs
)

else:
if args.nogpu:
cluster_config = json.load(open(f"{default_slurm_config_path}", "r"))
cluster_config["Snakemake_job"]["queue_job_options"]["cpus-per-task"] = int(args.number_of_parallel_receptor_jobs)
cluster_config["Sub_job"]["queue_job_options"]["cpus-per-task"] = int(args.number_of_parallel_ligand_jobs)

else:
cluster_config = json.load(open(f"{default_slurm_config_path}", "r"))
cluster_config["Snakemake_job"]["queue_job_options"]["cpus-per-task"] = int(args.number_of_parallel_receptor_jobs)
cluster_config["Sub_job"]["queue_job_options"]["cpus-per-task"] = int(args.number_of_parallel_ligand_jobs)
cluster_config["Sub_job"]["queue_job_options"]["partition"] = "gpu"
cluster_config = json.load(open(f"{default_slurm_config_path}", "r"))
cluster_config["Snakemake_job"]["queue_job_options"]["cpus-per-task"] = int(
args.number_of_parallel_receptor_jobs
)
cluster_config["Sub_job"]["queue_job_options"]["cpus-per-task"] = int(
args.number_of_parallel_ligand_jobs
)
cluster_config["Sub_job"]["queue_job_options"]["partition"] = "gpu"

print(args.gmx_files_root_dir)

Expand Down

0 comments on commit d96444e

Please sign in to comment.