xiaoyeye / CCST

Cell clustering for spatial transcriptomics data with graph neural network
57 stars 11 forks source link

Run PCA repeatedly ? #4

Closed LenisLin closed 2 years ago

LenisLin commented 2 years ago

Hi @lijc0804 : Thank you to develop such a wonderful clustering architecture for spatial transcriptomics ! When I run the codes in CCST_ST_utils.py about the part of clustering, I noticed that:

X_embedding_filename =  args.embedding_data_path+'lambdaI' + str(lambda_I) + '_epoch' + str(args.num_epoch) + '_Embed_X.npy'
X_embedding = np.load(X_embedding_filename)

X_embedding = PCA_process(X_embedding, nps=30)

when I set:cluster_type == 'leiden' it would run

adata = ad.AnnData(X_embedding)
sc.tl.pca(adata, n_comps=50, svd_solver='arpack')

The problem was occured, in function PCA_process, the embedding has been reduce to 30-d already, and do we need to run sc.tl.pca ? May I get your some advice?

Sincerely , LinYuX.

lijc0804 commented 2 years ago

Thanks for your comments! We mainly adopted kmeans clustering in this study and overlooked this issue for louvain and leiden. Now we have fixed it according to your suggestion.

LenisLin commented 2 years ago

OK, thanks for your timely reply. And I am going to close this issue.