-
Notifications
You must be signed in to change notification settings - Fork 48
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
st.add_cell_labels error: ValueError: Length mismatch #128
Comments
Hi, Thanks for the feedback. Unfortunately I was not able to reproduce the error when playing around with example data. I am happy to take a closer look if you can share with me the file 'labels.tsv'. But in your case, you can actually skip the step Let me know if this works for you. |
Yes, you can. The pseudotime with different nodes will be all computed once the tree structure is learnt. The pseudotime info is stored in So you can simply replace 'S4' with the root node you desire. E.g., in your case, you can replace |
Thanks for your advice! It worked. But I find that I can't add my annotaion color if I don't follow STREAM tutorial to add the colors by 'st.add_cell_colors'. My color annotations are stored in adata.obs.label_color, which match the cluster labels in adata.obs.label. How could I use my annotation color when plotting the stream?
|
For now I guess it has to be done in a hacky way.. You can add your own colors by : But this is something that will certainly be addressed in our stream v2. |
Thank you so much. And I met a similar error with issue 115 (#115) after running st.plot_stream(adata,root='S5',color=['label'],save_fig=True, fig_format='pdf') Traceback (most recent call last): I tried to downgrade to pandas==1.0 or any other versions, but it didn't work. Sorry to encroach upon your time. I am also looking forward to the release of stream v2.
|
I am sorry that you have to go through these tricky steps to use stream. Unfortunately I am not sure how to address this issue as I have not run into it or been able to reproduce it myself. If you can share with me a script and a dummy dataset to reproduce the error, I am more than happy to take a closer look. |
Hi,
|
hmmm, that is very strange. I just tested your script and I was able to run it without any errors. I am attaching the notebook I was using here. |
So it is likely that there is an error in my environment. anndata 0.7.3 Can you find anything wrong?
|
Hi,
I'm using a loom file saving from a seurat object. My adata is like:
AnnData object with n_obs × n_vars = 56109 × 22965
obs: 'ClusterID', 'ClusterName', 'DF_classification', 'RNA_snn_res_1_5', 'cell_types', 'gender', 'group', 'nCount_RNA', 'nFeature_RNA', 'orig_ident', 'percent_hsp', 'percent_mt', 'percent_rb', 'seurat_clusters', 'label_color'
var: 'Selected', 'vst_mean', 'vst_variable', 'vst_variance', 'vst_variance_expected', 'vst_variance_standardized'
uns: 'label_color', 'workdir'
obsm: 'harmony_cell_embeddings', 'pca_cell_embeddings', 'umap_cell_embeddings'
varm: 'harmony_feature_loadings_projected', 'pca_feature_loadings'
layers: 'norm_data', 'scale_data'
I extracted my cell labels by this:
adata.obs['cell_types'].to_csv('labels.tsv',sep='\t',header=0)
But when I try to add it to my object by this:
st.add_cell_labels(adata, file_name = 'labels.tsv')
It came an error:
ValueError: Length mismatch: Expected axis has 56110 elements, new values have 56109 elements
I checked my adata, there seems 56109 cells with no problem:
Could you please help me? I can't figure it out.
The text was updated successfully, but these errors were encountered: