sc_reconstruction.models.ReconPCA#
- class sc_reconstruction.models.ReconPCA(n_components=300)[source]#
Bases:
BaseReconstructionModelPCA reconstruction model with a scalable GPU implementation.
Adapted from rapids-singlecell so the fit scales to 100M-cell datasets via a
dask_cuda.LocalCUDAClusterand chunked SVD over the input zarr store.- Parameters:
n_components (int)
Methods
__init__([n_components])load(path[, map_location])Load the model path: list[str] - The path to the model file.
predict(X, **inference_kwargs)Takes a raw NumPy array (batch of data), prepares it, runs the reconstruction, and returns a NumPy array.
prepare(data_path[, batch_size])save(dir_path)Save the trained model.
train(datamodule[, gpu_ids, save_mean, ...])Train PCA model adata: ad.AnnData - X: dask array of csr matrix gpu_ids: str - The GPU IDs to use save_mean: bool - Whether to save the mean