[Bioc-sig-seq] strand problem in GenomicRanges

Martin Morgan mtmorgan at fhcrc.org
Tue Jan 18 21:58:09 CET 2011


On 01/17/2011 04:05 PM, Joseph Scandura wrote:
> I recently updated BioC to 2.12.1 and now find a new issue when assigning strand to a GRanges object. 
> 
> The problem must be something straightforward but I have not been able to track it down. 
> 
> ################### Example: 
>> z=GRanges(seqnames=paste("chr",seq(3), sep=""), ranges = IRanges(start=c(1,300,600), width=50), strand=c("+", "-", "*"))
>> strand(z)
> 	'factor' Rle of length 3 with 3 runs
> 	  Lengths: 1 1 1
> 	  Values : + - *
> 	Levels(3): + - *
>> strand(z) = "*"  #this used to assign a strand of "*" to all elements in z
> Error in x[[name, exact = FALSE]] : 
>   missing '[[' method for Sequence class GRanges

Hi Joe -- I don't see this in a new R session; I think what happens is
that the wrong 'update' is being called, e.g., stats::update rather than
GRanges::update. Not really sure what to suggest, other than debugging
by figuring out which of the loaded packages is causing problems. This
could be tedious.

Other possibilities are to start R with the --vanilla argument (so that
no .RData files are loaded on start-up) and to explicitly

  library(GenomicRanges)

at the start of your session.

Here's what I see...

> library(GenomicRanges)
Loading required package: IRanges

Attaching package: 'IRanges'

The following object(s) are masked from 'package:base':

    cbind, eval, Map, mapply, order, paste, pmax, pmax.int, pmin,
    pmin.int, rbind, rep.int, table

> z=GRanges(seqnames=paste("chr",seq(3), sep=""), ranges =
+ IRanges(start=c(1,300,600), width=50), strand=c("+", "-", "*"))
> strand(z)
'factor' Rle of length 3 with 3 runs
  Lengths: 1 1 1
  Values : + - *
Levels(3): + - *
> strand(z) = "*"
> sessionInfo()
R version 2.12.0 Patched (2010-11-21 r53647)
Platform: x86_64-unknown-linux-gnu (64-bit)

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

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

other attached packages:
[1] GenomicRanges_1.2.3 IRanges_1.8.8

Martin

> 
>> traceback()
> 10: stop("missing '[[' method for Sequence class ", class(x))
> 9: x[[name, exact = FALSE]]
> 8: x[[name, exact = FALSE]]
> 7: object$call
> 6: object$call
> 5: update.default(x, strand = value)
> 4: update(x, strand = value)
> 3: update(x, strand = value)
> 2: `strand<-`(`*tmp*`, value = "*")
> 1: `strand<-`(`*tmp*`, value = "*")
> 
>> sessionInfo()
> R version 2.12.1 (2010-12-16)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
> 
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
> 
> attached base packages:
> [1] stats   utils   methods base   
> 
> other attached packages:
> [1] GenomicRanges_1.2.3 IRanges_1.8.8       Biobase_2.10.0     
> 
> loaded via a namespace (and not attached):
>  [1] annotate_1.28.0                     AnnotationDbi_1.12.0                biomaRt_2.6.0                      
>  [4] Biostrings_2.18.2                   BSgenome_1.18.2                     BSgenome.Ecoli.NCBI.20080805_1.3.16
>  [7] ChIPpeakAnno_1.6.0                  DBI_0.2-5                           DESeq_1.2.1                        
> [10] gdata_2.8.1                         genefilter_1.32.0                   geneplotter_1.28.0                 
> [13] GO.db_2.4.5                         gplots_2.8.0                        graphics_2.12.1                    
> [16] grDevices_2.12.1                    grid_2.12.1                         gtools_2.6.2                       
> [19] limma_3.6.9                         MASS_7.3-9                          multtest_2.6.0                     
> [22] org.Hs.eg.db_2.4.6                  RColorBrewer_1.0-2                  RCurl_1.5-0                        
> [25] RMySQL_0.7-5                        RSQLite_0.9-4                       splines_2.12.1                     
> [28] survival_2.36-2                     tools_2.12.1                        XML_3.2-0                          
> [31] xtable_1.5-6       
> ###################
> Joe
> 
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioc-sig-sequencing mailing list