DRAGMAP

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

Build hash table for Dragmap read mapper.

URL: https://github.com/Illumina/DRAGMAP

Example

This wrapper can be used in the following way:

rule dragmap_build:
    input:
        ref="{genome}.fasta",
    output:
        idx=multiext(
            "{genome}/",
            "hash_table.cfg",
            "hash_table.cfg.bin",
            "hash_table.cmp",
            "hash_table_stats.txt",
            "reference.bin",
            "ref_index.bin",
            "repeat_mask.bin",
            "str_table.bin",
        ),
    log:
        "logs/dragmap/{genome}.build.log",
    params:
        extra="",
    threads: 2
    wrapper:
        "v3.8.0-49-g6f33607/bio/dragmap/build"

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

  • dragmap=1.3.0

Input/Output

Input:

  • ref: Path to reference genome sequence (Fasta formatted)

Output:

  • idx: Path to reference hash table

Params

  • extra: Optional parameters, besides –ht-num-threads, –build-hash-table, –ht-reference, and –output-directory

Authors

  • Filipe G. Vieira

Code

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


from pathlib import Path
from snakemake.shell import shell


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


# Prefix that should be used for the database
prefix = Path(snakemake.output[0]).parent


shell(
    "dragen-os"
    " --ht-num-threads {snakemake.threads}"
    " --build-hash-table true"
    " --ht-reference {snakemake.input[0]}"
    " --output-directory {prefix}"
    " {extra}"
    " {log}"
)