[BioC] Replacing GRanges mcol makes it inaccessible
Shraddha Pai
Shraddha.Pai at camh.ca
Fri May 30 17:48:53 CEST 2014
Hi all,
After I update the metadata on a Granges() object, I can no longer access
the object. This happens on a Granges() object generated from the GFF3
file; I don't know if that matters.
Here is the code to reproduce the error message. The gff file in question
is from miRbase: ftp://mirbase.org/pub/mirbase/CURRENT/genomes/hsa.gff3
Has anyone else experienced this problem? Is there something different
about a GRanges object generated by import()?
I have also tried first setting mcols() to NULL and then doing mcols(x) <-
tmp (putting in my new content), but that results in the same error.
Thanks in advance,
Shraddha
-----
Shraddha Pai, Ph.D.
Post-doctoral fellow
Krembil Family Epigenetic Research Laboratory (Lab head: Dr. Art Petronis)
Centre for Addiction and Mental Health, Toronto
-------------------------------------------
> require(rtracklayer)
> x <- import("hsa.gff3")
> tmp <- mcols(x)
> tmp <- cbind(as.data.frame(tmp), new_column="abc")
> head(x)
GRanges with 6 ranges and 8 metadata columns:
seqnames ranges strand | source type
<Rle> <IRanges> <Rle> | <factor> <factor>
[1] chr1 [ 17369, 17436] - | <NA> miRNA_primary_transcript
[2] chr1 [ 17409, 17431] - | <NA> miRNA
[3] chr1 [ 17369, 17391] - | <NA> miRNA
[4] chr1 [ 30366, 30503] + | <NA> miRNA_primary_transcript
[5] chr1 [ 30438, 30458] + | <NA> miRNA
[6] chr1 [567705, 567793] - | <NA> miRNA_primary_transcript
score phase ID Alias Name
<numeric> <integer> <character> <CharacterList> <character>
[1] <NA> <NA> MI0022705 MI0022705 hsa-mir-6859-1
[2] <NA> <NA> MIMAT0027618 MIMAT0027618 hsa-miR-6859-5p
[3] <NA> <NA> MIMAT0027619 MIMAT0027619 hsa-miR-6859-3p
[4] <NA> <NA> MI0006363 MI0006363 hsa-mir-1302-2
[5] <NA> <NA> MIMAT0005890 MIMAT0005890 hsa-miR-1302
[6] <NA> <NA> MI0022558 MI0022558 hsa-mir-6723
Derives_from
<character>
[1] <NA>
[2] MI0022705
[3] MI0022705
[4] <NA>
[5] MI0006363
[6] <NA>
---
seqlengths:
chr1 chr10 chr11 chr12 chr13 chr14 ... chr6 chr7 chr8 chr9 chrX
chrY
NA NA NA NA NA NA ... NA NA NA NA NA
NA
> mcols(x) <- tmp
> head(x)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function 'extractROWS' for
signature '"AsIs"'
> x
GRanges with 4665 ranges and 9 metadata columns:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function 'extractROWS' for
signature '"AsIs"'
----
Here is the output from sessionInfo()
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] C
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] rtracklayer_1.22.2 GenomicRanges_1.14.4 XVector_0.2.0
[4] IRanges_1.20.6 BiocGenerics_0.8.0
loaded via a namespace (and not attached):
[1] BSgenome_1.30.0 Biostrings_2.30.1 RCurl_1.95-4.1 Rsamtools_1.14.2
[5] XML_3.98-1.1 bitops_1.0-6 stats4_3.0.1 tools_3.0.1
[9] zlibbioc_1.8.0
More information about the Bioconductor
mailing list