Skip to content

Commit

Permalink
Merge pull request #1223 from AllenNeuralDynamics/1175-20-replace-fie…
Browse files Browse the repository at this point in the history
…ld_full_name-usage-with-a-class-researchername

feat: replace experimenter_full_name with Investigator class
  • Loading branch information
saskiad authored Jan 24, 2025
2 parents c23e66e + 4f3e009 commit 7349ad6
Show file tree
Hide file tree
Showing 50 changed files with 396 additions and 145 deletions.
11 changes: 6 additions & 5 deletions docs/source/example_workflow/example_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
import pandas as pd
from aind_data_schema_models.modalities import Modality
from aind_data_schema_models.organizations import Organization
from aind_data_schema_models.pid_names import PIDName
from aind_data_schema_models.platforms import Platform

from aind_data_schema.core.data_description import Funding, RawDataDescription
from aind_data_schema.core.procedures import NanojectInjection, Perfusion, Procedures, Surgery, ViralMaterial
from aind_data_schema.core.subject import BreedingInfo, Housing, Species, Subject

from aind_data_schema.components.identifiers import Person

sessions_df = pd.read_excel("example_workflow.xlsx", sheet_name="sessions")
mice_df = pd.read_excel("example_workflow.xlsx", sheet_name="mice")
procedures_df = pd.read_excel("example_workflow.xlsx", sheet_name="procedures")

# everything was done by one person, so it's not in the spreadsheet
experimenter = "Sam Student"
experimenter = Person(name="Some experimenter")

# in our spreadsheet, we stored sex as M/F instead of Male/Female
subject_sex_lookup = {
Expand All @@ -35,7 +36,7 @@
subject_id=str(session["mouse_id"]),
creation_time=session["end_time"].to_pydatetime(),
institution=Organization.OTHER,
investigators=[PIDName(name="Some Investigator")],
experimenters=[experimenter],
funding_source=[Funding(funder=Organization.NIMH)],
)

