KrishnaswamyLab / SingleCellWorkshop

GNU General Public License v3.0
88 stars 35 forks source link

Interface change for mnn_correct in Batch Correction in PBMCs notebook #28

Open atong01 opened 3 years ago

atong01 commented 3 years ago

Error reported by Tianyu going through the answer key notebooks

My concern is about the content in the colab code of workshop  Batch correction in PBMCs (Answer Key) I find that there are some errors in the sc.external.pp.mnn_correct step (In part 6)

If I run this code, it will throw me an error: IndexError: arrays used as indices must be of integer (or boolean) type

This can be fixed

by changing this line:

cdata = sc.external.pp.mnn_correct(alldata['Donor_1'], alldata['Donor_2'], svd_dim=50, 
                                  batch_key = 'sample_labels', batch_categories=["Donor_1","Donor_2"])

to this

cdata = sc.external.pp.mnn_correct(pbmc_anndata, svd_dim=50, 
                                  batch_key = 'sample_labels', batch_categories=["Donor_1","Donor_2"])[0]
atong01 commented 3 years ago

It appears this under corrects this data and should be further investigated.

HelloWorldLTY commented 3 years ago

Thanks for your post! I am Tianyu and I am still confused about this problem, because if I use small set data, the mnn_correct will work. For example, image