Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in rowData annotation (that also affects colData) #17

Closed
lgeistlinger opened this issue May 7, 2018 · 3 comments
Closed

Error in rowData annotation (that also affects colData) #17

lgeistlinger opened this issue May 7, 2018 · 3 comments

Comments

@lgeistlinger
Copy link

lgeistlinger commented May 7, 2018

library(GenomicRanges)
library(RaggedExperiment)
grl <- GRangesList(
     sample1 = GRanges( c("chr1:1-10", "chr2:15-18", "chr2:25-34") ),
     sample2 = GRanges( c("chr1:1-10", "chr2:11-18" , "chr2:25-36") ),
     sample3 = GRanges( c("chr1:2-11", "chr2:14-18", "chr2:26-36") ),
     sample4 = GRanges( c("chr1:1-12", "chr2:18-35" ) ),
     sample5 = GRanges( c("chr1:1-12", "chr2:11-17" , "chr2:26-34") ) , 
     sample6 = GRanges( c("chr1:1-12", "chr2:12-18" , "chr2:25-35") )
)

ra <- RaggedExperiment(grl)

Some arbitrary colData annotation:

> colData(ra)$colanno <- seq_len(ncol(ra)) 
> colData(ra)
DataFrame with 6 rows and 1 column
          colanno
        <integer>
sample1         1
sample2         2
sample3         3
sample4         4
sample5         5
sample6         6

Ok.

Some arbitrary rowData annotation:

> rowData(ra)$rowanno <- LETTERS[seq_len(nrow(ra))]
> rowData(ra)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘getListElement’ for signature ‘"GRanges"’

Also, colData now returns the row annotation (??):

> colData(ra)
DataFrame with 6 rows and 1 column
      rowanno
  <character>
1           A
2           B
3           C
4           D
5           E
6           F
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.3

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

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] RaggedExperiment_1.5.0 GenomicRanges_1.33.1   GenomeInfoDb_1.17.0   
[4] IRanges_2.15.4         S4Vectors_0.19.2       BiocGenerics_0.27.0   

loaded via a namespace (and not attached):
 [1] lattice_0.20-35             matrixStats_0.53.1         
 [3] bitops_1.0-6                grid_3.5.0                 
 [5] zlibbioc_1.27.0             XVector_0.21.0             
 [7] Matrix_1.2-14               BiocParallel_1.15.0        
 [9] tools_3.5.0                 Biobase_2.41.0             
[11] RCurl_1.95-4.10             DelayedArray_0.7.0         
[13] compiler_3.5.0              SummarizedExperiment_1.11.1
[15] GenomeInfoDbData_1.1.0     
> 
@lwaldron
Copy link

lwaldron commented May 7, 2018 via email

@lgeistlinger
Copy link
Author

For instance, you can think of the individual CNV calls from ABSOLUTE - which would correspond to the rowRanges here.
You might want to annotate quality measures to the calls such as the number of probes supporting this call.

@LiNk-NY
Copy link
Collaborator

LiNk-NY commented May 23, 2018

Hi Ludwig, @lgeistlinger
In this instance, mcols and rowData are both referring to the same information, annotations of the ranges in a GRangesList.
Essentially when you do mcols<- or rowData<-, you're adding to "number of assays". Since each column in mcols is an "assay". That's how RaggedExperiment is represented.

I found a bug in the replacement method that will fix this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants