c2v.tl.eigenvalue_test

c2v.tl.eigenvalue_test#

c2v.tl.eigenvalue_test(adata, key=None, key_added='eigenvalues_test', flavor='synthetic', n_simulations=10000, progress_bar=True, null_distribution=None)#

Performs Johnstone’s Spiked Covariance Test to identify if the embedding is random.

Parameters:
adata sc.AnnData | np.ndarray

AnnData object or numpy array containing the data.

key str | None

Key to use for AnnData input.

key_added str

Key to use for adding the results to the AnnData object.

flavor Literal["asymptotic", "synthetic"]

Flavor of the test to use.

n_simulations int

Number of simulations to use for the synthetic approach.

progress_bar bool

Whether to show a progress bar.

null_distribution np.ndarray | None

Null distribution to use for the synthetic approach.

Returns:

dict Dictionary containing the test statistic and p-value.