Expand Down Expand Up @@ -88,7 +89,7 @@
start_date=proc_row["injection_date"].to_pydatetime().date(),
protocol_id=protocol,
ethics_review_id=ethics_review_id,
experimenter_full_name=experimenter,
experimenters=[experimenter],
procedures=[
NanojectInjection(
protocol_id=protocol,
Expand All @@ -111,7 +112,7 @@
),
Surgery(
start_date=proc_row["perfusion_date"].to_pydatetime().date(),
experimenter_full_name=experimenter,
experimenters=[experimenter],
ethics_review_id=ethics_review_id,
protocol_id=protocol,
procedures=[Perfusion(protocol_id=protocol, output_specimen_ids=["1"])],
Expand Down
2 changes: 1 addition & 1 deletion docs/source/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ more ontologies into our schema. We currently use:

* NCBI Taxonomy to specify species
* Research Organization Registry (ROR) to specify organizations (including manufacturer, funders, research organizations)
* Open Researcher and Contributor ID (ORCID) to identify investigators
* Open Researcher and Contributor ID (ORCID) to identify experimenters
* Research Resource Identifiers (RRID) to identify reagents and other resources
* Addgene to identify viruses and plasmids
* Mouse Genome Informatics (MGI) to identify transgenic alleles
88 changes: 80 additions & 8 deletions examples/aibs_smartspim_procedures.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
"procedure_type": "Surgery",
"protocol_id": "doi_of_protocol_surgery",
"start_date": "2022-11-17",
"experimenter_full_name": "LAS",
"experimenters": [
{
"name": "LAS",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"ethics_review_id": "xxxx",
"animal_weight_prior": null,
"animal_weight_post": null,
Expand All @@ -33,7 +42,16 @@
"specimen_id": "651286",
"start_date": "2023-01-13",
"end_date": "2023-01-17",
"experimenter_full_name": "John Smith",
"experimenters": [
{
"name": "John Smith",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"protocol_id": [
"unknown"
],
Expand Down Expand Up @@ -74,7 +92,16 @@
"specimen_id": "651286",
"start_date": "2023-01-17",
"end_date": "2023-01-18",
"experimenter_full_name": "John Smith",
"experimenters": [
{
"name": "John Smith",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"protocol_id": [
"unknown"
],
Expand Down Expand Up @@ -103,7 +130,16 @@
"specimen_id": "651286",
"start_date": "2023-01-18",
"end_date": "2023-01-19",
"experimenter_full_name": "John Smith",
"experimenters": [
{
"name": "John Smith",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"protocol_id": [
"unknown"
],
Expand Down Expand Up @@ -132,7 +168,16 @@
"specimen_id": "651286",
"start_date": "2023-01-19",
"end_date": "2023-01-20",
"experimenter_full_name": "John Smith",
"experimenters": [
{
"name": "John Smith",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"protocol_id": [
"unknown"
],
Expand Down Expand Up @@ -173,7 +218,16 @@
"specimen_id": "651286",
"start_date": "2023-01-30",
"end_date": "2023-01-31",
"experimenter_full_name": "John Smith",
"experimenters": [
{
"name": "John Smith",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"protocol_id": [
"unknown"
],
Expand Down Expand Up @@ -214,7 +268,16 @@
"specimen_id": "651286",
"start_date": "2023-01-31",
"end_date": "2023-02-02",
"experimenter_full_name": "John Smith",
"experimenters": [
{
"name": "John Smith",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"protocol_id": [
"unknown"
],
Expand Down Expand Up @@ -243,7 +306,16 @@
"specimen_id": "651286",
"start_date": "2023-01-31",
"end_date": "2023-02-02",
"experimenter_full_name": "John Smith",
"experimenters": [
{
"name": "John Smith",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"protocol_id": [
"unknown"
],
Expand Down
19 changes: 10 additions & 9 deletions examples/aibs_smartspim_procedures.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

from aind_data_schema_models.organizations import Organization

from aind_data_schema.components.identifiers import Person
from aind_data_schema.core import procedures

experimenter = "John Smith"
experimenters = [Person(name="John Smith")]
# subject and specimen id can be the same?
specimen_id = "651286"

Expand Down Expand Up @@ -35,7 +36,7 @@

perfusion = procedures.Surgery(
start_date=date(2022, 11, 17),
experimenter_full_name="LAS",
experimenters=[Person(name="LAS")],
ethics_review_id="xxxx",
protocol_id="doi_of_protocol_surgery",
procedures=[
Expand All @@ -55,7 +56,7 @@
procedure_type="Fixation",
start_date=date(2023, 1, 13),
end_date=date(2023, 1, 17),
experimenter_full_name=experimenter,
experimenters=experimenters,
protocol_id=["unknown"],
reagents=[shield_buffer, shield_epoxy],
)
Expand All @@ -67,7 +68,7 @@
procedure_type="Fixation",
start_date=date(2023, 1, 17),
end_date=date(2023, 1, 18),
experimenter_full_name=experimenter,
experimenters=experimenters,
protocol_id=["unknown"],
reagents=[
shield_on,
Expand All @@ -81,7 +82,7 @@
procedure_type="Soak",
start_date=date(2023, 1, 18),
end_date=date(2023, 1, 19),
experimenter_full_name=experimenter,
experimenters=experimenters,
protocol_id=["unknown"],
reagents=[
delipidation_buffer,
Expand All @@ -95,7 +96,7 @@
procedure_name="Active Delipidation",
start_date=date(2023, 1, 19),
end_date=date(2023, 1, 20),
experimenter_full_name=experimenter,
experimenters=experimenters,
protocol_id=["unknown"],
reagents=[delipidation_buffer, conductivity_buffer],
)
Expand All @@ -107,7 +108,7 @@
procedure_name="EasyIndex 50%",
start_date=date(2023, 1, 30),
end_date=date(2023, 1, 31),
experimenter_full_name=experimenter,
experimenters=experimenters,
protocol_id=["unknown"],
reagents=[
easy_index,
Expand All @@ -122,7 +123,7 @@
procedure_name="EasyIndex 100%",
start_date=date(2023, 1, 31),
end_date=date(2023, 2, 2),
experimenter_full_name=experimenter,
experimenters=experimenters,
protocol_id=["unknown"],
reagents=[
easy_index,
Expand All @@ -135,7 +136,7 @@
procedure_type="Embedding",
start_date=date(2023, 1, 31),
end_date=date(2023, 2, 2),
experimenter_full_name=experimenter,
experimenters=experimenters,
protocol_id=["unknown"],
reagents=[
easy_index,
Expand Down
11 changes: 9 additions & 2 deletions examples/bergamo_ophys_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/session.py",
"schema_version": "1.1.4",
"protocol_id": [],
"experimenter_full_name": [
"John Doe"
"experimenters": [
{
"name": "John Smith",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"session_start_time": "2022-07-12T07:00:00Z",
"session_end_time": "2022-07-12T07:00:00Z",
Expand Down
3 changes: 2 additions & 1 deletion examples/bergamo_ophys_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from aind_data_schema_models.modalities import Modality
from aind_data_schema_models.units import FrequencyUnit

from aind_data_schema.components.identifiers import Person
from aind_data_schema.components.stimulus import PhotoStimulation, PhotoStimulationGroup
from aind_data_schema.core.session import (
DetectorConfig,
Expand All @@ -22,7 +23,7 @@
t = datetime(2022, 7, 12, 7, 00, 00, tzinfo=timezone.utc)

s = Session(
experimenter_full_name=["John Doe"],
experimenters=[Person(name="John Smith")],
session_start_time=t,
session_end_time=t,
subject_id="652567",
Expand Down
6 changes: 4 additions & 2 deletions examples/data_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
"investigators": [
{
"name": "Jane Smith",
"abbreviation": null,
"registry": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
Expand Down
4 changes: 2 additions & 2 deletions examples/data_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from aind_data_schema_models.modalities import Modality
from aind_data_schema_models.organizations import Organization
from aind_data_schema_models.pid_names import PIDName
from aind_data_schema_models.platforms import Platform

from aind_data_schema.components.identifiers import Person
from aind_data_schema.core.data_description import Funding, RawDataDescription

d = RawDataDescription(
Expand All @@ -15,7 +15,7 @@
subject_id="12345",
creation_time=datetime(2022, 2, 21, 16, 30, 1, tzinfo=timezone.utc),
institution=Organization.AIND,
investigators=[PIDName(name="Jane Smith")],
investigators=[Person(name="Jane Smith")],
funding_source=[Funding(funder=Organization.AI)],
)

Expand Down
12 changes: 9 additions & 3 deletions examples/ephys_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/session.py",
"schema_version": "1.1.4",
"protocol_id": [],
"experimenter_full_name": [
"Max Quibble",
"Finn Tickle"
"experimenters": [
{
"name": "John Smith",
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null
}
],
"session_start_time": "2023-04-25T02:35:00Z",
"session_end_time": "2023-04-25T03:16:00Z",
Expand Down
3 changes: 2 additions & 1 deletion examples/ephys_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from aind_data_schema_models.modalities import Modality

from aind_data_schema.components.devices import Software
from aind_data_schema.components.identifiers import Person
from aind_data_schema.core.session import (
CcfCoords,
Coordinates3d,
Expand All @@ -19,7 +20,7 @@
from aind_data_schema_models.brain_atlas import CCFStructure

session = Session(
experimenter_full_name=["Max Quibble", "Finn Tickle"],
experimenters=[Person(name="John Smith")],
subject_id="664484",
session_start_time=datetime(year=2023, month=4, day=25, hour=2, minute=35, second=0, tzinfo=timezone.utc),
session_end_time=datetime(year=2023, month=4, day=25, hour=3, minute=16, second=0, tzinfo=timezone.utc),
Expand Down
Loading

0 comments on commit 7349ad6

Please sign in to comment.