Hi everyone,
I am trying to run MaAsLin2 with a large data set of 300 taxa, controlling for 2 variables. I am using relative abundance data, and would ideally like to do a CLR transformation. I noticed that if I use the default TSS transformation, the program runs smoothly and I get results. However if I use CLR (without changing anything else), it doesn’t work, and I get the following error message multiple times, for every taxa:
Error in contrasts<-
(*tmp*
, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
I am confused as to how to resolve this issue? I assume it is not an issue with the factors in my metadata, since the same data ran smoothly with TSS.
Here is my code:
mas_1 = Maaslin2(
input_data = input_data,
input_metadata = input_metadata,
output = “Baseline_8_25_22_CLR”,
normalization = “CLR”,
analysis_method = “LM”,
correction = “BH”, #corrects for FDR
min_prevalence = 0.2,
fixed_effects = c(“IgG”, “Age”, “Sex”),
reference =c(“Sex, Male”)
)