Public
Edited
Mar 2, 2023
Fork of Vit-S
1 fork
Insert cell
Insert cell
geneExpression = {
const { AnnDataSource, ObsFeatureMatrixAnndataLoader } = ZarrFileType;

const url = "https://s3.amazonaws.com/vitessce-data/0.0.33/main/satija-2020/satija_2020.h5ad.zarr";

const source = new AnnDataSource({ url });
const config = {
url,
fileType: 'obsFeatureMatrix.mudata.zarr',
options: {
path: 'X',
},
};
const loader = new ObsFeatureMatrixAnndataLoader(source, config);

const { data: { rows: obsIndex, cols: varIndex } } = await loader.loadAttrs();
// obsIndex is cell IDs. varIndex is gene IDs.

// We can load the data for a subset of genes by selecting an array of gene IDs.
const { data } = await loader.loadGeneSelection({ selection: ['ENSG00000170476.16'] });

return obsIndex.map((cellId, i) => ({ cellId, normalizedExpression: data[0][i] / 256 }));
}
Insert cell
geneExpression
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
ZarrFileType = await import('https://esm.sh/@vitessce/zarr@2.0.3')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more