motifCloud: plot a DNA sequence logo cloud

Description Usage Arguments Value Examples

View source: R/motifCloud.R

Description

Plot a DNA sequence logo cloud

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
motifCloud(
  motifSig,
  rcpostfix = "(RC)",
  layout = c("rectangles", "cloud", "tree"),
  scale = c(6, 0.5),
  rot.per = 0.1,
  draw.box = TRUE,
  draw.freq = TRUE,
  box.col = "gray",
  freq.col = "gray",
  group.col = NULL,
  groups = NULL,
  draw.legend = FALSE,
  font = "Helvetica-Bold",
  ic.scale = TRUE
)

Arguments

motifSig

an object of class motifSig

rcpostfix

postfix for reverse-complement motif names, default: (RC)

layout

layout of the logo cloud, rectangles, cloud or tree

scale

A vector of length 2 indicating the range of the size of the sequence logo.

rot.per

proportion sequence logo with 90 degree rotation. Only work for "cloud" layout

draw.box

draw box for each sequence logo or not

draw.freq

label frequency of each signature or not

box.col

color of box for each sequence logo

freq.col

color of frequency label

group.col

color setting for groups

groups

a named vectors of motif groups

draw.legend

draw group color legend or not

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.

Value

none

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
  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)})
    motifSig <- motifSignature(pfms, phylog, cutoffPval=0.0001)
    motifCloud(motifSig)
  }

motifStack documentation built on Nov. 8, 2020, 7:43 p.m.