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
Maybe empower obs_vector to allow accessing obsp? That could be easy, @ivirshup?
Or adding a .loc accessor to the obsp attribute.
ivirshup
changed the title
Inability to slice to get a row vector from .varp,.obsp
Ability to index by label along one axis into obsp, varp arrays
Apr 29, 2020
That's the plan! One of the last remaining things to do in #342 (@flying-sheep). IIRC we were going to leave the ability to select which axis of the pairwise array is being subset and default to rows for now.
I do think it would be nice to make adata.obs.index.get_loc('key') more concise.
Or adding a .loc accessor to the obsp attribute.
This could be interesting. Right now the idea of a subset of one of the aligned mappings is pretty tightly coupled to a view of an AnnData object, so this could take some doing.
So I've run into an issue when slicing my anndata object to get a vector.
My anndata is structured like:
X
:obs x var
obs
: iterable of observation namesvar
: iterable of variable namesobsp
: connectivity matrices defined by my differentobsp
keys and having a shape ofobs x obs
varp
: connectivity matrices defined by my differentvarp
keys and having a shape ofvar x var
I initiate the object with (note that all X's are sparse matrices):
I would like to slice with:
adata[key].obsp[obsp_1_X]
but this returns a1x1
matrix whereas I would like a1 x n_obs
To get around this I am having to do:
adata.obsp['obsp_1_X'][adata.obs.index.get_loc('key')]
I assume similar behavior with
.varm
and.obsm
The text was updated successfully, but these errors were encountered: