[Bioc-devel] GenomicRanges: Seqinfo indexing with non-existing key
tooyoung at gmail.com
Thu Feb 27 14:17:22 CET 2014
Ah, yes, the name part could have been improved, maybe something like,
Seqinfo of length 1
seqnames seqlengths isCircular genome
<NA> NA NA <NA>
My thoughts was more on the error part. For those inconsistencies, you
may have to wait for some core member to chime-in.
On Thu, 2014-02-27 at 14:05 +0100, Julian Gehring wrote:
> Hi Dan,
> Subestting your vector returns an element with both value and name set
> to 'NA'. In contrast, subsetting the 'Seqinfo' object returns an
> element with 'seqname' set to the key - which can be easily
> misinterpreted.. Also, subsetting a GRanges (e.g. 'as(si, "GRanges")')
> with a non-existing key throws an error.
> Best wishes
> On 27/02/14 14:00, Dan Du wrote:
> > Hi,
> > To me it sounds like what I am expecting, from a R base point of view.
> > x<-1:5
> > names(x)<-letters[1:5]
> > i<-'f'
> > x[i]
> > Best,
> > Dan
> > On Thu, 2014-02-27 at 13:49 +0100, Julian Gehring wrote:
> >> Hi,
> >> In the current bioc-stable and bioc-devel, a 'Seqinfo' object can be
> >> indexed successfully with any character key, even it is non-existing:
> >> #+BEGIN_SRC R
> >> library(GenomicRanges)
> >> library(BSgenome.Hsapiens.UCSC.hg19)
> >> si = seqinfo(BSgenome.Hsapiens.UCSC.hg19)
> >> ind2 = "999"
> >> ind2 %in% seqnames(si) ## FALSE, no seqlevel with this name
> >> si[ind2] ## works, but should not
> >> #+END_SRC
> >> Shouldn't this throw an error?
> >> Best wishes
> >> Julian
> >> _______________________________________________
> >> Bioc-devel at r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/bioc-devel
More information about the Bioc-devel