BARRNAP
BAsic Rapid Ribosomal RNA Predictor
URL: https://github.com/tseemann/barrnap
Example
This wrapper can be used in the following way:
rule barrnap:
input:
fasta="{sample}.fasta",
output:
gff="{sample}.gff",
fasta="{sample}_hits.fasta",
params:
kingdom="bac",
extra="",
threads: 1
log:
"logs/barrnap/{sample}.log",
wrapper:
"v4.6.0-24-g250dd3e/bio/barrnap"
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
Multiple threads can be used during nhmmer search.
Software dependencies
barrnap=0.9
Input/Output
Input:
fasta
: query fasta file
Output:
gff
: The rRNA locations in GFF3 format.fasta
: Optional. Fasta file with the hit sequences.
Params
extra
: additional parameterskingdom
: database to use, either Bacteria:bac, Archaea:arc, Eukaryota:euk or Metazoan Mitochondria:mito.
Code
"""Snakemake wrapper for barrnap."""
__author__ = "Curro Campuzano Jiménez"
__copyright__ = "Copyright 2023, Curro Campuzano Jiménez"
__email__ = "campuzanocurro@gmail.com"
__license__ = "MIT"
from snakemake.shell import shell
log = snakemake.log_fmt_shell(stdout=False, stderr=True)
extra = snakemake.params.get("extra", "")
kingdom = snakemake.params.get("kingdom", "bac")
fasta_out = snakemake.output.get("fasta")
if fasta_out:
extra += f" -o {fasta_out}"
shell(
"barrnap"
" --threads {snakemake.threads}"
" -k {kingdom}"
" {extra}"
" < {snakemake.input.fasta}"
" > {snakemake.output.gff}"
" {log}"
)