ShobiStassen / VIA

trajectory inference
https://pyvia.readthedocs.io/en/latest/
MIT License
86 stars 21 forks source link

Where is the mESC_7000perDay_noscaling_meso.csv file for Time Series Mesoderm Tutorial? #38

Closed ylcheng closed 1 year ago

ylcheng commented 1 year ago

Hi, I was not able to find the file, mESC_7000perDay_noscaling_meso.csv, for the Time Series Mesoderm Tutorial anywhere in the VIA respository. I did go back to the paper and noticed that the raw data came from reference 36. Maybe because I am not familiar with CyTOF, so I was also having difficulty finding the file there. I intend to use VIA to analyze a time series single cell RNAseq Data and want to work though the Time Series Tutorial. Would you be able to upload mESC_7000perDay_noscaling_meso.csv that you used for the tutorial? or provide me link or direct me to the exact location to download the file.

Thanks for all the help

ShobiStassen commented 1 year ago

hi! let me know if this works: https://drive.google.com/file/d/1Zd2WahSKEzCTtr4zuy_7sgn2sTDFYTsN/view?usp=share_link

shobi

ylcheng commented 1 year ago

Thanks for the file. Just worked through the tutorial. Everything worked as described except the run_umap_hnsw, and same issue for run via_umap when I was working through the basic tutorial. Searched 'densmap', 'densmap_kwds', and ''output_dens' in docs, but to no avail. What should I input for those? or How do I resolve this? Screen Shot 2023-02-21 at 4 38 17 PM

yim

ShobiStassen commented 1 year ago

perhaps this has to do with the version of umap-learn you are using? i have umap-learn version 0.4.6 installed with pip

ShobiStassen commented 1 year ago

Ah i think more recent versions of umap-learn have some additional arguments which we dont require here. i'll get around to updating for this and message you, but for now it might be easiest to install an older version of umap. Alternatively for the time being also supply empty arguments for these arguments as done here densmap_kwds = {}, output_dens = False

ShobiStassen commented 1 year ago

@ylcheng hi again, so if you want to keep your current version of umap then in the via_umap() function just add in: output_dens=False, densmap_kwds={}, densmap=False

before i upload a version of the code compatible with newer Umaps, i will want to test out a few things so this might take a day or so in case you dont want to wait :)

ShobiStassen commented 1 year ago

@ylcheng , i just uploaded a new version of via 0.1.77 which works for versions of umap-learn >=0.5.0 let me know if you can now run the via_umap() function

ylcheng commented 1 year ago

Codes ran, but results looked very different. Any thought? Screen Shot 2023-02-22 at 4 31 41 PM Screen Shot 2023-02-22 at 4 32 05 PM

ylcheng commented 1 year ago

To be clear, the draw_piechart_graph result looked different from the tutorial during the first time I ran it, so before I asked you about via_umap(). I just did not think too much about it.

ShobiStassen commented 1 year ago

@ylcheng Hi, this is my code and it seems to work well, the tutorial is from an older version. The below code is run on the latest version of via: streamplot via-umap_InitposVia_nepochs150_mindistp3_knn40_kseq15_krev15 viagraph

` root = [0.0] knn_sequential = 15 knn_sequential_reverse = 15 t_diff_step = 2 U= pd.read_csv('/home/shobi/Trajectory/Datasets/mESC/mESC_7000perDay_noscaling_meso_timeseries_viaumap_knn40_knnseq15_locallypruned.csv') U = U.values[:,1:]

data = pd.read_csv('/home/shobi/Trajectory/Datasets/mESC/mESC_7000perDay_noscaling_meso.csv')

marker_meso = ['Sca-1', 'CD41', 'Nestin', 'Desmin', 'CD24', 'FoxA2', 'Oct4', 'CD45', 'Ki67', 'Vimentin',
                     'Cdx2', 'Nanog', 'pStat3-705', 'Sox2', 'Flk-1', 'Tuj1', 'H3K9ac', 'Lin28', 'PDGFRa', 'EpCAM',
                     'CD44', 'GATA4', 'Klf4', 'CCR9', 'p53', 'SSEA1', 'bCatenin', 'IdU']
true_labels_numeric= data['day'].tolist()
print('set true_labels', set(true_labels_numeric))
data = data[marker_meso] #using the subset of markers in the original paper

scale_arcsinh = 5
raw = data.values
raw = raw.astype(np.float)
raw = raw / scale_arcsinh
raw = np.arcsinh(raw)

adata = sc.AnnData(raw)
adata.var_names = data.columns
adata.obs['day_str'] = [str(i) for i in true_labels_numeric]
print(f"anndata shape {adata.shape}")
print(f"jac std global {jac_std_global}")
v0 = VIA(adata.X, true_labels_numeric, jac_std_global=jac_std_global, dist_std_local=1, knn=knn,
         cluster_graph_pruning_std=cluster_graph_pruning_std,
         too_big_factor=0.3, resolution_parameter=2,
         root_user=root, dataset='group', random_seed=random_seed,
         is_coarse=True, preserve_disconnected=False, pseudotime_threshold_TS=40, x_lazy=0.99,
         alpha_teleport=0.99, time_series=True, time_series_labels=true_labels_numeric, edgebundle_pruning=cluster_graph_pruning_std, edgebundle_pruning_twice=True, knn_sequential_reverse=knn_sequential_reverse, knn_sequential=knn_sequential, t_diff_step=t_diff_step, do_compute_embedding=False, embedding_type='via-umap')

v0.run_VIA()
draw_piechart_graph(via_object=v0)
plt.show()

U_via = via_umap(via_object=v0, n_epochs=150, min_dist=0.3, init_pos='via')
plot_scatter(U_via, labels=true_labels_numeric, title='via initalized')
plt.show()
U=U_via
via_streamplot(v0, embedding=U[:, 0:2], scatter_size=50, scatter_alpha=0.2, marker_edgewidth=0.01,
               density_stream=1, density_grid=0.5, smooth_transition=1, smooth_grid=0.3,
               use_sequentially_augmented=True)
plt.show()

`

ylcheng commented 1 year ago

I was able to reproduce similar results. Thanks for all the help