View source: R/createBindingFactor.layer_region.R
createBindingFactor.layer_region | R Documentation |
Create a new binding factor based on a simple pattern of marks on others layers and may (when used) set marks on other layers.
createBindingFactor.layer_region(
name,
type = "layer_region",
patternLength = 1,
patternString = NULL,
mismatch.rate = 0,
stateWidth = patternLength,
profile.layers = NULL,
profile.marks = NULL,
mod.layers = NULL,
mod.marks = NULL,
offset = 0,
offset.method = NULL,
offset.params = NULL,
align = "centre",
test.layer0.binding = FALSE,
test.mismatch.rate = 0.1,
max.pattern.tries = 1000,
min.DM.length = 2,
min.DR.length = 10,
verbose = FALSE
)
name |
give the binding factor a name |
type |
"layer_region" to differentiate from other types |
patternLength |
[= 1] length of pattern |
patternString |
= NOT USED in this case |
stateWidth |
the width of pattern to recognise on other layers, default is same as patternLength |
profile.layers |
a vector of named layers to set as a match |
profile.marks |
a vector of 0/1 to match the layers in profile.layers |
mod.layers |
a vector of named layers to alter on a match |
mod.marks |
a vector of 0/1 to set on the mod.layers |
offset |
0 integer value to indicate relative distance from pattern to apply modifications. Very simple. |
offset.method |
NULL a |
offset.params |
NULL a |
align |
"centre" |
test.layer0.binding |
when creating, test if the DNA sequence has a match. |
test.mismatch.rate |
proportion of mismatches to tolerate when testing |
max.pattern.tries |
NA |
min.DM.length |
NA |
min.DR.length |
NA |
verbose |
set to TRUE for more output |
"hits"
bf.LR <- createBindingFactor.layer_region("bf.LR", type="layer_region",
patternLength = 1,
stateWidth = 9, profile.layers = "LAYER.1",
profile.marks = 0, mod.layers = "LAYER.1", mod.marks = 1)
bf.LR1 <- createBindingFactor.layer_region("bf.LR1", type="layer_region", patternLength = 1, patternString = "N", profile.layers = "LAYER.1", profile.marks = 0, mod.layers = "LAYER.1", mod.marks = 1)
bf.LR2 <- createBindingFactor.layer_region("bf.LR2", type="layer_region", patternLength = 1, patternString = "N", profile.layers = "LAYER.1", profile.marks = 0) # profile but no mods
bf.LR3 <- createBindingFactor.layer_region("bf.LR3", type="layer_region", patternLength = 1, patternString = "N", mod.layers = "LAYER.1", mod.marks = 1) # no profile beyond LAYER.0 (genome)
# example of using an offset.method to pass a function
upDownFuncRnorm <- function(n, offset.mean, offset.sd) {
y <- round(rnorm(n, mean=offset.mean, sd=offset.sd))
z <- sample(c(1, -1), length(y), replace=T) # random vector of 1,-1 to negate half the values
return(round(y*z))
}
bf.LR4 <- createBindingFactor.layer_region("bf.LR4", type="layer_region",
patternLength = 10, profile.layers = "LAYER.1", profile.marks = 1,
mod.layers = "LAYER.1", mod.marks = 1,
offset.method=upDownFuncRnorm,
offset.params=list(offset.mean=50, offset.sd=15))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.