# Replotting MaAsLin3 output in specific column order

**URL:** <https://forum.biobakery.org/t/replotting-maaslin3-output-in-specific-column-order/9047>\
**Category:** MaAsLin\
**Created:** [August 31, 2026, 11:10pm UTC](https://forum.biobakery.org/t/replotting-maaslin3-output-in-specific-column-order/9047 "2026-08-31T23:10:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![franciscodanieldavi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/franciscodanieldavi/32/3696_2.png) [@franciscodanieldavi](https://forum.biobakery.org/u/franciscodanieldavi)\
**Post date:** [August 31, 2026, 11:10pm UTC](https://forum.biobakery.org/t/replotting-maaslin3-output-in-specific-column-order/9047/1 "2026-08-31T23:10:15Z")

</div>

Hi Will,

I am running MaAsLin3 using the following code:

```auto
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:

 ![summary_plot](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/2/27d4b8a5ac4d9ac87dc96bcffa4d1b6cad35a141.png)

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

---

<div class="post-metadata">

**Author:** ![WillNickols](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/willnickols/32/3223_2.png) [@WillNickols](https://forum.biobakery.org/u/WillNickols)\
**Post date:** [September 1, 2026, 12:30am UTC](https://forum.biobakery.org/t/replotting-maaslin3-output-in-specific-column-order/9047/2 "2026-09-01T00:30:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![franciscodanieldavi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/franciscodanieldavi/32/3696_2.png) [@franciscodanieldavi](https://forum.biobakery.org/u/franciscodanieldavi)\
**Post date:** [September 2, 2026, 5:00pm UTC](https://forum.biobakery.org/t/replotting-maaslin3-output-in-specific-column-order/9047/3 "2026-09-02T17:00:41Z")

</div>

Hi Will,

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

```auto
# 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:

 ![summary_plot](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/a/a9fa52936108ab478cf9a94897caae77a65c432d.jpeg)

Thanks a lot!

Daniel

---

<div class="post-metadata">

**Author:** ![franciscodanieldavi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/franciscodanieldavi/32/3696_2.png) [@franciscodanieldavi](https://forum.biobakery.org/u/franciscodanieldavi)\
**Post date:** [October 2, 2026, 9:56pm UTC](https://forum.biobakery.org/t/replotting-maaslin3-output-in-specific-column-order/9047/4 "2026-10-02T21:56:56Z")

</div>

Hi again Will,

I just noticed that when generating the summary plots for two conditions (Ox and Hypox), the range of BOTH the Abundance and Prevalence P\_FDR differs between them (PLOT 1:Prevalence 0.1-1 Abundance 0.1 -1; Figure 2: Prevalence: 1e-3 - 1, Abundance 1e-3 - 1 )but the colour gradient is the same. Is there a way to set Figure 1 scale from 1e-3 to 1?

I have attached both summary plots for your reference.

Thanks!

Daniel

 ![Hypox_summary_plot](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/8/8ad880d8553092e0b5b07847dc05a83010ef8a50.png)

 ![Ox_all_summary_plot](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/2X/5/5517f80f8ae7b6659ba6450b4e8bead2be057fe7.png)

---

<div class="post-metadata">

**Author:** ![WillNickols](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/willnickols/32/3223_2.png) [@WillNickols](https://forum.biobakery.org/u/WillNickols)\
**Post date:** [October 2, 2026, 10:13pm UTC](https://forum.biobakery.org/t/replotting-maaslin3-output-in-specific-column-order/9047/5 "2026-10-02T22:13:30Z")

</div>

If you’re referring to the fact that the two scales are different across two different plotting runs, there’s not a direct way to harmonize these in MaAsLin. The plotting output should produce ggplot objects though, and I bet if you give those to Claude/Chat they could write some code to synchronize the scales.

Will

---

<div class="post-metadata">

**Author:** ![jamesleonelwyn2003](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jamesleonelwyn2003](https://forum.biobakery.org/u/jamesleonelwyn2003)\
**Post date:** [November 22, 2026, 1:27am UTC](https://forum.biobakery.org/t/replotting-maaslin3-output-in-specific-column-order/9047/6 "2026-11-22T01:27:37Z")

</div>

Will is right that MaAsLin doesn’t expose a single shared scale. Since the outputs are ggplot objects, add the same continuous fill/colour scale to both before saving, e.g. `scale_fill_continuous(limits = c(1e-3, 1), oob = scales::squish)` and `scale_colour_continuous(limits = c(1e-3, 1), oob = scales::squish)`. If the P\_FDR colours are log-scaled, add `trans = "log10"` to both scales. That will put both plots on the same 1e-3–1 range.
