I am currently working on an analysis using MCIA in the Omicsanalyst website and downloaded the ‘loading_mcia’ file. And I am curious about how these values are calculated. So, I looked at the code on GitHub (https://github.dev/xia-lab/OmicsAnalystR, specifically, line 61 in ‘util_dimreduction,’ where it mentions ‘loading.pos.xyz = mcoin$mcoa$Tco’). I noticed that the ‘mcia’ function calls the ‘omicade4’ package. Subsequently, I loaded ‘omicade4’ and performed the calculations with the same data and parameters. However, the values obtained from ‘mcoin$mcoa$Tco’ do not match the ‘loading_mcia’ file generated by Omicsanalyst. I would like to understand why this discrepancy exists. Very appreciate if anyone could help me about this.
OmicsAnalyst has performed unit scaling on the loading values so that the values fall between -1 and 1 for subsequent visualization in 3D space.
Guangyan
Thank you for your response. I have noticed that in the code from line 143 to 189 on GitHub (https://github.dev/xia-lab/OmicsAnalystR), there is unit scaling applied to the loading values, but this seems to be specifically for the DIABLO method(line 117 reductionOpt == “diablo”), not MCIA. As I mentioned earlier, when the dimensionality reduction method is set to MCIA, the loading values are assigned as ‘loading.pos.xyz = mcoin$mcoa$Tco’ and do not undergo any data scaling before being saved (line 204, fast.write.csv(loading.pos.xyz, file=fileNm)). Furthermore, I have tried various scaling methods on the ‘mcoin$mcoa$Tco’ data generated by omicade4, but the discrepancy still persists. This has left me puzzled, and I am eagerly looking forward to your response. Your help would be greatly appreciated.
I see, the values from saved file was not unit scaled before saving. In that case, I am not quite sure what could be the reason. the loading.pos.xyz data.frame, like you said, hasn’t gone any modifications after being generated from “mcia” function. Can you share with me your sessionInfo(). Could be related to difference in package version.
Sure, I conducted MCIA-Spearman correlation analysis online using the website https://www.omicsanalyst.ca/ on Augest 24th, and the sessionInfo() for the MCIA analysis performed by the omicade4 package are as following:
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8
[2] LC_CTYPE=Chinese (Simplified)_China.utf8
[3] LC_MONETARY=Chinese (Simplified)_China.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.utf8
time zone: Asia/Shanghai
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] omicade4_1.40.0 ade4_1.7-22 edgeR_3.42.4 limma_3.56.2
loaded via a namespace (and not attached):
[1] SummarizedExperiment_1.30.2 made4_1.74.0 gtable_0.3.4
[4] ellipse_0.5.0 ggplot2_3.4.3 caTools_1.18.2
[7] ggrepel_0.9.3 Biobase_2.60.0 lattice_0.21-8
[10] vctrs_0.6.3 tools_4.3.1 bitops_1.0-7
[13] generics_0.1.3 stats4_4.3.1 parallel_4.3.1
[16] tibble_3.2.1 fansi_1.0.4 rARPACK_0.11-0
[19] pkgconfig_2.0.3 KernSmooth_2.23-22 Matrix_1.6-1
[22] RColorBrewer_1.1-3 S4Vectors_0.38.1 mixOmics_6.24.0
[25] scatterplot3d_0.3-44 lifecycle_1.0.3 GenomeInfoDbData_1.2.10
[28] compiler_4.3.1 stringr_1.5.0 gplots_3.1.3
[31] Biostrings_2.68.1 munsell_0.5.0 codetools_0.2-19
[34] GenomeInfoDb_1.36.2 RCurl_1.98-1.12 pillar_1.9.0
[37] crayon_1.5.2 tidyr_1.3.0 MASS_7.3-60
[40] BiocParallel_1.34.2 DelayedArray_0.26.7 abind_1.4-5
[43] RSpectra_0.16-1 gtools_3.9.4 tidyselect_1.2.0
[46] locfit_1.5-9.8 stringi_1.7.12 dplyr_1.1.2
[49] reshape2_1.4.4 purrr_1.0.2 grid_4.3.1
[52] colorspace_2.1-0 cli_3.6.1 magrittr_2.0.3
[55] S4Arrays_1.0.6 utf8_1.2.3 corpcor_1.6.10
[58] scales_1.2.1 XVector_0.40.0 matrixStats_1.0.0
[61] igraph_1.5.1 gridExtra_2.3 GenomicRanges_1.52.0
[64] IRanges_2.34.1 rlang_1.1.1 Rcpp_1.0.11
[67] glue_1.6.2 BiocGenerics_0.46.0 rstudioapi_0.15.0
[70] R6_2.5.1 plyr_1.8.8 MatrixGenerics_1.12.3
[73] zlibbioc_1.46.0
In the server, the ade package is: ade4_1.7-20. Note, I have extracted mcia function from omicade4 in order to save memory consumption from loading package, that line: library(omicade4) was added back by mistake. So only ade4 is used. Perhaps, the differences are caused by the difference in version.
If it were due to version or data scaling issues, it should only result in minor differences in the loading values, and there shouldn’t be significant inconsistencies in the variable rankings. However, I compared the results from the two packages, and there are considerable discrepancies in the variable rankings. Therefore, I think that version issues may not adequately explain the current phenomenon. Do you think there could be any other possibilities?
Hello Shiwan,
I am unable to reproduce the issue. I would need more details about the input, the R script you have used to get different results.
Guangyan
Sorry, I missed the message notification. Here is my Rscript:
library(omicade4)
data.SCZ ← list(Bacteria= X.SCZ.b_family_diff, metabo = X.metabo.SCZ);sapply(data.SCZ, dim)
mcoin.SCZ ← mcia(data.SCZ,cia.nf = 5)
mcia_loading ← mcoin.SCZ[[“mcoa”]][[“Tco”]]
where " X.SCZ.b_family_diff" and “X.metabo.SCZ” are my own data. If you need them to reproduce the issue, can you please provide a more private way to receive them? As this part of data hasn’t been published yet.
The generated mcia_loading file do not match the ‘loading_mcia’ file generated by Omicsanalyst.