You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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:
This asserts that the index
-1
will generateNone
s 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 populatingNone
s would be very helpful!Versions
The text was updated successfully, but these errors were encountered: