Lumi - Can't write to pData Slot
1
0
Entering edit mode
@andrewjskelton73-7074
Last seen 8 days ago
United Kingdom

Hi, 

I tried writing to the pData slot of my LumiBatch object (read in using lumiR), this afternoon and got the following error.

> pData(raw_data)       <- pheno_table
Error in (function (classes, fdef, mtable)  : unable to find an inherited method for function ‘pData<-’ for signature ‘"LumiBatch", "tbl_df"’

I've used this function before and haven't had any problems. - I was wondering if other people are experiencing this issue?  

> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

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

other attached packages:
[1] readr_0.1.1          lumi_2.20.1          Biobase_2.28.0       BiocGenerics_0.14.0 
[5] BiocInstaller_1.18.3

loaded via a namespace (and not attached):
 [1] mclust_5.0.1            base64_1.1              Rcpp_0.11.6            
 [4] locfit_1.5-9.1          lattice_0.20-31         nleqslv_2.8            
 [7] Rsamtools_1.20.4        Biostrings_2.36.1       digest_0.6.8           
[10] foreach_1.4.2           GenomeInfoDb_1.4.1      plyr_1.8.3             
[13] futile.options_1.0.0    stats4_3.2.1            RSQLite_1.0.0          
[16] bumphunter_1.8.0        zlibbioc_1.14.0         GenomicFeatures_1.20.1 
[19] annotate_1.46.0         S4Vectors_0.6.1         Matrix_1.2-1           
[22] preprocessCore_1.30.0   splines_3.2.1           BiocParallel_1.2.6     
[25] stringr_1.0.0           RCurl_1.95-4.7          biomaRt_2.24.0         
[28] rtracklayer_1.28.5      multtest_2.24.0         pkgmaker_0.22          
[31] mgcv_1.8-6              GEOquery_2.34.0         quadprog_1.5-5         
[34] IRanges_2.2.5           codetools_0.2-11        matrixStats_0.14.2     
[37] XML_3.98-1.3            reshape_0.8.5           GenomicAlignments_1.4.1
[40] MASS_7.3-41             bitops_1.0-6            grid_3.2.1             
[43] affy_1.46.1             nlme_3.1-120            xtable_1.7-4           
[46] registry_0.2            DBI_0.3.1               magrittr_1.5           
[49] KernSmooth_2.23-14      stringi_0.5-5           XVector_0.8.0          
[52] genefilter_1.50.0       affyio_1.36.0           doRNG_1.6              
[55] limma_3.24.12           minfi_1.14.0            futile.logger_1.4.1    
[58] nor1mix_1.2-0           lambda.r_1.1.7          RColorBrewer_1.1-2     
[61] iterators_1.0.7         siggenes_1.42.0         tools_3.2.1            
[64] illuminaio_0.10.0       rngtools_1.2.4          survival_2.38-2        
[67] methylumi_2.14.0        AnnotationDbi_1.30.1    colorspace_1.2-6       
[70] GenomicRanges_1.20.5    beanplot_1.2           
lumi • 2.0k views
ADD COMMENT
2
Entering edit mode
@martin-morgan-1513
Last seen 6 weeks ago
United States

Neat. At some point in your work flow you've coerced your plain-old data.frame into a tbl_df, probably indirectly but you could have done it like

library(Biobase)
library(dplyr)
data(sample.ExpressionSet)
eset = sample.ExpressionSet
tbl_df(pData(eset))

Assignment for the data.frame works but not for the new-fangled object

> pData(eset) = pData(eset)
> pData(eset) = tbl_df(pData(eset))
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function 'pData<-' for signature '"ExpressionSet", "tbl_df"'

The reason is that ExpressionSet doesn't know that the 'tbl_df' class extends data.frame (maybe it should be able to figure this out: 

> class(tbl_df(pData(eset)))
[1] "tbl_df"     "tbl"        "data.frame"

The solution is to coerce your new-fangled object to a data.frame

> pData(eset) = as.data.frame(tbl_df(pData(eset)))
> 

 

 

 

ADD COMMENT
0
Entering edit mode

Good catch, it's been a very hot afternoon, I obviously missed str-ing my pheno table! I tried out readr's read_delim and got a tbl_df object back.... odd, thought it returned a data frame. Thanks!  

ADD REPLY

Login before adding your answer.

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