HOMER FINDPEAKS
Find ChIP- or ATAC-Seq peaks with the HOMER suite. For more information, please see the documentation.
Example
This wrapper can be used in the following way:
rule homer_findPeaks:
input:
# tagDirectory of sample
tag="tagDir/{sample}",
# tagDirectory of control background sample - optional
control="tagDir/control"
output:
"{sample}_peaks.txt"
params:
# one of 7 basic modes of operation, see homer manual
style="histone",
extra="" # optional params, see homer manual
log:
"logs/findPeaks/{sample}.log"
wrapper:
"v5.0.1/bio/homer/findPeaks"
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
homer=4.11
Code
__author__ = "Jan Forster"
__copyright__ = "Copyright 2020, Jan Forster"
__email__ = "j.forster@dkfz.de"
__license__ = "MIT"
from snakemake.shell import shell
import os.path as path
import sys
extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
control = snakemake.input.get("control", "")
if control == "":
control_command = ""
else:
control_command = "-i " + control
shell(
"(findPeaks"
" {snakemake.input.tag}"
" -style {snakemake.params.style}"
" {extra}"
" {control_command}"
" -o {snakemake.output})"
" {log}"
)