grassp.tl.tagm_model#
- tagm_model(adata, key_added='tagm_map')[source]#
Fetch the stored TAGM model, preferring the current key.
uns[f"{key_added}_model"]is wheretagm_map_train()writes the fitted posteriors; the dotteduns["tagm.map.params"]is where it used to, and where a pRoloc round trip puts its own, so both are accepted.The model is deliberately not in
uns[f"{key_added}_params"]: that slot holds the annotation provenance every annotator writes, and TAGM is the only one of them with a fitted model to persist as well. Sharing the key would have the prediction overwrite the thing it was predicting from.Relation to pRoloc#
pRoloc’s
tagmMapTrainreturns a standaloneMAPParamsS4 object and writes nothing to theMSnSet– the model lives in the R session and is handed totagmMapPredictas an argument. So there is no pRoloc convention for storing it in the data object, and the twounsslots are grassp’s own choice; keeping the model on the object is what letstagm_map_predict(adata)work without threading it through, and what lets it survive an h5ad round trip.The dictionary mirrors
MAPParams’ five slots so the two stay comparable –method,priors,posteriors,datasize, andseedunder grassp’s namerandom_state– plusgt_colandmarkers, which grassp needs because it reads the marker column from the stored model where pRoloc takesfcolat predict time.