Message 'invalid data format' on impute.MAR function
0
0
Entering edit mode
@9a33c5a0
Last seen 10 weeks ago
United States

I'm trying to build a plugin R to be run from within Perseus. The plugin should take an input matrix, replace de missing values and return the imputed matrix (code below).

The input matrix is created by 'Create random matrix' (in Perseus) with 1000 lines, 12 columns and 10% of missing values. The R script is called by Perseus with 'External : Matrix => R'. When the R script reaches the 'impute.MAR' function, it sends the message 'Error in pca(dataSet.mvs, method='svdimpute', pPcs = K) : invalid data format' and stops.

The same function 'impute.MAR' works fine when I run from a standalone script (directly from RStudio) and generate the sample matrix with the function 'generate.ExpressionData'.

Thanks for any help.

```library(imputeLCMD)
```library(PerseusR)
```args = commandArgs(trailingOnly=TRUE)
```if (length(args) != 2) {
```  stop("Do not provide additional arguments!", call.=FALSE)
```}
```inFile <- args[1]
```outFile <- args[2]
```mdata <- read.perseus(inFile)
```mainMatrix <- main(mdata)
```dfx = as.data.frame(mainMatrix) 
```m.s = model.Selector(dfx)
```df2 = impute.MAR(dfx, m.s, method = "SVD")
```outMdata <- matrixData(main=df2)
```write.perseus(outMdata, outFile)

```sessionInfo( ) R version 4.4.0 (2024-04-24 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows 10 x64 (build 19045) Matrix products: default locale: [1] LC_COLLATE=Portuguese_Brazil.utf8 LC_CTYPE=Portuguese_Brazil.utf8
[3] LC_MONETARY=Portuguese_Brazil.utf8 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.utf8
time zone: America/Sao_Paulo tzcode source: internal attached base packages: [1] stats4 stats graphics grDevices utils datasets methods base
other attached packages: [1] imputeLCMD_2.1 impute_1.78.0 pcaMethods_1.96.0 Biobase_2.64.0
[5] BiocGenerics_0.50.0 norm_1.0-11.1 tmvtnorm_1.6 gmm_1.8
[9] sandwich_3.1-0 Matrix_1.7-0 mvtnorm_1.2-5 BiocManager_1.30.23 [13] PerseusR_0.3.4
loaded via a namespace (and not attached): [1] cli_3.6.2 rlang_1.1.3 stringi_1.8.4 glue_1.7.0 zoo_1.8-12
[6] plyr_1.8.9 grid_4.4.0 MASS_7.3-60.2 lifecycle_1.0.4 stringr_1.5.1
[11] compiler_4.4.0 Rcpp_1.0.12 rstudioapi_0.16.0 lattice_0.22-6 magrittr_2.0.3
[16] tools_4.4.0

impute • 244 views

Login before adding your answer.

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