berrylogo.matrix: Generates a Berry logo in ggplot from a positional weight...

Description Usage Arguments Value Examples

View source: R/berrylogo.r

Description

Generates a Berry logo in ggplot from a positional weight matrix

Usage

1
berrylogo.matrix(pwm, gc_content = 0.41, zero = 1e-04, base = exp(1))

Arguments

pwm

matrix of fractional nucleotide frequencies 0.00-1.00 here rows are A, C, G, T and columns are position

gc_content

optional the GC content of the source genome

zero

optional a pseudocount placeholder estimate for true frequency when 0 is observed

base

the log base to use, exp(1) by default

Value

A ggplot2 object, use print() to display

Examples

1
2
3
4
5
6
7
8
9
freqs<-matrix(data = c(0.25,0.65,0.87,0.92,0.16,0.16,0.04,0.98,0.98
,1.00,0.02,0.10,0.10,0.80,0.98,0.91,0.07,0.07,0.11,0.05,0.04,0.00
,0.26,0.17,0.00,0.01,0.00,0.00,0.29,0.17,0.01,0.03,0.00,0.00,0.32
,0.32,0.53,0.26,0.07,0.02,0.53,0.18,0.96,0.01,0.00,0.00,0.65,0.01
,0.89,0.17,0.01,0.09,0.59,0.12,0.11,0.04,0.02,0.06,0.05,0.49,0.00
,0.00,0.02,0.00,0.04,0.72,0.00,0.00,0.01,0.00,0.02,0.49)
,byrow = TRUE,nrow = 4,dimnames = list(c('A','C','G','T')))
p<-(freqs)
print(p)

leipzig/berrylogo documentation built on May 16, 2019, 8:12 p.m.