Skip to content
Open
Changes from all commits
Commits
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
54 changes: 48 additions & 6 deletions tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,55 @@ tools:
cores: 6
mem: 24
toolshed.g2.bx.psu.edu/repos/bgruening/hifiasm/hifiasm/.*:
cores: 20
mem: 120
cores: 10
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cores: 10
cores: 20
mem: 120
- id: hifiasm_small_input_rule
if: 0.07 <= input_size < 9.4
cores: 8
mem: 28
- id: hifiasm_scalable_input_rule
if: input_size >= 9.4
cores: 16
mem: min(max(int(input_size * 5), 28), max_scaled_mem)

If you like that more, you can take that one in addition, I think. If hg_size is set, it should be more accurate and should be taken.

rules:
- id: tpvdb_hifiasm_small_input_rule
if: input_size <= 0.2
cores: 6
mem: 40
- id: tpvdb_hifiasm_expert_memory_rule
# The memory requirement of Hifiasm depends on the "Estimated haploid genome size" (hg_size).
# If hg_size is set, and it can be calculated automatically, then we can fit memory more efficiently.
# This is done for example in the VGP workflows.
if: |
parameters = {p.name: p.value for p in job.parameters}
parameters = tool.params_from_strings(parameters, app)

advanced_options = parameters.get("advanced_options", dict())
hg_size = advanced_options.get("hg_size", "")

bool(hg_size)
mem: |
from math import ceil

parameters = {p.name: p.value for p in job.parameters}
parameters = tool.params_from_strings(parameters, app)

advanced_options = parameters.get("advanced_options", dict())

kcov_default = 36
kcov = advanced_options.get("kcov", kcov_default)

hg_size = advanced_options.get("hg_size", "")

value = 0
if hg_size:
conversion_factors = {
"k": 1000000,
"M": 1000,
"G": 1,
}
conversion_factors = {
key.lower(): value for key, value in conversion_factors.items()
}
suffix = hg_size[-1:].lower()
value = hg_size[:len(hg_size) - 1]
value = value.replace(",", ".")
value = float(value)
# compute hg size in Gb
value = value / conversion_factors[suffix.lower()]
value = ceil(value * (kcov * 2) * 1.75)

# return the amount of memory needed
value


toolshed.g2.bx.psu.edu/repos/bgruening/infernal/infernal_cmbuild/.*:
cores: 10
mem: 20
Expand Down