[Bioc-devel] rtracklayer::import( as = 'NumericList' ) doesn't work with more than 1 range

Michael Lawrence lawrence.michael at gene.com
Wed May 20 20:28:30 CEST 2015


I guess I would say that the summary stuff is sort of an estimate that is
useful for e.g. visualization, rather than an exact quantification.

On Wed, May 20, 2015 at 10:56 AM, Valerie Obenchain <vobencha at fredhutch.org>
wrote:

> Hi Leo,
>
> Thanks for reporting the bug with import. The problem was in how the
> length of the output was computed. This has been fixed in both release
> (1.28.3) and devel (1.29.6).
>
> I'll let Michael answer the summary() question.
>
> Valerie
>
>
>
> On 05/19/2015 12:10 PM, Leonardo Collado Torres wrote:
>
>> Hi,
>>
>> While playing around with importing BigWig files I found that
>> import.bw() fails when you use a `which` or `selection` that has more
>> than one range and you specify `as = 'NumericList'`. The code and
>> output are available at
>> https://gist.github.com/lcolladotor/a0eafc335a2738de42f6. From the
>> BigWigFile-class documentation, I suspect that this is a bug. The same
>> thing happens even if I use BigWigFileSelection() instead of supplying
>> a GRanges of length 2.
>>
>> Also, what is the summary() function doing when you calculate the
>> mean? I would expect it to be the same mean if I import the data as an
>> Rle and calculate the mean there. See (after running the code in the
>> gist):
>>
>>  x <- import(BigWigFile(bw[1]), as = 'RleList')
>>> mean(x)
>>>
>>       chr21
>> 0.02474045
>>
>>> summary(BigWigFile(bw[1]), type = 'mean')[[1]]$score
>>>
>> [1] 0.9037462
>>
>>> mean(x[x > 0])
>>>
>>     chr21
>> 1.202603
>>
>> It's not the mean of the non-zero positions either.
>>
>>
>> Cheers,
>> Leo
>>
>>
>> Leonardo Collado Torres, PhD Candidate
>> Department of Biostatistics
>> Johns Hopkins University
>> Bloomberg School of Public Health
>> Website: http://www.biostat.jhsph.edu/~lcollado/
>> Blog: http://lcolladotor.github.io/
>>
>> _______________________________________________
>> Bioc-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
>>
>
> --
> Computational Biology / Fred Hutchinson Cancer Research Center
> 1100 Fairview Ave. N, Seattle, WA 98109
>
> Email: vobencha at fredhutch.org
> Phone: (206) 667-3158
>
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>

	[[alternative HTML version deleted]]



More information about the Bioc-devel mailing list