[BioC] GRangesList mcols names

Valerie Obenchain vobencha at fhcrc.org
Wed Oct 9 02:03:22 CEST 2013


Hi Leonard,

This check was most likely put in place to avoid a name clash if the 
GRangesList was flattened and the mcols() on the GRangesList were rep'd 
out. I can't think of a function that currently does this but I might be 
overlooking something. At any rate, in v 1.13.52 I've moved the error up 
to the time of construction.

 > mcols(grl)$x <- 1
Error in .local(x, ..., value = value) :
   'mcols(x)' cannot have columns named as metadata  columns of unlisted 
GRanges

Valerie


On 10/05/2013 10:14 PM, Leonard Goldstein wrote:
> Dear list,
>
> I noticed that GRangesList objects are not allowed to have outer
> elementMetadata columns with names identical to names of inner
> elementMetadata columns (see below)
>
> Is this restriction necessary? And if yes, should identical names raise an
> exception at the time of construction rather than further down the line?
>
> Best wishes,
>
> Leonard
>
>
>> gr <- GRanges("1", IRanges(1, 100), "x" = 1)
>> grl <- split(gr, 1)
>> mcols(grl)$x <- 1
>> grl[1, ]
> Error in validObject(.Object) :
>    invalid class “GRangesList” object: 'mcols(x)' cannot have columns named
> as metadata  columns of unlisted GRanges
>>
>> sessionInfo()
> R version 3.0.0 (2013-04-03)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>   [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>   [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
>   [7] LC_PAPER=C                 LC_NAME=C
>   [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] parallel  stats     graphics  grDevices utils     datasets  methods
> [8] base
>
> other attached packages:
> [1] GenomicRanges_1.13.50 XVector_0.1.4         IRanges_1.19.38
> [4] BiocGenerics_0.7.5
>
> loaded via a namespace (and not attached):
> [1] stats4_3.0.0
>>
>
> 	[[alternative HTML version deleted]]
>
>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list