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 the second sequences (sorted by lognormal background P-value)
head(motifRankingForSequence(res, 2))
# return unique TFs enriched in sequence 2
head(motifRankingForSequence(res, 2, unique=TRUE))
# sorted by raw affinity instead of P-value
head(motifRankingForSequence(res, 2, bg=FALSE))
# show IDs instead of target TF names
head(motifRankingForSequence(res, 2, id=TRUE))
# output the rank instead of P-value
head(motifRankingForSequence(res, 2, rank=TRUE))
}
Run the code above in your browser using DataLab