[Bioc-devel] runmean and NA values

Valerie Obenchain vobencha at fhcrc.org
Mon Aug 6 19:44:36 CEST 2012


Florian, Kasper,

In IRanges 1.15.26, runsum() and runmean() now have an 'na.rm' argument,

x <- Rle(c(2, 1, NA, 3, 1))
 > runsum(x, k=2, na.rm=TRUE)
numeric-Rle of length 4 with 4 runs
   Lengths: 1 1 1 1
   Values : 3 1 3 4

 > runsum(x, k=2, na.rm=FALSE)
numeric-Rle of length 4 with 3 runs
   Lengths:  1  2  1
   Values :  3 NA  4

 > runmean(x, k=2, na.rm=TRUE)
numeric-Rle of length 4 with 4 runs
   Lengths:   1   1   1   1
   Values : 1.5   1   3   2

 > runmean(x, k=2, na.rm=FALSE)
numeric-Rle of length 4 with 3 runs
   Lengths:   1   2   1
   Values : 1.5  NA   2

Is it worth adding the argument to runmed(), runwtsum() and runq() as 
well? I'm not sure how heavily used these functions are.

Valerie


On 04/13/2012 02:36 PM, Valerie Obenchain wrote:
> Hi Florian,
>
> Thanks for the reminder. I can pick this up and will post back here 
> when it's done.
>
> Valerie
>
>
> On 04/13/2012 08:06 AM, Hahne, Florian wrote:
>> Hi all,
>> Runmean and the related run* functions currently can't deal with NA
>> values. Kasper asked for a na.rm argument a long while ago and back then
>> Patrick agreed to add this in one of the upcoming releases
>> (https://stat.ethz.ch/pipermail/bioconductor/2010-August/034982.html)
>>
>> Is that still on someone's radar? I would really like to see that in
>> runmean for the same reasons Kasper pointed out: NAs and zeros are not
>> necessarily equivalent in Rle vectors, and I would like to be able to
>> smooth data that contains NAs.
>>
>> Thanks,
>> Florian
>>
>>
>> Florian Hahne
>> Novartis Institute For Biomedical Research
>> Translational Sciences / Preclinical Safety / PCS Informatics
>> Expert Data Integration and Modeling Bioinformatics
>> CHBS, WKL-135.2.26
>> Novartis Institute For Biomedical Research, Werk Klybeck
>> Klybeckstrasse 141
>> CH-4057 Basel
>> Switzerland
>> Phone: +41 61 6967127
>> Email : florian.hahne at novartis.com
>>
>> _______________________________________________
>> Bioc-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list