Skip to content

msmu._preprocessing._normalise._normalise

adjust_ptm_by_protein

adjust_ptm_by_protein(mdata, global_mdata, ptm_mod='phospho_site', method='ridge', rescale=True)

Estimation of PTM stoichiometry by using Global Protein Data.

Parameters:

Name Type Description Default
mdata MuData

MuData object to normalise.

required
global_mdata MuData

MuData object which contains global protein expression.

required
ptm_mod str

PTM modality to normalise (e.g. phospho_site, {ptm}_site).

'phospho_site'
global_mod str

Modality in global_mdata to normalise PTM site. Default is 'protein'.

required
method str

A method for normalisation. Options: ridge, ratio. Default is 'ridge'.

'ridge'
rescale bool

If True, rescale the data after normalisation with median value across dataset. Default is True.

True

Returns:

Name Type Description
mdata MuData

Normalised MuData object.

feature_scale

feature_scale(mdata, method, modality, gis_prefix=None, gis_col=None, rescale=True)

Feature scale data in MuData object.

Parameters:

Name Type Description Default
mdata MuData

MuData object to normalise.

required
method str

Normalisation method to use. Options are 'gis', 'median_center'.

required
modality str

Modality to normalise.

required
gis_prefix str | None

Prefix for GIS samples. If None, all samples with 'gis' in the name will be used.

None
gis_col list[str] | None

Column name for GIS samples. If None, all samples with 'gis' in the name will be used.

None
rescale bool

If True, rescale the data after normalisation with median value across dataset. This is only applicable for median normalisation.

True

Returns:

Name Type Description
mdata MuData

Normalised MuData object.

get_modality_dict

get_modality_dict(mdata, level=None, modality=None)

Get modality data from MuData object

normalise

normalise(mdata, method, modality, fraction=False, rescale=True)

Normalise data in MuData object.

Parameters:

Name Type Description Default
mdata MuData

MuData object to normalise.

required
method str

Normalisation method to use. Options are 'quantile', 'median', 'total_sum (not implemented)'.

required
modality str

Modality to normalise. If None, all modalities at the specified level will be normalised.

required
fraction bool

If True, normalise within fractions. If False, normalise across all data. "fraction" yet supports fractionated TMT.

False
rescale bool

If True, rescale the data after normalisation with median value across dataset. This is only applicable for median normalisation.

True

Returns:

Name Type Description
mdata MuData

Normalised MuData object.