Hi -
I’m having a new issue with an update to Maaslin2 (I’m running the same code as I ran in version 1.10.0 now in version 1.14.1 and now experiencing an error). I believe the error is related to my input data and input metadata, but I’m not sure how to fix it. I am getting two different errors depending on how I import my data/metadata. The first way I tried is the exact same way as I was successfully importing the data/metadata before with 1.10.0. The second way is the suggested import method from the Maaslin2 tutorial online. There are NAs in the matrix, but I don’t believe that is the issue as I have replaced them with 0’s and still have the same errors. I have included a subset of my data to help troubleshoot/replicate the errors.
Thank you for any help.
Main session information:
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.6 LTS
> packageVersion("Maaslin2")
[1] ‘1.14.1’
First version of the code I have tried to run:
library(dplyr) # v. 1.1.2
library(Maaslin2) # v. 1.14.1
library(ggplot2) # v. 3.4.2
library(ggpubr) # v. 0.6.0
# 1. Load metadata ####
metadata <- read.csv(file = "metadata_subset.csv", sep = ",", header= TRUE)
# 2. Load Data ####
df <- read.csv(file = "OTU_FUNguild_subset.csv", sep = ",", header= TRUE)
# 3. Run MaAsLin2 - subset ####
fit_data_cplm_none_category <-
Maaslin2(
input_data = df,
input_metadata = metadata,
output = "fit_data_cplm_none_category",
analysis_method = "CPLM",
normalization = "NONE",
transform = "NONE",
fixed_effects = c("category_broad")
)
Error:
Error in Maaslin2(input_data = df, input_metadata = metadata, output = "fit_data_cplm_none_category", :
If supplying input_data as a data frame, it must have appropriate rownames!
Second version of the code I have tried to run:
library(dplyr) # v. 1.1.2
library(Maaslin2) # v. 1.14.1
library(ggplot2) # v. 3.4.2
library(ggpubr) # v. 0.6.0
# 1. Load metadata ####
metadata <- read.csv(file = "metadata_subset.csv", sep = ",", header= TRUE, row.names = 1, stringsAsFactors = FALSE)
# 2. Load Data ####
df <- read.csv(file = "OTU_FUNguild_subset.csv", sep = ",", header= TRUE, row.names = 1, stringsAsFactors = FALSE)
# 3. Run MaAsLin2 - subset ####
fit_data_cplm_none_category <-
Maaslin2(
input_data = df,
input_metadata = metadata,
output = "fit_data_cplm_none_category",
analysis_method = "CPLM",
normalization = "NONE",
transform = "NONE",
fixed_effects = c("category_broad")
)
Error:
Error in `rownames<-`(x, value) :
attempt to set 'rownames' on an object with no dimensions
Other session info:
> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.6 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: America/Chicago
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggpubr_0.6.0 ggplot2_3.4.2 dplyr_1.1.2 Maaslin2_1.14.1
loaded via a namespace (and not attached):
[1] gtable_0.3.3 ggsignif_0.6.4 compiler_4.3.0 crayon_1.5.2 tidyselect_1.2.0 optparse_1.7.3
[7] tidyr_1.3.0 scales_1.2.1 R6_2.5.1 generics_0.1.3 pcaPP_2.0-3 biglm_0.9-2.1
[13] robustbase_0.99-0 backports_1.4.1 tibble_3.2.1 car_3.1-2 munsell_0.5.0 DBI_1.1.3
[19] pillar_1.9.0 rlang_1.1.1 utf8_1.2.2 getopt_1.20.3 broom_1.0.5 cli_3.6.1
[25] withr_2.5.0 magrittr_2.0.3 grid_4.3.0 rstudioapi_0.14 mvtnorm_1.2-2 logging_0.10-108
[31] lifecycle_1.0.3 DEoptimR_1.0-14 vctrs_0.6.3 rstatix_0.7.2 glue_1.6.2 data.table_1.14.8
[37] abind_1.4-5 hash_2.2.6.2 carData_3.0-5 fansi_1.0.3 colorspace_2.1-0 purrr_1.0.1
[43] tools_4.3.0 pkgconfig_2.0.3
metadata_subset.csv (603 Bytes)
OTU_FUNguild_subset.csv (7.8 KB)