Skip to content
Merged
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
20 changes: 19 additions & 1 deletion docs/source/components/reagent.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,27 @@

## Model definitions

### FluorescentReagent

Description of an inherently fluorescent marker. Note this class will change name in v3.0

| Field | Type | Title (Description) |
|-------|------|-------------|
| `stain_type` | [StainType](../aind_data_schema_models/reagent.md#staintype) | |
| `excitation_wavelength` | `int` | Excitation wavelength (nm) |
| `emission_wavelength` | `int` | Emission wavelength (nm) |
| `wavelength_unit` | [SizeUnit](../aind_data_schema_models/units.md#sizeunit) | Excitation wavelength unit |
| `name` | `str` | Name |
| `source` | [Organization](../aind_data_schema_models/organizations.md#organization) | Source |
| `rrid` | Optional[[PIDName](../aind_data_schema_models/pid_names.md#pidname)] | Research Resource ID |
| `lot_number` | `Optional[str]` | Lot number |
| `expiration_date` | `Optional[datetime.date]` | Lot expiration date |


### FluorescentStain

Description of a fluorescent stain
Description of a fluorescent stain consisting of a probe associated with a fluorophore.
Note this class will change names in v3.0

| Field | Type | Title (Description) |
|-------|------|-------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/source/components/specimen_procedures.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Description of surgical or other procedure performed on a specimen
| `end_date` | `datetime.date` | End date |
| `experimenters` | `List[str]` | experimenter(s) |
| `protocol_parameters` | `Optional[Dict[str, str]]` | Protocol parameters (Parameters defined in the protocol and their value during this procedure) |
| `procedure_details` | List[[HCRSeries](#hcrseries) or [FluorescentStain](reagent.md#fluorescentstain) or [Sectioning](#sectioning) or [PlanarSectioning](#planarsectioning) or [ProbeReagent](reagent.md#probereagent) or [Reagent](reagent.md#reagent) or [GeneProbeSet](reagent.md#geneprobeset) or [Solution](reagent.md#solution)] | Procedure details (Details of the procedures, including reagents and sectioning information.) |
| `procedure_details` | List[[HCRSeries](#hcrseries) or [FluorescentReagent](reagent.md#fluorescentreagent) or [FluorescentStain](reagent.md#fluorescentstain) or [Sectioning](#sectioning) or [PlanarSectioning](#planarsectioning) or [ProbeReagent](reagent.md#probereagent) or [Reagent](reagent.md#reagent) or [GeneProbeSet](reagent.md#geneprobeset) or [Solution](reagent.md#solution)] | Procedure details (Details of the procedures, including reagents and sectioning information.) |
| `notes` | `Optional[str]` | Notes |
| `protocol_id` | `Optional[List[str]]` | Protocol ID (DOI for protocols.io) |

Expand Down
12 changes: 11 additions & 1 deletion src/aind_data_schema/components/reagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,19 @@ class ProbeReagent(Reagent):


class FluorescentStain(Reagent):
"""Description of a fluorescent stain"""
"""Description of a fluorescent stain consisting of a probe associated with a fluorophore.
Note this class will change names in v3.0"""

probe: Discriminated[GeneProbe | ProteinProbe | SmallMoleculeProbe] = Field(..., title="Target of the stain")
stain_type: StainType = Field(..., title="Stain type")
fluorophore: Fluorophore = Field(..., title="Fluorophore used in the stain")
initiator_name: Optional[str] = Field(default=None, title="Initiator for HCR probes")


class FluorescentReagent(Reagent):
"""Description of an inherently fluorescent marker. Note this class will change name in v3.0"""

stain_type: StainType = Field(..., type="Stain type")
excitation_wavelength: int = Field(..., title="Excitation wavelength (nm)")
emission_wavelength: int = Field(..., title="Emission wavelength (nm)")
wavelength_unit: SizeUnit = Field(default=SizeUnit.NM, title="Excitation wavelength unit")
22 changes: 19 additions & 3 deletions src/aind_data_schema/components/specimen_procedures.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
from aind_data_schema.base import AwareDatetimeWithDefault, DataModel, DiscriminatedList
from aind_data_schema.components.coordinates import Atlas, CoordinateSystem, Translation
from aind_data_schema.components.identifiers import ProtocolListMixin
from aind_data_schema.components.reagent import FluorescentStain, GeneProbeSet, ProbeReagent, Reagent, Solution
from aind_data_schema.components.reagent import (
FluorescentReagent,
FluorescentStain,
GeneProbeSet,
ProbeReagent,
Reagent,
Solution,
)
from aind_data_schema.utils.exceptions import OneOfError


Expand Down Expand Up @@ -178,7 +185,15 @@ class SpecimenProcedure(ProtocolListMixin, DataModel):
)

procedure_details: DiscriminatedList[
HCRSeries | FluorescentStain | Sectioning | PlanarSectioning | ProbeReagent | Reagent | GeneProbeSet | Solution
HCRSeries
| FluorescentReagent
| FluorescentStain
| Sectioning
| PlanarSectioning
| ProbeReagent
| Reagent
| GeneProbeSet
| Solution
] = Field(
default=[],
title="Procedure details",
Expand All @@ -193,6 +208,7 @@ def validate_procedure_type(self):

has_hcr_series = any(isinstance(detail, HCRSeries) for detail in self.procedure_details)
has_fluorescent_stain = any(isinstance(detail, FluorescentStain) for detail in self.procedure_details)
has_fluorescent_reagent = any(isinstance(detail, FluorescentReagent) for detail in self.procedure_details)
has_protein_probe = any(isinstance(detail, ProbeReagent) for detail in self.procedure_details)
has_sectioning = any(
(isinstance(detail, PlanarSectioning) or isinstance(detail, Sectioning))
Expand All @@ -210,7 +226,7 @@ def validate_procedure_type(self):
elif self.procedure_type == SpecimenProcedureType.HYBRIDIZATION_CHAIN_REACTION and not has_hcr_series:
raise AssertionError("HCRSeries required if procedure_type is HCR.")
elif self.procedure_type == SpecimenProcedureType.IMMUNOLABELING and not (
has_fluorescent_stain or has_protein_probe
has_fluorescent_stain or has_protein_probe or has_fluorescent_reagent
):
raise AssertionError("FluorescentStain or ProbeReagent required if procedure_type is Immunolabeling.")
elif self.procedure_type == SpecimenProcedureType.SECTIONING and not has_sectioning:
Expand Down
Loading