parseHomerOutput: load output from HOMER findMotifsGenome.pl into R

View source: R/motif_enrichment_HOMER.R

parseHomerOutputR Documentation

load output from HOMER findMotifsGenome.pl into R

Description

Parse HOMER output files into R data structures.

Usage

parseHomerOutput(infiles, pseudocount.log2enr = 8, p.adjust.method = "BH")

Arguments

infiles

HOMER output files to be parsed.

pseudocount.log2enr

A numerical scalar with the pseudocount to add to foreground and background counts when calculating log2 motif enrichments

p.adjust.method

A character scalar selecting the p value adjustment method (used in p.adjust).

Value

A list of nine components (negLog10P, negLog10Padj, pearsonResid, expForegroundWgtWithHits, log2enr, sumForegroundWgtWithHits and sumBackgroundWgtWithHits), seven containing each a motif (rows) by bin (columns) matrix with raw -log10 P values, -log10 adjusted P values, the expected number of foreground sequences with hits, the observed number of foreground and background sequences with hits, and motif enrichments as Pearson residuals (pearsonResid) and as log2 ratios (log2enr), and two containing the total foreground and background weight (totalWgtForeground, totalWgtBackground).

Examples

outfile <- system.file("extdata", "homer_output.txt.gz",
                       package = "monaLisa")
res <- parseHomerOutput(infiles = c(bin1 = outfile))
head(res$negLog10P)


fmicompbio/monaLisa documentation built on Nov. 2, 2024, 1:33 p.m.