reorderUPGMAtree: re-order UPGMA tree

Description Usage Arguments Value Author(s) Examples

View source: R/reorderUPGMAtree.R

Description

re-order the UPGMA tree by adjacent motif distance

Usage

1
reorderUPGMAtree(phylog, motifs, rcpostfix = "(RC)")

Arguments

phylog

an object of phylog

motifs

a list of objects of pfm

rcpostfix

the postfix for reverse complements

Value

an object of phylog

Author(s)

Jianhong Ou

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  if(interactive()){
    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)
    jaspar.scores <- MotIV::readDBScores(file.path(find.package("MotIV"), 
                                   "extdata", "jaspar2010_PCC_SWU.scores"))
    d <- MotIV::motifDistances(pfms)
    hc <- MotIV::motifHclust(d, method="average")
    phylog <- hclust2phylog(hc)
    reorderUPGMAtree(phylog, pfms)
  }

motifStack documentation built on July 24, 2018, 2 a.m.