On Wed, Nov 3, 2010 at 9:06 AM, Michael Dondrup <Michael.Dondrup@uni.no>wrote:

> Hi,
>
> I remember having posted something like this earlier.
>
> calling values on a RangedData object deletes the ranges names, if the
> DataFrame doesn't have names, is
> that intentional?
>
> > rd = RangedData(ranges=IRanges(start=1:2, width=1, names=c("A","B")),
> space=1)
> > rownames(rd)
> [1] "A" "B"
> > values(rd) = DataFrame(somedata=1:2)
> > rownames(rd)
> NULL
>
>
Definitely a bug, because it yields an invalid object, where the ranges have
names but not the data. The question is how to rectify the names. You're
expecting that if the DataFrame has NULL names, for it to take the names of
the RangedData. That makes sense to me. If the rownames on the DataFrame
were not NULL and different from the RangedData, what should happen? I'm
thinking that should throw an error; that's how ranges<- has always behaved.


Anyway, I checked in a fix to the devel version. Thanks for reporting this.

Michael


> I can work around this by setting them again:
>
> values(rd) = DataFrame(somedata=1:2, row.names=c("A","B"))
>  but that's still a glitch...
>
> Michael
> R version 2.12.0 (2010-10-15)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] rtracklayer_1.10.0 RCurl_1.4-3        bitops_1.0-4.1     IRanges_1.8.0
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

