motiflogo: A new representation of DNA motif logo

Description Usage Arguments Author(s) Examples

Description

A new representation of DNA motif logo via ggplot2. Besides, the xlabel could be DNA or SNP.

Usage

1
2
(pwm, xlabel = NULL, ylabel = "Bits", tit = "Motif",
  addpoint = FALSE, scaleSize = c(5, 20))

Arguments

pwm

position weight matrix

xlabel

text of label in x-axis

ylabel

The default is Bits

tit

The default is Motif

addpoint

add point to the position of nt. The default is FALSE

scaleSize

the scale size of nt. ref scale_size

Author(s)

Zhilong Jia

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library()
pfm <- matrix(data=c(5, 3, 16, 1, 0, 17, 17, 0, 0, 16, 12, 8,
6, 9, 1, 1, 18,  1, 0, 0, 18,  1, 0, 2,
2,3, 1, 0, 0, 0, 0, 1, 0, 0, 1, 2,
5, 3, 0, 16, 0, 0, 1, 17,  0, 1, 5, 6),
byrow=TRUE,nrow=4,dimnames=list(c('A','C','G','T')))

pwm <- apply(pfm, 2, function(x) x/sum(x))

(pwm)

xlabel <- c("T", "G", "A", "T", "C", "A\nC", "A", "A", "C","A", "A", "T")
(pwm, xlabel=xlabel)
(pwm, xlabel=xlabel, addpoint=TRUE)

zhilongjia/motiflogo documentation built on May 4, 2019, 11:22 p.m.