if(require("PWMEnrich.Dmelanogaster.background")){
###
# load the pre-compiled lognormal background
data(PWMLogn.dm3.MotifDb.Dmel)
# scan two sequences for motif enrichment
sequences = list(DNAString("GAAGTATCAAGTGACCAGTAAGTCCCAGATGA"), DNAString("AGGTAGATAGAACAGTAGGCAATGAAGCCGATG"))
res = motifEnrichment(sequences, PWMLogn.dm3.MotifDb.Dmel)
# most enriched in both sequences (sorted by lognormal background P-value)
head(motifRankingForGroup(res))
# Return a non-redundant set of TFs
head(motifRankingForGroup(res, unique=TRUE))
# sorted by raw affinity instead of P-value
head(motifRankingForGroup(res, bg=FALSE))
# show IDs instead of target TF names
head(motifRankingForGroup(res, id=TRUE))
# output the rank instead of P-value
head(motifRankingForGroup(res, rank=TRUE))
}
Run the code above in your browser using DataLab