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

An error of cnmf combine #89

Open
Lyu-Gaoyuan opened this issue May 26, 2024 · 1 comment
Open

An error of cnmf combine #89

Lyu-Gaoyuan opened this issue May 26, 2024 · 1 comment

Comments

@Lyu-Gaoyuan
Copy link

Hi,
Thank you for your wonderful work! I currently encountered the following error when running system('cnmf combine --output-dir tset_2 --name T1'):

Combining factorizations for k=7.
Combining factorizations for k=8.
Combining factorizations for k=9.
Combining factorizations for k=10.
Combining factorizations for k=11.
Traceback (most recent call last):
  File "/home/lgy/miniconda3/envs/cnmf/bin/cnmf", line 33, in <module>
    sys.exit(load_entry_point('cNMF', 'console_scripts', 'cnmf')())
  File "/home/lgy/miniconda3/envs/cnmf/lib/python3.7/site-packages/cnmf-master/cNMF/cnmf.py", line 1656, in main
    args.func(args)
  File "/home/lgy/miniconda3/envs/cnmf/lib/python3.7/site-packages/cnmf-master/cNMF/cnmf.py", line 1305, in combine
    cnmf_obj.combine_nmf(k)
  File "/home/lgy/miniconda3/envs/cnmf/lib/python3.7/site-packages/cnmf-master/cNMF/cnmf.py", line 793, in combine_nmf
    combined_spectra = combined_spectra.reshape(-1, combined_spectra.shape[-1])
AttributeError: 'NoneType' object has no attribute 'reshape'

my complete code are as follow:
use_condaenv(condaenv = "cnmf", required = T)
py_config()

python:         /home/lgy/miniconda3/envs/cnmf/bin/python
libpython:      /home/lgy/miniconda3/envs/cnmf/lib/libpython3.7m.so
pythonhome:     /home/lgy/miniconda3/envs/cnmf:/home/lgy/miniconda3/envs/cnmf
version:        3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:21)  [GCC 9.4.0]
numpy:          /home/lgy/miniconda3/envs/cnmf/lib/python3.7/site-packages/numpy
numpy_version:  1.21.6
NOTE: Python version was forced by use_python() function

py_module_available('cnmf')
TRUE
system("cnmf prepare --output-dir tset_2 --name T1 count_data/T1.count.txt -k 3 4 5 6 7 8 9 10 --n-iter 200")

Reading in counts from count_data/T1.count.txt - 177 cells and 21337 genes
Removing 3022 genes with zero counts; final shape (177, 18315)
Selecting 2000 highly variable genes
Warning: 8 cells have zero counts of overdispersed genes - ignoring                 these cells for factorization.
/home/lgy/miniconda3/envs/cnmf/lib/python3.7/site-packages/cnmf-master/cNMF/cnmf.py:1186: FutureWarning: X.dtype being converted to np.float32 from int64. In the next version of anndata (0.9) conversion will not be automatic. Pass dtype explicitly to avoid this warning. Pass `AnnData(X, dtype=X.dtype, ...)` to get the future behavour.
  var=pd.DataFrame(index=input_counts.columns),

system("cnmf factorize --output-dir tset_2 --name T1 --worker-index 0")

.........
.........
[Worker 0]. Starting task 1596.
[Worker 0]. Starting task 1597.
[Worker 0]. Starting task 1598.
[Worker 0]. Starting task 1599.

system("cnmf combine --output-dir tset_2 --name T1")

Combining factorizations for k=7.
Combining factorizations for k=8.
Combining factorizations for k=9.
Combining factorizations for k=10.
Combining factorizations for k=11.
Traceback (most recent call last):
  File "/home/lgy/miniconda3/envs/cnmf/bin/cnmf", line 33, in <module>
    sys.exit(load_entry_point('cNMF', 'console_scripts', 'cnmf')())
  File "/home/lgy/miniconda3/envs/cnmf/lib/python3.7/site-packages/cnmf-master/cNMF/cnmf.py", line 1656, in main
    args.func(args)
  File "/home/lgy/miniconda3/envs/cnmf/lib/python3.7/site-packages/cnmf-master/cNMF/cnmf.py", line 1305, in combine
    cnmf_obj.combine_nmf(k)
  File "/home/lgy/miniconda3/envs/cnmf/lib/python3.7/site-packages/cnmf-master/cNMF/cnmf.py", line 793, in combine_nmf
    combined_spectra = combined_spectra.reshape(-1, combined_spectra.shape[-1])
AttributeError: 'NoneType' object has no attribute 'reshape'

Could you tell me how to fix this bug.
Looking forward to your reply.
Think you

@xyzheng123
Copy link

Hi @Lyu-Gaoyuan, have you been able to resolve the issue?

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