# load in the two example de-novo motifs
motifs = readMotifs(system.file(package="PWMEnrich", dir="extdata", file="example.transfac"), remove.acc=TRUE)
## Not run:
# # construct lognormal background
# bg.logn = makeBackground(motifs, organism="dm3", type="logn")
#
# # alternatively, any BSgenome object can also be used
# if(require("BSgenome.Dmelanogaster.UCSC.dm3"))
# bg.logn = makeBackground(motifs, organism=Dmelanogaster, type="logn")
#
# # construct a Z-score of hits with P-value background
# bg.pval = makeBackground(motifs, organism="dm3", type="pval", p.value=1e-3)
#
# # now we can use them to scan for enrichment in sequences (in this case there is a consensus Tin binding site)
# motifEnrichment(DNAString("TGCATCAAGTGTGTAGTG"), bg.logn)
# motifEnrichment(DNAString("TGCATCAAGTGTGTAGTG"), bg.pval)
# ## End(Not run)
Run the code above in your browser using DataLab