COOLTOOLS GENOME_GC

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

Calculate GC content for a genome in bins

URL: https://github.com/open2c/cooltools

Example

This wrapper can be used in the following way:

rule cooltools_genome_gc:
    input:
        bins="ASM584v2/bins_100000.bed",  # 100000 bins
        fasta="ASM584v2/ASM584v2.fa",  # genome fasta for E. coli
    output:
        "gc_100000.tsv",
    params:
        extra="",
    threads: 1
    log:
        "logs/gc.log",
    wrapper:
        "v3.12.1-18-g9861c57/bio/cooltools/genome/gc"

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

  • cooltools=0.5.4

Input/Output

Input:

  • .bed file with bin coordinates

  • fasta file with the genome sequence

Output:

  • A tsv file with GC content in bins

Params

  • extra: Any additional arguments to pass

Authors

  • Ilya Flyamer

Code

__author__ = "Ilya Flyamer"
__copyright__ = "Copyright 2022, Ilya Flyamer"
__email__ = "flyamer@gmail.com"
__license__ = "MIT"

from snakemake.shell import shell

## Extract arguments
extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=False, stderr=True)
shell(
    "(cooltools genome gc"
    " {snakemake.input.bins} {snakemake.input.fasta} {extra} > {snakemake.output})"
    " {log} "
)