|
1 | | -```markdown |
2 | 1 | # Xenium Analysis Tools |
3 | 2 |
|
4 | | -A Python library for processing and mapping Xenium spatial data, developed by the Allen Institute for Neural Dynamics. |
| 3 | +A Python library for processing and mapping Xenium sections using SpatialData formatting. |
5 | 4 |
|
6 | 5 | ## Installation |
7 | 6 |
|
8 | | -### Code Ocean Package Manager (Recommended) |
9 | | -This library can be installed directly via the Code Ocean environment manager. |
| 7 | +### Code Ocean Package Manager |
| 8 | +pip: git+[https://github.com/AllenInstitute/xenium_analysis_tools#egg=xenium-analysis-tools] |
10 | 9 |
|
11 | | -1. Open your Capsule. |
12 | | -2. Go to the **Environment** tab. |
13 | | -3. In the **Pip** section, click **Add**. |
14 | | -4. Paste the following link: |
15 | | - ```text |
16 | | - git+[https://github.com/AllenInstitute/xenium_analysis_tools#egg=xenium-analysis-tools](https://github.com/AllenInstitute/xenium_analysis_tools#egg=xenium-analysis-tools) |
17 | | -
|
18 | | -``` |
19 | | - |
20 | | -5. Click **Launch Cloud Workstation** to build. |
21 | | - |
22 | | -### Local Installation |
23 | | - |
24 | | -To install locally or in a standard terminal: |
25 | | - |
26 | | -```bash |
27 | | -pip install git+[https://github.com/AllenInstitute/xenium_analysis_tools.git](https://github.com/AllenInstitute/xenium_analysis_tools.git) |
28 | | - |
29 | | -``` |
30 | 10 |
|
31 | 11 | --- |
32 | 12 |
|
33 | 13 | ## Modules |
34 | 14 |
|
35 | | -The library is organized into three primary sub-packages designed to handle different stages of the Xenium analysis pipeline. |
36 | | - |
37 | 15 | ### 1. `process_xenium` |
38 | 16 |
|
39 | 17 | Tools for processing raw Xenium outputs, managing SpatialData objects, and preparing data for downstream analysis. |
40 | 18 |
|
41 | | -* **`process_dataset_slides`**: Main workflow for processing slides across an entire dataset. |
| 19 | +#### Main processing functions: |
| 20 | +* **`generate_dataset_slides`**: Generate the slide-level SpatialData objects from Xenium bundles for a Xenium dataset. |
| 21 | +* **`process_dataset_slides`**: Generate the section-level SpatialData objects from slides for a Xenium dataset. |
| 22 | +#### Task-specific functions: |
42 | 23 | * **`process_spatialdata`**: Core logic for manipulating and formatting Xenium `SpatialData` objects. |
43 | 24 | * **`divide_sections`**: Utilities for handling section boundaries and splitting data. |
44 | 25 | * **`validate_sections`**: Quality control checks to ensure section integrity before processing. |
45 | | -* **`generate_dataset_slides`**: Helper functions for creating slide-level representations. |
46 | 26 |
|
47 | 27 | ### 2. `map_xenium` |
48 | 28 |
|
49 | 29 | Functions for mapping cell types to Xenium data using reference taxonomies. |
50 | 30 |
|
51 | | -* **`map_sections`**: Logic for mapping cell types on individual tissue sections. |
| 31 | +#### Main processing function: |
52 | 32 | * **`map_dataset_sections`**: Batch processing tools to apply mapping across multiple sections in a dataset. |
| 33 | +* **`map_sections`**: Logic for mapping cell types on individual sections. |
53 | 34 |
|
54 | 35 | ### 3. `utils` |
55 | | - |
56 | 36 | Shared utility functions used across the library. |
57 | | - |
58 | | -* **`io_utils`**: Standardized functions for loading and saving Xenium data structures. |
59 | | - |
60 | | ---- |
61 | | - |
62 | | -## Usage |
63 | | - |
64 | | -Import the specific modules you need for your analysis workflow. |
65 | | - |
66 | | -**Example: Processing a Dataset** |
67 | | - |
68 | | -```python |
69 | | -from xenium_analysis_tools.process_xenium import process_dataset_slides |
70 | | -from xenium_analysis_tools.utils import io_utils |
71 | | - |
72 | | -# Load your configuration or data path |
73 | | -data_path = "/path/to/xenium/data" |
74 | | - |
75 | | -# Run the processing pipeline |
76 | | -process_dataset_slides.run(data_path) |
77 | | - |
78 | | -``` |
79 | | - |
80 | | -**Example: Mapping Sections** |
81 | | - |
82 | | -```python |
83 | | -from xenium_analysis_tools.map_xenium import map_dataset_sections |
84 | | - |
85 | | -# Run cell type mapping on processed sections |
86 | | -map_dataset_sections.run_mapping( |
87 | | - processed_data_path="/path/to/processed/data", |
88 | | - taxonomy_ref="/path/to/taxonomy" |
89 | | -) |
90 | | - |
91 | | -``` |
92 | | - |
93 | | ---- |
94 | | - |
95 | | -## Development |
96 | | - |
97 | | -### Updating the Package |
98 | | - |
99 | | -1. Make changes to the code in the `src/` directory. |
100 | | -2. Bump the version in `src/xenium_analysis_tools/__init__.py`. |
101 | | -3. Commit and push to GitHub. |
102 | | -4. Create and push a new tag matching the version (e.g., `v0.1.1`). |
103 | | - |
104 | | -### Running Tests |
105 | | - |
106 | | -This project uses `pytest`. Run the following in the root directory: |
107 | | - |
108 | | -```bash |
109 | | -pytest tests/ |
110 | | - |
111 | | -``` |
| 37 | +* **`io_utils`**: Standardized functions for loading and saving Xenium data structures. |
0 commit comments