LIFTOFF

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

Lift features from one genome assembly to another

URL: https://github.com/agshumate/Liftoff

Example

This wrapper can be used in the following way:

rule liftoff:
    input:
        ref="{ref}.fasta.gz",
        tgt="{tgt}.fasta.gz",
        ann="{ann}.gff.gz",
    output:
        main="{ref}_{ann}_{tgt}.gff3",
        unmapped="{ref}_{ann}_{tgt}.unmapped.txt",
    log:
        "logs/liftoff_{ref}_{ann}_{tgt}.log",
    params:
        extra="",
    threads: 1
    wrapper:
        "v3.9.0-14-g476823b/bio/liftoff"

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

  • liftoff=1.6.3

Input/Output

Input:

  • A fasta formatted reference genome file

  • A fasta formatted target genome file

  • A GFF/GTF formatted annotations file

Output:

  • A GFF formatted file containing the mapped annotations

  • A GFF formatted file containing the unmapped annotations

Authors

  • Tomás Di Domenico

Code

"""Snakemake wrapper for liftoff"""

__author__ = "Tomás Di Domenico"
__copyright__ = "Copyright 2021, Tomás Di Domenico"
__email__ = "tdido@tdido.ar"
__license__ = "MIT"

from snakemake.shell import shell

log = snakemake.log_fmt_shell(stdout=True, stderr=True)

extra = snakemake.params.get("extra", "")

shell(
    "liftoff "  # tool
    "-g {snakemake.input.ann} "  # annotation file to lift over in GFF or GTF format
    "-o {snakemake.output.main} "  # main output
    "-u {snakemake.output.unmapped} "  # unmapped output
    "{extra} "  # optional parameters
    "{snakemake.input.tgt} "  # target fasta genome to lift genes to
    "{snakemake.input.ref} "  # reference fasta genome to lift genes from
    "{log}"  # Logging
)