Hi everyone,
I am trying to get the reference base for a set of chromosome-position pairs like this:
library(Rsamtools) library(BSgenome) library(BSgenome.Hsapiens.UCSC.hg19) dat <- read.table(text = 'chr start chr1 114242 chr1 114242 chr2 7485484', header=T,stringsAsFactors=F) gr1 <- GRanges(dat$chr,IRanges(start=as.numeric(dat$start), end=as.numeric(dat$start))) genome <- getBSgenome("hg19") refbase <- getSeq(Hsapiens,gr1)
I am getting the following error:
Error in NSBS(i, x, exact = exact, upperBoundIsStrict = !allow.append) :
subscript contains NAs or out-of-bounds indices
No idea what could be causing this, any suggestions?
This is my sessionInfo:
R version 3.2.2 (2015-08-14) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.10.5 (Yosemite) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets [8] methods base other attached packages: [1] BSgenome.Hsapiens.UCSC.hg19_1.4.0 BSgenome_1.38.0 [3] rtracklayer_1.30.1 Rsamtools_1.22.0 [5] Biostrings_2.38.1 XVector_0.10.0 [7] GenomicRanges_1.22.1 GenomeInfoDb_1.6.1 [9] IRanges_2.4.2 S4Vectors_0.8.3 [11] BiocGenerics_0.16.1 loaded via a namespace (and not attached): [1] XML_3.98-1.3 GenomicAlignments_1.6.1 [3] bitops_1.0-6 futile.options_1.0.0 [5] zlibbioc_1.16.0 futile.logger_1.4.1 [7] BiocParallel_1.4.0 lambda.r_1.1.7 [9] tools_3.2.2 Biobase_2.30.0 [11] RCurl_1.95-4.7 SummarizedExperiment_1.0.1
Hi,
I can't reproduce this:
Then:
H.