Error in GRanges strand input
1
0
Entering edit mode
prabin.dm • 0
@prabindm-9986
Last seen 20 months ago
United States

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.

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

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] 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    
GRanges Tutorial • 1.5k views
ADD COMMENT
0
Entering edit mode

Hi,

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().

Thanks,

H.

ADD REPLY
0
Entering edit mode
@martin-morgan-1513
Last seen 3 months ago
United States

(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()
factor(0)
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 COMMENT

Login before adding your answer.

Traffic: 786 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