BIMSBbioinfo / genomation

R package for genomic feature analysis and visualization
http://bioinformatics.mdc-berlin.de/genomation/
74 stars 22 forks source link

Negative coverage values and is.noCovNA=T give wrong results #156

Open frenkiboy opened 7 years ago

frenkiboy commented 7 years ago

when the target vector is negative (i.e. negative fold changes), is.noCovNA gives wrong results - it converts all < 0 values to NA

al2na commented 7 years ago

this is because is.noCovNA is not designed to deal with negative values, and designed with methylation values in mind. Although, for ChIP-seq FCs it may not make sense to use is.noCovNA. It uses an arithmetic trick to figure where the NAs are on the Rle vector and that trick doesn't work when there already negative values https://github.com/BIMSBbioinfo/genomation/blob/master/R/scoreMatrix.R#L388

frenkiboy commented 7 years ago

yeah - we just have to make a check if is.noCovNA and negative coverage, to stop the function