Wonder if anyone has any creative solutions for th...
# modules
j
Wonder if anyone has any creative solutions for this one: https://github.com/nf-core/modules/blob/master/modules/nf-core/busco/busco/main.nf The BUSCO process calls
stats.sh
from the
bbtools
package. Because you can't modify the arguments to it, this has a hard-coded memory limit of 120Mb, which sometimes gives OOM errors for large genome assemblies. The BUSCO folks don't seem to be very responsive, and there's no way to set the
bbtools
java process to receive a memory setting via e.g.
JAVA_OPTS
. However, BUSCO does have a config file (TOML format) and it's possible to override the path to the
stats.sh
script. So we could write a wrapper that calls
stats.sh
with an increased amount of memory, and set this as the call in a config file. But the config file is also an optional input into the process, so we would somehow have to append this to the config if supplied. Is this a ridiculous idea, should we just wait for a bugfix to BUSCO? Is there another option that I might be missing?
🚫 2
j
That module is already a horrible mess, what's another strand of spaghetti
🫠 1
j
You can also skip running bbtools entirely, but if you use batch mode (pass in more than 1 genome) it only gets applied to the first genome..
m
Would it be an option to add a patch to the conda recipe?
j
I'm not sure what a sensible patch would be - either we hard-code some new memory number (simple, but if we set it too high it might not work for others), or we make it configurable via command line (probably a serious patch!)
m
j
m
Perhaps it’s possible to patch the config and a bbtools_mem field that sources it’s value from the environment, with a default fallback?
Copy code
BBTOOLS_ARGS = {
        "memory": os.environ.get('BBTOOLS_MEM', '120Mb')
        "contig_break": 10,
        "scaffold_composition": False,
        "skip_bbtools": False,
    }
j
Perhaps we could just make it add one in here? https://gitlab.com/ezlab/busco/-/blob/master/src/busco/busco_tools/bbtools.py?ref_type=heads#L49
Copy code
if os.environ.get('BUSCO_BBTOOLS_MEM'):
    bbtools_job.add_parameter(f"--xmx {os.environ.get('BUSCO_BBTOOLS_MEM')}")
m
yeah sure
If you can produce a patch file, you can add it to the bioconda recipe and release a new build version
problem solved 😄
j
Just have to get it past the Bioconda guards... they might not like this
m
Just ping me 😉
❤️ 1
There’s plenty of recipes with patches
j
BUSCO already has two
m
see 😄 we’re not the only ones
Also, that might be a sign for people to start looking for alternatives, but that’s another matter I guess
@Jim Downie, did you test the patch?
j
Not yet
Verified now!
❤️ 1
m
Approved and merged
🎉 1
j
Thanks! 🤩