JELLYFISH_COUNT

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

Count k-mers in a fastn file using jellyfish.

URL: https://github.com/gmarcais/Jellyfish

Example

This wrapper can be used in the following way:

rule jellyfish_count:
    input:
        "{prefix}.fasta",
    output:
        "{prefix}.jf",
    log:
        "{prefix}.jf.log",
    params:
        kmer_length=21,
        size="1G",
        extra="--canonical",
    threads: 2
    wrapper:
        "v3.7.0/bio/jellyfish/count"

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.

Software dependencies

  • kmer-jellyfish=2.3.1

Input/Output

Input:

  • sequence FASTA file

Output:

  • kmer count jf file

Authors

  • William Rowell

Code

__author__ = "William Rowell"
__copyright__ = "Copyright 2020, William Rowell"
__email__ = "wrowell@pacb.com"
__license__ = "MIT"

from snakemake.shell import shell

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


shell(
    """
    (jellyfish count \
        {extra} \
        --mer-len={snakemake.params.kmer_length} \
        --size={snakemake.params.size} \
        --threads={snakemake.threads} \
        --output={snakemake.output} \
        {snakemake.input}) {log}
    """
)