Skip to content

Commit

Permalink
switch memory multiplier to 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
AroneyS committed Nov 12, 2024
1 parent 4fc6532 commit 2dfe88f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 49 deletions.
6 changes: 3 additions & 3 deletions aviary/modules/annotation/annotation.smk
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ rule checkm2:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 8*60*attempt,
gpus = 1 if config["request_gpu"] else 0
log:
Expand Down Expand Up @@ -177,7 +177,7 @@ rule eggnog:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
log:
'logs/eggnog.log'
Expand Down Expand Up @@ -208,7 +208,7 @@ rule gtdbtk:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 256*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 256*1000*attempt),
runtime = lambda wildcards, attempt: 12*60*attempt,
log:
'logs/gtdbtk.log'
Expand Down
26 changes: 13 additions & 13 deletions aviary/modules/assembly/assembly.smk
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ rule flye_assembly:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60 + 24*60*attempt,
log:
"logs/flye_assembly.log"
Expand Down Expand Up @@ -86,7 +86,7 @@ rule polish_metagenome_flye:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
gpus = 1 if config["request_gpu"] else 0
log:
Expand All @@ -113,7 +113,7 @@ rule generate_pilon_sort:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
log:
"logs/generate_pilon_sort.log"
Expand All @@ -135,7 +135,7 @@ rule polish_meta_pilon:
threads: 1 # Threads no longer supported for pilon
# config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
log:
"logs/polish_meta_pilon.log"
Expand All @@ -162,7 +162,7 @@ rule polish_meta_racon_ill:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
log:
"logs/polish_meta_racon_ill.log"
Expand Down Expand Up @@ -304,7 +304,7 @@ rule filter_illumina_assembly:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
log:
"logs/filter_illumina_assembly.log"
Expand Down Expand Up @@ -354,7 +354,7 @@ rule spades_assembly:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 256*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 256*1000*attempt),
runtime = lambda wildcards, attempt: 72*60 + 24*60*attempt,
log:
"logs/spades_assembly.log"
Expand Down Expand Up @@ -393,7 +393,7 @@ rule assemble_short_reads:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 72*60 + 24*60*attempt,
log:
"logs/short_read_assembly.log"
Expand Down Expand Up @@ -430,7 +430,7 @@ rule spades_assembly_coverage:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
log:
"logs/spades_assembly_coverage.log"
Expand All @@ -457,7 +457,7 @@ rule metabat_binning_short:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
log:
"logs/metabat_binning_short.log"
Expand All @@ -482,7 +482,7 @@ rule map_long_mega:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
log:
"logs/map_long_mega.log"
Expand Down Expand Up @@ -525,7 +525,7 @@ rule get_read_pools:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 12*60*attempt,
log:
"logs/get_read_pools.log"
Expand All @@ -544,7 +544,7 @@ rule assemble_pools:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 72*60 + 24*60*attempt,
log:
"logs/assemble_pools.log"
Expand Down
50 changes: 25 additions & 25 deletions aviary/modules/binning/binning.smk
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ rule prepare_binning_files:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60 + 24*60*attempt,
log:
"logs/coverm_prepare.log"
Expand Down Expand Up @@ -91,7 +91,7 @@ rule maxbin2:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 72*60 + 24*60*attempt,
output:
"data/maxbin2_bins/done"
Expand All @@ -118,7 +118,7 @@ rule concoct:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 72*60 + 24*60*attempt,
output:
"data/concoct_bins/done"
Expand Down Expand Up @@ -177,7 +177,7 @@ rule vamb:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
gpus = 1 if config["request_gpu"] else 0
output:
Expand Down Expand Up @@ -217,7 +217,7 @@ rule metabat2:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 12*60*attempt,
log:
"logs/metabat2.log"
Expand Down Expand Up @@ -248,7 +248,7 @@ rule metabat_spec:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
shell:
"rm -rf data/metabat_bins_spec; "
Expand All @@ -274,7 +274,7 @@ rule metabat_sspec:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
shell:
"rm -rf data/metabat_bins_sspec; "
Expand All @@ -300,7 +300,7 @@ rule metabat_sens:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
shell:
"rm -rf data/metabat_bins_sens; "
Expand All @@ -326,7 +326,7 @@ rule metabat_ssens:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
shell:
"rm -rf data/metabat_bins_ssens; "
Expand All @@ -352,7 +352,7 @@ rule rosella:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 24*60*attempt,
log:
"logs/rosella.log"
Expand All @@ -377,7 +377,7 @@ rule semibin:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 24*60 + 48*60*(attempt-1),
gpus = 1 if config["request_gpu"] else 0
conda:
Expand Down Expand Up @@ -410,7 +410,7 @@ rule checkm_rosella:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 8*60*attempt,
gpus = 1 if config["request_gpu"] else 0
log:
Expand All @@ -435,7 +435,7 @@ rule checkm_metabat2:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 8*60*attempt,
gpus = 1 if config["request_gpu"] else 0
log:
Expand All @@ -460,7 +460,7 @@ rule checkm_semibin:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 8*60*attempt,
gpus = 1 if config["request_gpu"] else 0
log:
Expand Down Expand Up @@ -493,7 +493,7 @@ rule refine_rosella:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 48*60 + 24*60*attempt,
log:
"logs/refine_rosella.log"
Expand All @@ -514,7 +514,7 @@ rule refine_metabat2:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 48*60 + 24*60*attempt,
benchmark:
'benchmarks/refine_metabat2.benchmark.txt'
Expand Down Expand Up @@ -546,7 +546,7 @@ rule refine_semibin:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 48*60 + 24*60*attempt,
output:
'data/semibin_refined/done'
Expand Down Expand Up @@ -626,7 +626,7 @@ rule das_tool:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 12*60*attempt,
output:
touch("data/das_tool_bins_pre_refine/done")
Expand All @@ -649,7 +649,7 @@ rule refine_dastool:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 48*60 + 24*60*attempt,
output:
temporary('bins/checkm.out'),
Expand Down Expand Up @@ -680,7 +680,7 @@ rule get_abundances:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60 + 24*60*attempt,
output:
"data/coverm_abundances.tsv"
Expand Down Expand Up @@ -717,7 +717,7 @@ rule checkm_das_tool:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 128*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 128*1000*attempt),
runtime = lambda wildcards, attempt: 8*60*attempt,
log:
"logs/checkm_das_tool.log"
Expand All @@ -736,7 +736,7 @@ rule singlem_pipe_reads:
package_path = os.environ["SINGLEM_METAPACKAGE_PATH"]
threads: min(config["max_threads"], 48)
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 8*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 8*1000*attempt),
runtime = lambda wildcards, attempt: 12*60*attempt,
log:
"logs/singlem_pipe_reads_log.txt"
Expand All @@ -762,7 +762,7 @@ rule singlem_appraise:
genomes_folder = "data/refined_bins/final_bins/"
threads: min(config["max_threads"], 48)
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 8*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 8*1000*attempt),
runtime = lambda wildcards, attempt: 12*60*attempt,
conda:
"../../envs/singlem.yaml"
Expand Down Expand Up @@ -816,7 +816,7 @@ rule dereplicate_and_get_abundances_paired:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60 + 24*60*attempt,
log:
"logs/coverm_abundances_paired.log"
Expand All @@ -837,7 +837,7 @@ rule dereplicate_and_get_abundances_interleaved:
threads:
config["max_threads"]
resources:
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1024, 512*1024*attempt),
mem_mb = lambda wildcards, attempt: min(int(config["max_memory"])*1000, 512*1000*attempt),
runtime = lambda wildcards, attempt: 24*60 + 24*60*attempt,
log:
"logs/coverm_abundances_interleaved.log"
Expand Down
2 changes: 1 addition & 1 deletion aviary/modules/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def run_workflow(self, cores=16, profile=None, cluster_retries=None,
target_rule=workflow if workflow != "None" else "",
conda_prefix="--conda-prefix " + self.conda_prefix,
conda_frontend="--conda-frontend " + conda_frontend,
resources=f"--resources mem_mb={int(self.max_memory)*1024} {self.resources}" if not dryrun else ""
resources=f"--resources mem_mb={int(self.max_memory)*1000} {self.resources}" if not dryrun else ""
)

logging.debug(f"Command: {cmd}")
Expand Down
Loading

0 comments on commit 2dfe88f

Please sign in to comment.