Skip to content

Commit

Permalink
change default PCA dimensionality to 128 to match scVI
Browse files Browse the repository at this point in the history
  • Loading branch information
safiyecelik committed Dec 21, 2023
1 parent 143dbd2 commit b38b88d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions efaar_benchmarking/efaar.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@ def embed_by_scvi_anndata(
return vae.get_latent_representation()


def embed_by_pca_anndata(adata, n_latent: int = 100) -> np.ndarray:
def embed_by_pca_anndata(adata, n_latent: int = 128) -> np.ndarray:
"""
Embed the input data using principal component analysis (PCA).
Note that the data is centered by the `pca` function prior to PCA transformation.
Args:
adata (AnnData): Annotated data matrix.
n_latent (int): Number of principal components to use. Defaults to 100.
n_latent (int): Number of principal components to use. Defaults to 128.
Returns:
numpy.ndarray: Embedding of the input data using PCA.
"""
print(n_latent)
sc.pp.pca(adata, n_comps=n_latent)
return adata.obsm["X_pca"]

Expand Down Expand Up @@ -80,7 +81,7 @@ def centerscale_on_plate(
def embed_by_pca(
features: np.ndarray,
metadata: pd.DataFrame = None,
variance_or_ncomp=100,
variance_or_ncomp=128,
plate_col: Optional[str] = None,
) -> np.ndarray:
"""
Expand Down

0 comments on commit b38b88d

Please sign in to comment.