Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .coveragerc_omit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ omit =
vitessce/widget.py
vitessce/wrappers.py
vitessce/repr.py
vitessce/data_utils/anndata.py
vitessce/data_utils/ome.py
vitessce/data_utils/entities.py
vitessce/data_utils/multivec.py
vitessce/data_utils/anndata/anndata.py
vitessce/data_utils/multivec/multivec.py
vitessce/data_utils/multivec/entities.py
vitessce/data_utils/ome_tiff/ome_tiff.py
vitessce/data_utils/ome_zarr/ome_zarr.py
vitessce/data_utils/ucsc_cellbrowser/ucsc_cellbrowser.py
2 changes: 1 addition & 1 deletion demos/codeluppi-2018/src/convert_to_cells_h5ad_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import scanpy as sc
import geopandas as gpd
from shapely.geometry import Polygon
from vitessce.data_utils import (
from vitessce.data_utils.anndata import (
to_uint8,
sort_var_axis,
optimize_adata,
Expand Down
2 changes: 1 addition & 1 deletion demos/codeluppi-2018/src/convert_to_ome_zarr.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
import h5py
import numpy as np
from vitessce.data_utils import (
from vitessce.data_utils.ome_zarr import (
multiplex_img_to_ome_zarr,
)

Expand Down
2 changes: 1 addition & 1 deletion demos/combat-2022/src/convert_to_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from anndata import read_h5ad
import numpy as np
from scipy import sparse
from vitessce.data_utils import to_uint8
from vitessce.data_utils.anndata import to_uint8


def convert_h5ad_to_zarr(input_path, output_path):
Expand Down
2 changes: 1 addition & 1 deletion demos/eng-2019/src/convert_to_csv.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
import json
import pandas as pd
from vitessce.data_utils import to_diamond
from vitessce.data_utils.anndata import to_diamond


def convert_to_csv(args):
Expand Down
2 changes: 1 addition & 1 deletion demos/habib-2017/src/convert_to_zarr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
from anndata import read_h5ad
from vitessce.data_utils import (
from vitessce.data_utils.anndata import (
to_uint8,
sort_var_axis,
optimize_adata,
Expand Down
6 changes: 4 additions & 2 deletions demos/human-lymph-node-10x-visium/src/create_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
import scanpy as sc
import numpy as np
import scipy.cluster
from vitessce.data_utils import (
from vitessce.data_utils.anndata import (
to_diamond,
rgb_img_to_ome_zarr,
optimize_adata,
)
from vitessce.data_utils.ome_zarr import (
rgb_img_to_ome_zarr,
)


def create_zarr(output_adata, output_img):
Expand Down
6 changes: 4 additions & 2 deletions demos/kuppe-2022/src/convert_to_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import json
from anndata import read_h5ad, AnnData
import imageio.v2 as imageio
from vitessce.data_utils import (
from vitessce.data_utils.anndata import (
to_diamond,
to_uint8,
rgb_img_to_ome_zarr,
optimize_adata,
)
from vitessce.data_utils.ome_zarr import (
rgb_img_to_ome_zarr,
)


def process_h5ad_files(args):
Expand Down
2 changes: 1 addition & 1 deletion demos/marshall-2022/src/convert_to_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from anndata import read_h5ad
import numpy as np
import scanpy as sc
from vitessce.data_utils import (
from vitessce.data_utils.anndata import (
to_diamond,
to_uint8,
optimize_adata,
Expand Down
2 changes: 1 addition & 1 deletion demos/meta-2022-azimuth/src/convert_to_zarr.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
from anndata import read_h5ad
from scipy import sparse
from vitessce.data_utils import (
from vitessce.data_utils.anndata import (
to_uint8,
)

Expand Down
2 changes: 1 addition & 1 deletion demos/satija-2020/src/convert_to_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
from anndata import read_h5ad
import pandas as pd
from vitessce.data_utils import (
from vitessce.data_utils.anndata import (
to_uint8,
sort_var_axis,
optimize_adata,
Expand Down
10 changes: 1 addition & 9 deletions docs/api_data.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Data preparation APIs
Data config APIs
#####################

Dataset wrapper classes
Expand All @@ -23,11 +23,3 @@ vitessce.export

.. automodule:: vitessce.export
:members:

vitessce.data_utils
*****************

.. automodule:: vitessce.data_utils.ome
:members:
.. automodule:: vitessce.data_utils.anndata
:members:
20 changes: 20 additions & 0 deletions docs/api_data_utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Data conversion APIs
#####################

Data conversion functions
provide functionality for converting data
to Vitessce-compatible formats.

vitessce.data_utils
*****************

.. automodule:: vitessce.data_utils.anndata.anndata
:members:
.. automodule:: vitessce.data_utils.multivec.multivec
:members:
.. automodule:: vitessce.data_utils.ome_tiff.ome_tiff
:members:
.. automodule:: vitessce.data_utils.ome_zarr.ome_zarr
:members:
.. automodule:: vitessce.data_utils.ucsc_cellbrowser.ucsc_cellbrowser
:members:
22 changes: 22 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ Installation requires Python 3.9 or greater. Install from `PyPI <https://pypi.or
pip install vitessce[all]


Notes:

* The most minimal ``pip install vitessce`` installs only those dependencies required to use the configuration and wrapper classes, such as ``VitessceConfig`` and ``AnnDataWrapper``.
* The second-most minimal ``pip install vitessce[all]`` additionally installs the dependencies required to use the Jupyter widget, enabling ``VitessceConfig.widget()``.
* Data conversion dependencies for usage of ``vitessce.data_utils`` submodules must be installed explicitly as described below.

To use functions from ``vitessce.data_utils.{submodule}``, the name of each submodule intended to be used must be specified in `extras <https://peps.python.org/pep-0508/#extras>`_:

.. code-block:: bash

pip install vitessce[anndata,multivec,ome_tiff,ome_zarr,ucsc_cellbrowser]

For example, to install the Jupyter widget and the data conversion dependencies for ``vitessce.data_utils.anndata``:

.. code-block:: bash

pip install vitessce[all,anndata]




Widget Compatibility
--------------------

Expand All @@ -47,6 +68,7 @@ The Vitessce widget is compatible with the following interactive Python platform
data_examples
api_config
api_data
api_data_utils
data_options
screenshots

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"import json\n",
"from os.path import join\n",
"from vitessce import (\n",
" convert_cell_browser_project_to_anndata,\n",
" AnnDataWrapper,\n",
" VitessceConfig,\n",
")\n",
"from vitessce.data_utils import VAR_CHUNK_SIZE"
"from vitessce.data_utils.anndata import VAR_CHUNK_SIZE\n",
"from vitessce.data_utils.ucsc_cellbrowser import convert_cell_browser_project_to_anndata"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/data_export_files.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
" CoordinationType as ct,\n",
" AnnDataWrapper,\n",
")\n",
"from vitessce.data_utils import (\n",
"from vitessce.data_utils.anndata import (\n",
" optimize_adata,\n",
" VAR_CHUNK_SIZE,\n",
")"
Expand Down Expand Up @@ -228,7 +228,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/data_export_s3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
" CoordinationType as ct,\n",
" AnnDataWrapper,\n",
")\n",
"from vitessce.data_utils import (\n",
"from vitessce.data_utils.anndata import (\n",
" optimize_adata,\n",
" VAR_CHUNK_SIZE,\n",
")"
Expand Down Expand Up @@ -222,7 +222,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/widget_brain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
" CoordinationType as ct,\n",
" AnnDataWrapper,\n",
")\n",
"from vitessce.data_utils import (\n",
"from vitessce.data_utils.anndata import (\n",
" optimize_adata,\n",
" VAR_CHUNK_SIZE,\n",
")"
Expand Down Expand Up @@ -287,7 +287,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/widget_brain_with_base_dir.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
" AnnDataWrapper,\n",
" BASE_URL_PLACEHOLDER,\n",
")\n",
"from vitessce.data_utils import (\n",
"from vitessce.data_utils.anndata import (\n",
" optimize_adata,\n",
" VAR_CHUNK_SIZE,\n",
")"
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/widget_genomic_profiles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
" AnnDataWrapper,\n",
" MultivecZarrWrapper,\n",
")\n",
"from vitessce.data_utils import (\n",
"from vitessce.data_utils.multivec import (\n",
" adata_to_multivec_zarr,\n",
")\n",
"from os.path import join\n",
Expand Down Expand Up @@ -212,7 +212,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/widget_loom.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
" CoordinationType as ct,\n",
" AnnDataWrapper,\n",
")\n",
"from vitessce.data_utils import (\n",
"from vitessce.data_utils.anndata import (\n",
" optimize_adata,\n",
" to_diamond,\n",
" VAR_CHUNK_SIZE,\n",
Expand Down Expand Up @@ -211,7 +211,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/widget_pbmc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
" CoordinationType as ct,\n",
" AnnDataWrapper,\n",
")\n",
"from vitessce.data_utils import (\n",
"from vitessce.data_utils.anndata import (\n",
" optimize_adata,\n",
" VAR_CHUNK_SIZE,\n",
")"
Expand Down Expand Up @@ -201,7 +201,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
"version": "3.9.0"
}
},
"nbformat": 4,
Expand Down
34 changes: 33 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,40 @@ testing = []
linting = []
notebook = []

# data_utils extras_require
# These dependencies are required
# to use the corresponding data_utils sub-packages.
anndata = [
'zarr>=2.5.0',
'numcodecs>=0.5.7',
'anndata>=0.7.8,<0.9',
'scanpy>=1.9.3'
]
ome_zarr = [
'zarr>=2.5.0',
'numcodecs>=0.5.7',
'ome-zarr==0.2.1'
]
ome_tiff = [
'generate-tiff-offsets>=0.1.7',
'tifffile>=2020.10.1'
]
multivec = [
'zarr>=2.5.0',
'numcodecs>=0.5.7',
'negspy>=0.2.24'
]

[project.urls]
repository = "https://github.com/vitessce/vitessce-python"

[tool.setuptools]
packages = ["vitessce", "vitessce.data_utils"]
packages = [
"vitessce",
"vitessce.data_utils",
"vitessce.data_utils.anndata",
"vitessce.data_utils.multivec",
"vitessce.data_utils.ome_tiff",
"vitessce.data_utils.ome_zarr",
"vitessce.data_utils.ucsc_cellbrowser"
]
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ per-file-ignores =
# Special case: names are reimported from __init__.py, so unused imports are expected.
vitessce/__init__.py: F401
vitessce/data_utils/__init__.py: F401
vitessce/data_utils/anndata/__init__.py: F401
vitessce/data_utils/multivec/__init__.py: F401
vitessce/data_utils/ome_tiff/__init__.py: F401
vitessce/data_utils/ome_zarr/__init__.py: F401
vitessce/data_utils/ucsc_cellbrowser/__init__.py: F401
ignore =
E501, # Ignore line too long
W605, # Ignore invalid escape sequence '\*'
Expand Down
4 changes: 3 additions & 1 deletion tests/test_anndata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
from scipy.io import mmread
import zarr

from vitessce.data_utils import (
from vitessce.data_utils.anndata import (
optimize_arr,
optimize_adata,
sort_var_axis,
to_uint8,
)
from vitessce.data_utils.multivec import (
adata_to_multivec_zarr,
)

Expand Down
Loading