MERYL SETS

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

A genomic k-mer counter (and sequence utility) with nice features.

URL: https://github.com/marbl/meryl

Example

This wrapper can be used in the following way:

rule meryl_union:
    input:
        "{genome}",
        "{genome}",
    output:
        directory("{genome}_union/"),
    log:
        "logs/{genome}.union.log",
    params:
        command="union-sum",
    wrapper:
        "v3.9.0/bio/meryl/sets"


rule meryl_intersect:
    input:
        "{genome}",
        "{genome}",
    output:
        directory("{genome}_intersect/"),
    log:
        "logs/{genome}.intersect.log",
    params:
        command="intersect-max",
    wrapper:
        "v3.9.0/bio/meryl/sets"


rule meryl_subtract:
    input:
        "{genome}",
        "{genome}",
    output:
        directory("{genome}_subtract/"),
    log:
        "logs/{genome}.subtract.log",
    params:
        command="subtract",
    wrapper:
        "v3.9.0/bio/meryl/sets"


rule meryl_difference:
    input:
        "{genome}",
        "{genome}",
    output:
        directory("{genome}_difference/"),
    log:
        "logs/{genome}.difference.log",
    params:
        command="difference",
    wrapper:
        "v3.9.0/bio/meryl/sets"

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 command param allows to specify how to handle the kmer sets: union (number of inputs) [default], union-min (union with minimum count), union-max (union with maximum count), union-sum (union with sum of the counts), intersect (intersect with counts in the first input), intersect-min (intersect with minimum count), intersect-max (intersect with maximum count), intersect-sum (intersect with sum of counts), subtract (counts from first input, subtracting counts from the other inputs), difference (counts from first input, but none of the other inputs), or symmetric-difference (exactly one input).

Software dependencies

  • meryl=2013

Input/Output

Input:

  • meryl database(s)

Output:

  • meryl database

Authors

  • Filipe G. Vieira

Code

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


from snakemake.shell import shell


log = snakemake.log_fmt_shell(stdout=True, stderr=True)


command = snakemake.params.get("command", "union")
assert command in [
    "union",
    "union-min",
    "union-max",
    "union-sum",
    "intersect",
    "intersect-min",
    "intersect-max",
    "intersect-sum",
    "subtract",
    "difference",
    "symmetric-difference",
], "invalid command specified."


shell("meryl {command} {snakemake.input} output {snakemake.output} {log}")