[BioC] can not coerce CompressedIntegerList to vector or integer in 'IRanges' package

LiGang luzifer.li at gmail.com
Tue Sep 22 08:07:38 CEST 2009


can not coerce "CompressedIntegerList" to vector or integer


#====================================
ranges <- IRanges(c(1,2,3),c(4,5,6))
filter <- c(1L, 0L, 1L)
score <- c(10L, 2L, NA)
range2 <- IRanges(start=c(15,45,20,1), end=c(15,100,80,5))
both <- c(ranges, range2)
score <- c(score, c(0L, 3L, NA, 22L))
filter <- c(filter, c(0L, 1L, NA, 0L)) 
chrom <- paste("chr", rep(c(1,2), c(length(ranges), length(range2))), sep="")
rd <- RangedData(both, score, filter, space = chrom, universe = "hg18")

start(ranges(rd))->inter
as.vector(inter)

#Error in as.vector(inter) : 
# no method for coercing this S4 class to a vector

as.integer(inter)

#Error in as.integer(inter) : 
#  cannot coerce type 'S4' to vector of type 'integer'
#====================================
 sessionInfo()
R version 2.10.0 Under development (unstable) (2009-09-14 r49685) 
i386-pc-mingw32 

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United 
States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United 
States.1252    

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

other attached packages:
[1] rtracklayer_1.5.14 RCurl_1.2-0        bitops_1.0-4.1     
Rgraphviz_1.23.4   graph_1.23.4       IRanges_1.3.77    

loaded via a namespace (and not attached):
[1] Biobase_2.5.6      Biostrings_2.13.40 BSgenome_1.13.12   Rcompression_0.6-
0 tools_2.10.0       XML_2.6-0  




---
LiGang



More information about the Bioconductor mailing list