Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added EMGInsertion #1030

Merged
merged 6 commits into from
Aug 23, 2024
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
14 changes: 14 additions & 0 deletions src/aind_data_schema/components/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ class LickSensorType(str, Enum):
PIEZOELECTIC = "Piezoelectric"


class MyomatrixArrayType(str, Enum):
"""Type of Myomatrix array"""

INJECTED = "Injected"
SUTURED = "Sutured"


class Device(AindModel):
"""Generic device"""

Expand Down Expand Up @@ -921,4 +928,11 @@ class Scanner(Device):
magnetic_strength_unit: str = Field(default="T", title="Magnetic strength unit")


class MyomatrixArray(Device):
"""Description of a Myomatrix array"""

device_type: Literal["Myomatrix Array"] = "Myomatrix Array"
array_type: MyomatrixArrayType = Field(..., title="Array type")


LIGHT_SOURCES = Annotated[Union[Laser, LightEmittingDiode, Lamp], Field(discriminator="device_type")]
31 changes: 30 additions & 1 deletion src/aind_data_schema/core/procedures.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from enum import Enum
from typing import List, Literal, Optional, Set, Union

from aind_data_schema_models.mouse_anatomy import MouseAnatomicalStructure
from aind_data_schema_models.pid_names import PIDName
from aind_data_schema_models.species import Species
from aind_data_schema_models.specimen_procedure_types import SpecimenProcedureType
Expand All @@ -24,7 +25,7 @@
from typing_extensions import Annotated

from aind_data_schema.base import AindCoreModel, AindModel, AwareDatetimeWithDefault
from aind_data_schema.components.devices import FiberProbe
from aind_data_schema.components.devices import FiberProbe, MyomatrixArray
from aind_data_schema.components.reagent import Reagent


Expand Down Expand Up @@ -555,6 +556,33 @@ class WaterRestriction(AindModel):
end_date: Optional[date] = Field(default=None, title="Water restriction end date")


class MyomatrixContact(AindModel):
""" "Description of a contact on a myomatrix thread"""

body_part: MouseAnatomicalStructure.BODY_PARTS = Field(..., title="Body part of contact insertion")
muscle: MouseAnatomicalStructure.EMG_MUSCLES = Field(..., title="Muscle of contact insertion")
in_muscle: bool = Field(..., title="In muscle")
notes: Optional[str] = Field(default=None, title="Notes")


class MyomatrixThread(AindModel):
"""Description of a thread of a myomatrix array"""

ground_electrode_location: MouseAnatomicalStructure.BODY_PARTS = Field(
..., title="Location of ground electrode"
)
contacts: List[MyomatrixContact] = Field(..., title="Contacts")


class MyomatrixInsertion(AindModel):
"""Description of a Myomatrix array insertion for EMG"""

procedure_type: Literal["Myomatrix_Insertion"] = "Myomatrix_Insertion"
protocol_id: str = Field(..., title="Protocol ID", description="DOI for protocols.io")
myomatrix_array: MyomatrixArray = Field(..., title="Myomatrix array")
threads: List[MyomatrixThread] = Field(..., title="Array threads")


class Perfusion(AindModel):
"""Description of a perfusion procedure that creates a specimen"""

Expand Down Expand Up @@ -603,6 +631,7 @@ class Surgery(AindModel):
IntraCisternalMagnaInjection,
IntraperitonealInjection,
IontophoresisInjection,
MyomatrixInsertion,
NanojectInjection,
OtherSubjectProcedure,
Perfusion,
Expand Down
Loading