Skip to content

Commit

Permalink
added logPCA (scanpy) option for clustering
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekbhr committed Jun 18, 2024
1 parent 0e4ec8f commit 24be014
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sincei/scClusterCells.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_args():
"--method",
"-m",
type=str,
choices=["LSA", "LDA", "glmPCA"],
choices=["logPCA", "LSA", "LDA", "glmPCA"],
default="LSA",
help="The dimentionality reduction method for clustering. (Default: %(default)s)",
)
Expand Down Expand Up @@ -152,7 +152,13 @@ def main(args=None):
if args.binarize:
mtx = binarize(mtx, copy=True)

if args.method == "LSA":
if args.method == "logPCA":
## log1p+PCA using scanpy
sc.pp.normalize_total(adata, target_sum=1e4)
sc.pp.log1p(adata)
sc.pp.pca(adata, args.nPrinComps)

elif args.method == "LSA":
## LSA using gensim
model_object = TOPICMODEL(
mtx,
Expand Down

0 comments on commit 24be014

Please sign in to comment.