transdecoder transdecoder predict

transdecoder predict

Version:
5.5.0
Identifier: TL_332881_59.db
Tool
1"""Snakemake wrapper for Transdecoder Predict"""
2# Snakemake wrappers are provided by Truwl to teach the internal mechanics of Snakemake recipes. View https://github.com/snakemake/snakemake-wrappers to learn how to use wrappers.
3
4__author__ = "N. Tessa Pierce"
5__copyright__ = "Copyright 2019, N. Tessa Pierce"
6__email__ = "ntpierce@gmail.com"
7__license__ = "MIT"
8
9from os import path
10from snakemake.shell import shell
11
12extra = snakemake.params.get("extra", "")
13
14log = snakemake.log_fmt_shell(stdout=True, stderr=True)
15
16addl_outputs = ""
17pfam = snakemake.input.get("pfam_hits", "")
18if pfam:
19    addl_outputs += " --retain_pfam_hits " + pfam
20
21blast = snakemake.input.get("blastp_hits", "")
22if blast:
23    addl_outputs += " --retain_blastp_hits " + blast
24
25input_fasta = str(snakemake.input.fasta)
26if input_fasta.endswith("gz"):
27    input_fa = input_fasta.rsplit(".gz")[0]
28    shell("gunzip -c {input_fasta} > {input_fa}")
29else:
30    input_fa = input_fasta
31
32shell("TransDecoder.Predict -t {input_fa} {addl_outputs} {extra} {log}")
33