makeTravisCoordsFromGRangesList: makeTravisCoordsFromGRangesList

Usage Arguments Examples

View source: R/makeTravisCoordsFromGRangesList.R

Usage

1
makeTravisCoordsFromGRangesList(comp, noBins = 100, collapseGene = FALSE)

Arguments

comp
noBins
collapseGene

Examples

 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)
  }

lzcyzm/Travis_Dev documentation built on May 21, 2019, 9:16 a.m.