Description Usage Arguments Author(s) Examples
process the bed file data to bin
1 | check_bed_bin(m_bed, bin = 2000)
|
m_bed |
|
bin |
Chao He
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (m_bed, bin = 2000)
{
ooo = matrix(data = 0, nrow = dim(m_bed)[1], ncol = 4)
for (i in 1:dim(m_bed)[1]) {
st = (ceiling(m_bed[i, 2]/bin))
ed = (ceiling(m_bed[i, 3]/bin))
st1 = (ceiling((m_bed[i, 2] - 500)/bin))
ed1 = (ceiling((m_bed[i, 3] + 500)/bin))
if (st != ed) {
ooo[i, 2] = st
ooo[i, 3] = ed
if (st1 != st) {
ooo[i, 1] = st1
}
if (ed1 != ed) {
ooo[i, 4] = ed1
}
}
else {
ooo[i, 2] = st
if (st1 != st) {
ooo[i, 1] = st1
}
if (ed1 != ed) {
ooo[i, 4] = ed1
}
}
}
return(ooo)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.