q2-gglasso Parameter Reference#
Every parameter of every registered q2-gglasso action, with its CLI spelling,
its type as registered with QIIME 2, its default as declared in the function
signature, and the chapter where the tutorial exercises it.
Turn to Troubleshooting when a flag does something other than what you expected. Command Coverage Matrix lists which actions the tutorial covers at all.
Important
These tables are maintained by hand today and can drift away from the plugin. The
intended end state is to capture
qiime gglasso <action> --help into docs/_data/help/gglasso-<action>.txt at
build time, render it with {literalinclude}, and add a CI check asserting that
the documented parameter set equals the set registered in
q2_gglasso/plugin_setup.py and q2_gglasso/_dict.py. That generation step is
not wired up yet. Until it is, treat --help on your own install as the final
authority and open an issue wherever the tables disagree with it.
Note
Every name, type and default below was read directly from
q2_gglasso/plugin_setup.py, q2_gglasso/_dict.py and the function signatures in
q2_gglasso/_func.py. They have not yet been checked against captured
--help output from a QIIME 2 2026.7 build, because that environment does not
exist yet. None of it is a recorded command output.
How to read the tables#
QIIME 2 derives every CLI flag mechanically from the registered name: a
parameter foo_bar becomes --p-foo-bar, an input becomes --i-foo-bar, an
output --o-foo-bar, and a Metadata parameter becomes --m-foo-bar-file.
Underscores in the registered name are not collapsed, which is why the
deprecated cv__nlam in the sibling plugin surfaces as --p-cv--nlam.
List[...] parameters are repeatable options on the command line: pass the flag
once per value (--p-lambda1-path 1.0 --p-lambda1-path 0.1 ...). Several
List[...] parameters here — the lambda*_min/lambda*_max/mu1_* bounds —
are registered as lists but consumed as scalars, so in practice you pass them
exactly once. (n_samples is the exception: pass it once per instance.)
Two conventions used in the Notes column:
always raises — the parameter is registered and accepted by the CLI, but every call that sets it fails. It exists so the limitation is explicit rather than silently ignored.
no
Choices()— the plugin does not constrain the accepted strings, so a typo passes argument parsing and fails, or is silently accepted, inside the function. See “String parameters have no validation” below.
The Demonstrated in column names the chapter that exercises the parameter,
or the closest chapter that discusses it. not demonstrated means no runnable
command in this tutorial passes the parameter; it may still be discussed in
prose, and it says nothing about whether the parameter works.
transform-features#
Turns a count table into a CLR- or mCLR-transformed table suitable for covariance estimation. Optionally joins scaled sample metadata onto the table as extra rows, which is how continuous covariates enter the network.
Inputs and outputs#
Name |
CLI flag |
Type |
Required |
Notes |
|---|---|---|---|---|
|
|
|
yes |
|
|
|
|
yes |
Required but never read. The function body ignores it entirely. |
|
|
|
yes |
Output is stored feature-major (p x n). |
Parameters#
Parameter |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
|
Only read when |
|
|
|
|
|
|
|
|
|
|
|
Zero replacement before the log. Only meaningful for |
|
|
|
|
|
Standardises metadata columns before joining. |
|
|
|
|
|
Appends metadata columns as additional variables of the network. Only numeric columns are used — |
|
|
|
|
|
Rows are always reordered by ascending total abundance, at either setting, with ties broken on the feature ID so the order depends only on the table’s contents. With |
add_metadata decides what kind of question the network answers: with it off
you get taxon-taxon conditional dependencies only; with it on, environmental
covariates become nodes and a taxon-covariate edge means the association survives
conditioning on every other taxon. scale_metadata matters because the
CLR-transformed taxa and a raw covariate such as elevation live on very different
scales, and the graphical lasso applies one global lambda1 to all of them —
leaving a covariate unscaled effectively changes its penalty relative to everything
else.
Note
The registration requires --i-taxonomy and the implementation never reads it.
Pass any valid FeatureData[Taxonomy] artifact; its contents cannot change the
result. Troubleshooting tracks this.
build-groups#
Builds the bookkeeping array that a non-conforming Group Graphical Lasso needs when the K instances do not share the same feature set.
Name |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
required |
Repeat the flag once per instance. |
|
|
|
|
|
Validates the constructed overlap groups. |
|
|
|
|
required |
|
Important
Known gap: build-groups does not chain into solve-problem. This action
emits a TensorData artifact, while solve-problem accepts group_array as a
List[Int] parameter. The QIIME 2 type system cannot connect the two: export
the artifact and pass the indices explicitly with --p-group-array.
Multiple Graphical Lasso
writes out the workaround.
calculate-covariance#
Name |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
required |
Expects the p x n output of |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
required |
p x p, rounded to 10 decimals. |
A single lambda1 penalises every entry of the precision matrix equally, so on
an unscaled covariance the taxa with the largest variance absorb the penalty
budget. method defaults to scaled for that reason, and the tutorial uses it
throughout.
solve-problem#
The core solver. Twenty parameters, but they fall into five groups: how big the problem is, the sparsity grid, the low-rank grid, the multiple-instance settings, and model selection.
Inputs and outputs#
Name |
CLI flag |
Type |
Notes |
|---|---|---|---|
|
|
|
p x p, positive semi-definite. |
|
|
|
Zarr store holding the solution and the hyperparameters used. |
Parameters#
Parameter |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
required |
Number of samples behind the covariance estimate; one value per instance. The only parameter with no default. |
|
|
|
|
|
Lower bound of the sparsity grid. If unset while |
|
|
|
|
|
Upper bound of the sparsity grid. If unset while |
|
|
|
|
|
Grid points between min and max. Leaving it at |
|
|
|
|
|
Explicit grid. Overrides |
|
|
|
|
|
Across-instance penalty, MGL only. Same |
|
|
|
|
|
Same |
|
|
|
|
|
||
|
|
|
|
Low-rank penalty. Only used when |
|
|
|
|
|
||
|
|
|
|
||
|
|
|
|
Explicit low-rank grid; overrides |
|
|
|
|
|
|
|
|
|
|
|
Switches on the sparse + low-rank decomposition. Required for |
|
|
|
|
|
Always raises. See the box below. |
|
|
|
|
|
|
|
|
|
|
|
Instances with differing feature sets; requires |
|
|
|
|
|
A parameter, not an input — see the |
|
|
|
|
|
|
|
|
|
|
|
eBIC parameter in [0, 1]. Larger values push model selection toward sparser solutions. |
Important
--p-rank always raises — ValueError if --p-latent is not set,
NotImplementedError otherwise. No released GGLasso
(up to and including 0.3.0) can fix the rank of the low-rank component; it
exposes only the continuous mu1 penalty and reports the achieved rank as an
output. The parameter is registered and guarded so that setting it fails
loudly instead of being ignored.
Size the low-rank block through mu1 instead: a larger mu1 gives a smaller
rank. Scout a small mu1 grid and read the achieved rank out of the solution —
Choosing the Latent Rank walks through
this. Setting rank without latent=True raises ValueError before the
version check is reached.
Substituted defaults#
Leave a grid entirely unset and the solver substitutes a built-in path, emitting a warning rather than failing:
Grid |
Substituted when both bounds are unset |
Warning |
|---|---|---|
|
|
|
|
|
|
|
|
|
Setting only one of the two bounds does not trigger this. A missing lower
bound silently becomes 1e-3 and a missing upper bound silently becomes 1,
which is easy to mistake for a grid you specified yourself.
When model selection runs#
Model selection runs whenever at least one grid ends up with more than one value, and the grids the solver sees are the ones left after it has filled in the defaults above. That substitution is what makes single fits harder to get than the flags suggest:
Non-latent (SGL/MGL). A run counts as a single fit only if
lambda1collapses to one value and at least one of--p-lambda2-min/--p-lambda2-maxis set (with--p-n-lambda2 1). Leavelambda2unset and the solver substitutes the 5-point default grid even for SGL, somodel_selectionis on andmodelselect_statsis written. Pinning--p-lambda1-min/--p-lambda1-maxto the same value, or passing a one-element--p-lambda1-path, is not enough on its own.Latent (
--p-latent True).lambda1,lambda2andmu1must all collapse to a single value. Supplying alambda1range while forgettingmu1— or the reverse — produces a grid search when you expected one fit.
Look for a modelselect_stats group in the solution: a genuine single fit has
none, and summarize omits the statistics accordingly. Because of the lambda2
substitution, most non-latent runs will have one.
Note
This describes current solver behaviour, not a design decision. Applying the
lambda2 default only to MGL problems would be the cleaner fix, but that is a
behaviour change in q2_gglasso/utils.py and needs a maintainer decision. The
same inaccurate “n_lambda1 == 1 means a single fit” rule is repeated as a code
comment in q2_gglasso/_summarize/_visualizer.py.
pca (visualizer)#
Projects samples onto the principal components of the low-rank component of an SLR solution.
Name |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
required |
The transformed table, p x n. |
|
|
|
|
required |
Must have been solved with |
|
|
|
|
|
Optional in the signature, required in practice — the visualizer dereferences it unconditionally. |
|
|
|
|
|
Number of components to plot. |
|
|
|
|
|
Name of a metadata column. Must exist in the file passed above. |
Note
Two failure modes, both easy to hit:
Running
pcaon a sparse-only (SGL) solution fails, because the visualizer readssolution/lowrank_, which only exists when--p-latent Truewas used.Omitting
--m-sample-metadata-filecrashes with anAttributeErrordespite the parameter being optional in the signature. Treat it as required.
summarize (visualizer)#
Name |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
required |
Works for sparse-only and latent solutions alike. |
|
|
|
|
|
Plot width in pixels. |
|
|
|
|
|
Plot height in pixels. |
|
|
|
|
|
A bokeh font-size string, e.g. |
|
|
|
|
|
Number of trailing variables that are covariates rather than taxa. When set, the heatmaps cluster the taxon block and the covariate block separately instead of mixing them. Set this if you used |
String parameters have no validation#
Neither plugin declares Choices() on any string parameter. QIIME 2 therefore
accepts any string, and the check happens inside the function — if it happens at
all. In q2-gglasso this affects:
Flag |
Accepted values |
Behaviour on a typo |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
Reaches the solver; behaviour depends on the GGLasso build |
|
any CSS size string |
No validation; a bad value degrades the plot silently |
A typo therefore costs you a whole run rather than being caught at argument-parsing time. On a 13-ASV problem that is a minor annoyance. On the 300-ASV Atacama problem of tier 2 it is the entire solve. Check the spelling before you submit the job.