Skip to content

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

@atong01

Description

@atong01

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions