PALADIN INDEX

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

Index a protein fasta file for mapping with paladin. PALADIN is a protein sequence alignment tool designed for the accurate functional characterization of metagenomes.

Example

This wrapper can be used in the following way:

rule paladin_index:
    input:
        "prot.fasta",
    output:
        "index/prot.fasta.bwt"
    log:
        "logs/paladin/prot_index.log"
    params:
      reference_type=3
    wrapper:
        "v3.8.0-1-g149ef14/bio/paladin/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

  • paladin=1.4.6

  • samtools=1.19.2

Input/Output

Input:

  • protein fasta file

Output:

  • file indexed for paladin mapping

Authors

    1. Tessa Pierce

Code

"""Snakemake wrapper for Paladin Index."""

__author__ = "N. Tessa Pierce"
__copyright__ = "Copyright 2019, N. Tessa Pierce"
__email__ = "ntpierce@gmail.com"
__license__ = "MIT"


# this wrapper temporarily copies your assembly into the output dir
# so that all the paladin output files end up in the desired spot

from snakemake.shell import shell

log = snakemake.log_fmt_shell(stdout=True, stderr=True)
extra = snakemake.params.get("extra", "")

input_assembly = snakemake.input
annotation = snakemake.input.get("gff", "")
paladin_index = str(snakemake.output)
reference_type = snakemake.params.get("reference_type", "3")
assert int(reference_type) in [1, 2, 3, 4]
ref_type_cmd = "-r" + str(reference_type)

output_base = paladin_index.rsplit(".bwt")[0]

shell("cp {input_assembly} {output_base}")
shell("paladin index {ref_type_cmd} {output_base} {annotation} {extra} {log}")
shell("rm -f {output_base}")