[Bioc-sig-seq] IRanges runmean Arithmetic Precision

Dario Strbenac D.Strbenac at garvan.org.au
Mon Feb 14 04:00:09 CET 2011


Hi,

We've noticed that using runmean on Rles with all elements being a mix of positive or zero numbers sometimes results in some very small negative numbers. Is it possible for it to be exactly zero ?

> cvg
'numeric' Rle of length 199432144 with 1495580 runs
  Lengths:             35100                35 ...                18
  Values :                 0 0.750447078847223 ... 0.750447078847223
> negs <- which(cvg < 0)
> negs
integer(0)
> smCvg <- IRanges::runmean(cvg, 1001, endrule = "constant")
> negs <- which(smCvg < 0)
> smCvg[head(negs)]
'numeric' Rle of length 6 with 1 run
  Lengths:                     6
  Values : -1.56163238628593e-16

> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=C              LC_MESSAGES=en_AU.UTF-8   
 [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] aroma.affymetrix_1.7.0             aroma.apd_0.1.7                   
 [3] affxparser_1.22.0                  R.huge_0.2.0                      
 [5] aroma.core_1.7.0                   aroma.light_1.18.0                
 [7] matrixStats_0.2.2                  R.rsp_0.4.0                       
 [9] R.cache_0.3.0                      R.filesets_0.9.0                  
[11] digest_0.4.2                       R.utils_1.5.3                     
[13] R.oo_1.7.4                         R.methodsS3_1.2.1                 
[15] BSgenome.Hsapiens.UCSC.hg18_1.3.16 BSgenome_1.18.3                   
[17] Biostrings_2.18.2                  GenomicRanges_1.2.3               
[19] IRanges_1.8.9                     

loaded via a namespace (and not attached):
[1] Biobase_2.10.0 tools_2.12.0  



--------------------------------------
Dario Strbenac
Research Assistant
Cancer Epigenetics
Garvan Institute of Medical Research
Darlinghurst NSW 2010
Australia



More information about the Bioc-sig-sequencing mailing list