Edit on GitHub

starplast.metabolites

The metabolite table: rows are compounds, not genes.

Three slots on the metabolism axis ask about metabolites -- their steady-state levels, the flux through them, the composition of membrane lipids -- and none of them can be answered by a table whose rows are genes. A metabolite is not a gene, and the mapping between them is a metabolic model rather than a measurement. Those slots carry unit="metabolite" for that reason, and this is the table they resolve against.

It is the same shape as the host tables instruction 39 describes: a second table, keyed by its own identifier, reached through slots that declare their unit rather than through rows bolted onto the parasite table.

What identifies a row

The compound name as the study reported it, normalised for case and punctuation only. There is no Toxoplasma-wide metabolite identifier the way there is for genes -- studies report names, sometimes HMDB or KEGG accessions, often neither -- so joining two studies means matching names, and matching names is lossy. With one study in the table that cost is not yet paid; the moment a second arrives it is the first problem to solve, and it should be solved with an identifier and not with fuzzy matching.

TABLE = 'metabolites.parquet'
SOURCE = 'PMC13170339'
LEVELS = ('mbio.03788-25-s0004.xlsx', 'data_normalised')
LABELLING = {'glucose': ('mbio.03788-25-s0006.xlsx', 'Relative abundance glucose'), 'glutamine': ('mbio.03788-25-s0006.xlsx', 'Relative abundance glutamine')}
def norm(name) -> str | None:

A compound name reduced to what two studies could plausibly agree on.

def build(archive_path: str, lipid_archive: str | None = None) -> pandas.DataFrame:

Assemble the metabolite table from the polar-metabolite study, plus lipid species if given.

The two arrive as separate archives because they are separate studies measuring disjoint classes of compound; lipids explains why appending them by name is safe here and what would make it unsafe.

def load(base: str) -> pandas.DataFrame:

The shipped metabolite table, or an empty frame if it has not been built.