STREAM icon indicating copy to clipboard operation
STREAM copied to clipboard

h5Seurat format

Open wajm opened this issue 4 years ago • 8 comments

Hi, is it possible to use h5Seurat format converted by SeuratDisk in STREAM? https://mojaveazure.github.io/seurat-disk/articles/convert-anndata.html

My data is integrated seurat object.

wajm avatar Mar 30 '21 23:03 wajm

for using seurat object, STREAM had suggested loomR conversion in seurat. however now loomR using seurat-disk, all setting is change.

wajm avatar Mar 31 '21 01:03 wajm

Okay, I've tried this. and working like previous #100 setting. but I'm not sure this is correct or not. Please check this.

patient object is subset of original my data and performed "FindVariableFeatures", "ScaleData" after subsetting.

library(Seurat) library(SeuratDisk) SaveH5Seurat(patient, filename = "patient.h5Seurat") Convert("patient.h5Seurat", dest = "h5ad")

in STREAM:

adata = ad.read_h5ad("patient.h5ad") st.set_workdir(adata,'result') st.add_metadata(adata,file_name='metadata.txt')

adata.obsm['top_pcs'] = adata.obsm['X_pca'] adata.obsm['X_dr'] = adata.obsm['X_umap'] adata.obsm['X_vis_umap'] = adata.obsm['X_umap']

then I can either learn graphical structure directly on UMAP from seurat:

st.plot_visualization_2D(adata,method='umap',n_neighbors=50,color=['label'],use_precomputed=True,fig_size=[11,9]) st.seed_elastic_principal_graph(adata,n_clusters=100,use_vis=True) st.elastic_principal_graph(adata,epg_alpha=0.01,epg_mu=0.2,epg_lambda=0.01,n_jobs=4)

wajm avatar Apr 01 '21 00:04 wajm

Sorry about the delay. Thanks very much for the feedback and solution. This looks all right to me. I would suggest lowering n_clusters though (a reasonable range would be 5~20 for it)

We are currently working on STREAM2 and making STREAM compatible with other single-cell analysis is one big part of it. Hope that our STREAM2 will facilitate the conversion between different file formats. Stay tuned!

huidongchen avatar Apr 01 '21 01:04 huidongchen

I'm realized an issue.

in STREAM: adata = ad.read_h5ad("patient.h5ad") st.set_workdir(adata,'result') st.add_metadata(adata,file_name='metadata.txt')

adata.obsm['top_pcs'] = adata.obsm['X_pca'] adata.obsm['X_dr'] = adata.obsm['X_umap'] adata.obsm['X_vis_umap'] = adata.obsm['X_umap']

For my integration Seurat object, upper code in STREAM was used. but I've got partial data from seurat object.

Please check whether the upper setting is correct.

wajm avatar Jan 06 '22 06:01 wajm

Hi, the setting looks all right to me. It seems the same as the code you shared previously though. I am not sure what the problem here is.

huidongchen avatar Jan 10 '22 18:01 huidongchen

Hi, the setting looks all right to me. It seems the same as the code you shared previously though. I am not sure what the problem here is.

hmmm. My integrated Seruat object lost many cells in subway plot and flat tree plot. Thanks.

wajm avatar Jan 10 '22 22:01 wajm

AnnData object with n_obs × n_vars = 11826 × 2000 obs: 'label', 'label_color' var: 'features' uns: 'workdir', 'label_color' obsm: 'X_pca', 'X_umap', 'top_pcs', 'X_dr', 'X_vis_umap' varm: 'PCs'

in my data, n_vars is only 2000. I think that is problem.

wajm avatar Jan 11 '22 06:01 wajm

I don't think the number of features should be a problem.

I am not sure why cells are missing in those plots, which is something new to me. It would be helpful if you can share with me a notebook to reproduce the issue. Give such information, unfortunately i can not help much.

huidongchen avatar Jan 11 '22 22:01 huidongchen