Question: Error in GRanges strand input
gravatar for
7 months ago by
prabin.dm0 wrote:

I am trying to make a Granges object with a list of genes that I have downloaded from MGI.

This is the column with strand info > mm9genes$X.3 gives me Levels: - +

However, when I use this code..

GRanges(seqnames = Rle("chr12", 322),
               ranges = IRanges(start = mm9genes$X, end = mm9genes$X.1),
               strand = Rle(mm9genes$X.3),
               symbol = mm9genes$X.2)`

I get error Error in .local(x, ...) : invalid strand levels in 'x': - , + I am pretty new to this and trying to learn from. Will appreciate any help.

R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)

[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] stats4    parallel  stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
[1] GenomicRanges_1.18.4 GenomeInfoDb_1.2.5   IRanges_2.0.1       
[4] S4Vectors_0.4.0      BiocGenerics_0.12.1  BiocInstaller_1.16.5

loaded via a namespace (and not attached):
 [1] bitops_1.0-6    digest_0.6.9    httr_1.1.0      magrittr_1.5   
 [5] RCurl_1.95-4.8  stringi_1.0-1   stringr_1.0.0   swirl_2.2.21   
 [9] testthat_0.11.0 tools_3.1.2     XVector_0.6.0   yaml_2.1.13    
ADD COMMENTlink modified 6 months ago by Martin Morgan ♦♦ 20k • written 7 months ago by prabin.dm0


This post is a question, not a Tutorial. Please ask again as a question i.e. make sure to set Post Type to Question (which is the default). Also provide a reproducible example and the output of your sessionInfo().



ADD REPLYlink written 7 months ago by Hervé Pagès ♦♦ 13k
gravatar for Martin Morgan
6 months ago by
Martin Morgan ♦♦ 20k
United States
Martin Morgan ♦♦ 20k wrote:

(Although you're 'new' to this, your R and Bioconductor are very old! Consider updating!). I'm guessing that the software is complaining about the order or completeness of levels, which have I believe always been expected to be

> strand()
Levels: + - *

whereas your levels are reversed and missing the "*". I think the current software is smart enough to re-level your factor, and the old software would work if you coerced your levels to a character vector

strand = as.character(mm9genes$X.3)


ADD COMMENTlink written 6 months ago by Martin Morgan ♦♦ 20k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 104 users visited in the last hour