sc_reconstruction.models.ReconPCA#

class sc_reconstruction.models.ReconPCA(n_components=300)[source]#

Bases: BaseReconstructionModel

PCA reconstruction model with a scalable GPU implementation.

Adapted from rapids-singlecell so the fit scales to 100M-cell datasets via a dask_cuda.LocalCUDACluster and chunked SVD over the input zarr store.

Parameters:

n_components (int)

__init__(n_components=300)[source]#
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