-
Notifications
You must be signed in to change notification settings - Fork 57
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
k_selection_plot and consensus - TypeError: H should have the same dtype as X. #8
Comments
I think the --densify flag might be causing the issue, since when I run try code that loads the counts and tpm matrices into scanpy objects, the dtype of X is float32 (the default for AnnData()). Further, when I reimport the data from the .h5ad object they are written to in I edited the |
consensus
- TypeError: H should have the same dtype as X.
consensus
- TypeError: H should have the same dtype as X.
I had another similar issue calling consensus (weirdly only for some runs and not others). On line 580 in the original cnmf.py I checked if tpm.X.dtype is 'float64' and changed it to 'float64' otherwise and it works now. |
In case someone doesn't know |
I did run into this issue for step 4 of the README tutorial, and adding the line suggested by Pentayouth worked. I've now run into what seems to be a related issue, for step 5 of the README. I am doing a test run with the PBMC example data from Seurat, which I first converted to an h5ad file before going through the README. Command: Traceback:
It has been a while since I've worked with Python so I'm struggling to understand how to edit the code. Thanks for any help! |
Hi, could it be that it's not the right line number? now it seems to raise name error on norm_counts. P.S: I added it at the beginning of factorize method, and now it works. |
Hi, I encountered the same issue using the most recent version of cnmf. I also tried all suggestions listed above, however, the problem still existed. Could anyone please let me know how to solve the problem? Where exactly I should add |
|
Find cnmf.py. At the beginning of the factorize method ( def factorize(self,worker_i=0, total_workers=1,):), one of the parameters is "norm_counts ". Insert "norm_counts.X = norm_counts.X.astype(np.float64)" as the first line of the method, so it will fix norm_counts. |
Okay, thanks for your reply, I'll try it. Hope you happy today.
***@***.***
***@***.***
…---- Replied Message ----
From Avishai ***@***.***> Date 04/10/2023 04:16 To ***@***.***> Cc ***@***.***>***@***.***> Subject Re: [dylkot/cNMF] k_selection_plot and consensus - TypeError: H should have the same dtype as X. (#8)
Hi,I want to know where exactly are you add norm_counts.X = norm_counts.X.astype(np.float64) in cnmf.py?
Hi, I encountered the same issue using the most recent version of cnmf. I also tried all suggestions listed above, however, the problem still existed. Could anyone please let me know how to solve the problem? Where exactly I should add norm_counts.X = norm_counts.X.astype(np.float64) in cnmf.py?
Find cnmf.py. At the beginning of the factorize method ( def factorize(self,worker_i=0, total_workers=1,):), one of the parameters is "norm_counts ". Insert "norm_counts.X = norm_counts.X.astype(np.float64)" as the first line of the method, so it will fix norm_counts.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Hello,
I'm encountering the following error while running
k_selection_plot
.I'm working with RNA-Seq data from multiple ~homogeneous tissue samples, rather than scRNA-Seq.
Here are my commands leading up to calling
k_selection_plot
:And here is the traceback for the error after the call:
Could I get some help with this? Thanks!
The text was updated successfully, but these errors were encountered: