A new representation of DNA motif logo via ggplot2.
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))
# require(devtools) # load_all("../") library(motiflogo) motiflogo(pwm)
#the length of xlabel should same as the the number of columns in PWM. xlabel <- c("T", "G", "A", "T", "C", "A\nC", "A", "A", "C","A", "A", "T") motiflogo(pwm, xlabel=xlabel) motiflogo(pwm, xlabel=xlabel, addpoint=TRUE)
https://github.com/zhilongjia/motiflogo/issues
System info
sessionInfo()
The END
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.