Xtfrm error with MTXmodel default example in R

MTXmodel 1.2.3

I was running the MTX model Demo

library(MTXmodel)
input_data <- read.table("HMP2_pwyRNA.tsv", sep="\t",header=T,row.names=1)
input_metadata <-read.table("HMP2_metadata.tsv", sep="\t",header=T,row.names=1)
input_dnadata <- read.table("HMP2_pwyDNA.tsv", sep="\t",header=T,row.names=1)
fit_data <- MTXmodel(
  input_data, input_metadata, 'demo_output', transform = "LOG",
  fixed_effects = c('diagnosis', 'dysbiosisnonIBD','dysbiosisUC','dysbiosisCD', 'antibiotics', 'age'),
  random_effects = c('site', 'subject'),
  reference = "diagnosis,nonIBD",
  normalization = 'NONE',
  standardize = FALSE,
  input_dnadata = input_dnadata
)

leading to the following error:

Error in xtfrm.data.frame(x) : cannot xtfrm data frames

My R session:

> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.4.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

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

time zone: Europe/Vienna
tzcode source: internal

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

other attached packages:
 [1] MTXmodel_1.2.3              sva_3.48.0                 
 [3] BiocParallel_1.34.2         genefilter_1.82.1          
 [5] mgcv_1.8-42                 nlme_3.1-162               
 [7] pheatmap_1.0.12             EnhancedVolcano_1.18.0     
 [9] DESeq2_1.40.2               SummarizedExperiment_1.30.2
[11] Biobase_2.60.0              MatrixGenerics_1.12.3      
[13] matrixStats_1.0.0           GenomicRanges_1.52.0       
[15] GenomeInfoDb_1.36.2         IRanges_2.34.1             
[17] S4Vectors_0.38.1            BiocGenerics_0.46.0        
[19] cowplot_1.1.1               Matrix_1.6-1               
[21] gtable_0.3.4                ggrepel_0.9.3              
[23] gridExtra_2.3               reshape_0.8.9              
[25] PerformanceAnalytics_2.0.4  xts_0.13.1                 
[27] zoo_1.8-12                  plotrix_3.8-2              
[29] compare_0.2-6               fpc_2.2-10                 
[31] cluster_2.1.4               phangorn_2.11.1            
[33] ade4_1.7-22                 vegan_2.6-4                
[35] lattice_0.21-8              permute_0.9-7              
[37] GUniFrac_1.7                lubridate_1.9.2            
[39] forcats_1.0.0               stringr_1.5.0              
[41] dplyr_1.1.3                 purrr_1.0.2                
[43] readr_2.1.4                 tidyr_1.3.0                
[45] tibble_3.2.1                ggplot2_3.4.3              
[47] tidyverse_2.0.0             phyloseq_1.44.0            
[49] ape_5.7-1                  

loaded via a namespace (and not attached):
  [1] splines_4.3.1           bitops_1.0-7            lpsymphony_1.28.1      
  [4] XML_3.99-0.14           rpart_4.1.19            lifecycle_1.0.3        
  [7] edgeR_3.42.4            vroom_1.6.3             prabclus_2.3-2         
 [10] MASS_7.3-60             magrittr_2.0.3          limma_3.56.2           
 [13] flexmix_2.3-19          DBI_1.1.3               RColorBrewer_1.1-3     
 [16] abind_1.4-5             zlibbioc_1.46.0         quadprog_1.5-8         
 [19] RCurl_1.98-1.12         hash_2.2.6.3            nnet_7.3-19            
 [22] GenomeInfoDbData_1.2.10 rmutil_1.1.10           spatial_7.3-16         
 [25] annotate_1.78.0         getopt_1.20.3           codetools_0.2-19       
 [28] DelayedArray_0.26.7     tidyselect_1.2.0        farver_2.1.1           
 [31] stable_1.1.6            jsonlite_1.8.7          multtest_2.56.0        
 [34] survival_3.5-5          iterators_1.0.14        foreach_1.5.2          
 [37] tools_4.3.1             Rcpp_1.0.11             glue_1.6.2             
 [40] withr_2.5.0             BiocManager_1.30.22     timeSeries_4031.107    
 [43] fastmap_1.1.1           rhdf5filters_1.12.1     fansi_1.0.4            
 [46] digest_0.6.33           timechange_0.2.0        R6_2.5.1               
 [49] colorspace_2.1-0        RSQLite_2.3.1           diptest_0.76-0         
 [52] modeest_2.4.0           utf8_1.2.3              generics_0.1.3         
 [55] data.table_1.14.8       robustbase_0.99-0       class_7.3-22           
 [58] httr_1.4.7              S4Arrays_1.0.5          pkgconfig_2.0.3        
 [61] timeDate_4022.108       modeltools_0.2-23       blob_1.2.4             
 [64] XVector_0.40.0          pcaPP_2.0-3             biomformat_1.28.0      
 [67] clue_0.3-64             logging_0.10-108        scales_1.2.1           
 [70] optparse_1.7.3          png_0.1-8               rstudioapi_0.15.0      
 [73] tzdb_0.4.0              reshape2_1.4.4          statip_0.2.3           
 [76] cachem_1.0.8            rhdf5_2.44.0            parallel_4.3.1         
 [79] AnnotationDbi_1.62.2    fBasics_4022.94         pillar_1.9.0           
 [82] vctrs_0.6.3             xtable_1.8-4            mvtnorm_1.2-3          
 [85] cli_3.6.1               locfit_1.5-9.8          compiler_4.3.1         
 [88] rlang_1.1.1             crayon_1.5.2            labeling_0.4.3         
 [91] mclust_6.0.0            plyr_1.8.8              stringi_1.7.12         
 [94] munsell_0.5.0           Biostrings_2.68.1       hms_1.1.3              
 [97] stabledist_0.7-1        bit64_4.0.5             Rhdf5lib_1.22.0        
[100] KEGGREST_1.40.0         statmod_1.5.0           kernlab_0.9-32         
[103] igraph_1.5.1            memoise_2.0.1           biglm_0.9-2.1          
[106] fastmatch_1.1-4         DEoptimR_1.1-2          bit_4.0.5 

This probably relates to:

Running the same dataset in Maaslin2 works without any problem.

Hi there,

This xtfrm warning should be fixed in MTXmodel v1.2.4 (Release MTXmodel v1.2.4 · biobakery/MTX_model · GitHub). We tested it working well in R version 4.2.0.

Thanks!
Yancong

1 Like

Dear Yangcong Zhang,

thank you for the lightning fast reply. I can confirm that everything is working now with v1.2.4.

Have a nice day !
Max