[BioC] rtracklayer blocks function
jayoung at fhcrc.org
Thu Aug 9 04:25:21 CEST 2012
A quick question - I'm a little confused about how to use the "blocks" function of rtracklayer - can you help? I think perhaps I'm just not understanding the help page right and not understanding what should be possible and what should not. I'm looking at ?blocks (and ?import.bed). From those pages, it seems like the following code should work, but I get errors. I'm missing something, I think....
I think i'll be able to find another more convoluted way to do what I want to do, which is to get the total transcript size from a bed file that contains block information, but it seems like this simpler way should work - any suggestions?
### read in a bed file: (this example is from the help page ?import.bed and has some block information)
test_path <- system.file("tests", package = "rtracklayer")
test_bed <- file.path(test_path, "test.bed")
test <- import(test_bed)
test2 <- as(test, "RangedData")
#Error in blocks(as(x, "GenomicRanges")) :
# error in evaluating the argument 'x' in selecting a method for function 'blocks': Error in as(x, "GenomicRanges") :
# no method or default for coercing "RangedData" to "GenomicRanges"
#Error in blocks(asBED(test2)) :
# error in evaluating the argument 'x' in selecting a method for function 'blocks': Error in function (classes, fdef, mtable) :
# unable to find an inherited method for function "asBED", for signature "RangedData"
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
attached base packages:
 stats graphics grDevices utils datasets methods base
other attached packages:
 rtracklayer_1.16.3 GenomicRanges_1.8.11 IRanges_1.14.4 BiocGenerics_0.2.0
loaded via a namespace (and not attached):
 Biostrings_2.24.1 bitops_1.0-4.1 BSgenome_1.24.0 RCurl_1.91-1 Rsamtools_1.8.6 stats4_2.15.1 tools_2.15.1
 XML_3.9-4 zlibbioc_1.2.0
More information about the Bioconductor