scvi.model.PEAKVI.get_accessibility_estimates

PEAKVI.get_accessibility_estimates(adata=None, indices=None, n_samples_overall=None, region_list=None, transform_batch=None, use_z_mean=True, threshold=None, normalize_cells=False, normalize_regions=False, batch_size=128, return_numpy=False)[source]

Impute the full accessibility matrix.

Returns a matrix of accessibility probabilities for each cell and genomic region in the input (for return matrix A, A[i,j] is the probability that region j is accessible in cell i).

Parameters
adata : AnnData | NoneOptional[AnnData] (default: None)

AnnData object that has been registered with scvi. If None, defaults to the AnnData object used to initialize the model.

indices : Sequence[int] | NoneOptional[Sequence[int]] (default: None)

Indices of cells in adata to use. If None, all cells are used.

n_samples_overall : int | NoneOptional[int] (default: None)

Number of samples to return in total

region_list : Sequence[str] | NoneOptional[Sequence[str]] (default: None)

Return accessibility estimates for this subset of regions. if None, all regions are used. This can save memory when dealing with large datasets.

transform_batch : str | int | NoneUnion[str, int, None] (default: None)

Batch to condition on. If transform_batch is:

  • None, then real observed batch is used

  • int, then batch transform_batch is used

use_z_mean : boolbool (default: True)

If True (default), use the distribution mean. Otherwise, sample from the distribution.

threshold : float | NoneOptional[float] (default: None)

If provided, values below the threshold are replaced with 0 and a sparse matrix is returned instead. This is recommended for very large matrices. Must be between 0 and 1.

normalize_cells : boolbool (default: False)

Whether to reintroduce library size factors to scale the normalized probabilities. This makes the estimates closer to the input, but removes the library size correction. False by default.

normalize_regions : boolbool (default: False)

Whether to reintroduce region factors to scale the normalized probabilities. This makes the estimates closer to the input, but removes the region-level bias correction. False by default.

batch_size : intint (default: 128)

Minibatch size for data loading into model

return_numpy : boolbool (default: False)

If True and threshold=None, return ndarray. If True and threshold is given, return csr_matrix. If False, return DataFrame. DataFrame includes regions names as columns.

Return type

DataFrame | ndarray | csr_matrixUnion[DataFrame, ndarray, csr_matrix]