plotForest() creates a feature- or sample-wise forest plot, showing
estimated results from a statistical test with their confidence intervals.
Additionally, the plot can be enriched with the tree structure and labelled
with Confidence Intervals (CIs), p-values and other side information.
plotForest(x, ...)
# S4 method for class 'TreeSummarizedExperiment'
plotForest(
x,
by = 1L,
effect.var = "effect",
ci.lower.var = "lower",
ci.upper.var = "upper",
err.var = NULL,
pval.var = "pval",
id.var = "rownames",
label.by = NULL,
order.by = NULL,
facet.by = NULL,
color.by = colour.by,
colour.by = NULL,
conf.level = 0.95,
tree.name = "phylo",
show.tree = TRUE,
...
)
# S4 method for class 'SummarizedExperiment'
plotForest(
x,
by = 1L,
effect.var = "effect",
ci.lower.var = "lower",
ci.upper.var = "upper",
err.var = NULL,
pval.var = "pval",
id.var = "rownames",
label.by = NULL,
order.by = NULL,
facet.by = NULL,
color.by = colour.by,
colour.by = NULL,
conf.level = 0.95
)
# S4 method for class 'data.frame'
plotForest(
x,
effect.var = "effect",
ci.lower.var = "lower",
ci.upper.var = "upper",
err.var = NULL,
pval.var = "pval",
id.var = "rownames",
label.by = NULL,
order.by = NULL,
facet.by = NULL,
color.by = colour.by,
colour.by = NULL,
conf.level = 0.95
)a
SummarizedExperiment
object, or a data.frame object containing statistical estimates.
additional parameters passed to plotRowTree.
Character scalar. Determines whether features or samples
data is used for the plot. (Default: "rows")
Character scalar. Specifies the variable of x which
corresponds to the effects or estimated results. (Default: "effect")
Character scalar. Specifies the variable of x
which corresponds to the lower CI boundaries. (Default: "lower")
Character scalar. Specifies the variable of x
which corresponds to the upper CI boundaries. (Default: "upper")
Character scalar. Specifies the variable of x which
corresponds to the standard errors associated with effect.var.
When defined, it overwrites ci.lower.var and ci.upper.var.
(Default: "pval")
Character scalar. Specifies the variable of x which
corresponds to the p-values associated with effect.var.
(Default: "pval")
Character scalar. Specifies the variable of x which
corresponds to the observation identifiers. When "rownames"),
the object rownames are used. (Default: "rownames")
Character vector. Specifies the variables of x or
row/colData(x) by which the plot should be labelled. "CI" and
"P-Value" are special entries which require either effect.var,
ci.lower.var and ci.upper.var or pval.var to be
specified, respectively. (Default: NULL)
Character scalar. Specifies the variable of x by which
observations are ordered. If NULL, the observations are ordered by
the tree structure if available. (Default: NULL)
Character scalar. Specifies the variable of x by which
observations are divided into horizontal facets. (Default: NULL)
Character scalar. Alias to colour.by.
Character scalar. Specifies the variable of x by
which observations are coloured. (Default: NULL)
Numeric scalar. Specifies the confidence level of
the interval when inferred from err.var. It is ignored when
ci.lower.var and ci.upper.var are defined.
(Default: 0.95)
Character scalar. Specifies a row/colTree from x.
(Default: "phylo")
Logical scalar. Should the tree structure of the data
be shown next to the forest plot?
a ggplot object.
library(mia)
library(maaslin3)
# Import dataset
data("Tengeler2020", package = "mia")
tse <- Tengeler2020
# Agglomerate by genus and subset by prevalence
tse <- subsetByPrevalent(tse, rank = "Genus", prevalence = 10/100)
#> Duplicated labels were made unique.
# Transform count assay to relative abundances
tse <- transformAssay(tse, assay.type = "counts", method = "relabundance")
# Run maaslin3
maaslin3_out <- maaslin3(
input_data = tse,
output = "maaslin_results",
formula = "~ patient_status",
)
#> 2026-03-23 13:19:46.919638 INFO::Writing function arguments to log file
#> 2026-03-23 13:19:46.939638 INFO::Verifying options selected are valid
#> 2026-03-23 13:19:46.940897 INFO::Determining format of input files
#> 2026-03-23 13:19:46.941483 INFO::Input format is data samples as rows and metadata samples as rows
#> 2026-03-23 13:19:46.943636 INFO::Running selected normalization method: TSS
#> 2026-03-23 13:19:46.945386 INFO::Creating output feature tables folder
#> 2026-03-23 13:19:46.946019 INFO::Writing normalized data to file maaslin_results/features/data_norm.tsv
#> 2026-03-23 13:19:46.948067 INFO::Filter data based on min abundance, min prevalence, and max prevalence
#> 2026-03-23 13:19:46.948627 INFO::Total samples in data: 27
#> 2026-03-23 13:19:46.949129 INFO::Min samples required with min abundance for a feature not to be filtered: 0.000000
#> 2026-03-23 13:19:46.949647 INFO::Max samples allowed with min abundance for a feature not to be filtered: 27.270000
#> 2026-03-23 13:19:46.955182 INFO::Total filtered features: 0
#> 2026-03-23 13:19:46.955842 INFO::Filtered feature names from abundance, min prevalence, and max prevalence filtering:
#> 2026-03-23 13:19:46.957124 INFO::Total features filtered by non-zero variance filtering: 0
#> 2026-03-23 13:19:46.957705 INFO::Filtered feature names from variance filtering:
#> 2026-03-23 13:19:46.95821 INFO::Writing filtered data to file maaslin_results/features/filtered_data.tsv
#> 2026-03-23 13:19:46.959774 INFO::Running selected transform method: LOG
#> 2026-03-23 13:19:46.961024 INFO::Writing normalized, filtered, transformed data to file maaslin_results/features/data_transformed.tsv
#> 2026-03-23 13:19:46.962897 INFO::Applying z-score to standardize continuous metadata
#> 2026-03-23 13:19:46.966542 INFO::Running the linear model component
#> 2026-03-23 13:19:46.979269 INFO::Fitting model to feature number 1, Akkermansia
#> 2026-03-23 13:19:46.983254 INFO::Fitting model to feature number 2, Alistipes
#> 2026-03-23 13:19:46.986314 INFO::Fitting model to feature number 3, Anaerostipes
#> 2026-03-23 13:19:46.989316 INFO::Fitting model to feature number 4, Anaerotruncus
#> 2026-03-23 13:19:46.992261 INFO::Fitting model to feature number 5, Bacteroides
#> 2026-03-23 13:19:46.995158 INFO::Fitting model to feature number 6, Barnesiella
#> 2026-03-23 13:19:46.99803 INFO::Fitting model to feature number 7, Blautia
#> 2026-03-23 13:19:47.000976 INFO::Fitting model to feature number 8, Butyricicoccus
#> 2026-03-23 13:19:47.002603 WARNING::Fitting problem for feature 8 returning NA
#> 2026-03-23 13:19:47.004216 INFO::Fitting model to feature number 9, Catabacter
#> 2026-03-23 13:19:47.007126 INFO::Fitting model to feature number 10, Clostridium_sensu_stricto_1
#> 2026-03-23 13:19:47.008837 INFO::Fitting model to feature number 11, Coprobacter
#> 2026-03-23 13:19:47.011761 INFO::Fitting model to feature number 12, Coprococcus_2
#> 2026-03-23 13:19:47.014693 INFO::Fitting model to feature number 13, Dielma
#> 2026-03-23 13:19:47.017572 INFO::Fitting model to feature number 14, Eisenbergiella
#> 2026-03-23 13:19:47.020442 INFO::Fitting model to feature number 15, Epulopiscium
#> 2026-03-23 13:19:47.023347 INFO::Fitting model to feature number 16, Erysipelatoclostridium
#> 2026-03-23 13:19:47.026239 INFO::Fitting model to feature number 17, Escherichia-Shigella
#> 2026-03-23 13:19:47.029171 INFO::Fitting model to feature number 18, Eubacterium
#> 2026-03-23 13:19:47.032104 INFO::Fitting model to feature number 19, Faecalibacterium
#> 2026-03-23 13:19:47.034992 INFO::Fitting model to feature number 20, Flavonifractor
#> 2026-03-23 13:19:47.037875 INFO::Fitting model to feature number 21, Fusicatenibacter
#> 2026-03-23 13:19:47.040817 INFO::Fitting model to feature number 22, Halomonas
#> 2026-03-23 13:19:47.043703 INFO::Fitting model to feature number 23, Holdemania
#> 2026-03-23 13:19:47.046614 INFO::Fitting model to feature number 24, Hungatella
#> 2026-03-23 13:19:47.049429 INFO::Fitting model to feature number 25, Lachnoclostridium
#> 2026-03-23 13:19:47.052359 INFO::Fitting model to feature number 26, Lachnospiraceae_ND3007_group
#> 2026-03-23 13:19:47.055245 INFO::Fitting model to feature number 27, Odoribacter
#> 2026-03-23 13:19:47.058153 INFO::Fitting model to feature number 28, Parabacteroides
#> 2026-03-23 13:19:47.06106 INFO::Fitting model to feature number 29, Paraprevotella
#> 2026-03-23 13:19:47.064001 INFO::Fitting model to feature number 30, Roseburia
#> 2026-03-23 13:19:47.067055 INFO::Fitting model to feature number 31, Ruminiclostridium_5
#> 2026-03-23 13:19:47.070015 INFO::Fitting model to feature number 32, Ruminiclostridium_9
#> 2026-03-23 13:19:47.072929 INFO::Fitting model to feature number 33, Ruminococcaceae_UCG-004
#> 2026-03-23 13:19:47.07583 INFO::Fitting model to feature number 34, Ruminococcaceae_UCG-013
#> 2026-03-23 13:19:47.078703 INFO::Fitting model to feature number 35, Ruminococcaceae_UCG-014
#> 2026-03-23 13:19:47.080279 WARNING::Fitting problem for feature 35 returning NA
#> 2026-03-23 13:19:47.081733 INFO::Fitting model to feature number 36, Ruminococcus_1
#> 2026-03-23 13:19:47.084703 INFO::Fitting model to feature number 37, Ruminococcus_2
#> 2026-03-23 13:19:47.087661 INFO::Fitting model to feature number 38, Subdoligranulum
#> 2026-03-23 13:19:47.090578 INFO::Fitting model to feature number 39, [Clostridium]_innocuum_group
#> 2026-03-23 13:19:47.09345 INFO::Fitting model to feature number 40, [Eubacterium]_coprostanoligenes_group
#> 2026-03-23 13:19:47.096339 INFO::Fitting model to feature number 41, [Eubacterium]_fissicatena_group
#> 2026-03-23 13:19:47.099225 INFO::Fitting model to feature number 42, [Eubacterium]_rectale_group
#> 2026-03-23 13:19:47.102155 INFO::Fitting model to feature number 43, [Eubacterium]_xylanophilum_group
#> 2026-03-23 13:19:47.105086 INFO::Fitting model to feature number 44, [Ruminococcus]_gauvreauii_group
#> 2026-03-23 13:19:47.108007 INFO::Fitting model to feature number 45, [Ruminococcus]_gnavus_group
#> 2026-03-23 13:19:47.110893 INFO::Fitting model to feature number 46, uncultured
#> 2026-03-23 13:19:47.113819 INFO::Fitting model to feature number 47, uncultured_1
#> 2026-03-23 13:19:47.116734 INFO::Fitting model to feature number 48, uncultured_2
#> 2026-03-23 13:19:47.118467 INFO::Fitting model to feature number 49, uncultured_bacterium
#> 2026-03-23 13:19:47.124846 INFO::Performing tests against medians
#> 2026-03-23 13:19:47.493399 INFO::Counting total values for each feature
#> 2026-03-23 13:19:47.495369 INFO::Running the logistic model component
#> 2026-03-23 13:19:47.50508 INFO::Fitting model to feature number 1, Akkermansia
#> 2026-03-23 13:19:47.506372 INFO::Fitting model to feature number 2, Alistipes
#> 2026-03-23 13:19:47.50758 INFO::Fitting model to feature number 3, Anaerostipes
#> 2026-03-23 13:19:47.51247 INFO::Fitting model to feature number 4, Anaerotruncus
#> 2026-03-23 13:19:47.516781 INFO::Fitting model to feature number 5, Bacteroides
#> 2026-03-23 13:19:47.52114 INFO::Fitting model to feature number 6, Barnesiella
#> 2026-03-23 13:19:47.525403 INFO::Fitting model to feature number 7, Blautia
#> 2026-03-23 13:19:47.529675 INFO::Fitting model to feature number 8, Butyricicoccus
#> 2026-03-23 13:19:47.534002 INFO::Fitting model to feature number 9, Catabacter
#> 2026-03-23 13:19:47.538244 INFO::Fitting model to feature number 10, Clostridium_sensu_stricto_1
#> 2026-03-23 13:19:47.542566 INFO::Fitting model to feature number 11, Coprobacter
#> 2026-03-23 13:19:47.546757 INFO::Fitting model to feature number 12, Coprococcus_2
#> 2026-03-23 13:19:47.550987 INFO::Fitting model to feature number 13, Dielma
#> 2026-03-23 13:19:47.555229 INFO::Fitting model to feature number 14, Eisenbergiella
#> 2026-03-23 13:19:47.559468 INFO::Fitting model to feature number 15, Epulopiscium
#> 2026-03-23 13:19:47.563772 INFO::Fitting model to feature number 16, Erysipelatoclostridium
#> 2026-03-23 13:19:47.568031 INFO::Fitting model to feature number 17, Escherichia-Shigella
#> 2026-03-23 13:19:47.572371 INFO::Fitting model to feature number 18, Eubacterium
#> 2026-03-23 13:19:47.576626 INFO::Fitting model to feature number 19, Faecalibacterium
#> 2026-03-23 13:19:47.580839 INFO::Fitting model to feature number 20, Flavonifractor
#> 2026-03-23 13:19:47.585056 INFO::Fitting model to feature number 21, Fusicatenibacter
#> 2026-03-23 13:19:47.589285 INFO::Fitting model to feature number 22, Halomonas
#> 2026-03-23 13:19:47.593511 INFO::Fitting model to feature number 23, Holdemania
#> 2026-03-23 13:19:47.597816 INFO::Fitting model to feature number 24, Hungatella
#> 2026-03-23 13:19:47.599083 INFO::Fitting model to feature number 25, Lachnoclostridium
#> 2026-03-23 13:19:47.603444 INFO::Fitting model to feature number 26, Lachnospiraceae_ND3007_group
#> 2026-03-23 13:19:47.607748 INFO::Fitting model to feature number 27, Odoribacter
#> 2026-03-23 13:19:47.612034 INFO::Fitting model to feature number 28, Parabacteroides
#> 2026-03-23 13:19:47.616363 INFO::Fitting model to feature number 29, Paraprevotella
#> 2026-03-23 13:19:47.620642 INFO::Fitting model to feature number 30, Roseburia
#> 2026-03-23 13:19:47.624913 INFO::Fitting model to feature number 31, Ruminiclostridium_5
#> 2026-03-23 13:19:47.62922 INFO::Fitting model to feature number 32, Ruminiclostridium_9
#> 2026-03-23 13:19:47.633592 INFO::Fitting model to feature number 33, Ruminococcaceae_UCG-004
#> 2026-03-23 13:19:47.637926 INFO::Fitting model to feature number 34, Ruminococcaceae_UCG-013
#> 2026-03-23 13:19:47.639138 INFO::Fitting model to feature number 35, Ruminococcaceae_UCG-014
#> 2026-03-23 13:19:47.643454 INFO::Fitting model to feature number 36, Ruminococcus_1
#> 2026-03-23 13:19:47.647702 INFO::Fitting model to feature number 37, Ruminococcus_2
#> 2026-03-23 13:19:47.651925 INFO::Fitting model to feature number 38, Subdoligranulum
#> 2026-03-23 13:19:47.656185 INFO::Fitting model to feature number 39, [Clostridium]_innocuum_group
#> 2026-03-23 13:19:47.660508 INFO::Fitting model to feature number 40, [Eubacterium]_coprostanoligenes_group
#> 2026-03-23 13:19:47.664808 INFO::Fitting model to feature number 41, [Eubacterium]_fissicatena_group
#> 2026-03-23 13:19:47.669201 INFO::Fitting model to feature number 42, [Eubacterium]_rectale_group
#> 2026-03-23 13:19:47.673418 INFO::Fitting model to feature number 43, [Eubacterium]_xylanophilum_group
#> 2026-03-23 13:19:47.677685 INFO::Fitting model to feature number 44, [Ruminococcus]_gauvreauii_group
#> 2026-03-23 13:19:47.682087 INFO::Fitting model to feature number 45, [Ruminococcus]_gnavus_group
#> 2026-03-23 13:19:47.686449 INFO::Fitting model to feature number 46, uncultured
#> 2026-03-23 13:19:47.690929 INFO::Fitting model to feature number 47, uncultured_1
#> 2026-03-23 13:19:47.695424 INFO::Fitting model to feature number 48, uncultured_2
#> 2026-03-23 13:19:47.699787 INFO::Fitting model to feature number 49, uncultured_bacterium
#> 2026-03-23 13:19:47.710664 INFO::Counting total values for each feature
#> 2026-03-23 13:19:47.712815 INFO::Re-running abundances for warn_prevalence
#> 2026-03-23 13:19:47.713375 INFO::Running selected normalization method: TSS
#> 2026-03-23 13:19:47.71532 INFO::Running selected transform method: LOG
#> 2026-03-23 13:19:47.72494 INFO::Fitting model to feature number 1, Akkermansia
#> 2026-03-23 13:19:47.727989 INFO::Fitting model to feature number 2, Alistipes
#> 2026-03-23 13:19:47.730905 INFO::Fitting model to feature number 3, Anaerostipes
#> 2026-03-23 13:19:47.73383 INFO::Fitting model to feature number 4, Anaerotruncus
#> 2026-03-23 13:19:47.736736 INFO::Fitting model to feature number 5, Bacteroides
#> 2026-03-23 13:19:47.739624 INFO::Fitting model to feature number 6, Barnesiella
#> 2026-03-23 13:19:47.742498 INFO::Fitting model to feature number 7, Blautia
#> 2026-03-23 13:19:47.745402 INFO::Fitting model to feature number 8, Butyricicoccus
#> 2026-03-23 13:19:47.746957 WARNING::Fitting problem for feature 8 returning NA
#> 2026-03-23 13:19:47.748355 INFO::Fitting model to feature number 9, Catabacter
#> 2026-03-23 13:19:47.751248 INFO::Fitting model to feature number 10, Clostridium_sensu_stricto_1
#> 2026-03-23 13:19:47.75297 INFO::Fitting model to feature number 11, Coprobacter
#> 2026-03-23 13:19:47.755955 INFO::Fitting model to feature number 12, Coprococcus_2
#> 2026-03-23 13:19:47.759664 INFO::Fitting model to feature number 13, Dielma
#> 2026-03-23 13:19:47.764039 INFO::Fitting model to feature number 14, Eisenbergiella
#> 2026-03-23 13:19:47.76749 INFO::Fitting model to feature number 15, Epulopiscium
#> 2026-03-23 13:19:47.771875 INFO::Fitting model to feature number 16, Erysipelatoclostridium
#> 2026-03-23 13:19:47.775063 INFO::Fitting model to feature number 17, Escherichia-Shigella
#> 2026-03-23 13:19:47.778003 INFO::Fitting model to feature number 18, Eubacterium
#> 2026-03-23 13:19:47.780951 INFO::Fitting model to feature number 19, Faecalibacterium
#> 2026-03-23 13:19:47.783919 INFO::Fitting model to feature number 20, Flavonifractor
#> 2026-03-23 13:19:47.786829 INFO::Fitting model to feature number 21, Fusicatenibacter
#> 2026-03-23 13:19:47.78971 INFO::Fitting model to feature number 22, Halomonas
#> 2026-03-23 13:19:47.792585 INFO::Fitting model to feature number 23, Holdemania
#> 2026-03-23 13:19:47.795443 INFO::Fitting model to feature number 24, Hungatella
#> 2026-03-23 13:19:47.798273 INFO::Fitting model to feature number 25, Lachnoclostridium
#> 2026-03-23 13:19:47.801172 INFO::Fitting model to feature number 26, Lachnospiraceae_ND3007_group
#> 2026-03-23 13:19:47.804049 INFO::Fitting model to feature number 27, Odoribacter
#> 2026-03-23 13:19:47.806973 INFO::Fitting model to feature number 28, Parabacteroides
#> 2026-03-23 13:19:47.80986 INFO::Fitting model to feature number 29, Paraprevotella
#> 2026-03-23 13:19:47.812734 INFO::Fitting model to feature number 30, Roseburia
#> 2026-03-23 13:19:47.815679 INFO::Fitting model to feature number 31, Ruminiclostridium_5
#> 2026-03-23 13:19:47.818567 INFO::Fitting model to feature number 32, Ruminiclostridium_9
#> 2026-03-23 13:19:47.821399 INFO::Fitting model to feature number 33, Ruminococcaceae_UCG-004
#> 2026-03-23 13:19:47.824264 INFO::Fitting model to feature number 34, Ruminococcaceae_UCG-013
#> 2026-03-23 13:19:47.827065 INFO::Fitting model to feature number 35, Ruminococcaceae_UCG-014
#> 2026-03-23 13:19:47.828603 WARNING::Fitting problem for feature 35 returning NA
#> 2026-03-23 13:19:47.829987 INFO::Fitting model to feature number 36, Ruminococcus_1
#> 2026-03-23 13:19:47.832852 INFO::Fitting model to feature number 37, Ruminococcus_2
#> 2026-03-23 13:19:47.835705 INFO::Fitting model to feature number 38, Subdoligranulum
#> 2026-03-23 13:19:47.838568 INFO::Fitting model to feature number 39, [Clostridium]_innocuum_group
#> 2026-03-23 13:19:47.841435 INFO::Fitting model to feature number 40, [Eubacterium]_coprostanoligenes_group
#> 2026-03-23 13:19:47.844315 INFO::Fitting model to feature number 41, [Eubacterium]_fissicatena_group
#> 2026-03-23 13:19:47.847183 INFO::Fitting model to feature number 42, [Eubacterium]_rectale_group
#> 2026-03-23 13:19:47.850547 INFO::Fitting model to feature number 43, [Eubacterium]_xylanophilum_group
#> 2026-03-23 13:19:47.853439 INFO::Fitting model to feature number 44, [Ruminococcus]_gauvreauii_group
#> 2026-03-23 13:19:47.856305 INFO::Fitting model to feature number 45, [Ruminococcus]_gnavus_group
#> 2026-03-23 13:19:47.859175 INFO::Fitting model to feature number 46, uncultured
#> 2026-03-23 13:19:47.862053 INFO::Fitting model to feature number 47, uncultured_1
#> 2026-03-23 13:19:47.864938 INFO::Fitting model to feature number 48, uncultured_2
#> 2026-03-23 13:19:47.866635 INFO::Fitting model to feature number 49, uncultured_bacterium
#> 2026-03-23 13:19:47.893176 INFO::Creating fits folder
#> 2026-03-23 13:19:47.893906 INFO::Writing residuals to file maaslin_results/fits/residuals_linear.rds
#> 2026-03-23 13:19:47.894932 INFO::Writing fitted values to file maaslin_results/fits/fitted_linear.rds
#> 2026-03-23 13:19:47.895833 INFO::Writing residuals to file maaslin_results/fits/residuals_logistic.rds
#> 2026-03-23 13:19:47.896862 INFO::Writing fitted values to file maaslin_results/fits/fitted_logistic.rds
#> 2026-03-23 13:19:47.89912 INFO::Writing all the results to file (ordered
#> by increasing individual q-values): maaslin_results/all_results.tsv
#> 2026-03-23 13:19:47.900655 INFO::Writing the significant results without errors (those which have joint q-values less than or equal to the threshold of 0.100000 ) to file (ordered by increasing individual q-values): maaslin_results/significant_results.tsv
#> 2026-03-23 13:19:47.901728 INFO::Creating output figures folder
#> 2026-03-23 13:19:47.902667 INFO::Writing summary plot of significant
#> results to file: maaslin_results/figures/summary_plot.pdf
#> 2026-03-23 13:19:49.072901 INFO::Writing association plots (one for each significant association) to output folder: maaslin_results/figures
#> 2026-03-23 13:19:49.074699 INFO::Plotting associations from most to least significant, grouped by metadata
#> 2026-03-23 13:19:49.078988 INFO::Creating box plot for categorical data (linear),
#> patient_status vs Coprobacter
#> 2026-03-23 13:19:49.144094 INFO::Creating box plot for categorical data (linear),
#> patient_status vs Faecalibacterium
#> 2026-03-23 13:19:49.232436 INFO::Creating tile plot for categorical data (logistic), patient_status vs Erysipelatoclostridium
# Retrieve abundance results
maaslin3_abund <- maaslin3_out$fit_data_abundance$results
maaslin3_abund <- maaslin3_abund[!is.na(maaslin3_abund$coef), ]
# Visualize abundance results
plotForest(
maaslin3_abund,
effect.var = "coef",
err.var = "stderr",
pval.var = "qval_joint",
id.var = "feature",
label.by = c("CI", "P-Value"),
order.by = "coef"
)
# Add abundance results to TreeSE rowData
rownames(maaslin3_abund) <- maaslin3_abund$feature
tax_order <- match(rownames(tse), rownames(maaslin3_abund))
rowData(tse) <- cbind(rowData(tse), maaslin3_abund[tax_order, ])
# Visualise abundance results with tree structure
plotForest(
tse,
effect.var = "coef",
err.var = "stderr",
pval.var = "qval_joint",
label.by = c("CI", "P-Value")
)
#> Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
#> ℹ Please use tidy evaluation idioms with `aes()`.
#> ℹ See also `vignette("ggplot2-in-packages")` for more information.
#> ℹ The deprecated feature was likely used in the miaViz package.
#> Please report the issue at <https://github.com/microbiome/miaViz/issues>.
#> Warning: Removed 4 rows containing missing values or values outside the scale range
#> (`geom_point()`).
# Retrieve prevalence results
maaslin3_prev <- maaslin3_out$fit_data_prevalence$results
maaslin3_prev <- maaslin3_prev[!is.na(maaslin3_prev$coef), ]
# Combine abundance and prevalence results
maaslin3_res <- rbind(maaslin3_abund, maaslin3_prev)
maaslin3_res$association <- c(
rep("Abundance", nrow(maaslin3_abund)),
rep("Prevalence", nrow(maaslin3_prev))
)
# Visualize combined results
plotForest(
maaslin3_res,
effect.var = "coef",
err.var = "stderr",
pval.var = "qval_joint",
id.var = "feature",
label.by = c("CI", "P-Value"),
order.by = "coef",
facet.by = "association",
colour.by = "association"
)