STRLING INDEX
STRling (pronounced like “sterling”) is a method to detect large short tandem repeat (STR) expansions from short-read sequencing data. index
creates a bed file of large STR regions in the reference genome. This step is performed automatically as part of strling extract
. However, when running multiple samples, it is more efficient to do it once, then pass the file to strling extract using the -g
option. Documentation at: https://strling.readthedocs.io/en/latest/run.html
Example
This wrapper can be used in the following way:
rule strling_index:
input:
"reference/genome.fasta"
output:
index="reference/genome.fasta.str",
fai="reference/genome.fasta.fai"
params:
extra="" # optionally add further command line arguments
log:
"log/strling/index.log"
wrapper:
"v5.0.1/bio/strling/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
strling=0.5.2
Code
"""Snakemake wrapper for strling index"""
__author__ = "Christopher Schröder"
__copyright__ = "Copyright 2020, Christopher Schröder"
__email__ = "christopher.schroede@tu-dortmund.de"
__license__ = "MIT"
from snakemake.shell import shell
from os import path
# Creating log
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
# Placeholder for optional parameters
extra = snakemake.params.get("extra", "")
# Check inputs/arguments.
if len(snakemake.input) != 1:
raise ValueError("Please provide exactly one reference genome.")
shell(
"(strling index {snakemake.input[0]} "
"-g {snakemake.output.index} "
"{extra}) {log}"
)