JiangBioLab / DeepST

Identify spatial domain
MIT License
59 stars 16 forks source link

Question for hyperparameters #6

Open zy-fang opened 1 year ago

zy-fang commented 1 year ago

Hi Jiang,

I am interested in your method DeepST. It is a nice method for analyzing spatial transcriptomics!

I tried to cluster DLPFC samples with DeepST. I set the hyperparameters as described in your paper. I found that the results of my run were quite different from the results of your paper. I want to check whether I misunderstood the parameters you set. The code I used is as follows, please help me to check whether it is wrong.

deepen = run(save_path = save_path, 
      platform="Visium",
      pca_n_comps = 100,
      pre_epochs = 1000, #### According to your own hardware, choose the number of training
      linear_encoder_hidden=[64,16],
      conv_hidden=[64,16],
      epochs = 1000, #### According to your own hardware, choose the number of training
      Conv_type="GCNConv", #### you can choose GNN types. 
)
adata = deepen._get_adata(data_path, dataset)
adata = deepen._get_augment(adata, adjacent_weight = 0.3,  neighbour_k=4, weights="weights_matrix_all")
graph_dict = deepen._get_graph(adata.obsm["spatial"], distType="KDTree", k=12, dim_reduction=True)
adata = deepen._fit(adata, graph_dict, pretrain = False)
adata = deepen._get_cluster_data(adata, n_domains = n_clusters, priori=True)

Best, Zhaoyu

JiangBioLab commented 1 year ago

Thanks for your question, we have updated the demo. First, your script is right, but the parameter "pretrain=True" is recommended. Second, DeepST is an unsupervised method. Since the convergence is undirected, it is almost impossible for two runs to have the same spatial domain figure.