dylkot / cNMF

Code and example data for running Consensus Non-negative Matrix Factorization on single-cell RNA-Seq data
MIT License
243 stars 57 forks source link

Usage sum of each cell is over 1 #77

Closed juneE-cloud closed 1 month ago

juneE-cloud commented 6 months ago

Thank you for creating this excellent package!

Following the provided tutorial (analyze_pbmc_example_data.ipynb), I successfully reproduced nearly all the results in my jupyter notebook, however, surprisingly, I found that the file "pbmc_cNMF.usages.k_7.dt_0_1.consensus.txt" showed extremely low usage (see below).

According to the tutorial, this matrix should be normalized to sum to 1, but I observed some values are over 1.

DA97E07E-5F3B-4312-9390-AB7C98AC2FEC 05CE5473-0C74-4FAD-A3BD-705B613B0003

Is it correct?

Looking for your kind reply.

Happy Christmas Eve, btw :)

LiuCanidk commented 2 months ago

Hi, did you figure that out? I also notice that there were some extreme values in my usage matrix, which made the visualization strange.

juneE-cloud commented 1 month ago

Hi, did you figure that out? I also notice that there were some extreme values in my usage matrix, which made the visualization strange.

I used the previous version that worked for me:)

dylkot commented 1 month ago

Hi apologies for the confusion. In the current master branch cnmf_obj.load_results() returns unnormalized usages. However, in the current development branch, it defaults to returning normalized usages but this can be controlled with a parameter:

cnmf_obj.load_results(self, K, density_threshold, n_top_genes=100, norm_usage = True)

I will be pushing the development branch to master and updating the pip installation as well. I hope this helps!