{"id":22731037,"url":"https://github.com/genentech/spex_spatial_transcriptomics","last_synced_at":"2025-08-25T18:47:39.090Z","repository":{"id":226994899,"uuid":"769326785","full_name":"Genentech/spex_spatial_transcriptomics","owner":"Genentech","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-17T03:16:07.000Z","size":9943,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T04:25:58.179Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Genentech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-08T20:17:04.000Z","updated_at":"2025-03-17T03:16:10.000Z","dependencies_parsed_at":"2024-11-16T05:18:31.412Z","dependency_job_id":"60989720-24a5-44f7-8599-c6b3d75abe15","html_url":"https://github.com/Genentech/spex_spatial_transcriptomics","commit_stats":null,"previous_names":["genentech/spex_spatial_transcriptomics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2Fspex_spatial_transcriptomics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2Fspex_spatial_transcriptomics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2Fspex_spatial_transcriptomics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2Fspex_spatial_transcriptomics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Genentech","download_url":"https://codeload.github.com/Genentech/spex_spatial_transcriptomics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246264473,"owners_count":20749471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T19:19:12.221Z","updated_at":"2025-08-25T18:47:39.045Z","avatar_url":"https://github.com/Genentech.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Documentation: File and Folder Structure\n\nBelow is a description of the general file and folder structure in the project, along with how conda environments can be used, and how each element is typically utilized. **All executable scripts for stages should be named `app.py`** to maintain consistency.\n\n## Project Structure\n\n- **Project root**\n    - `manifest.json` — The main project manifest (if used). It may contain common settings or link individual pipeline stages.\n    - Other files not related to a specific stage.\n\n- **Stage folders** (for example, `load_anndata`, `clustering`, `dimensionality_reduction`)\n    1. **`manifest.json`** (inside the stage folder)\n        - Describes the key parameters required by this stage.\n        - Contains the stage name, its description, execution order (`stage`), types and requirements of input parameters (`params`), and information about returned data (`return`).\n        - May specify dependencies (e.g., `depends_and_script` or `depends_or_script`) and the environments used (`conda`, `libs`, `conda_pip`).\n            - **Conda usage**: If `conda` is specified, the system creates or uses a conda environment with the requested Python version and installs the listed libraries (`libs` via conda, `conda_pip` via pip in that conda environment). This isolation helps avoid library conflicts.\n\n    2. **`app.py`** (the executable script for this stage)\n        - This file name should **always** be `app.py` to maintain a consistent structure.\n        - It contains the core business logic: reading data, transforming it, analyzing it, and producing output.\n        - Typically, it defines a function (often `run(**kwargs)`) that:\n            1. **Imports the necessary dependencies** (e.g., `scanpy`, `scvi`, `numpy`).\n            2. **Reads parameters** from `kwargs`, which are provided from `manifest.json` (e.g., file path, analysis method, metrics).\n            3. **Calls a helper function** or a series of functions that perform the main logic (e.g., data loading, clustering, dimensionality reduction, etc.).\n            4. **Returns the result** in the format described in the manifest (usually a dictionary where the keys match the fields in `return`).\n\n### Example `app.py` Structure\n\n1. **Import libraries**\n   ```python\n   import scanpy as sc\n   import numpy as np\n   import pandas as pd\n   # ...\n   ```\n2. **Define helper functions** (e.g., `reduce_dimensionality`, `cluster`, `load_data`)\n   ```python\n   def reduce_dimensionality(adata, method='pca', ...):\n       # Dimensionality reduction logic\n       return adata\n   ```\n3. **`run(**kwargs)` function**\n   ```python\n   def run(**kwargs):\n       # Read arguments\n       adata = kwargs.get('adata')\n       method = kwargs.get('method', 'pca')\n       # ...\n       # Call a helper function\n       out = reduce_dimensionality(adata, method=method)\n       # Return the result\n       return { 'adata': out }\n   ```\n\n## Main Purpose\n\n1. **`manifest.json`** in each folder:\n    - Defines which parameters the stage requires and what data it returns.\n    - Specifies the execution order in the pipeline.\n    - Allows you to determine which libraries (conda or pip) are needed for the stage.\n    - May include version constraints for packages.\n    - **Conda Environments**: If `conda` is specified, the system will create/use the indicated environment (for example, `python=3.11`) and install the specified libraries.\n\n2. **`app.py`**:\n    - Performs the main work — processes data using parameters obtained from `manifest.json`.\n    - Produces output that subsequent stages can access.\n    - Has a structure consisting of several steps:\n        - Imports\n        - Helper functions\n        - `run(**kwargs)` function — the entry point.\n\n## Example Project Structure\n\n```text\nproject_root/\n├── manifest.json               # Main (root) manifest, if present\n├── load_anndata/\n│   ├── manifest.json           # Manifest for the loading stage\n│   └── app.py                  # Script performing data loading\n├── clustering/\n│   ├── manifest.json           # Manifest for the clustering stage\n│   └── app.py                  # Script for clustering data\n├── dimensionality_reduction/\n│   ├── manifest.json           # Manifest for the dimensionality reduction stage\n│   └── app.py                  # Script performing the analysis\n└── other_folders_or_files      # Other files/folders in the project\n```\n\n## Usage Recommendations\n- Store a maximum of one stage in **each folder** (with its own `manifest.json` and `app.py`).\n- The **main manifest** can set the overall pipeline logic or serve as the entry point for the entire system.\n- Each `app.py` should be as focused as possible, making the stage easier to test, modify, and reuse.\n- Parameters in `manifest.json` should be described in as much detail as possible so that users understand what is required as input and what will be returned as output.\n- **Conda Environments**: When `conda` is specified, each stage can be isolated in its own environment to avoid library version conflicts across different scripts.\n# Documentation: File and Folder Structure\n\nBelow is a description of the general file and folder structure in the project, along with how conda environments can be used, and how each element is typically utilized. **All executable scripts for stages should be named `app.py`** to maintain consistency.\n\n## Project Structure\n\n- **Project root**\n    - `manifest.json` — The main project manifest (if used). It may contain common settings or link individual pipeline stages.\n    - Other files not related to a specific stage.\n\n- **Stage folders** (for example, `load_anndata`, `clustering`, `dimensionality_reduction`)\n    1. **`manifest.json`** (inside the stage folder)\n        - Describes the key parameters required by this stage.\n        - Contains the stage name, its description, execution order (`stage`), types and requirements of input parameters (`params`), and information about returned data (`return`).\n        - May specify dependencies (e.g., `depends_and_script` or `depends_or_script`) and the environments used (`conda`, `libs`, `conda_pip`).\n            - **Conda usage**: If `conda` is specified, the system creates or uses a conda environment with the requested Python version and installs the listed libraries (`libs` via conda, `conda_pip` via pip in that conda environment). This isolation helps avoid library conflicts.\n\n    2. **`app.py`** (the executable script for this stage)\n        - This file name should **always** be `app.py` to maintain a consistent structure.\n        - It contains the core business logic: reading data, transforming it, analyzing it, and producing output.\n        - Typically, it defines a function (often `run(**kwargs)`) that:\n            1. **Imports the necessary dependencies** (e.g., `scanpy`, `scvi`, `numpy`).\n            2. **Reads parameters** from `kwargs`, which are provided from `manifest.json` (e.g., file path, analysis method, metrics).\n            3. **Calls a helper function** or a series of functions that perform the main logic (e.g., data loading, clustering, dimensionality reduction, etc.).\n            4. **Returns the result** in the format described in the manifest (usually a dictionary where the keys match the fields in `return`).\n\n### Example `app.py` Structure\n\n1. **Import libraries**\n   ```python\n   import scanpy as sc\n   import numpy as np\n   import pandas as pd\n   # ...\n   ```\n2. **Define helper functions** (e.g., `reduce_dimensionality`, `cluster`, `load_data`)\n   ```python\n   def reduce_dimensionality(adata, method='pca', ...):\n       # Dimensionality reduction logic\n       return adata\n   ```\n3. **`run(**kwargs)` function**\n   ```python\n   def run(**kwargs):\n       # Read arguments\n       adata = kwargs.get('adata')\n       method = kwargs.get('method', 'pca')\n       # ...\n       # Call a helper function\n       out = reduce_dimensionality(adata, method=method)\n       # Return the result\n       return { 'adata': out }\n   ```\n\n## Main Purpose\n\n1. **`manifest.json`** in each folder:\n    - Defines which parameters the stage requires and what data it returns.\n    - Specifies the execution order in the pipeline.\n    - Allows you to determine which libraries (conda or pip) are needed for the stage.\n    - May include version constraints for packages.\n    - **Conda Environments**: If `conda` is specified, the system will create/use the indicated environment (for example, `python=3.11`) and install the specified libraries.\n\n2. **`app.py`**:\n    - Performs the main work — processes data using parameters obtained from `manifest.json`.\n    - Produces output that subsequent stages can access.\n    - Has a structure consisting of several steps:\n        - Imports\n        - Helper functions\n        - `run(**kwargs)` function — the entry point.\n\n## Example Project Structure\n\n```text\nproject_root/\n├── manifest.json               # Main (root) manifest, if present\n├── load_anndata/\n│   ├── manifest.json           # Manifest for the loading stage\n│   └── app.py                  # Script performing data loading\n├── clustering/\n│   ├── manifest.json           # Manifest for the clustering stage\n│   └── app.py                  # Script for clustering data\n├── dimensionality_reduction/\n│   ├── manifest.json           # Manifest for the dimensionality reduction stage\n│   └── app.py                  # Script performing the analysis\n└── other_folders_or_files      # Other files/folders in the project\n```\n\n## Usage Recommendations\n- Store a maximum of one stage in **each folder** (with its own `manifest.json` and `app.py`).\n- The **main manifest** can set the overall pipeline logic or serve as the entry point for the entire system.\n- Each `app.py` should be as focused as possible, making the stage easier to test, modify, and reuse.\n- Parameters in `manifest.json` should be described in as much detail as possible so that users understand what is required as input and what will be returned as output.\n- **Conda Environments**: When `conda` is specified, each stage can be isolated in its own environment to avoid library version conflicts across different scripts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenentech%2Fspex_spatial_transcriptomics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenentech%2Fspex_spatial_transcriptomics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenentech%2Fspex_spatial_transcriptomics/lists"}