Skip to content

msmu.io.add_quant

Attach FlashLFQ peptide quantification to MuData.

Parameters:

Name Type Description Default
mdata MuData

MuData with sample metadata in .obs; may already contain a peptide modality.

required
quant_data str | PathLike[str] | DataFrame

Tab-separated file path/URL or DataFrame with Sequence and Intensity_<sample> columns.

required
quant_tool str

Only "flashlfq" is supported.

required
index_name str | None

Column in global .obs used to match intensity sample names; None uses the observation index. MS filename extensions are stripped from these names.

None

Returns:

Type Description
MuData

MuData with updated peptide.X, or a newly attached peptide modality. Existing peptide quantification is replaced in place; reassign the return value in either case.

Notes

All input samples must have intensity columns. Zeros become NaN and values are stored as float32. For an existing peptide modality, its feature/sample axes and annotations are preserved: unmatched identified peptides receive NaN and extra quantified peptides are discarded. Use mdata.copy() to preserve the original. See write_flashlfq_input to prepare FlashLFQ input.

Examples:

import msmu as mm
mdata = mm.io.add_quant(mdata, "QuantifiedPeptides.tsv", quant_tool="flashlfq")