motifSignature: get signatures from motifs

Description Usage Arguments Value Examples

View source: R/motifSignature.R

Description

extract signatures from multiple motifs by distance calculated from STAMP

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
motifSignature(
  pfms,
  phylog,
  cutoffPval,
  groupDistance,
  rcpostfix = "(RC)",
  min.freq = 2,
  trim = 0.2,
  families = list(),
  sort = TRUE
)

Arguments

pfms

a list of objects of class pfm

phylog

an object of class phylog

cutoffPval

pvalue for motifs to merge.

groupDistance

maxmal distance of motifs in the same group

rcpostfix

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

min.freq

signatures with frequency below min.freq will not be plotted

trim

minimal information content for each position of signature

families

for each family, the motif number in one signature should only count as 1

sort

sort the signatures by frequency or not.

Value

an Object of class motifSig

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
  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)
  }

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