Skip to content
Closed
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
14 changes: 11 additions & 3 deletions docs/source/biodata_models/external.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@ External registries act as an application programming interfaces (API). They all

## Model definitions

### MouseAnatomyModel
### AnatomyModel

Shared Pydantic model for species-specific anatomy terms. Fields typed as `AnatomyModel` can use a lookup subclass such as `MouseAnatomyLookup` or `HumanAnatomyLookup`, which provides ontology-specific lookup behavior.

| Name | Registry | Registry Identifier |
|------|-------|--------|
| `heart` | `Registry.EMAPA` | `EMAPA:16105` |

### MouseAnatomyLookup

[EMAPA](https://www.ebi.ac.uk/ols4/ontologies/emapa)

Base model for mouse anatomy. Some examples:
Lookup model for mouse anatomy terms. Use `search_by_name` to find terms and `get_by_name` for an exact label match.

| Name | Registry | Registry Identifier |
|------|-------|--------|
| `heart` | `Registry.EMAPA` | `16105` |
| `heart` | `Registry.EMAPA` | `EMAPA:16105` |

### Gene

Expand Down
59 changes: 0 additions & 59 deletions docs/source/biodata_models/process_names.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/components/configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Configuration of a catheter

| Field | Type | Title (Description) |
|-------|------|-------------|
| `targeted_structure` | [MouseAnatomyModel](../biodata_models/external.md#mouseanatomymodel) | Targeted blood vessel (Use options from MouseBloodVessels) |
| `targeted_structure` | [AnatomyModel](../biodata_models/external.md#anatomymodel) | Targeted blood vessel (For common mouse blood-vessel targets, use MouseBloodVessels with MouseAnatomyLookup.get_by_name.) |
| `device_name` | `str` | Device name (Must match a device defined in the instrument.json) |


Expand Down
4 changes: 2 additions & 2 deletions docs/source/components/coordinates.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Definition an atlas
| `size_unit` | [SizeUnit](../biodata_models/units.md#sizeunit) | Size unit |
| `resolution` | `List[float]` | Resolution |
| `resolution_unit` | [SizeUnit](../biodata_models/units.md#sizeunit) | Resolution unit |
| `origin` | [MouseAnatomyModel](../biodata_models/external.md#mouseanatomymodel) | Origin (Defines the position of (0,0,0) in the coordinate system) |
| `origin` | ONE OF: [Origin](../biodata_models/coordinates.md#origin), [AnatomyModel](../biodata_models/external.md#anatomymodel) | Origin (Defines the position of (0,0,0) in the coordinate system) |
| `axes` | List[[Axis](#axis)] | Axis names (Axis names and directions) |
| `axis_unit` | [SizeUnit](../biodata_models/units.md#sizeunit) | Size unit |
| `handedness` | Optional[[Handedness](#handedness)] | Handedness (Whether the coordinate system is right-handed or left-handed) |
Expand Down Expand Up @@ -57,7 +57,7 @@ Definition of a coordinate system
| Field | Type | Title (Description) |
|-------|------|-------------|
| `name` | `str` | Name (Convention is to use <Origin>_<POS_X_DIR><POS_Y_DIR><POS_Z_DIR> etc) |
| `origin` | [MouseAnatomyModel](../biodata_models/external.md#mouseanatomymodel) | Origin (Defines the position of (0,0,0) in the coordinate system) |
| `origin` | ONE OF: [Origin](../biodata_models/coordinates.md#origin), [AnatomyModel](../biodata_models/external.md#anatomymodel) | Origin (Defines the position of (0,0,0) in the coordinate system) |
| `axes` | List[[Axis](#axis)] | Axis names (Axis names and directions) |
| `axis_unit` | [SizeUnit](../biodata_models/units.md#sizeunit) | Size unit |
| `handedness` | Optional[[Handedness](#handedness)] | Handedness (Whether the coordinate system is right-handed or left-handed) |
Expand Down
6 changes: 3 additions & 3 deletions docs/source/components/devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,9 @@ Description of a contact on a myomatrix thread

| Field | Type | Title (Description) |
|-------|------|-------------|
| `body_part` | [MouseAnatomyModel](../biodata_models/external.md#mouseanatomymodel) | Body part of contact insertion (Use MouseBodyParts) |
| `body_part` | [AnatomyModel](../biodata_models/external.md#anatomymodel) | Body part of contact insertion (For common mouse body parts, use MouseBodyParts with MouseAnatomyLookup.get_by_name.) |
| `relative_position` | [AnatomicalRelative](../biodata_models/coordinates.md#anatomicalrelative) | Relative position (Position relative to procedures coordinate system) |
| `muscle` | [MouseAnatomyModel](../biodata_models/external.md#mouseanatomymodel) | Muscle of contact insertion (Use MouseEmgMuscles) |
| `muscle` | [AnatomyModel](../biodata_models/external.md#anatomymodel) | Muscle of contact insertion (For common mouse EMG muscles, use MouseEmgMuscles with MouseAnatomyLookup.get_by_name.) |
| `in_muscle` | `bool` | In muscle |


Expand All @@ -688,7 +688,7 @@ Description of a thread of a myomatrix array

| Field | Type | Title (Description) |
|-------|------|-------------|
| `ground_electrode_location` | [MouseAnatomyModel](../biodata_models/external.md#mouseanatomymodel) | Location of ground electrode (Use GroundWireLocations) |
| `ground_electrode_location` | [AnatomyModel](../biodata_models/external.md#anatomymodel) | Location of ground electrode (For common mouse ground-wire locations, use MouseGroundWireLocations with MouseAnatomyLookup.get_by_name.) |
| `contacts` | List[[MyomatrixContact](#myomatrixcontact)] | Contacts |


Expand Down
7 changes: 5 additions & 2 deletions docs/source/components/injection_procedures.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

### Injection

Description of an injection procedure
Description of an injection procedure.

For common mouse injection targets, use MouseInjectionTargets with
MouseAnatomyLookup.get_by_name(...).

| Field | Type | Title (Description) |
|-------|------|-------------|
| `injection_materials` | List[[ViralMaterial](#viralmaterial) or [NonViralMaterial](#nonviralmaterial)] | Injection material |
| `targeted_structure` | Optional[[MouseAnatomyModel](../biodata_models/external.md#mouseanatomymodel)] | Injection target (Use InjectionTargets) |
| `targeted_structure` | Optional[[AnatomyModel](../biodata_models/external.md#anatomymodel)] | Injection target (Species-specific anatomy term; use the appropriate lookup (e.g., MouseAnatomyLookup or HumanAnatomyLookup).) |
| `relative_position` | Optional[List[[AnatomicalRelative](../biodata_models/coordinates.md#anatomicalrelative)]] | Relative position |
| `dynamics` | List[[InjectionDynamics](#injectiondynamics)] | Injection dynamics (List of injection events, one per location/depth) |
| `protocol_id` | `Optional[str]` | Protocol ID (DOI for protocols.io) |
Expand Down
2 changes: 1 addition & 1 deletion docs/source/components/surgery_procedures.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Ground wire implant procedure

| Field | Type | Title (Description) |
|-------|------|-------------|
| `ground_electrode_location` | [MouseAnatomyModel](../biodata_models/external.md#mouseanatomymodel) | Location of ground electrode |
| `ground_electrode_location` | [AnatomyModel](../biodata_models/external.md#anatomymodel) | Location of ground electrode (For common mouse ground-wire locations, use MouseGroundWireLocations with MouseAnatomyLookup.get_by_name.) |
| `ground_wire_hole` | `Optional[int]` | Ground wire hole (For SHIELD implants, the hole number for the ground wire) |
| `ground_wire_material` | Optional[[GroundWireMaterial](#groundwirematerial)] | Ground wire material |
| `ground_wire_diameter` | `Optional[float]` | Ground wire diameter |
Expand Down
4 changes: 2 additions & 2 deletions docs/source/inheritance.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For assets created during analysis that aggregate across multiple acquisitions o
from datetime import datetime, timezone

from biodata_schema.core.metadata import Metadata
from biodata_schema.core.processing import DataProcess, Processing, ProcessName, ProcessStage
from biodata_schema.core.processing import DataProcess, Processing, ProcessStage
from biodata_schema.core.quality_control import QCMetric, QCStatus, QualityControl, Stage, Status
from biodata_schema.components.identifiers import Code
from biodata_models.modalities import Modality
Expand All @@ -45,7 +45,7 @@ source = Metadata.model_validate_json(open("metadata.nd.json").read())
new_processing = Processing.create_with_sequential_process_graph(
data_processes=[
DataProcess(
process_type=ProcessName.IMAGE_TILE_FUSING,
process_type="Image tile fusing",
name="Tile fusing",
experimenters=["Dr. Dan"],
stage=ProcessStage.PROCESSING,
Expand Down
4 changes: 2 additions & 2 deletions docs/source/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Description of model evaluation

| Field | Type | Title (Description) |
|-------|------|-------------|
| `process_type` | [ProcessName](biodata_models/process_names.md#processname) | |
| `process_type` | `str` | |
| `performance` | List[[PerformanceMetric](model.md#performancemetric)] | Evaluation performance |
| `name` | `str` | Name (Unique name of the processing step. If not provided, the type will be used as the name.) |
| `stage` | [ProcessStage](processing.md#processstage) | Processing stage |
Expand Down Expand Up @@ -65,7 +65,7 @@ Description of model training

| Field | Type | Title (Description) |
|-------|------|-------------|
| `process_type` | [ProcessName](biodata_models/process_names.md#processname) | |
| `process_type` | `str` | |
| `train_performance` | List[[PerformanceMetric](model.md#performancemetric)] | Training performance (Performance on training set) |
| `test_performance` | Optional[List[[PerformanceMetric](model.md#performancemetric)]] | Test performance (Performance on test data, evaluated during training) |
| `test_evaluation_method` | `Optional[str]` | Test evaluation method (Approach to cross-validation or Train/test splitting) |
Expand Down
2 changes: 1 addition & 1 deletion docs/source/processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Description of a single processing step

| Field | Type | Title (Description) |
|-------|------|-------------|
| `process_type` | [ProcessName](biodata_models/process_names.md#processname) | Process type |
| `process_type` | `str` | Process type |
| `name` | `str` | Name (Unique name of the processing step. If not provided, the type will be used as the name.) |
| `stage` | [ProcessStage](processing.md#processstage) | Processing stage |
| `code` | [Code](components/identifiers.md#code) | Code (Code used for processing) |
Expand Down
1 change: 0 additions & 1 deletion docs/source/registries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Registries are models that are linked to an external definition, like the NCBI s
biodata_models/modalities
biodata_models/organizations
biodata_models/pid_names
biodata_models/process_names
biodata_models/reagent
biodata_models/registries
biodata_models/species
Expand Down
11 changes: 5 additions & 6 deletions examples/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from biodata_schema.core.processing import (
DataProcess,
Processing,
ProcessName,
ProcessStage,
ResourceTimestamped,
ResourceUsage,
Expand Down Expand Up @@ -62,7 +61,7 @@
],
data_processes=[
DataProcess(
process_type=ProcessName.IMAGE_TILE_FUSING,
process_type="Image tile fusing",
experimenters=["Dr. Dan"],
stage=ProcessStage.PROCESSING,
start_date_time=t,
Expand Down Expand Up @@ -90,7 +89,7 @@
),
),
DataProcess(
process_type=ProcessName.FILE_FORMAT_CONVERSION,
process_type="File format conversion",
pipeline_name="Imaging processing pipeline",
experimenters=["Dr. Dan"],
stage=ProcessStage.PROCESSING,
Expand All @@ -104,7 +103,7 @@
),
),
DataProcess(
process_type=ProcessName.IMAGE_DESTRIPING,
process_type="Image destriping",
pipeline_name="Imaging processing pipeline",
experimenters=["Dr. Dan"],
stage=ProcessStage.PROCESSING,
Expand All @@ -121,7 +120,7 @@
name="Analysis 1",
stage=ProcessStage.ANALYSIS,
experimenters=["Some Analyzer"],
process_type=ProcessName.ANALYSIS,
process_type="Analysis",
start_date_time=t,
end_date_time=t,
output_path="path/to/outputs",
Expand All @@ -135,7 +134,7 @@
name="Analysis 2",
stage=ProcessStage.ANALYSIS,
experimenters=["Some Analyzer"],
process_type=ProcessName.ANALYSIS,
process_type="Analysis",
start_date_time=t,
end_date_time=t,
output_path="path/to/outputs",
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "README.md"
dynamic = ["version"]

dependencies = [
'biodata-models>=1.0.1,<2',
'biodata-models>=2.0.2,<3',
'pydantic>=2.7, <3',
'pydantic-extra-types',
'tzdata',
Expand All @@ -30,7 +30,7 @@ dev = [
'pytest>=8.3',
'pytest-cov>=6',
'ruff>=0.11',
'semver',
'semver>=3.0.0',
]

docs = [
Expand Down Expand Up @@ -70,7 +70,6 @@ ignore-words-list = 'nd,DeviceC'
testpaths = ["tests"]
strict_config = true
strict_markers = true
markers = ["online: tests requiring external services"]

[tool.ruff]
line-length = 120
Expand Down
68 changes: 8 additions & 60 deletions schemas/metadata_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9102,8 +9102,8 @@
"type": "string"
},
"process_type": {
"$ref": "#/$defs/ProcessName",
"title": "Process type"
"title": "Process type",
"type": "string"
},
"name": {
"default": "",
Expand Down Expand Up @@ -26888,8 +26888,9 @@
"type": "string"
},
"process_type": {
"$ref": "#/$defs/ProcessName",
"default": "Model evaluation"
"default": "Model evaluation",
"title": "Process Type",
"type": "string"
},
"name": {
"default": "",
Expand Down Expand Up @@ -27047,8 +27048,9 @@
"type": "string"
},
"process_type": {
"$ref": "#/$defs/ProcessName",
"default": "Model training"
"default": "Model training",
"title": "Process Type",
"type": "string"
},
"name": {
"default": "",
Expand Down Expand Up @@ -37433,60 +37435,6 @@
"title": "Procedures",
"type": "object"
},
"ProcessName": {
"description": "Process names",
"enum": [
"Analysis",
"Compression",
"Denoising",
"Ephys curation",
"Ephys postprocessing",
"Ephys preprocessing",
"Ephys visualization",
"Fiducial segmentation",
"File format conversion",
"Fix color range",
"Fluorescence event detection",
"Image atlas alignment",
"Image background subtraction",
"Image cell classification",
"Image cell quantification",
"Image cell segmentation",
"Image cross-image alignment",
"Image destriping",
"Image flat-field correction",
"Image importing",
"Image mip visualization",
"Image multiscaling",
"Image radial correction",
"Image spot detection",
"Image spot spectral unmixing",
"Image thresholding",
"Image tile alignment",
"Image tile fusing",
"Image tile projection",
"Manual curation",
"Model evaluation",
"Model training",
"Neuron skeleton processing",
"Neuropil subtraction",
"Other",
"Pipeline",
"Simulation",
"Skull stripping",
"Spatial timeseries demixing",
"Spike sorting",
"Video ROI classification",
"Video ROI cross session matching",
"Video ROI segmentation",
"Video ROI timeseries extraction",
"Video motion correction",
"Video plane decrosstalk",
"dF/F estimation"
],
"title": "ProcessName",
"type": "string"
},
"ProcessStage": {
"description": "Stages of processing",
"enum": [
Expand Down
Loading
Loading