Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5Seurat format #117

Open
wajm opened this issue Mar 30, 2021 · 8 comments
Open

h5Seurat format #117

wajm opened this issue Mar 30, 2021 · 8 comments

Comments

@wajm
Copy link

wajm commented Mar 30, 2021

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
Copy link
Author

wajm commented Mar 31, 2021

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

@wajm
Copy link
Author

wajm commented Apr 1, 2021

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)

@huidongchen
Copy link
Collaborator

huidongchen commented Apr 1, 2021

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!

@wajm
Copy link
Author

wajm commented Jan 6, 2022

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.

@huidongchen
Copy link
Collaborator

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.

@wajm
Copy link
Author

wajm commented Jan 10, 2022

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
Copy link
Author

wajm commented Jan 11, 2022

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.

@huidongchen
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants