SAMTOOLS FAIDX

index reference sequence in FASTA format from reference sequence. For more information see SAMtools documentation.

URL:

Example

This wrapper can be used in the following way:

rule samtools_index:
    input:
        "{sample}.fa"
    output:
        "{sample}.fa.fai"
    params:
        "" # optional params string
    wrapper:
        "v1.1.0/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.

Software dependencies

  • samtools==1.10

Input/Output

Input:

  • reference sequence file (.fa)

Output:

  • indexed reference sequence file (.fai)

Authors

  • Michael Chambers

Code

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


from snakemake.shell import shell

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

shell(
    "samtools faidx {snakemake.params} {snakemake.input[0]} > {snakemake.output[0]} {log}"
)