Question: Length of a region incorrectly calculated
gravatar for balwierz
3.7 years ago by
United Kingdom
balwierz40 wrote:

Length of a region is calculated as end - start, instead of end - start + 1.

This causes problems when length of a region equals no_windows.

I also suggest either checking this condition before CPU intensive operations on a bam file, using warnings instead of stop, or solving the problem properly for shorter genes (i.e. by assigning a position to multiple bins)

In cov.bin.R:

setMethod("cov.bin", signature(extend = "missing", no_windows = "numeric", obj = "CoverageBamFile",
    chr = "missing", grFromWig = "missing"), function(x, no_windows, obj, offset) {
    chr <- as.character(x[[1]])
    start.pre <- as.integer(x[[2]])
    end.pre <- as.integer(x[[3]])
    strand <- as.character(x[[5]])
    message("[INFO] processing coords:", chr, " ", start.pre, " ", end.pre)
    ceil <- end.pre - start.pre
    if (ceil < no_windows) {
        errormsg <- paste("[ERROR] nucleotidic interval from start to end coordinates cannot be smaller than the no_windows value. The interval:",
            chr, start.pre, end.pre, "is not valid!", sep = " ")
        stop(errormsg, call. = FALSE)
bug coverageview • 497 views
ADD COMMENTlink written 3.7 years ago by balwierz40
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 198 users visited in the last hour