diff --git a/docs/source/components/reagent.md b/docs/source/components/reagent.md index 72f92ff56..f6f8a5846 100644 --- a/docs/source/components/reagent.md +++ b/docs/source/components/reagent.md @@ -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) | |-------|------|-------------| diff --git a/docs/source/components/specimen_procedures.md b/docs/source/components/specimen_procedures.md index 61a23e7e1..3304932cb 100644 --- a/docs/source/components/specimen_procedures.md +++ b/docs/source/components/specimen_procedures.md @@ -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) | diff --git a/src/aind_data_schema/components/reagent.py b/src/aind_data_schema/components/reagent.py index cdd8f5603..34e04ecaa 100644 --- a/src/aind_data_schema/components/reagent.py +++ b/src/aind_data_schema/components/reagent.py @@ -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") diff --git a/src/aind_data_schema/components/specimen_procedures.py b/src/aind_data_schema/components/specimen_procedures.py index 6510b8e8b..7024d5f4b 100644 --- a/src/aind_data_schema/components/specimen_procedures.py +++ b/src/aind_data_schema/components/specimen_procedures.py @@ -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 @@ -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", @@ -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)) @@ -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: