 Dear bioc-sig-sequencing,

Following the BioC2010 lab (http://www.bioconductor.org/help/course-materials/2010/BioC2010/Workflow.pdf).  Would like to coerce GRanges to data.frame form, then to RangedData, and finally back to GRanges object (so can normalize number of reads while in data.frame form).

GRanges documentation suggests this possible:

‘as(from, "GRanges")’: Creates a GRanges object from a RangedData or
          RangesList object.

However, in step from data.frame to RangedData, "seqnames" column placed in elementMetadata, and in step from RangedData to GRanges, get error: slot 'elementMetadata' now has column named "seqnames".

Can you indicate how to successfully accomplish this set of coercions?

> gr <- as(rd, "GRanges")
Error in validObject(.Object) :
  invalid class "GRanges" object: slot 'elementMetadata' cannot use "seqnames", "ranges", "strand", "seqlengths", "start", "end", "width", or "element" as column names

R version 2.12.0 Under development (unstable) (2010-09-16 r52922)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.utf8       LC_NUMERIC=C
 [3] LC_TIME=en_US.utf8        LC_COLLATE=en_US.utf8
 [5] LC_MONETARY=C             LC_MESSAGES=en_US.utf8
 [7] LC_PAPER=en_US.utf8       LC_NAME=C
 [9] LC_ADDRESS=C              LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
 [1] BSgenome.Athaliana.TAIR.04232008_1.3.16
 [2] GenomicFeatures_1.1.12
 [3] chipseq_0.99.1
 [4] ShortRead_1.7.21
 [5] Rsamtools_1.1.15
 [6] lattice_0.19-11
 [7] BSgenome_1.17.7
 [8] Biostrings_2.17.47
 [9] GenomicRanges_1.1.25
[10] IRanges_1.7.38

loaded via a namespace (and not attached):
 [1] Biobase_2.9.2     biomaRt_2.5.1     DBI_0.2-5         grid_2.12.0
 [5] hwriter_1.2       RCurl_1.4-3       RSQLite_0.9-2     rtracklayer_1.9.9
 [9] tools_2.12.0      XML_3.1-1
>


Thanks,
P. Terry
pterry@huskers.unl.edu

	[[alternative HTML version deleted]]

