|
37 | 37 | from aind_data_schema.components.surgery_procedures import Anaesthetic |
38 | 38 | from aind_data_schema.utils.merge import merge_notes, merge_optional_list, remove_duplicates |
39 | 39 | from aind_data_schema.utils.validators import subject_specimen_id_compatibility |
| 40 | +from aind_data_schema.components.subject_procedures import Injection, BrainInjection |
40 | 41 |
|
41 | 42 | # Define the requirements for each modality |
42 | 43 | # Define the mapping of modalities to their required device types |
@@ -68,7 +69,10 @@ class AcquisitionSubjectDetails(DataModel): |
68 | 69 | description="Animal weight after procedure", |
69 | 70 | ) |
70 | 71 | weight_unit: MassUnit = Field(default=MassUnit.G, title="Weight unit") |
71 | | - anaesthesia: Optional[Anaesthetic] = Field(default=None, title="Anaesthesia") |
| 72 | + anaesthesia: Optional[Anaesthetic] = Field(default=None, title="Anaesthesia", description=( |
| 73 | + "Anaesthesia present during entire acquisition, use Manipulation for partial anaesthesia" |
| 74 | + ) |
| 75 | + ) |
72 | 76 | mouse_platform_name: str = Field(..., title="Mouse platform") |
73 | 77 | reward_consumed_total: Optional[Decimal] = Field(default=None, title="Total reward consumed (mL)") |
74 | 78 | reward_consumed_unit: Optional[VolumeUnit] = Field(default=None, title="Reward consumed unit") |
@@ -237,6 +241,22 @@ class StimulusEpoch(DataModel): |
237 | 241 | ) |
238 | 242 |
|
239 | 243 |
|
| 244 | +class Manipulation(DataModel): |
| 245 | + """Description of procedures performed during an acquisition.""" |
| 246 | + |
| 247 | + start_time: Annotated[AwareDatetimeWithDefault, TimeValidation.BETWEEN] = Field( |
| 248 | + ..., title="Manipulation start time", description="Must be between the acquisition start and end times" |
| 249 | + ) |
| 250 | + end_time: Annotated[AwareDatetimeWithDefault, TimeValidation.BETWEEN] = Field( |
| 251 | + ..., title="Manipulation end time", description="Must be between the acquisition start and end times" |
| 252 | + ) |
| 253 | + procedures: Optional[DiscriminatedList[Injection | BrainInjection]] = Field( |
| 254 | + default=None, title="Procedures", description="Procedures performed during the manipulation" |
| 255 | + ) |
| 256 | + anaesthesia: Optional[Anaesthetic] = Field(default=None, title="Anaesthesia") |
| 257 | + notes: Optional[str] = Field(default=None, title="Notes") |
| 258 | + |
| 259 | + |
240 | 260 | class Acquisition(DataCoreModel): |
241 | 261 | """Description of data acquisition metadata including streams, stimuli, and experimental setup. |
242 | 262 |
|
@@ -312,6 +332,9 @@ class Acquisition(DataCoreModel): |
312 | 332 | " Epochs should be split when the purpose of the stimulus changes." |
313 | 333 | ), |
314 | 334 | ) |
| 335 | + manipulations: List[Manipulation] = Field( |
| 336 | + default=[], title="Manipulations", description="Procedures performed during the acquisition." |
| 337 | + ) |
315 | 338 | subject_details: Optional[AcquisitionSubjectDetails] = Field(default=None, title="Subject details") |
316 | 339 |
|
317 | 340 | @model_validator(mode="after") |
|
0 commit comments