db <- system.file("extdata", "Bacteria_175seqs.sqlite", package="DECIPHER")
dna <- SearchDB(db)
BrowseSeqs(dna, colWidth=100, highlight=1)
# color bases in alternating groups with a different color scheme
BrowseSeqs(dna[1:5],
colorPatterns=seq(1, width(dna)[1], 10),
patterns=c("A", "C", "G", "T", "-"),
colors=c("#1E90FF", "#32CD32", "#9400D3", "#000000", "#EE3300"))
# color all restriction sites
data(RESTRICTION_ENZYMES)
sites <- RESTRICTION_ENZYMES
sites <- gsub("[^A-Z]", "", sites) # remove non-letters
sites <- DNAStringSet(sites)
rc_sites <- DNAStringSet(sites)
w <- which(sites != rc_sites)
sites <- c(sites, rc_sites[w])
sites <- sites[order(nchar(sites))] # match shorter sites first
dna <- SearchDB(db, remove="all") # unaligned sequences
BrowseSeqs(dna, patterns=sites)
Run the code above in your browser using DataLab