<jupyter_start><jupyter_text>Vitessce Widget Tutorial  The from_object shortcut  1. Import dependenciesImport the functions and classes that we will be using.<jupyter_code>import os
from os.path import join
from urllib.request import urlretrieve
from anndata import read_h5ad
import scanpy as sc

from vitessce import (
    VitessceConfig,
    Component as cm,
    CoordinationType as ct,
    AnnDataWrapper,
)<jupyter_output><empty_output><jupyter_text>2. Download the dataFor this example, we need to download a dataset from the COVID-19 Cell Atlas https://www.covid19cellatlas.org/index.healthy.htmlhabib17.<jupyter_code>os.makedirs("data", exist_ok=True)
adata_filepath = join("data", "habib17.processed.h5ad")
urlretrieve('https://covid19.cog.sanger.ac.uk/habib17.processed.h5ad', adata_filepath)<jupyter_output><empty_output><jupyter_text>3. Load the data<jupyter_code>adata = read_h5ad(join("data", "habib17.processed.h5ad"))<jupyter_output><empty_output><jupyter_text>3.1. Preprocess the Data For Visualization<jupyter_code>top_dispersion = adata.var["dispersions_norm"][
    sorted(
        range(len(adata.var["dispersions_norm"])),
        key=lambda k: adata.var["dispersions_norm"][k],
    )[-51:][0]
]
adata.var["top_highly_variable"] = (
    adata.var["dispersions_norm"] > top_dispersion
)<jupyter_output><empty_output><jupyter_text>With one line of code, you may create a Vitessce widget based on an automatically inferred configuration.<jupyter_code>vw = VitessceConfig.from_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"
)).widget(height=800)
vw<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11276127612761276, 'fraction_numerical': 0.0165016501650165, 'mean_word_length': 5.737037037037037, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 22, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '49082', 'license': 'MIT', 'n_tokens_mistral': 654, 'n_tokens_neox': 632, 'n_words': 118, 'path': 'docs/notebooks/widget_shortcut.ipynb', 'repo_name': 'manzt/vitessce-python', 'size': '1818'}