View source: R/plotMotifStackWithPhylog.R
plotMotifStackWithPhylog | R Documentation |
plot sequence logo stacks with a ape4-style phylogenic tree
plotMotifStackWithPhylog(
phylog,
pfms = NULL,
f.phylog = 0.3,
f.logo = NULL,
cleaves = 1,
cnodes = 0,
labels.leaves = names(phylog$leaves),
clabel.leaves = 1,
labels.nodes = names(phylog$nodes),
clabel.nodes = 0,
font = "sans",
ic.scale = TRUE,
...
)
phylog |
an object of class phylog |
pfms |
a list of objects of class pfm |
f.phylog |
a size coefficient for tree size (a parameter to draw the tree in proportion to leaves label) |
f.logo |
a size coefficient for the motif |
cleaves |
a character size for plotting the points that represent the leaves, used with par("cex")*cleaves. If zero, no points are drawn |
cnodes |
a character size for plotting the points that represent the nodes, used with par("cex")*cnodes. If zero, no points are drawn |
labels.leaves |
a vector of strings of characters for the leaves labels |
clabel.leaves |
a character size for the leaves labels, used with par("cex")*clavel.leaves |
labels.nodes |
a vector of strings of characters for the nodes labels |
clabel.nodes |
a character size for the nodes labels, used with par("cex")*clabel.nodes. If zero, no nodes labels are drawn |
font |
font of logo |
ic.scale |
logical If TRUE, the height of each column is proportional to its information content. Otherwise, all columns have the same height. |
... |
not used. |
none
plot.phylog
if(interactive() || Sys.getenv("USER")=="jianhongou"){
library("MotifDb")
matrix.fly <- query(MotifDb, "Dmelanogaster")
motifs <- as.list(matrix.fly)
motifs <- motifs[grepl("Dmelanogaster-FlyFactorSurvey-", names(motifs), fixed=TRUE)]
names(motifs) <- gsub("Dmelanogaster_FlyFactorSurvey_", "",
gsub("_FBgn[0-9]+$", "",
gsub("[^a-zA-Z0-9]","_",
gsub("(_[0-9]+)+$", "", names(motifs)))))
motifs <- motifs[unique(names(motifs))]
pfms <- sample(motifs, 50)
hc <- clusterMotifs(pfms)
library(ade4)
phylog <- ade4::hclust2phylog(hc)
leaves <- names(phylog$leaves)
pfms <- pfms[leaves]
pfms <- mapply(pfms, names(pfms), FUN=function(.ele, .name){
new("pfm",mat=.ele, name=.name)})
pfms <- DNAmotifAlignment(pfms, minimalConsensus=3)
plotMotifStackWithPhylog(phylog, pfms, f.phylog=0.3,
cleaves = 0.5, clabel.leaves = 0.7)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.