write_homer_motif: Write Motif PWM in HOMER format

Description Usage Arguments Value Examples

View source: R/write_pwm.R

Description

Create a minimal HOMER formatted motif file based on PWM and required motif info.

Usage

1
2
3
4
5
6
7
8
write_homer_motif(
  motif_pwm,
  motif_name,
  log_odds_detection,
  consensus = NULL,
  file,
  append = TRUE
)

Arguments

motif_pwm

tibble with alphabet columns

motif_name

name of the sequence

log_odds_detection

the threshold for detecting given motif

consensus

the accepted consensus motif sequence [optional: calculated from pwm if not provided]

file

path to new motif file; suffix should be '.motif'

append

whether to overwrite existing file [default: TRUE, e.g. add on to existing file]

Value

nothing; called for its side-effect of producing HOMER motif file

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
knw_pwm <- read_known_results("inst/extdata/knownResults.txt", homer_dir = FALSE)

## Write multiple motifs
pwalk(list(motif_pwm = knw_pwm$motif_pwm,
           motif_name = knw_pwm$motif_name,
           log_odds_detection = knw_pwm$log_odds_detection),
      write_homer_motif, file = "test.motif", append = TRUE)

## End(Not run)

robertamezquita/marge documentation built on Sept. 30, 2020, 6:15 a.m.