vitessce/vitessce-python

Fix Examples

Closed this issue · 0 comments

It seems like some of the examples (at least https://vitessce.github.io/vitessce-python/notebooks/data_export_s3.html) are not working, for example

vc = VitessceConfig(name='Habib et al', description='COVID-19 Healthy Donor Brain')
dataset = vc.add_dataset(name='Brain').add_object(AnnDataWrapper(
        adata,
        mappings_obsm=["X_umap"],
        mappings_obsm_names=["UMAP"],
        cell_set_obs=["CellType"],
        cell_set_obs_names=["Cell Type"],
        expression_matrix="X",
        matrix_gene_var_filter="top_highly_variable"
))
scatterplot = vc.add_view(dataset, cm.SCATTERPLOT, mapping="UMAP")
cell_sets = vc.add_view(dataset, cm.CELL_SETS)
genes = vc.add_view(dataset, cm.GENES)
heatmap = vc.add_view(dataset, cm.HEATMAP)
vc.layout((scatterplot | (cell_sets / genes)) / heatmap);

seems to give

Input In [51], in <cell line: 1>()
----> 1 scatterplot = vc.add_view(dataset, cm.SCATTERPLOT, mapping="UMAP")
      2 cell_sets = vc.add_view(dataset, cm.CELL_SETS)
      3 genes = vc.add_view(dataset, cm.GENES)

File ~/software/miniconda3/envs/scfglue/lib/python3.9/site-packages/vitessce/config.py:686, in VitessceConfig.add_view(self, component, dataset, dataset_uid, x, y, w, h, mapping, coordination_scopes, props)
    652 """
    653 Add a view to the config.
    654
   (...)
    683     v2 = vc.add_view(cm.SCATTERPLOT, dataset=my_dataset, mapping="X_umap")
    684 """
    685 # User should only provide dataset or dataset_uid, but not both.
--> 686 assert isinstance(dataset, VitessceConfigDataset) or isinstance(
    687     dataset_uid, str)
    688 assert dataset is None or dataset_uid is None
    689 assert type(component) in [str, cm]

AssertionError: