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

ValueError: Bin edges must be unique #35

Open
tfujian opened this issue Jan 14, 2025 · 1 comment
Open

ValueError: Bin edges must be unique #35

tfujian opened this issue Jan 14, 2025 · 1 comment

Comments

@tfujian
Copy link

tfujian commented Jan 14, 2025

Hello, respected author, I have the following questions to ask you. I used the following command:

SEVtras.ESAI_calculator(adata_ev_path='outputs/raw_cellranger_patient1.h5ad', adata_cell_path='seurat.h5ad', out_path='./outputs', Xraw=False, OBScelltype='celltype')

I obtained the seurat.h5ad file with cell type information using Scanpy analysis. There is only one sample, so I didn't use OBSsample='batch'. However, after running the above command, I encountered the following error:

ValueError: Bin edges must be unique: Index([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], dtype='float64'). You can drop duplicate edges by setting the 'duplicates' kwarg

Our method requires the use of the raw_feature_bc_matrix, but the seurat.h5ad file with cell type information has been filtered. Does this mean the number of cells is different? Could this be the reason for the issue? How should this problem be resolved?

Additionally, do we need to perform filtering during Scanpy analysis?

Thank you very much for your response.

@RuiqiaoHe
Copy link
Member

Thank you for your testing. Could you artificially add the 'batch' variable to the obs of the cell object? The values in it are the sample names and can be confirmed by reading 'outputs/raw_cellranger_patient1.h5ad' and viewing its adata.obs['batch']. Then re-run it and see if it reports an error.
If it still reports an error, please copy the full error for reference.
The adata_cell does not require the use of raw_feature_bc_matrix, instead it is recommended to follow the regular single cell analysis process and use the filtered_feature_bc_matrix. Only the first step requires the raw_feature_bc_matrix.

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