LOGLOG

https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/bbtools/loglog?label=version%20update%20pull%20requests

Run LogLog to estimate memory requirements.

URL: https://jgi.doe.gov/data-and-tools/software-tools/bbtools/bb-tools-user-guide/bbnorm-guide/

Example

This wrapper can be used in the following way:

rule loglog_se:
    input:
        sample=["reads/se/{sample}.fastq"],
    log:
        "logs/se/{sample}.log",
    params:
        extra="buckets=2048 seed=1234",
    threads: 2
    resources:
        mem_mb=1024,
    wrapper:
        "v1.25.0/bio/bbtools/loglog"


rule loglog_pe:
    input:
        sample=["reads/pe/{sample}.1.fastq", "reads/pe/{sample}.2.fastq"],
    log:
        "logs/pe/{sample}.log",
    params:
        extra="buckets=2048 seed=1234",
    threads: 2
    resources:
        mem_mb=1024,
    wrapper:
        "v1.25.0/bio/bbtools/loglog"

Note that input, output and log file paths can be chosen freely.

When running with

snakemake --use-conda

the software dependencies will be automatically deployed into an isolated environment before execution.

Notes

  • The java_opts param allows for additional arguments to be passed to the java compiler, e.g. -XX:ParallelGCThreads=10 (not for -XmX or -Djava.io.tmpdir, since they are handled automatically).

Software dependencies

  • bbmap=39.01
  • python=3.11.0
  • snakemake-wrapper-utils=0.5.2

Params

  • extra: additional program arguments

Authors

  • Filipe G. Vieira

Code

__author__ = "Filipe G. Vieira"
__copyright__ = "Copyright 2023, Filipe G. Vieira"
__license__ = "MIT"


from snakemake.shell import shell
from snakemake_wrapper_utils.java import get_java_opts


java_opts = get_java_opts(snakemake)
extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=True, stderr=True)


n = len(snakemake.input.sample)
assert (
    n == 1 or n == 2
), "input->sample must have 1 (single-end) or 2 (paired-end) elements."

if n == 1:
    reads = "in={}".format(snakemake.input.sample)
else:
    reads = "in={} in2={}".format(*snakemake.input.sample)


shell("loglog.sh {java_opts} {reads} {extra} {log}")