getSeq with GRanges object error: function not found
1
1
Entering edit mode
@miskey-csaba-6379
Last seen 6.5 years ago
Germany

I want to retrieve genomic sequences strand specifically from hg19.
The coordinates are in a data frame, I make GRanges object out of it
and try to use getSeq.  getSeq gives me the error message below.
What's wrong?  Any alternative way?  Many thanks!

Csaba

> df <- data.frame(chr="chr1", start=11:13, end=12:14,
+                  strand=c("+","-","+"), score=1:3)
>
> gr <- makeGRangesFromDataFrame(df)
> gr
GRanges with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chr1  [11, 12]      +
  [2]     chr1  [12, 13]      -
  [3]     chr1  [13, 14]      +
  ---
  seqlengths:
   chr1
     NA

> getSeq(Hsapiens, gr)

Error in rep.int(DNAStringSet(""), length(sseq_idx)) : error in
  evaluating the argument 'x' in selecting a method for function
  'rep.int': Error in .Call2("new_XString_from_CHARACTER", classname,
  x, start(solved_SEW), : function '_alloc_XRaw' not provided by
  package 'IRanges'

R version 3.1.1 (2014-07-10)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] BSgenome.Hsapiens.UCSC.hg19_1.3.19 BSgenome_1.28.0                    lattice_0.20-29
[4] Biostrings_2.28.0                  GenomicRanges_1.16.4               GenomeInfoDb_1.0.2
[7] IRanges_1.22.10                    BiocGenerics_0.10.0

loaded via a namespace (and not attached):
[1] bitops_1.0-6   grid_3.1.1     stats4_3.1.1   tools_3.1.1    XVector_0.4.0  zlibbioc_1.6.0
biostrings bsgenome granges • 2.5k views
ADD COMMENT
1
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States

This looks like a package version mis-matched, try

source("http://bioconductor.org/biocLite.R")
BiocInstaller::biocValid()

and follow the recommendations.

For a current installation of the current release, I have

other attached packages:
[1] BSgenome.Hsapiens.UCSC.hg19_1.3.1000 BSgenome_1.32.0                     
[3] Biostrings_2.32.1                    XVector_0.4.0                       
[5] GenomicRanges_1.16.4                 GenomeInfoDb_1.0.2                  
[7] IRanges_1.22.10                      BiocGenerics_0.10.0                 
[9] BiocInstaller_1.14.2      

Notice that we both have IRanges 1.22.10 and GenomeInfoDb 1.0.2 (both from the current release) but then your other packages are mostly from 2 Bioc releases before that.

ADD COMMENT

Login before adding your answer.

Traffic: 685 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6