[Bioc-devel] coverage(gr, weight='score') does not work when score(gr) is an Rle

Philip Lijnzaad p.lijnzaad at umcutrecht.nl
Fri Apr 17 17:00:46 CEST 2015


Dear all,  I'm puzzled by the following behaviour:

Given

     n <- 10
     gr <- GRanges(seqnames=Rle('A', n),
                   ranges=IRanges(1:n, width=1),
                   score=Rle(5,n))
If I do

     coverage(gr,weight='score')

I get

     Error in .normarg_shift_or_weight(weight, "weight", x) :
       'weight' must be a numeric vector, a single string, or a 
list-like object

Surely 'score' should be allowed to be an Rle? Especially given the
fact that the return value of coverage(x,weight="score") when score is
plain numeric vector is always an Rle ! Is this the expected behaviour?
If so, I would argue that violates the principle of least suprise :-)

The background to this is that I do numerical analysis on derived
numerical data along my chromosomes. It contains many
contiguous zeroes so it would be wasteful to cast
everything down using as.numeric().

This is R version 3.01 on x86_64 Linux, Bioconductor version 2.13,

 > package.version("IRanges")
[1] "1.20.7"
 > package.version("GenomicRanges")
[1] "1.14.4"

Regards,


Philip


-- 
Philip Lijnzaad, PhD
Molecular Cancer Research
University Medical Center (UMC), Utrecht
Stratenum room 2.211
IM: plijnzaad at jabber.org , philip.lijnzaad at gmail.com
P.O. Box 85060, 3508 AB Utrecht
(Universiteitsweg 100, 3584 CG Utrecht)
The Netherlands
tel: +31 (0)8875 68464

------------------------------------------------------------------------------

De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren. Het Universitair Medisch
Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de W.H.W.
(Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd bij
de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.

Denk s.v.p aan het milieu voor u deze e-mail afdrukt.

------------------------------------------------------------------------------

This message may contain confidential information and is...{{dropped:8}}



More information about the Bioc-devel mailing list