MyNixOS website logo
Description

Create (Advanced) Coupled.

Creation and selection of (Advanced) Coupled Matrix and Tensor Factorization (ACMTF) and ACMTF-Regression (ACMTF-R) models. Selection of the optimal number of components can be done using 'ACMTF_modelSelection()' and 'ACMTFR_modelSelection()'. The CMTF and ACMTF methods were originally described by Acar et al., 2011 <doi:10.48550/arXiv.1105.3422> and Acar et al., 2014 <doi:10.1186/1471-2105-15-239>, respectively.

CMTFtoolbox CMTFtoolbox website

codecov R-CMD-check

Overview

The CMTFtoolbox package provides R users with two data fusion methods that have previously been presented in the MATLAB sphere.

  • cmtf_opt: Coupled Matrix and Tensor Factorization (CMTF) (doi:10.48550/arXiv.1105.3422).
  • acmtf_opt: Advanced Coupled Matrix and Tensor Factorization (ACMTF) (doi:10.1186/1471-2105-15-239).
  • acmtfr_opt: ACMTF-regression (ACMTF-R) as described in van der Ploeg et al., 2025 (see citation below).

Both of these methods were implemented using the all-at-once optimization approaches as described in the papers above. This implementation was achieved using the S4 Tensor object from rTensor and the various conjugate gradient approaches from mize. Other features of the package include:

  • ACMTF_modelSelection: Combined random initialization and cross-validation approach for determining the correct number of components in ACMTF.
  • ACMTFR_modelSelection: Combined random initialization and cross-validation approach for determining the correct number of components in ACMTF-R.
  • npred: Prediction of Y for a new sample using an existing ACMTF-R model.
  • Georgiou2025: An example dataset containing a tensor of inflammatory mediator data and a matrix of tooth microbiome data in a cohort of apical periodontitis patients (doi:10.1111/iej.13854 and doi:10.1111/iej.13912).

Installation

The CMTFtoolbox package can be installed from CRAN using:

install.packages("CMTFtoolbox")

Development version

You can install the development version of CMTFtoolbox from GitHub with:

# install.packages("devtools")
devtools::install_github("GRvanderPloeg/CMTFtoolbox")

Citation

Please use the following citation when using this package:

  • van der Ploeg, G. R., White, F. T. G., Jakobsen, R. R., Westerhuis, J., Heintz-Buschart, A., & Smilde, A. (2024). ACMTF-R: supervised multi-omics data integration uncovering shared and distinct outcome-associated variation. bioRxiv. 2025.07.28.667162; doi:10.1101/2025.07.28.667162

Usage

library(CMTFtoolbox)

set.seed(123)
numComponents = 3
I = 108
J = 100
K = 10
L = 100
A = array(rnorm(I*numComponents), c(I, numComponents))  # shared subject mode
B = array(rnorm(J*numComponents), c(J, numComponents))  # distinct feature mode of X1
C = array(rnorm(K*numComponents), c(K, numComponents))  # distinct condition mode of X1
D = array(rnorm(L*numComponents), c(L, numComponents))  # distinct feature mode of X2
Y = matrix(A[,1])
lambdas = array(c(1, 1, 1, 0, 0, 1), c(2,3))

df1 = array(0L, c(I, J, K))
df2 = array(0L, c(I, L))
for(i in 1:numComponents){
  df1 = df1 + lambdas[1,i] * reinflateTensor(A[,i], B[,i], C[,i])
  df2 = df2 + lambdas[2,i] * reinflateMatrix(A[,i], D[,i])
}
datasets = list(df1, df2)
modes = list(c(1,2,3), c(1,4))
Z = setupCMTFdata(datasets, modes, normalize=TRUE)

cmtf_model = cmtf_opt(Z, 3)
acmtf_model = acmtf_opt(Z, 3)
acmtfr_model = acmtfr_opt(Z, Y, 3)
Metadata

Version

1.0.1

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows