Skip to content

Scirpy tutorial incorrect - working with multimodal data #616

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

Open
benemead opened this issue May 23, 2025 · 0 comments
Open

Scirpy tutorial incorrect - working with multimodal data #616

benemead opened this issue May 23, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@benemead
Copy link

Report

Hi There,

I find myself in the unfortunate position where I need to work with airr data within an anndata as opposed to it's own modality in a mudata - I was reading the tutorial documentation here, specifically implementing this code:

# Map each cell barcode to its respective numeric index (assumes obs_names are unique)
barcode2idx = {barcode: i for i, barcode in enumerate(adata_airr.obs_names)}
# Generate a slice for the awkward array that retrieves the corresponding row
# from `adata_airr` for each barcode in `adata_gex`. `-1` will generate all
# "None"s for barcodes that are not in `adata_airr`
idx = [barcode2idx.get(barcode, -1) for barcode in adata_gex.obs_names]
adata_gex.obsm["airr"] = adata_airr.obsm["airr"][idx]

This asserts that the index -1 will generate Nones but my reading (and in practice) is that it's just inserting the last record, which in fact is a valid record... am I missing something here? Guidance on in fact populating Nones would be very helpful!

Versions

@benemead benemead added the bug Something isn't working label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant