grassp.tl.tagm_map_predict#
- tagm_map_predict(adata, params=None, gt_col=None, probJoint=False, probOutlier=True, inplace=True)[source]#
Predict subcellular localization for unknown proteins using MAP parameters.
This function calculates the probabilities for each component (both Gaussian and t-distribution contributions) for each unlabelled protein (where adata.obs[gt_col] is NA). It assigns the label from the Gaussian part with the highest probability and stores the predictions and probabilities in adata.obs.
- Parameters:
- adata AnnData
AnnData object containing the proteomics data.
- params dict, optional
MAP parameters as returned by tagm_map_train. If None, the function will try to retrieve them from adata.uns[“tagm.map.params”].
- gt_col str, optional
Column in adata.obs with marker labels (default is “markers”).
- probJoint bool, optional
If True, also compute and store the joint probability matrix (default is False).
- probOutlier bool, optional
If True, store the probability of being an outlier (default is True).
- inplace bool, optional
If True, modify the input AnnData object in place.
- Return type:
DataFrame
|None
- Returns:
pd.DataFrame | None The DataFrame with new observation columns containing the predictions and probabilities. If inplace is True, the input AnnData object is modified in place.