PYROE ID-TO-NAME

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

Create a 2-column tab-separated file mapping IDs to names

URL: https://pyroe.readthedocs.io/en/latest/geneid_to_name.html

Example

This wrapper can be used in the following way:

rule test_pyroe_idtoname:
    input:
        "annotation.{format}",
    output:
        "id2name.{format}.tsv",
    threads: 1
    log:
        "logs/{format}.log",
    params:
        extra="",
    wrapper:
        "v3.9.0-14-g476823b/bio/pyroe/idtoname"

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

Format is automatically inferred from input files.

Software dependencies

  • pyroe=0.9.3

Input/Output

Input:

  • Path to genome annotation (GTF or GFF3)

Output:

  • Path to gene id <-> gene names mapping

Params

  • extra: Optional parameters to be passed to pyroe

Authors

Code

__author__ = "Thibault Dayris"
__copyright__ = "Copyright 2023, Thibault Dayris"
__email__ = "thibault.dayris@gustaveroussy.fr"
__license__ = "MIT"


from snakemake.shell import shell


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

if str(snakemake.input).endswith(("gtf", "gtf.gz")):
    extra += " --format GTF "
elif str(snakemake.input).endswith(("gff", "gff.gz", "gff3", "gff3.gz")):
    extra += " --format GFF3 "

shell("pyroe id-to-name {extra} {snakemake.input} {snakemake.output} {log}")