Question: DEP: Grouping Samples for missing value imputation
0
gravatar for alex.gos90
18 months ago by
alex.gos9010
alex.gos9010 wrote:

Dear Arne Smits and Wolfgang Huber,

First, Thank you for your amazing package it really helps me a lot to easily perform the kind of analysis that I was looking for.

But there is one thing that I would like to know, is there a way to perform the missing value imputation in a group wise manner, just like it is possible in the Perseus analysis software? 


The reason why I need this is that I am analysing co-IP mass spec data for two different animal conditions compared to control with three replicates each. The difficulty here is that the control is an empty bead without antibody, leading to rather expected missing values. So I would like to do a group-wise imputation to keep the separate conditions clear.   

 

Best,

Alex

ADD COMMENTlink modified 16 months ago • written 18 months ago by alex.gos9010
Answer: DEP: Grouping Samples for missing value imputation
2
gravatar for Laurent Gatto
18 months ago by
Laurent Gatto1.1k
United Kingdom
Laurent Gatto1.1k wrote:

If your data is in an MSnSet, you can impute different subsets and combine the results. In the example below, I assume that I want to independently impute condition 1 (samples/columns 1 to 8) and condition 2 (samples/columns 9:16):

> suppressPackageStartupMessages(library("MSnbase"))
> data(naset)
> dim(naset)
[1] 689  16
> e1 <- exprs(impute(naset[, 1:8], method = "zero"))
> e2 <- exprs(impute(naset[, 9:16], method = "zero"))
> exprs(naset) <- cbind(e1, e2)

Hope this helps.

Laurent

> sessionInfo()
R version 3.4.2 Patched (2017-10-12 r73548)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

Matrix products: default
BLAS: /usr/lib/atlas-base/libf77blas.so.3.0
LAPACK: /usr/lib/atlas-base/atlas/liblapack.so.3.0

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

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

other attached packages:
[1] MSnbase_2.4.0        ProtGenerics_1.9.1   BiocParallel_1.11.13
[4] mzR_2.11.12          Rcpp_0.12.13         Biobase_2.37.2      
[7] BiocGenerics_0.23.4

loaded via a namespace (and not attached):
 [1] IRanges_2.11.19       zlibbioc_1.23.0       doParallel_1.0.11    
 [4] munsell_0.4.3         colorspace_1.3-2      impute_1.51.0        
 [7] lattice_0.20-35       rlang_0.1.4           foreach_1.4.3        
[10] msdata_0.17.1         plyr_1.8.4            tools_3.4.2          
[13] mzID_1.15.0           grid_3.4.2            gtable_0.2.0         
[16] affy_1.55.0           iterators_1.0.8       digest_0.6.12        
[19] lazyeval_0.2.0        tibble_1.3.4          preprocessCore_1.39.3
[22] affyio_1.47.2         ggplot2_2.2.1         S4Vectors_0.15.14    
[25] codetools_0.2-15      MALDIquant_1.16.4     limma_3.33.14        
[28] BiocInstaller_1.28.0  compiler_3.4.2        pcaMethods_1.69.0    
[31] scales_0.5.0          stats4_3.4.2          XML_3.98-1.9         
[34] vsn_3.45.2
ADD COMMENTlink modified 18 months ago • written 18 months ago by Laurent Gatto1.1k
Answer: DEP: Grouping Samples for missing value imputation
1
gravatar for arne.smits
18 months ago by
arne.smits20
arne.smits20 wrote:

The data is stored in a SummarizedExperiment object in DEP. Therefore, we need a small workaround to be able to use Laurent's solution. DEP offers the function se2msn to easily turn a SummarizedExperiment into an MSnSet. Next, we use the exprs and impute functions from MSnbase and eventually store the data in a SummarizedExperiment object. See the example below where we start with the SummarizedExperiment object 'se'.


> library("DEP")
> suppressPackageStartupMessages(library("SummarizedExperiment"))
> MSnSet_data <- se2msn(se)
> MSnSet_imputed1 <- MSnbase::impute(MSnSet_data[, 1:8], method = "zero")
> MSnSet_imputed2 <- MSnbase::impute(MSnSet_data[, 9:16], method = "zero")
> assay(se) <- cbind(MSnbase::exprs(MSnSet_imputed1),
                                 MSnbase::exprs(MSnSet_imputed2))



Best,

Arne

 

 

 

ADD COMMENTlink modified 18 months ago • written 18 months ago by arne.smits20
Please log in to add an answer.

Help
Access

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