Search
Question: Length of a region incorrectly calculated
1
gravatar for balwierz
21 months ago by
balwierz40
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)
    }
... 
ADD COMMENTlink written 21 months ago by balwierz40
Please log in to add an answer.

Help
Access

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