Skip to content

Commit

Permalink
chore: Add new readme section and dev_doc file (#1101)
Browse files Browse the repository at this point in the history
Co-authored-by: rainandbare <[email protected]>
  • Loading branch information
rainandbare and rainandbare authored Sep 16, 2024
1 parent 78427b4 commit 7218253
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .infra/rdev/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ stack:
services:
explorer:
image:
tag: sha-f55da22f
tag: sha-da511850
replicaCount: 1
env:
# env vars common to all deployment stages
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ CZ CELLxGENE Explorer (pronounced "cell-by-gene") is an interactive data explore

Whether you need to visualize one thousand cells or one million, CELLxGENE Explorer helps you gain insight into your single-cell data.

#### Highlighted Features

- **Interactive Exploration**: Provides intuitive navigation of 2D matrices with dimensions, allowing users to explore datasets.
- **Data Visualization**: Offers clear, intuitive visual representations of datasets and related artifacts.
- **Spatial Mode with Deep Zoom**: Enables seamless zooming in and out of high-resolution images & spatial data (e.g., Slide-seq V2, Visium) to examine fine details.
- **Gating/Selection**: Allows users to sub-select data and integrate multiple selections.
- **Dynamic**: Users can create their own gene sets to investigate.
- **Analytics**: Provides on-demand, interactive analytical tools such as differential expression analysis (gene/var t-tests).

## Getting started

### The comprehensive guide to CZ CELLxGENE
Expand Down Expand Up @@ -37,10 +46,17 @@ For any errors, [report bugs on Github](https://github.com/chanzuckerberg/single

### Contributing

Please see our [contributing guide](https://github.com/chanzuckerberg/cellxgene-documentation/blob/main/contribute.md) and don't hesitate to open an issue or send a pull request to improve CZ CELLxGENE Explorer. Please see the [dev_docs](https://github.com/chanzuckerberg/single-cell-explorer/blob/main/dev_docs) for pull request suggestions, unit test details, local documentation preview, and other development specifics.
Please see our [contributing guide](https://github.com/chanzuckerberg/cellxgene-documentation/blob/main/contribute.md) and don't hesitate to open an issue or send a pull request to improve CZ CELLxGENE Explorer.

This project adheres to the Contributor Covenant [code of conduct](https://github.com/chanzuckerberg/.github/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

#### Start Here
- [Set Up Local Dev Environment](https://github.com/chanzuckerberg/single-cell-explorer/blob/main/dev_docs/developer_guidelines.md)
- [Design Principles](https://github.com/chanzuckerberg/single-cell-explorer/blob/main/dev_docs/design_principles.md)
- [How to write Tests](https://github.com/chanzuckerberg/single-cell-explorer/blob/main/dev_docs/e2e_tests.md)
- [Pull Request Suggestions](https://github.com/chanzuckerberg/single-cell-explorer/blob/main/dev_docs/pull_request_guidelines.md)
- ...and [more](https://github.com/chanzuckerberg/single-cell-explorer/blob/main/dev_docs)

### Reuse

This project was started with the sole goal of empowering the scientific community to explore and understand their data.
Expand Down
32 changes: 32 additions & 0 deletions dev_docs/deep_zoom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Spatial Mode Deep Zoom Feature

The Deep Zoom feature in CELLxGENE Explorer enhances the spatial exploration of datasets by allowing users to zoom in and out of high-resolution images smoothly. This functionality is critical for detailed examination of spatial data, such as those from Visium, providing fine-grained insight into tissue samples and cellular interactions.

It is built on the OpenSeadragon (OSD) JavaScript library, integrated into the Explorer’s frontend to deliver a responsive zooming experience. The backend handles the generation and storage of deep zoom image tiles, making it efficient to load and view high-resolution spatial data across environments (dev, staging, prod).

## Frontend Integration (Explorer FE)

- [OpenSeadragon (OSD)](https://openseadragon.github.io/): The OSD library is imported into the frontend to handle interactive zoom and pan operations. OSD dynamically loads image tiles based on the user’s zoom level and position.
- Zoom & Pan Synchronization: Zooming and panning are kept in sync with spatial layers (e.g., dot layers) in the Explorer to ensure smooth interaction across different dataset views.
- Dynamic Resource Loading: URLs for the image tiles are generated based on the current environment (dev, staging, prod), ensuring the correct assets are fetched dynamically.

## Backend Image Processing & Storage

- CXG Conversion Script: The backend uses a CXG conversion pipeline to process high-resolution spatial images and generate the necessary image tiles and manifest files (DZI format) for deep zoom.
- Metadata API: Sends some metadata like image_width, image_height, resolution, scaleref etc. used in dot size calculation & normalizes spatial embedding so it aligns with the image underlay.
- Storage on S3: The generated deep zoom assets (tiles and DZI files) are uploaded to a dedicated Amazon S3 bucket (spatial-deep-zoom). Each dataset has its own folder in the bucket (e.g., spatial-deep-zoom/{DATASET_VERSION_ID}). Note: The DATASET_VERSION_ID includes a dataset's revisions while a DATASET_ID does not.

## Content Delivery

- AWS CloudFront: CloudFront is used to cache and deliver deep zoom assets, improving performance by serving assets from the nearest available server to the user. This minimizes latency, ensuring a smooth experience during zooming and panning.

## Validation & Testing

- Frontend Tests: Screenshot testing ensures correct tile rendering across different zoom levels. E2E testing verifies that image export, toggle, and panning features work seamlessly.
- Backend Tests: Ensure that the CXG conversion process correctly generates deep zoom tiles, uploads them to S3, and that CloudFront caches the assets properly.

### Resources and Links

[Spatial Mode Deep Zooming Tech Spec Design Doc](https://docs.google.com/document/d/1Jp5ePtAk6uXYZjY8XVkdfr0jf1IG0MJj8H_clPuRdFY)

[CELLxGENE Platform Technical Overview](https://docs.google.com/document/d/19IZbojtc7eofV75NnL5C6fCgBJB13KIswWNOn12xAa0)

0 comments on commit 7218253

Please sign in to comment.