Skip to content

Commit 0f9169c

Browse files
add FluorescentReagent (#1860)
* add FluorescentReagent * update docs * whitespace * update docs * specimen procedures * update docs * lint --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent d1682b6 commit 0f9169c

4 files changed

Lines changed: 50 additions & 6 deletions

File tree

docs/source/components/reagent.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,27 @@
22

33
## Model definitions
44

5+
### FluorescentReagent
6+
7+
Description of an inherently fluorescent marker. Note this class will change name in v3.0
8+
9+
| Field | Type | Title (Description) |
10+
|-------|------|-------------|
11+
| `stain_type` | [StainType](../aind_data_schema_models/reagent.md#staintype) | |
12+
| `excitation_wavelength` | `int` | Excitation wavelength (nm) |
13+
| `emission_wavelength` | `int` | Emission wavelength (nm) |
14+
| `wavelength_unit` | [SizeUnit](../aind_data_schema_models/units.md#sizeunit) | Excitation wavelength unit |
15+
| `name` | `str` | Name |
16+
| `source` | [Organization](../aind_data_schema_models/organizations.md#organization) | Source |
17+
| `rrid` | Optional[[PIDName](../aind_data_schema_models/pid_names.md#pidname)] | Research Resource ID |
18+
| `lot_number` | `Optional[str]` | Lot number |
19+
| `expiration_date` | `Optional[datetime.date]` | Lot expiration date |
20+
21+
522
### FluorescentStain
623

7-
Description of a fluorescent stain
24+
Description of a fluorescent stain consisting of a probe associated with a fluorophore.
25+
Note this class will change names in v3.0
826

927
| Field | Type | Title (Description) |
1028
|-------|------|-------------|

docs/source/components/specimen_procedures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Description of surgical or other procedure performed on a specimen
107107
| `end_date` | `datetime.date` | End date |
108108
| `experimenters` | `List[str]` | experimenter(s) |
109109
| `protocol_parameters` | `Optional[Dict[str, str]]` | Protocol parameters (Parameters defined in the protocol and their value during this procedure) |
110-
| `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.) |
110+
| `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.) |
111111
| `notes` | `Optional[str]` | Notes |
112112
| `protocol_id` | `Optional[List[str]]` | Protocol ID (DOI for protocols.io) |
113113

src/aind_data_schema/components/reagent.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,19 @@ class ProbeReagent(Reagent):
8383

8484

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

8889
probe: Discriminated[GeneProbe | ProteinProbe | SmallMoleculeProbe] = Field(..., title="Target of the stain")
8990
stain_type: StainType = Field(..., title="Stain type")
9091
fluorophore: Fluorophore = Field(..., title="Fluorophore used in the stain")
9192
initiator_name: Optional[str] = Field(default=None, title="Initiator for HCR probes")
93+
94+
95+
class FluorescentReagent(Reagent):
96+
"""Description of an inherently fluorescent marker. Note this class will change name in v3.0"""
97+
98+
stain_type: StainType = Field(..., type="Stain type")
99+
excitation_wavelength: int = Field(..., title="Excitation wavelength (nm)")
100+
emission_wavelength: int = Field(..., title="Emission wavelength (nm)")
101+
wavelength_unit: SizeUnit = Field(default=SizeUnit.NM, title="Excitation wavelength unit")

src/aind_data_schema/components/specimen_procedures.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414
from aind_data_schema.base import AwareDatetimeWithDefault, DataModel, DiscriminatedList
1515
from aind_data_schema.components.coordinates import Atlas, CoordinateSystem, Translation
1616
from aind_data_schema.components.identifiers import ProtocolListMixin
17-
from aind_data_schema.components.reagent import FluorescentStain, GeneProbeSet, ProbeReagent, Reagent, Solution
17+
from aind_data_schema.components.reagent import (
18+
FluorescentReagent,
19+
FluorescentStain,
20+
GeneProbeSet,
21+
ProbeReagent,
22+
Reagent,
23+
Solution,
24+
)
1825
from aind_data_schema.utils.exceptions import OneOfError
1926

2027

@@ -178,7 +185,15 @@ class SpecimenProcedure(ProtocolListMixin, DataModel):
178185
)
179186

180187
procedure_details: DiscriminatedList[
181-
HCRSeries | FluorescentStain | Sectioning | PlanarSectioning | ProbeReagent | Reagent | GeneProbeSet | Solution
188+
HCRSeries
189+
| FluorescentReagent
190+
| FluorescentStain
191+
| Sectioning
192+
| PlanarSectioning
193+
| ProbeReagent
194+
| Reagent
195+
| GeneProbeSet
196+
| Solution
182197
] = Field(
183198
default=[],
184199
title="Procedure details",
@@ -193,6 +208,7 @@ def validate_procedure_type(self):
193208

194209
has_hcr_series = any(isinstance(detail, HCRSeries) for detail in self.procedure_details)
195210
has_fluorescent_stain = any(isinstance(detail, FluorescentStain) for detail in self.procedure_details)
211+
has_fluorescent_reagent = any(isinstance(detail, FluorescentReagent) for detail in self.procedure_details)
196212
has_protein_probe = any(isinstance(detail, ProbeReagent) for detail in self.procedure_details)
197213
has_sectioning = any(
198214
(isinstance(detail, PlanarSectioning) or isinstance(detail, Sectioning))
@@ -210,7 +226,7 @@ def validate_procedure_type(self):
210226
elif self.procedure_type == SpecimenProcedureType.HYBRIDIZATION_CHAIN_REACTION and not has_hcr_series:
211227
raise AssertionError("HCRSeries required if procedure_type is HCR.")
212228
elif self.procedure_type == SpecimenProcedureType.IMMUNOLABELING and not (
213-
has_fluorescent_stain or has_protein_probe
229+
has_fluorescent_stain or has_protein_probe or has_fluorescent_reagent
214230
):
215231
raise AssertionError("FluorescentStain or ProbeReagent required if procedure_type is Immunolabeling.")
216232
elif self.procedure_type == SpecimenProcedureType.SECTIONING and not has_sectioning:

0 commit comments

Comments
 (0)