Skip to content

Instantly share code, notes, and snippets.

@kcha
Last active August 29, 2015 14:07
Show Gist options
  • Save kcha/b4cbe9edf78d045b0efa to your computer and use it in GitHub Desktop.
Save kcha/b4cbe9edf78d045b0efa to your computer and use it in GitHub Desktop.
#install if necessary
source("http://bioconductor.org/biocLite.R")
biocLite("seqLogo")
biocLite("Biostrings")
library(seqLogo)
library(Biostrings)
strings <- c("GATTACA", "GATAACA", "GATAAAA", "GATTAGA")
set <- DNAStringSet(strings)
pfm <- consensusMatrix(set)[DNA_BASES,]
seqLogo(pfm / colSums(pfm))
seqLogo(pfm / colSums(pfm), ic.scale = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment