MaAsLin value output and CSS normalization

Hi,

I’m doing an analysis in MaAsLin and had a couple of questions.

  1. My fixed effect is sample location. I am comparing microbial differences in samples collected from the center and leading edge of tumours to contralateral healthy tissue samples. In my column labeled “location” I have samples labeled as “A_center”, “B_lead” and “C_cont”. I have set “C_cont” as my reference but the output data in the “value” column is listed as 1 and 2 instead of “A_center” and “B_lead”. I am assuming 1 = “A_center” and 2= “B_lead” but want to make sure. Does anyone know how to check. I already looked at the figures but its not obvious. See below attachments for clarifications.

  1. I am using an OTU table with count data. I am using the below code to run my data but the figures that are generated are still in counts i.e. it doesn’t appear to change count data to CSS. Is this expected?

fit_data = Maaslin2(
input_data = otudata5_df,
input_metadata = metadata3_df,
output = “Contralateral_vs_leading_center_1percent_filter_AUG21_22”,
normalization = ‘CSS’,
transform = ‘LOG’,
min_prevalence= 0.4,
min_abundance = 0.01,
fixed_effects = c(“location”),random_effects = c(“patient_id”), reference = c(“location,C_cont”))

![Screen Shot 2022-08-21 at 2.15.02 PM|690x327]


(upload://7PF6iTPL3qme4Nx6skc4vwmAUla.png)

Thanks for the help in advance.
Alya

1 Like

Commenting/following, I’m having the same issue as question two with TSS normalization.

Thanks,
Samantha

Hi @Alya,

For 1. The value 1 issue is one we are working on - it’s an R bug that (I believe) factors are being converted into nonsense. The plot should have Value: XXX where XXX is the significant variable in the comparison. Without the model output, I can’t say for certain but since the plot has C_cont as the first boxplot I believe it is doing the correct comparisons (by default it should be alphabetical unless you changed the reference, which is what you did here). So my best guess is that it is running as expected given your command.
For 2. Yes, that is expected behavior, MaAsLin plots the raw untransformed data - another update that we are working on in the future version of MaAsLin to allow the user to select what they want for the plots. For now, the data plotted is the input feature table. - This would also apply for @Samantha

I hope this helps!

Best,
Kelsey

Hi Kelsey,

Thanks for answering! I did have a follow-up question on your answer for question one. You said that the plots default to alphabetical unless the reference is changed. I changed the reference for all my categorical variables and the plots (seemed to have) correctly changed the order for all plots except one. Does that mean the model isn’t running properly?

Here is what I ran in R:

fit_data <- Maaslin2(
  input_data = df_counts,
  input_metadata = df_meta,
  min_prevalence = 0,
  normalization = "TSS",
  #transform = "None",
  output = "out_rec-init_norando",
  fixed_effects = c("recurrent_initial_formers","sex","CA_Weight","OX_BSA","Cit_BSA"),
  reference = c("recurrent_initial_reformers,initial","CA_Weight:normal","OX_BSA:normal",
                "Cit_BSA:normal")
)

And here is the offending plot:

Is this something I should be concerned about or just a quirk and I can move on with confidence?

Thanks,
Samantha

Hi @Samantha,

This is another fix we have in the pipeline. Currently, MaAsLin ignores the setting of the reference in 2 level categoricals. So in this case MaAsLin is using abnormal as the reference. If you want to use these data still you can simply flip the sign on the coef, which would change the direction of the association. If you want to check this the numbers should be basically the same if you rename normal to a_normal - for which MaAsLin would then use normal as the reference.

I hope this helps!

Best,
Kelsey