makeBackground {PWMEnrich} | R Documentation |
This is a convenience front-end function to compile new backgrounds for a set of PFMs. Currently only supports D. melanogaster, but in the future should support other common organisms as well.
makeBackground( motifs, organism = "dm3", type = "logn", quick = FALSE, bg.seq = NULL, ... )
motifs |
a list of position frequency matrices (4xL matrices) |
organism |
either a name of the organisms for which the background should be compiled
(currently supported names are "dm3", "mm9" and "hg19"), or a |
type |
the type of background to be compiled. Possible types are:
|
quick |
if to preform fitting on a reduced set of 100 promoters. This will not give as good results but is much quicker than fitting to all the promoters (~10k). Usage of this parameter is recommended only for testing and rough estimates. |
bg.seq |
a set of background sequences to use. This parameter overrides the "organism" and "quick" parameters. |
... |
other named parameters that backend function makePWM***Background functions take. |
Robert Stojnic, Diego Diez
# 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(requireNamespace("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)