[Bioc-devel] rownames in SummerizedExperiments

Hervé Pagès hpages at fhcrc.org
Mon Apr 7 08:47:23 CEST 2014


Hi Michael, Simon,

On 04/06/2014 02:32 PM, Michael Lawrence wrote:
> On Sat, Apr 5, 2014 at 8:42 AM, Simon Anders <anders at embl.de> wrote:
>
>> Hi
>>
>> On 05/04/14 17:39, Simon Anders wrote:
>>> When I use "mcols" on a SummerizedExperiment object, I get a DataFrame
>>> with the row metadata, but without rownames. This is quite annoying if I
>>> want to select specific rows using my feature identifiers.
>>
>> Okay, I should have read the help page for "mcols" before posting.
>> Hence, I amend my question to: Is there a reason why "use.names"
>> defaults to FALSE?
>>
>>
> On an arbitrary vector, the names do not need to be unique, but they DO
> need to be unique on a DataFrame (according to the data.frame conventions).
> Conditioning on whether there are duplicate names would be too complicated,
> so it is left to the user to declare whether the names are expected on the
> result. Since in general the vector names are not valid rownames, the
> default is FALSE. I guess if we really wanted to be consistent with R, we
> would mangle the names to make them unique, but that check is expensive.
>
> Just for some history, as of a couple of years ago, it always copied the
> names and relied on make.unique(). Herve changed it, so he might be able to
> defend it better.

Close but not exactly how it was. 2 (or maybe 3) years ago the names of
a GRanges object were forced to be unique. So elementMetadata() (mcols()
didn't exist at that time) was always propagating the names as the row
names with no need to mangle them.

Enforcing uniqueness of the names of a GRanges object was indirectly
causing many issues that I'm not going to re-discuss here. I'll only
mention that, because of this, the names of a GRangesList object had
to be mangled when unlisting the object. We're in a better place today
without that kind of feature :-)

H.

>
> Michael
>
>    Simon
>>
>> _______________________________________________
>> Bioc-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioc-devel mailing list