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

IndexError #30

Open
adamgayoso opened this issue Jan 4, 2020 · 3 comments
Open

IndexError #30

adamgayoso opened this issue Jan 4, 2020 · 3 comments

Comments

@adamgayoso
Copy link

adamgayoso commented Jan 4, 2020

I get the following error when using MNN with 4000 genes, but do not get it when testing on 100 genes. This is with the newest numba version (0.47.0)

Performing cosine normalization...
Starting MNN correct iteration. Reference batch: 0
Step 1 of 1: processing batch 1
  Looking for MNNs...
  Computing correction vectors...
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-19-9ee4a0f9a20e> in <module>
     23 sc.pp.log1p(mnn_input_adata_1_rna)
     24 
---> 25 adata_mnn_rna, _, _ = mnn_correct(mnn_input_adata_0_rna, mnn_input_adata_1_rna, n_jobs=None)

/data/yosef2/users/adamgayoso/.pyenv/versions/scvi/lib/python3.7/site-packages/mnnpy/mnn.py in mnn_correct(var_index, var_subset, batch_key, index_unique, batch_categories, k, sigma, cos_norm_in, cos_norm_out, svd_dim, var_adj, compute_angle, mnn_order, svd_mode, do_concatenate, save_raw, n_jobs, *datas, **kwargs)
    124                                 cos_norm_out=cos_norm_out, svd_dim=svd_dim, var_adj=var_adj,
    125                                 compute_angle=compute_angle, mnn_order=mnn_order,
--> 126                                 svd_mode=svd_mode, do_concatenate=do_concatenate, **kwargs)
    127         print('Packing AnnData object...')
    128         if do_concatenate:

/data/yosef2/users/adamgayoso/.pyenv/versions/scvi/lib/python3.7/site-packages/mnnpy/mnn.py in mnn_correct(var_index, var_subset, batch_key, index_unique, batch_categories, k, sigma, cos_norm_in, cos_norm_out, svd_dim, var_adj, compute_angle, mnn_order, svd_mode, do_concatenate, save_raw, n_jobs, *datas, **kwargs)
    180         print('  Computing correction vectors...')
    181         correction_in = compute_correction(ref_batch_in, new_batch_in, mnn_ref, mnn_new,
--> 182                                            new_batch_in, sigma)
    183         if not same_set:
    184             correction_out = compute_correction(ref_batch_out, new_batch_out, mnn_ref, mnn_new,

IndexError: arrays used as indices must be of integer (or boolean) type

Update: the code works with numba==0.45.0.

@tkisss
Copy link

tkisss commented Jan 6, 2020

Hi, did you solve this problem? I also encountered the same problem

@adamgayoso
Copy link
Author

Yes, it worked with numba version 0.45.0 and llvmlite 0.30.0

@tkisss
Copy link

tkisss commented Jan 6, 2020

Yes, it worked with numba version 0.45.0 and llvmlite 0.30.0

It works! Thank you very much!

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