Learn R Programming

DiffLogo (version 1.2.1)

diffLogoFromPwm: Draw DiffLogo from PWM

Description

Draws the difference of two sequence logos.

Usage

diffLogoFromPwm(pwm1, pwm2, ymin = 0, ymax = 0, stackHeight = shannonDivergence, baseDistribution = normalizedDifferenceOfProbabilities, sparse = FALSE, alphabet = DNA)

Arguments

pwm1
representation of the first position weight matrix (PWM) of type pwm, data.frame, or matrix
pwm2
representation of the second position weight matrix (PWM) of type pwm, data.frame, or matrix
ymin
minimum value on the y-axis
ymax
maximum value on the y-axis
stackHeight
function for the height of a stack at position i
baseDistribution
function for the heights of the individual bases
sparse
if TRUE margins are reduced and tickmarks are removed from the logo
alphabet
of type Alphabet

Examples

Run this code
motif_folder= "extdata/pwm"
motif_names = c("HepG2","MCF7","HUVEC","ProgFib")
motifs = list()
for (name in motif_names) {
  fileName = paste(motif_folder,"/",name,".txt",sep="")
  file = system.file(fileName, package = "DiffLogo")
  motifs[[name]] = as.matrix(read.delim(file,header=FALSE))
}

pwm1 = motifs[[motif_names[[1]]]]
pwm2 = motifs[[motif_names[[2]]]]

diffLogoFromPwm(pwm1 = pwm1, pwm2 = pwm2)

Run the code above in your browser using DataLab