Replotting MaAsLin3 output in specific column order

Hi Will,

I am running MaAsLin3 using the following code:

set.seed(1)
fit_out <- maaslin3(input_data = seqtab.nochim,
                    input_metadata = sample_data,
                    output = "Ox_vs_time",
                    formula = "~ time_point + (1|replicate)",
                    normalization = "TSS",
                    transform = "LOG",
                    augment = TRUE,
                    standardize = TRUE,
                    small_random_effects = TRUE,
                    reference = ("time_point,T1"),
                    max_significance = 0.1,
                    median_comparison_abundance = TRUE,
                    median_comparison_prevalence = FALSE,
                    max_pngs = 25)

and I got the following summary plot:

I would like to know if it is possible to replot the summary figure so the scatter plot shows first time point 2 and later time point 5? Same with the heatmap, I would like to plot time point 2 first then time point 3, time point 4 and finally time point 5, so I can see the results in a chronological way. Is it possible?

Thanks for your help!
Daniel

Yes - if you use coef_plot_vars and heatmap_vars, the order should appear as the vectors you provide to those parameters. Let me know if that doesn’t work like you’re expecting.

Will

Hi Will,

Thanks for your prompt reply. Yes, it worked. The code that I ran was:

# Set coef_plot_vars and heatmap_vars
coef_vars <- c('time_point T2', 'time_point T5')
heat_vars <- c('time_point T2', 'time_point T3','time_point T4', 'time_point T5')

# Running MaAsLin3 for Amended samples only
set.seed(1)
fit_out <- maaslin3(input_data = seqtab.nochim,
                    input_metadata = sample_data,
                    output = "Anox_vs_time",
                    formula = "~ time_point + (1|replicate)",
                    normalization = "TSS",
                    transform = "LOG",
                    augment = TRUE,
                    standardize = TRUE,
                    small_random_effects = TRUE,
                    reference = ("time_point,T1"),
                    max_significance = 0.1,
                    median_comparison_abundance = TRUE,
                    median_comparison_prevalence = FALSE,
                    max_pngs = 25,
                    coef_plot_vars = coef_vars,
                    heatmap_vars = heat_vars)

and it was able to generate the desired figure:

Thanks a lot!

Daniel