Skip to content

Commit

Permalink
set n_pcs to none
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahOuologuem committed Sep 3, 2024
1 parent 3db4ccd commit 2a3bff2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions panpipes/python_scripts/batch_correct_none.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,18 @@

if dimred not in adata.obsm:
L.warning("Dimred '%s' could not be found in adata.obsm. Computing PCA with default parameters." % dimred)
n_pcs = 50
if adata.var.shape[0] < n_pcs:
L.info("You have less features than number of PCs you intend to calculate")
n_pcs = adata.var.shape[0] - 1
L.info("Setting n PCS to %i" % int(n_pcs))
#n_pcs = 50
#if adata.var.shape[0] < n_pcs:
# L.info("You have less features than number of PCs you intend to calculate")
# n_pcs = adata.var.shape[0] - 1
# L.info("Setting n PCS to %i" % int(n_pcs))
L.info("Scaling data")
sc.pp.scale(adata)
L.info("Computing PCA")
sc.tl.pca(adata, n_comps=n_pcs,
svd_solver='arpack',
sc.tl.pca(adata, svd_solver='arpack',
random_state=0)
pc_kwargs['use_rep'] = "X_pca"
pc_kwargs['n_pcs'] = n_pcs
#pc_kwargs['n_pcs'] = n_pcs


L.info("Computing neighbors")
Expand Down

0 comments on commit 2a3bff2

Please sign in to comment.