BEDGRAPHTOBIGWIG#
Convert *.bedGraph file to *.bw file (see http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/FOOTER.txt)
Example#
This wrapper can be used in the following way:
rule bedGraphToBigWig:
input:
bedGraph="{sample}.bedGraph",
chromsizes="genome.chrom.sizes"
output:
"{sample}.bw"
log:
"logs/{sample}.bed-graph_to_big-wig.log"
params:
"" # optional params string
wrapper:
"v3.0.1-5-gc155ca9/bio/ucsc/bedGraphToBigWig"
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#
ucsc-bedgraphtobigwig=445
Input/Output#
Input:
bedGraph
: Path to *.bedGraph filechromsizes
: Chrom sizes file, could be generated by twoBitInfo or downloaded from UCSC
Output:
Path to output ‘*.bw’ file
Code#
"""Snakemake wrapper for *.bedGraph to *.bw conversion using UCSC bedGraphToBigWig tool."""
# http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/FOOTER.txt
__author__ = "Roman Chernyatchik"
__copyright__ = "Copyright (c) 2019 JetBrains"
__email__ = "roman.chernyatchik@jetbrains.com"
__license__ = "MIT"
from snakemake.shell import shell
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
extra = snakemake.params.get("extra", "")
shell(
"bedGraphToBigWig {extra}"
" {snakemake.input.bedGraph} {snakemake.input.chromsizes}"
" {snakemake.output} {log}"
)