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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more