[BioC] need to clarify RangedData documentation?

Michael Dondrup Michael.Dondrup at uni.no
Wed Nov 3 15:35:23 CET 2010


Hi,

I am trying to create a RangedData object and then add a DataFrame of extra annotation columns in a second step.
From the documentation of the method columnMetadata, I was assuming this function was meant to do this,
but it doesn't seem to work. The documentation says:

"columnMetadata(x): Get the DataFrame of metadata along the value columns, i.e., where each column in x is represented by a row in the metadata. Note that calling elementMetadata(x)returns the metadata on each space in x.
columnMetadata(x) <- value: Set the DataFrame of metadata for the columns."

After reading this more closely, I wasn't able to figure what this really means, and I didn't get it to work at all. 
Can someone clarify what this is for?

Thank you

For example: 

> rd = RangedData(ranges=IRanges(start=1:2, width=1), space=1, somedata=1:2)
> rd
RangedData with 2 rows and 1 value column across 1 space
        space    ranges |  somedata
  <character> <IRanges> | <integer>
1           1    [1, 1] |         1
2           1    [2, 2] |         2
> columnMetadata(rd)
NULL
> columnMetadata(rd) = DataFrame(somedata=1:2)
Error in .local(x, ..., value) : 
  the number of rows in elementMetadata 'value' (if non-NULL) must match the length of 'x'
> columnMetadata(rd) = DataFrame(somedata=1)
Warning message:
In newCompressedList("CompressedSplitDataFrameList", x, splitFactor = f,  :
  data length is not a multiple of split variable
> columnMetadata(rd) = DataFrame(somedata=1, hi=1:2, hello=1:2)
> columnMetadata(rd)
NULL
> 



> sessionInfo()
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     

loaded via a namespace (and not attached):
 [1] annotate_1.28.0      AnnotationDbi_1.12.0 Biobase_2.10.0       Biostrings_2.18.0    BSgenome_1.18.0     
 [6] DBI_0.2-5            DESeq_1.2.0          genefilter_1.32.0    geneplotter_1.28.0   GenomicRanges_1.2.0 
[11] grid_2.12.0          RColorBrewer_1.0-2   RSQLite_0.9-2        splines_2.12.0       survival_2.35-8     
[16] tools_2.12.0         XML_3.2-0            xtable_1.5-6        



More information about the Bioconductor mailing list