Load a previously saved DLBCLone model (including UMAP state)
DLBCLone_load_optimized.RdReconstructs a DLBCLone model saved via DLBCLone_save_optimized() by
restoring the serialized model list and the associated uwot UMAP object.
Optionally performs an integrity check to verify that embeddings can be
reproduced from the saved state.
Arguments
- path
Character scalar. Directory containing the saved files. Defaults to
".".- name_prefix
Character scalar. Common filename prefix used when the model was saved. The function looks for
<name_prefix>_model.rdsand<name_prefix>_umap.uwotinpath. Defaults to"DLBCLone".- check_integrity
Logical. If
TRUE, the function re-embeds the training samples (both batch and iterative modes, when available) and confirms that the coordinates match the saved embeddings (within a small tolerance). This requires that the saved model list containsprojection_train, which is a consequence of activating the model withDLBCLone_activate().
Value
A list representing the reconstructed DLBCLone model, suitable for
downstream use with DLBCLone_predict() or utilities that expect
DLBCLone_model. On return, DLBCLone_model$model contains the
restored uwot model object.
Details
This function expects two files produced by DLBCLone_save_optimized():
<name_prefix>_model.rds: a serialized list with the core model components (e.g.,features,df, and optional test embeddings).<name_prefix>_umap.uwot: a serializeduwotUMAP model saved withuwot::save_uwot().
If check_integrity = TRUE, the function computes fresh embeddings via
make_and_annotate_umap() and compares them to the saved ones. A
mismatch larger than 0.01 in either axis will throw an error.
Examples
if (FALSE) { # \dontrun{
# Restore a model for use in a fresh R session
DLBCLone_myfeats_opt <- DLBCLone_load_optimized(
path = ".",
name_prefix = "DLBCLone_myfeats"
)
# Restore and verify that saved embeddings can be reproduced
confirmed_DLBCLone <- DLBCLone_load_optimized(
path = ".",
name_prefix = "dlbclone_dlc_test",
check_integrity = TRUE
)
} # }