find_differentially_abundant_organisms
Find increased and decreased differentially abundant organisms for a single GeneLab assay, using DESeq2/ANCOM-BC significance filters and log2fc ranking.
Instructions
USE THIS TOOL (not the query tool) for any "differentially abundant
organisms", DESeq2/ANCOM-BC abundance, or "increased/decreased
abundance" question for a single assay.
The query tool can express the same Cypher, but using it for this
category loses the formatted markdown tables, the inline CSV
side-channel, the method-aware significance filtering (DESeq2
adj_p_value vs. ANCOM-BC q_value), and the safe lnfc handling that
avoids silently dropping DESeq2 rows (where lnfc IS NULL would fail a
naive lnfc > 0 filter).
Return the top-N organisms with increased and decreased differential abundance for a given assay_id.
Direction (increase vs. decrease) and ranking use log2fc, which is populated for BOTH DESeq2 and ANCOM-BC abundance edges in the GeneLab KG. log2fc is therefore used as the universal direction/ordering field and as the default magnitude filter.
The lnfc property is only populated for ANCOM-BC edges (DESeq2 leaves it null). It is returned in the result for reference and can be used as an additional magnitude filter via the lnfc_threshold parameter. log2fc is the direction filter because it is populated for both DESeq2 and ANCOM-BC rows; using lnfc for direction would null-filter every DESeq2 row out of the result.
Significance filtering is method-aware:
DESeq2 edges populate adj_p_value (not q_value); the adj_p_threshold applies.
ANCOM-BC edges populate q_value (not adj_p_value); the q_value_threshold applies. Each row is kept if its populated significance field meets the matching threshold.
Magnitude filtering:
log2fc_threshold (default 0.0) applies to every row, since log2fc is populated for both methods.
lnfc_threshold (default None = no filter) is method-aware: when set, it requires |lnfc| >= lnfc_threshold on rows where lnfc is populated. Rows where lnfc is null (i.e., DESeq2 rows) are not affected by this filter. Set lnfc_threshold to a positive number to add an ANCOM-BC-specific magnitude filter on top of log2fc.
This tool runs two queries on the GeneLab KG:
Top-N organisms with increased abundance (log2fc > log2fc_threshold, significance and optional lnfc filters met, highest log2fc first)
Top-N organisms with decreased abundance (log2fc < -log2fc_threshold, significance and optional lnfc filters met, lowest log2fc first)
Results include organism name, log2fc, lnfc, q-value, adj-p-value, and group means and standard deviations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | How many organisms to display for each of increased and decreased abundance lists. Pass None (or omit) to return ALL organisms passing the magnitude + significance filters rather than a top-N — useful when the user asks for 'all significantly increased organisms' or wants the complete filtered set as CSV. When the full set is large, the CSV contains every row passing the filter. | |
| assay_id | Yes | Assay identifier (e.g., 'OSD-253-6c5f9f37b9cb2ebeb2743875af4bdc86') | |
| session_id | No | Session id returned by `create_session()`. This server serves many users from one process; the session id is what keeps your output directory and generated plots private to you. Pass the SAME value on every tool call. If the server replies that the session is unknown or expired, call `create_session()` again and use the new id. | |
| lnfc_threshold | No | Optional minimum |lnfc| magnitude. Only applied to rows with lnfc populated (ANCOM-BC). DESeq2 rows are not filtered by this parameter. Leave unset (None) to skip lnfc filtering entirely. | |
| adj_p_threshold | No | Adjusted p-value threshold for DESeq2 abundance assays (default: 0.05). Applied to rows with adj_p_value populated. | |
| log2fc_threshold | No | Minimum |log2fc| magnitude required for a row to be kept (default: 0.0 = any change). Applies to BOTH DESeq2 and ANCOM-BC rows since log2fc is populated for both methods. | |
| q_value_threshold | No | q-value threshold for ANCOM-BC abundance assays (default: 0.05). Applied to rows with q_value populated. |