View source: R/makeTravisCoordsFromGRangesList.R
1 | makeTravisCoordsFromGRangesList(comp, noBins = 100, collapseGene = FALSE)
|
comp |
|
noBins |
|
collapseGene |
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 | ##---- 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 (comp, noBins = 100, collapseGene = FALSE)
{
tx_length <- as.numeric(sum(width(comp)))
checkpoints_interval <- tx_length/noBins
tx_name <- names(comp)
granges <- unlist(comp)
tx <- granges[tx_name]
strand <- as.character(as.data.frame(strand(tx))[[1]])
chr <- as.character(as.data.frame(seqnames(tx))[[1]])
t <- lapply(X = 1:noBins, FUN = .makeTravisCoordsForSingleIndex,
comp = comp, noBins = noBins, checkpoints_interval = checkpoints_interval,
strand = strand, chr = chr, tx_name = tx_name)
TravisCoords <- .combineListOfGRanges(t)
if (collapseGene) {
temp <- split(TravisCoords, mcols(TravisCoords)$pos,
drop = FALSE)
mcols(temp) <- data.frame(pos = unique(mcols(TravisCoords)$pos))
TravisCoords <- temp
}
return(TravisCoords)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.