SAMTOOLS FAIDX

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

index reference sequence in FASTA format from reference sequence.

Example

This wrapper can be used in the following way:

rule samtools_index:
    input:
        "{sample}.fa",
    output:
        "{sample}.fa.fai",
    log:
        "{sample}.log",
    params:
        extra="",  # optional params string
    wrapper:
        "v3.8.0-1-g149ef14/bio/samtools/faidx"

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

Software dependencies

  • samtools=1.19.2

  • snakemake-wrapper-utils=0.6.2

Input/Output

Input:

  • reference sequence file (.fa)

Output:

  • indexed reference sequence file (.fai)

Authors

  • Michael Chambers

  • Filipe G. Vieira

Code

__author__ = "Michael Chambers"
__copyright__ = "Copyright 2019, Michael Chambers"
__email__ = "greenkidneybean@gmail.com"
__license__ = "MIT"


from snakemake.shell import shell
from snakemake_wrapper_utils.samtools import get_samtools_opts

samtools_opts = get_samtools_opts(
    snakemake, parse_threads=False, parse_write_index=False, parse_output_format=False
)
extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=True, stderr=True)

shell("samtools faidx {samtools_opts} {extra} {snakemake.input[0]} {log}")