Skip to content

Commit df49561

Browse files
new ion channel modeling entities (#139)
* Ion channel models * Fix tests --------- Co-authored-by: Eleftherios Zisis <eleftherios.zisis@openbraininstitute.org>
1 parent 502acf3 commit df49561

16 files changed

+732
-0
lines changed

src/entitysdk/models/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
from entitysdk.models.etype import ETypeClass
2929
from entitysdk.models.ion_channel import IonChannel
3030
from entitysdk.models.ion_channel_model import IonChannelModel, NeuronBlock, UseIon
31+
from entitysdk.models.ion_channel_modeling_campaign import IonChannelModelingCampaign
32+
from entitysdk.models.ion_channel_modeling_config import IonChannelModelingConfig
33+
from entitysdk.models.ion_channel_modeling_config_generation import (
34+
IonChannelModelingConfigGeneration,
35+
)
36+
from entitysdk.models.ion_channel_modeling_execution import IonChannelModelingExecution
3137
from entitysdk.models.ion_channel_recording import IonChannelRecording
3238
from entitysdk.models.license import License
3339
from entitysdk.models.measurement_annotation import MeasurementAnnotation
@@ -74,6 +80,10 @@
7480
"ETypeClassification",
7581
"IonChannel",
7682
"IonChannelModel",
83+
"IonChannelModelingCampaign",
84+
"IonChannelModelingConfig",
85+
"IonChannelModelingConfigGeneration",
86+
"IonChannelModelingExecution",
7787
"IonChannelRecording",
7888
"License",
7989
"MeasurementAnnotation",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Ion channel modeling campaign model."""
2+
3+
from entitysdk.models.entity import Entity
4+
from entitysdk.models.ion_channel_modeling_config import IonChannelModelingConfig
5+
from entitysdk.models.ion_channel_recording import IonChannelRecording
6+
7+
8+
class IonChannelModelingCampaign(Entity):
9+
"""IonChannelModelingCampaign model."""
10+
11+
scan_parameters: dict
12+
ion_channel_modeling_configs: list[IonChannelModelingConfig] | None = None
13+
input_recordings: list[IonChannelRecording] | None = None
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Ion channel modeling config model."""
2+
3+
from entitysdk.models.entity import Entity
4+
from entitysdk.types import ID
5+
6+
7+
class IonChannelModelingConfig(Entity):
8+
"""IonChannelModelingConfig model."""
9+
10+
ion_channel_modeling_campaign_id: ID
11+
scan_parameters: dict
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Ion channel modeling config generation model."""
2+
3+
from entitysdk.models.activity import Activity
4+
5+
6+
class IonChannelModelingConfigGeneration(Activity):
7+
"""Ion channel modeling config generation activity class."""
8+
9+
pass
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Ion channel modeling execution model."""
2+
3+
from entitysdk.models.activity import Activity
4+
from entitysdk.types import IonChannelModelingExecutionStatus
5+
6+
7+
class IonChannelModelingExecution(Activity):
8+
"""Ion channel modeling execution model."""
9+
10+
status: IonChannelModelingExecutionStatus

src/entitysdk/route.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
"Ion": "ion",
2828
"IonChannel": "ion-channel",
2929
"IonChannelModel": "ion-channel-model",
30+
"IonChannelModelingCampaign": "ion-channel-modeling-campaign",
31+
"IonChannelModelingConfig": "ion-channel-modeling-config",
32+
"IonChannelModelingConfigGeneration": "ion-channel-modeling-config-generation",
33+
"IonChannelModelingExecution": "ion-channel-modeling-execution",
3034
"IonChannelRecording": "ion-channel-recording",
3135
"License": "license",
3236
"MeasurementAnnotation": "measurement-annotation",

src/entitysdk/types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
from entitysdk._server_schemas import EMCellMeshGenerationMethod as EMCellMeshGenerationMethod
3636
from entitysdk._server_schemas import EMCellMeshType as EMCellMeshType
3737
from entitysdk._server_schemas import EntityType as EntityType
38+
from entitysdk._server_schemas import (
39+
IonChannelModelingExecutionStatus as IonChannelModelingExecutionStatus,
40+
)
3841
from entitysdk._server_schemas import MeasurableEntity as MeasurableEntity
3942
from entitysdk._server_schemas import MeasurementStatistic as MeasurementStatistic
4043
from entitysdk._server_schemas import MeasurementUnit as MeasurementUnit

tests/integration/test_searching.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
EModel,
99
IonChannel,
1010
IonChannelModel,
11+
IonChannelModelingCampaign,
12+
IonChannelModelingConfig,
13+
IonChannelModelingConfigGeneration,
14+
IonChannelModelingExecution,
1115
IonChannelRecording,
1216
License,
1317
MEModel,
@@ -33,6 +37,10 @@
3337
Contribution,
3438
IonChannel,
3539
IonChannelModel,
40+
IonChannelModelingCampaign,
41+
IonChannelModelingConfig,
42+
IonChannelModelingConfigGeneration,
43+
IonChannelModelingExecution,
3644
IonChannelRecording,
3745
License,
3846
MTypeClass,
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
{
2+
"assets": [],
3+
"id": "be2daf30-c2a0-4433-a0e2-5e20ccff5908",
4+
"update_date": "2025-06-11T09:33:51.707275Z",
5+
"creation_date": "2025-06-11T09:33:51.707275Z",
6+
"name": "my-campaign",
7+
"description": "my-campaign-description",
8+
"type": "ion_channel_modeling_campaign",
9+
"scan_parameters": {"foo": "bar"},
10+
"input_recordings": [
11+
{
12+
"contributions": [],
13+
"assets": [
14+
{
15+
"size": 1657656,
16+
"creation_date": null,
17+
"update_date": null,
18+
"sha256_digest": "96cc3960ce65133a79be19af9b8b5fa614eb42328cb2e4c67fbe0f96c51c28e2",
19+
"path": "S1FL_L5_DBC_cIR_4.nwb",
20+
"full_path": "public/a98b7abc-fc46-4700-9e3d-37137812c730/0dbced5f-cc3d-488a-8c7f-cfb8ea039dc6/assets/electrical_cell_recording/98dece14-e154-4ff1-9c1d-34e1563cdd0a/S1FL_L5_DBC_cIR_4.nwb",
21+
"is_directory": false,
22+
"content_type": "application/nwb",
23+
"meta": {},
24+
"label": "nwb",
25+
"id": "898ef0f4-d36f-4426-8af7-145cdb202004",
26+
"storage_type": "aws_s3_internal",
27+
"status": "created"
28+
}
29+
],
30+
"license": {
31+
"id": "c268a20e-b78a-4332-a5e1-38e26c4454b9",
32+
"creation_date": "2025-06-27T11:10:28.715323Z",
33+
"update_date": "2025-06-27T11:10:28.715324Z",
34+
"name": "https://bbp.epfl.ch/neurosciencegraph/data/licenses/97521f71-605d-4f42-8f1b-c37e742a30bf",
35+
"description": "undefined",
36+
"label": "undefined"
37+
},
38+
"creation_date": "2021-06-15T09:42:25.311000Z",
39+
"update_date": "2024-01-11T07:56:56.842835Z",
40+
"created_by": {
41+
"id": "4067c358-4ee2-47f8-9a94-e3e8ab73738f",
42+
"given_name": "Anna-Kristin",
43+
"family_name": "Kaufmann",
44+
"pref_label": "Anna-Kristin Kaufmann",
45+
"type": "person",
46+
"creation_date": null,
47+
"update_date": null
48+
},
49+
"updated_by": {
50+
"id": "bd143fa9-b714-410c-a65d-7435c1066932",
51+
"given_name": "Christina",
52+
"family_name": "Gonzalez",
53+
"pref_label": "Christina Gonzalez",
54+
"type": "person",
55+
"creation_date": null,
56+
"update_date": null
57+
},
58+
"brain_region": {
59+
"creation_date": "2025-06-27T11:10:27.186088Z",
60+
"update_date": "2025-06-27T11:10:27.186088Z",
61+
"id": "61d89b07-dfa0-439a-9187-7ebfe60e212b",
62+
"annotation_value": 322,
63+
"name": "Primary somatosensory area",
64+
"acronym": "SSp",
65+
"color_hex_triplet": "188064",
66+
"parent_structure_id": "9680c40f-ccfe-4804-851f-1024ff0d6409",
67+
"hierarchy_id": "e3e70682-c209-4cac-a29f-6fbed82c07cd"
68+
},
69+
"subject": {
70+
"id": "9fb86d35-6bda-4b8d-9eb3-2715c98fff3b",
71+
"name": "Unknown",
72+
"description": "",
73+
"sex": "unknown",
74+
"weight": null,
75+
"age_value": null,
76+
"age_min": null,
77+
"age_max": null,
78+
"age_period": null,
79+
"species": {
80+
"id": "3b1c2a25-b4fb-468d-98d2-d2d431ac8b4a",
81+
"name": "Rattus norvegicus",
82+
"taxonomy_id": "NCBITaxon:10116",
83+
"creation_date": null,
84+
"update_date": null
85+
},
86+
"strain": null,
87+
"assets": [],
88+
"creation_date": null,
89+
"update_date": null,
90+
"type": null,
91+
"authorized_project_id": null,
92+
"authorized_public": false,
93+
"contributions": null,
94+
"created_by": null,
95+
"legacy_id": null,
96+
"updated_by": null
97+
},
98+
"authorized_project_id": "0dbced5f-cc3d-488a-8c7f-cfb8ea039dc6",
99+
"authorized_public": true,
100+
"type": "ion_channel_recording",
101+
"id": "98dece14-e154-4ff1-9c1d-34e1563cdd0a",
102+
"experiment_date": null,
103+
"contact_email": null,
104+
"published_in": null,
105+
"name": "Cell 29414",
106+
"description": "Kv1.1 recording.",
107+
"ljp": 0.0,
108+
"recording_location": [],
109+
"recording_type": "intracellular",
110+
"recording_origin": "in_silico",
111+
"temperature": null,
112+
"comment": "RTR (30 min pre-incubation in HBSS)",
113+
"legacy_id": null,
114+
"stimuli": [
115+
{
116+
"assets": [],
117+
"authorized_project_id": null,
118+
"authorized_public": false,
119+
"contributions": null,
120+
"created_by": null,
121+
"updated_by": null,
122+
"type": "electrical_recording_stimulus",
123+
"id": "b487b0da-33dd-4cf1-a9c7-6d19a2b55ab7",
124+
"name": "GenericStep",
125+
"description": "",
126+
"dt": null,
127+
"injection_type": "current_clamp",
128+
"shape": "step",
129+
"start_time": null,
130+
"end_time": null,
131+
"recording_id": "98dece14-e154-4ff1-9c1d-34e1563cdd0a",
132+
"creation_date": null,
133+
"update_date": null,
134+
"legacy_id": null
135+
},
136+
{
137+
"assets": [],
138+
"authorized_project_id": null,
139+
"authorized_public": false,
140+
"contributions": null,
141+
"created_by": null,
142+
"updated_by": null,
143+
"creation_date": null,
144+
"legacy_id": null,
145+
"update_date": null,
146+
"type": "electrical_recording_stimulus",
147+
"id": "fed29e0c-cf49-4841-9025-213606ab1bc4",
148+
"name": "GenericStep",
149+
"description": "",
150+
"dt": null,
151+
"injection_type": "current_clamp",
152+
"shape": "step",
153+
"start_time": null,
154+
"end_time": null,
155+
"recording_id": "98dece14-e154-4ff1-9c1d-34e1563cdd0a"
156+
},
157+
{
158+
"assets": [],
159+
"authorized_project_id": null,
160+
"authorized_public": false,
161+
"contributions": null,
162+
"created_by": null,
163+
"updated_by": null,
164+
"creation_date": null,
165+
"legacy_id": null,
166+
"update_date": null,
167+
"type": "electrical_recording_stimulus",
168+
"id": "5d0664fd-7785-48e0-b760-532a73f59f14",
169+
"name": "GenericStep",
170+
"description": "",
171+
"dt": null,
172+
"injection_type": "current_clamp",
173+
"shape": "step",
174+
"start_time": null,
175+
"end_time": null,
176+
"recording_id": "98dece14-e154-4ff1-9c1d-34e1563cdd0a"
177+
}
178+
],
179+
"cell_line": "CHO",
180+
"ion_channel": {
181+
"creation_date": "2021-06-15T09:42:25.311000Z",
182+
"update_date": "2024-01-11T07:56:56.842835Z",
183+
"id": "98dece14-e154-4ff1-9c1d-34e1563cdd0a",
184+
"label": "K<SUB>v<\/SUB>1.1",
185+
"gene": "Kcna1",
186+
"synonyms": ["HBK1", "Kcn1", "MBK1", "RCK1", "AEMK", "HUK1", "Shak", "Kcna", "Kcpvd"],
187+
"name": "Kv1.1",
188+
"description": ""
189+
}
190+
}
191+
],
192+
"created_by": {
193+
"id": "e8997b32-0183-42c8-b11f-1a61da933a89",
194+
"update_date": null,
195+
"creation_date": null,
196+
"type": "person",
197+
"pref_label": "Admin User",
198+
"given_name": null,
199+
"family_name": null
200+
},
201+
"updated_by": {
202+
"id": "e8997b32-0183-42c8-b11f-1a61da933a89",
203+
"update_date": null,
204+
"creation_date": null,
205+
"type": "person",
206+
"pref_label": "Admin User",
207+
"given_name": null,
208+
"family_name": null
209+
},
210+
"authorized_public": false,
211+
"authorized_project_id": "0dbced5f-cc3d-488a-8c7f-cfb8ea039dc6",
212+
"contributions": null,
213+
"legacy_id": null,
214+
"ion_channel_modeling_configs": [
215+
{
216+
"assets": [],
217+
"id": "32073304-a8cc-4461-9ef7-9d526527214b",
218+
"update_date": null,
219+
"creation_date": null,
220+
"name": "ion-channel-modeling-config-0",
221+
"description": "ion-channel-modeling-config-0",
222+
"type": "ion_channel_modeling_config",
223+
"created_by": null,
224+
"updated_by": null,
225+
"authorized_public": false,
226+
"authorized_project_id": null,
227+
"contributions": null,
228+
"legacy_id": null,
229+
"ion_channel_modeling_campaign_id": "be2daf30-c2a0-4433-a0e2-5e20ccff5908",
230+
"scan_parameters": {
231+
"foo": "bar"
232+
}
233+
},
234+
{
235+
"assets": [],
236+
"id": "e2549cb6-c065-4827-ba09-005117a0a1a7",
237+
"update_date": null,
238+
"creation_date": null,
239+
"name": "ion-channel-modeling-config-1",
240+
"description": "ion-channel-modeling-config-1",
241+
"type": "ion_channel_modeling_config",
242+
"created_by": null,
243+
"updated_by": null,
244+
"authorized_public": false,
245+
"authorized_project_id": null,
246+
"contributions": null,
247+
"legacy_id": null,
248+
"ion_channel_modeling_campaign_id": "be2daf30-c2a0-4433-a0e2-5e20ccff5908",
249+
"scan_parameters": {
250+
"foo": "bar"
251+
}
252+
}
253+
]
254+
}

0 commit comments

Comments
 (0)