.ndloc should be used for gridded data:
Targets to get working:
img = hv.Image(adata, [A.var["index"], A.obs["index"]], [A[:, :]])
img[:20, :30]
img[cells_to_keep, genes_to_keep]
img[cell_mask, :]
Context:
Use case: I'm thinking about how to create an image or heatmap of either a range from the expression array or a particular named list or index list of [genes, cells]
Making a subset on the adata is the only method I've been able to get partially working so far..
adata_subset = adata[0:20, 0:30]
hv.Image(adata_subset, [A.var["index"], A.obs["index"]], [A[:, :]]) # works
hv.HeatMap(adata_subset, [A.var["index"], A.obs["index"]], [A[:, :]]) # works
- By specific gene and cell names:
genes_to_keep = ['gene-47', 'gene-4', 'gene-7', 'gene-10']
cells_to_keep = ['cell-10', 'cell-1', 'cell-20']
adata_subset = adata[cells_to_keep, genes_to_keep]
hv.Image(adata_subset, [A.var["index"], A.obs["index"]], [A[:, :]]) # works
hv.HeatMap(adata_subset, [A.obs["index"], A.var["index"]], [A[:, :]]) # doesn't work
cell_mask = adata.obs['type'] == 1
adata_subset = adata[cell_mask, :]
hv.Image(adata_subset, [A.obs["index"], A.var["index"]], [A[:, :]]) # works
hv.HeatMap(adata_subset, [A.obs["index"], A.var["index"]], [A[:, :]]) # works
.iloc or .select won't work on the hv.Image object because the standard iloc accessor assumes non-gridded output.
.ndlocshould be used for gridded data:Targets to get working:
Context:
Use case: I'm thinking about how to create an image or heatmap of either a range from the expression array or a particular named list or index list of [genes, cells]
Making a subset on the adata is the only method I've been able to get partially working so far..
.ilocor.selectwon't work on thehv.Imageobject because the standardilocaccessor assumes non-gridded output.