KALLISTO INDEX

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

Index a transcriptome using kallisto.

URL: https://github.com/pachterlab/kallisto

Example

This wrapper can be used in the following way:

rule kallisto_index:
    input:
        fasta="{transcriptome}.fasta",
    output:
        index="{transcriptome}.idx",
    params:
        extra="",  # optional parameters
    log:
        "logs/kallisto_index_{transcriptome}.log",
    threads: 1
    wrapper:
        "v4.6.0-24-g250dd3e/bio/kallisto/index"

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

  • kallisto=0.51.1

Input/Output

Input:

  • fasta: FASTA file to index

Output:

  • index: indexed file

Params

  • extra: Additional parameters

Authors

  • Joël Simoneau

Code

"""Snakemake wrapper for Kallisto index"""

__author__ = "Joël Simoneau"
__copyright__ = "Copyright 2019, Joël Simoneau"
__email__ = "simoneaujoel@gmail.com"
__license__ = "MIT"

from snakemake.shell import shell

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

# Placeholder for optional parameters
extra = snakemake.params.get("extra", "")

# Allowing for multiple FASTA files
fasta = snakemake.input.get("fasta")
assert fasta is not None, "input-> a FASTA-file is required"
fasta = " ".join(fasta) if isinstance(fasta, list) else fasta

shell(
    "kallisto index"  # Tool
    " --threads {snakemake.threads}"
    " {extra}"  # Optional parameters
    " --index {snakemake.output.index}"  # Output file
    " {fasta}"  # Input FASTA files
    " {log}"  # Logging
)