runLayerBinding: Run the layer binding simulation

View source: R/runLayerBinding.R

runLayerBindingR Documentation

Run the layer binding simulation

Description

Description text here

Usage

runLayerBinding(
  layerList,
  factorSet,
  iterations = 1,
  bindingFactorFreqs = rep(1, length(factorSet)),
  watch.function = function(x) {
 },
  collect.stats = FALSE,
  target.layer = 2,
  verbose = FALSE,
  ...
)

Arguments

layerList

a "Layerlist" object containing a layerSet and other meta-data

factorSet

a "list" of "bindingFactor" objects

iterations

how many changes to make NEED TO RENAME THIS

bindingFactorFreqs

the relative proportions of each "bindingFactor" in "factorSet"

watch.function

have this function execute during each iteration e.g. print something

collect.stats

collect a table of stats each iteration

target.layer

NOT IMPLEMENTED

verbose

give more output

Value

A list containing a "LayerSet" and meta-data, a.k.a. a "LayerList"

See Also

runLayerBinding.BSgenome matchBindingFactor modifyLayerByBindingFactor.Views

Examples

require(Biostrings)     # hopefully this should be available?!

basicLayerList <- createLayerList.DNAstring(seq=DNAString("ACGTTGAAGT"), layerNames=c( "LAYER.1"))

simpleBindingFactor <- createBindingFactor.layer_region(name="simpleBF")

runLayerBinding(basicLayerList, factorSet= list(simpleBF = simpleBindingFactor))  # not working.

# The above find a match to a single DNA pattern in the sequence and is not different from using matchPattern()
# Here, we model two layers on the sequence and a second binding factor that only responds to changes 
# that have already been made to LAYER.1

twoLayerList <- createLayerList.DNAstring(seq=DNAString("ACGTTGCCATAAACGTTGCCATAAGTGT"), 
               layerNames=c( "LAYER.1", "LAYER.2"))

bfList <- list( DNA_A = createBindingFactor.DNA_motif(name="DNA_A",patternString = "CAT" ) ,
                LAYER_1_2 = createBindingFactor.layer_region(name="LAYER_1_2", 
                                                             profile.layers =c("LAYER.1"), profile.marks = c(1), 
                                                             mod.layers = c("LAYER.2"), mod.marks = c(1)) )



runLayerBinding(twoLayerList, factorSet= bfList)  
runLayerBinding(twoLayerList, factorSet= rev(bfList))     # should not produce hits on LAYER.2



davetgerrard/GenomicLayers documentation built on April 23, 2024, 3:55 p.m.