Learn R Programming

motifStack (version 1.16.2)

getRankedUniqueMotifs: get the unique motif in each category grouped by distance

Description

to get the unique motif in a given category, eg by species.

Usage

getRankedUniqueMotifs(phylog, attr)

Arguments

phylog
an object of class phylog
attr
attribute used for category of motifs

Value

  • return a list:
  • uni.rankunique motif ranks
  • uni.lengthlength of unique motif grouped by distance
  • uni.listunique motif names grouped by distance

Examples

Run this code
if(interactive()){
        library("MotifDb")
        matrix.fly <- query(MotifDb, "Dmelanogaster")
        matrix.human <- query(MotifDb, "Hsapiens")
        pfms <- c(as.list(matrix.fly), as.list(matrix.human))
        pfms <- pfms[sample(1:length(pfms), 100)]
        jaspar.scores <- MotIV::readDBScores(file.path(find.package("MotIV"), 
                                   "extdata", "jaspar2010_PCC_SWU.scores"))
        d <- MotIV::motifDistances(lapply(pfms, pfm2pwm))
        hc <- MotIV::motifHclust(d, method="average")
        phylog <- hclust2phylog(hc)
        leaves <- names(phylog$leaves)
        attr <- gsub("^(.*?)_.*$", "\1", leaves)
        getRankedUniqueMotifs(phylog, attr)
    }

Run the code above in your browser using DataLab