DIAMOND BLASTX
DIAMOND is a sequence aligner for protein and translated DNA searches, designed for high performance analysis of big sequence data.
URL: https://github.com/bbuchfink/diamond/wiki
Example
This wrapper can be used in the following way:
rule diamond_blastx:
input:
fname_fastq = "{sample}.fastq",
fname_db = "db.dmnd"
output:
fname = "{sample}.tsv.gz"
log:
"logs/diamond_blastx/{sample}.log"
params:
extra="--header --compress 1"
threads: 8
wrapper:
"v3.8.0-1-g149ef14/bio/diamond/blastx"
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
diamond=2.1.9
Input/Output
Input:
fname_fastq
: Fastq query filefname_db
: Path to diamon database
Output:
fname
: Path to query result
Params
extra
: Optional parameters besides –threads, –db, –query, and –out.
Code
__author__ = "Kim Philipp Jablonski"
__copyright__ = "Copyright 2020, Kim Philipp Jablonski"
__email__ = "kim.philipp.jablonski@gmail.com"
__license__ = "MIT"
from snakemake.shell import shell
extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=False, stderr=True)
shell(
"diamond blastx"
" --threads {snakemake.threads}"
" --db {snakemake.input.fname_db}"
" --query {snakemake.input.fname_fastq}"
" --out {snakemake.output.fname}"
" {extra}"
" {log}"
)