diff --git a/nwb_linkml/.coveragerc b/nwb_linkml/.coveragerc index 125ebec..99fa480 100644 --- a/nwb_linkml/.coveragerc +++ b/nwb_linkml/.coveragerc @@ -4,4 +4,5 @@ source = ./nwb_linkml/src/nwb_linkml omit = */nwb_schema_language/* */nwb_linkml/models/* - */tests/* \ No newline at end of file + */tests/* + */plot.py \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/adapters/adapter.py b/nwb_linkml/src/nwb_linkml/adapters/adapter.py index a33e0fc..0b5161e 100644 --- a/nwb_linkml/src/nwb_linkml/adapters/adapter.py +++ b/nwb_linkml/src/nwb_linkml/adapters/adapter.py @@ -46,7 +46,7 @@ class BuildResult: self.types.extend(other.types) return self - def __repr__(self): + def __repr__(self): # pragma: no cover out_str = "\nBuild Result:\n" out_str += '-'*len(out_str) @@ -122,28 +122,3 @@ class Adapter(BaseModel): for item in self.walk(input): if any([type(item) == atype for atype in get_type]): yield item - - # - # - # if isinstance(input, BaseModel): - # for key in input.__fields__.keys(): - # val = getattr(input, key) - # if key == field: - # yield val - # if isinstance(val, (BaseModel, dict, list)): - # yield from self.walk(val, field) - # - # elif isinstance(input, dict): - # for key, val in input.items(): - # if key == field: - # yield val - # if isinstance(val, (BaseModel, dict, list)): - # yield from self.walk(val, field) - # - # elif isinstance(input, (list, tuple)): - # for val in input: - # yield from self.walk(val, field) - # - # else: - # # do nothing, is a string or whatever - # pass diff --git a/nwb_linkml/src/nwb_linkml/generators/pydantic.py b/nwb_linkml/src/nwb_linkml/generators/pydantic.py index d121f4a..3dc2ebb 100644 --- a/nwb_linkml/src/nwb_linkml/generators/pydantic.py +++ b/nwb_linkml/src/nwb_linkml/generators/pydantic.py @@ -82,7 +82,7 @@ metamodel_version = "{{metamodel_version}}" version = "{{version if version else None}}" """ ### BASE MODEL ### - if pydantic_ver == "1": + if pydantic_ver == "1": # pragma: no cover template += """ class WeakRefShimBaseModel(BaseModel): __slots__ = '__weakref__' @@ -165,7 +165,7 @@ class {{ c.name }} {% endfor %} """ ### FWD REFS / REBUILD MODEL ### - if pydantic_ver == "1": + if pydantic_ver == "1": # pragma: no cover template += """ # Update forward refs # see https://pydantic-docs.helpmanual.io/usage/postponed_annotations/ @@ -337,7 +337,7 @@ class NWBPydanticGenerator(PydanticGenerator): class_def.description = class_def.description.replace('"', '\\"') return class_def - def _check_anyof(self, s:SlotDefinition, sn: SlotDefinitionName, sv:SchemaView): + def _check_anyof(self, s:SlotDefinition, sn: SlotDefinitionName, sv:SchemaView): # pragma: no cover # Confirm that the original slot range (ignoring the default that comes in from # induced_slot) isn't in addition to setting any_of if len(s.any_of) > 0 and sv.get_slot(sn).range is not None: @@ -506,7 +506,7 @@ class NWBPydanticGenerator(PydanticGenerator): # for class_def in sv.all_classes().values(): # for slot_name in sv.class_slots(class_def.name): # slot = sv.induced_slot(slot_name, class_def.name) - if slot.designates_type: + if slot.designates_type: # pragma: no cover target_value = get_type_designator_value(sv, slot, class_def) slot_value = f'"{target_value}"' if slot.multivalued: @@ -534,7 +534,7 @@ class NWBPydanticGenerator(PydanticGenerator): predefined_slot_values = {} """splitting up parent class :meth:`.get_predefined_slot_values`""" - if self.template_file is not None: + if self.template_file is not None: # pragma: no cover with open(self.template_file) as template_file: template_obj = Template(template_file.read()) else: @@ -645,7 +645,7 @@ class NWBPydanticGenerator(PydanticGenerator): ) return code - def compile_module(self, module_path:Path=None, **kwargs) -> ModuleType: + def compile_module(self, module_path:Path=None, **kwargs) -> ModuleType: # pragma: no cover - replaced with provider """ Compiles generated python code to a module :return: @@ -662,7 +662,7 @@ class NWBPydanticGenerator(PydanticGenerator): except NameError as e: raise e -def compile_python(text_or_fn: str, package_path: Path = None) -> ModuleType: +def compile_python(text_or_fn: str, package_path: Path = None) -> ModuleType: # pragma: no cover - replaced with provider """ Compile the text or file and return the resulting module @param text_or_fn: Python text or file name that references python file @@ -675,22 +675,6 @@ def compile_python(text_or_fn: str, package_path: Path = None) -> ModuleType: package_path = Path(text_or_fn) spec = compile(python_txt, '', 'exec') module = ModuleType('test') - # if package_path: - # if package_path.is_absolute(): - # module.__package__ = str(package_path) - # else: - # package_path_abs = os.path.join(os.getcwd(), package_path) - # # We have to calculate the path to expected path relative to the current working directory - # for path in sys.path: - # if package_path.startswith(path): - # path_from_tests_parent = os.path.relpath(package_path, path) - # break - # if package_path_abs.startswith(path): - # path_from_tests_parent = os.path.relpath(package_path_abs, path) - # break - # else: - # path_from_tests_parent = os.path.relpath(package_path, os.path.join(os.getcwd(), '..')) - # module.__package__ = os.path.dirname(os.path.relpath(path_from_tests_parent, os.getcwd())).replace(os.path.sep, '.') - # sys.modules[module.__name__] = module + exec(spec, module.__dict__) return module diff --git a/nwb_linkml/src/nwb_linkml/maps/naming.py b/nwb_linkml/src/nwb_linkml/maps/naming.py index c95f8ad..2e9cb60 100644 --- a/nwb_linkml/src/nwb_linkml/maps/naming.py +++ b/nwb_linkml/src/nwb_linkml/maps/naming.py @@ -26,7 +26,10 @@ def module_case(name:str) -> str: - - - . """ - return name.replace('-', '_').replace('.', '_').lower() + return name.replace('-', '_' + ).replace('.', '_' + ).replace('/', '.' + ).lower() def version_module_case(name:str) -> str: """ diff --git a/nwb_linkml/src/nwb_linkml/models/__init__.py b/nwb_linkml/src/nwb_linkml/models/__init__.py index e69de29..86775d8 100644 --- a/nwb_linkml/src/nwb_linkml/models/__init__.py +++ b/nwb_linkml/src/nwb_linkml/models/__init__.py @@ -0,0 +1 @@ +from .pydantic.core.v2_6_0_alpha.namespace import * \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py new file mode 100644 index 0000000..9a493c0 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_base.py @@ -0,0 +1,149 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_0.hdmf_common_table import ( + Container, + DynamicTable, + Data +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBData(Data): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class Image(NWBData): + """ + An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). + """ + name:str= Field(...) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + array:Optional[Union[ + NDArray[Shape["* x, * y"], Number], + NDArray[Shape["* x, * y, 3 r_g_b"], Number], + NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number] + ]]= Field(None) + + +class NWBContainer(Container): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class NWBDataInterface(NWBContainer): + """ + An abstract data type for a generic container storing collections of data, as opposed to metadata. + """ + name:str= Field(...) + + +class TimeSeries(NWBDataInterface): + """ + General purpose time series. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + data:TimeSeriesData= Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TimeSeriesData(ConfiguredBaseModel): + """ + Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. + """ + name:Literal["data"]= Field("data") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""") + resolution:Optional[float]= Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Any], + NDArray[Shape["* num_times, * num_DIM2"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3, * num_DIM4"], Any] + ]]= Field(None) + + +class TimeSeriesStartingTime(ConfiguredBaseModel): + """ + Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. + """ + name:Literal["starting_time"]= Field("starting_time") + rate:Optional[float]= Field(None, description="""Sampling rate, in Hz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + value:float= Field(...) + + +class TimeSeriesSync(ConfiguredBaseModel): + """ + Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. + """ + name:Literal["sync"]= Field("sync") + + +class ProcessingModule(NWBContainer): + """ + A collection of processed data. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of processed data.""") + nwb_data_interface:Optional[List[NWBDataInterface]]= Field(default_factory=list, description="""Data objects stored in this collection.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""Tables stored in this collection.""") + + +class Images(NWBDataInterface): + """ + A collection of images. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of images.""") + image:List[Image]= Field(default_factory=list, description="""Images stored in this collection.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBData.model_rebuild() +Image.model_rebuild() +NWBContainer.model_rebuild() +NWBDataInterface.model_rebuild() +TimeSeries.model_rebuild() +TimeSeriesData.model_rebuild() +TimeSeriesStartingTime.model_rebuild() +TimeSeriesSync.model_rebuild() +ProcessingModule.model_rebuild() +Images.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py new file mode 100644 index 0000000..b75f478 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_behavior.py @@ -0,0 +1,135 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from .core_nwb_misc import ( + IntervalSeries +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class SpatialSeries(TimeSeries): + """ + Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. + """ + name:str= Field(...) + data:SpatialSeriesData= Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""") + reference_frame:Optional[str]= Field(None, description="""Description defining what exactly 'straight-ahead' means.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpatialSeriesData(ConfiguredBaseModel): + """ + 1-D or 2-D array storing position or direction relative to some reference frame. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class BehavioralEpochs(NWBDataInterface): + """ + TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. + """ + name:str= Field(...) + interval_series:Optional[List[IntervalSeries]]= Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""") + + +class BehavioralEvents(NWBDataInterface): + """ + TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing behavioral events.""") + + +class BehavioralTimeSeries(NWBDataInterface): + """ + TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""") + + +class PupilTracking(NWBDataInterface): + """ + Eye-tracking data, representing pupil size. + """ + name:str= Field(...) + time_series:List[TimeSeries]= Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""") + + +class EyeTracking(NWBDataInterface): + """ + Eye-tracking data, representing direction of gaze. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""") + + +class CompassDirection(NWBDataInterface): + """ + With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""") + + +class Position(NWBDataInterface): + """ + Position data, whether along the x, x/y or x/y/z axis. + """ + name:str= Field(...) + spatial_series:List[SpatialSeries]= Field(default_factory=list, description="""SpatialSeries object containing position data.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +SpatialSeries.model_rebuild() +SpatialSeriesData.model_rebuild() +BehavioralEpochs.model_rebuild() +BehavioralEvents.model_rebuild() +BehavioralTimeSeries.model_rebuild() +PupilTracking.model_rebuild() +EyeTracking.model_rebuild() +CompassDirection.model_rebuild() +Position.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_device.py similarity index 80% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_device.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_device.py index 35fc747..a3728cb 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_device.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_device.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -17,7 +18,7 @@ from .core_nwb_base import ( metamodel_version = "None" -version = "None" +version = "2.2.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -40,5 +41,5 @@ class Device(NWBContainer): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# Device.model_rebuild() +Device.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py new file mode 100644 index 0000000..8720869 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ecephys.py @@ -0,0 +1,238 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ElectricalSeries(TimeSeries): + """ + A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. + """ + name:str= Field(...) + data:ElectricalSeriesData= Field(..., description="""Recorded voltage data.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ElectricalSeriesData(ConfiguredBaseModel): + """ + Recorded voltage data. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and 'channel_conversion' (if present).""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_channels"], Number], + NDArray[Shape["* num_times, * num_channels, * num_samples"], Number] + ]]= Field(None) + + +class ElectricalSeriesElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class SpikeEventSeries(ElectricalSeries): + """ + Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). + """ + name:str= Field(...) + data:SpikeEventSeriesData= Field(..., description="""Spike waveforms.""") + timestamps:List[float]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpikeEventSeriesData(ConfiguredBaseModel): + """ + Spike waveforms. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""") + array:Optional[Union[ + NDArray[Shape["* num_events, * num_samples"], Number], + NDArray[Shape["* num_events, * num_samples, * num_channels"], Number] + ]]= Field(None) + + +class FeatureExtraction(NWBDataInterface): + """ + Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. + """ + name:str= Field(...) + description:List[str]= Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""") + features:FeatureExtractionFeatures= Field(..., description="""Multi-dimensional array of features extracted from each event.""") + times:List[float]= Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""") + electrodes:FeatureExtractionElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + + +class FeatureExtractionFeatures(ConfiguredBaseModel): + """ + Multi-dimensional array of features extracted from each event. + """ + name:Literal["features"]= Field("features") + array:Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]]= Field(None) + + +class FeatureExtractionElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class EventDetection(NWBDataInterface): + """ + Detected spike events from voltage trace(s). + """ + name:str= Field(...) + detection_method:str= Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""") + source_idx:List[int]= Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""") + times:List[float]= Field(default_factory=list, description="""Timestamps of events, in seconds.""") + + +class EventWaveform(NWBDataInterface): + """ + Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. + """ + name:str= Field(...) + spike_event_series:Optional[List[SpikeEventSeries]]= Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""") + + +class FilteredEphys(NWBDataInterface): + """ + Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""") + + +class LFP(NWBDataInterface): + """ + LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""") + + +class ElectrodeGroup(NWBContainer): + """ + A physical grouping of electrodes, e.g. a shank of an array. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this electrode group.""") + location:Optional[str]= Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""") + position:Optional[Any]= Field(None, description="""stereotaxic or common framework coordinates""") + + +class ClusterWaveforms(NWBDataInterface): + """ + DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. + """ + name:str= Field(...) + waveform_filtering:str= Field(..., description="""Filtering applied to data before generating mean/sd""") + waveform_mean:ClusterWaveformsWaveformMean= Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""") + waveform_sd:ClusterWaveformsWaveformSd= Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""") + + +class ClusterWaveformsWaveformMean(ConfiguredBaseModel): + """ + The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled) + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class ClusterWaveformsWaveformSd(ConfiguredBaseModel): + """ + Stdev of waveforms for each cluster, using the same indices as in mean + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class Clustering(NWBDataInterface): + """ + DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""") + num:List[int]= Field(default_factory=list, description="""Cluster number of each event""") + peak_over_rms:List[float]= Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""") + times:List[float]= Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ElectricalSeries.model_rebuild() +ElectricalSeriesData.model_rebuild() +ElectricalSeriesElectrodes.model_rebuild() +SpikeEventSeries.model_rebuild() +SpikeEventSeriesData.model_rebuild() +FeatureExtraction.model_rebuild() +FeatureExtractionFeatures.model_rebuild() +FeatureExtractionElectrodes.model_rebuild() +EventDetection.model_rebuild() +EventWaveform.model_rebuild() +FilteredEphys.model_rebuild() +LFP.model_rebuild() +ElectrodeGroup.model_rebuild() +ClusterWaveforms.model_rebuild() +ClusterWaveformsWaveformMean.model_rebuild() +ClusterWaveformsWaveformSd.model_rebuild() +Clustering.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py new file mode 100644 index 0000000..dd87543 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_epoch.py @@ -0,0 +1,74 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_0.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TimeIntervals(DynamicTable): + """ + A container for aggregating epoch data and the TimeSeries that each epoch applies to. + """ + name:str= Field(...) + start_time:Optional[List[float]]= Field(default_factory=list, description="""Start time of epoch, in seconds.""") + stop_time:Optional[List[float]]= Field(default_factory=list, description="""Stop time of epoch, in seconds.""") + tags:Optional[List[str]]= Field(default_factory=list, description="""User-defined tags that identify or categorize events.""") + tags_index:Optional[TimeIntervalsTagsIndex]= Field(None, description="""Index for tags.""") + timeseries:Optional[List[Any]]= Field(default_factory=list, description="""An index into a TimeSeries object.""") + timeseries_index:Optional[TimeIntervalsTimeseriesIndex]= Field(None, description="""Index for timeseries.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class TimeIntervalsTagsIndex(VectorIndex): + """ + Index for tags. + """ + name:Literal["tags_index"]= Field("tags_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class TimeIntervalsTimeseriesIndex(VectorIndex): + """ + Index for timeseries. + """ + name:Literal["timeseries_index"]= Field("timeseries_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TimeIntervals.model_rebuild() +TimeIntervalsTagsIndex.model_rebuild() +TimeIntervalsTimeseriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py new file mode 100644 index 0000000..7691237 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_file.py @@ -0,0 +1,220 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_epoch import ( + TimeIntervals +) + +from .core_nwb_icephys import ( + SweepTable, + IntracellularElectrode +) + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeries, + ProcessingModule, + NWBContainer +) + +from .core_nwb_ogen import ( + OptogeneticStimulusSite +) + +from .core_nwb_ophys import ( + ImagingPlane +) + +from .core_nwb_misc import ( + Units +) + +from .core_nwb_device import ( + Device +) + +from ...hdmf_common.v1_1_0.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBFile(NWBContainer): + """ + An NWB:N file storing cellular-based neurophysiology data from a single experimental session. + """ + name:Literal["root"]= Field("root") + nwb_version:Optional[str]= Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""") + file_create_date:List[datetime ]= Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""") + identifier:str= Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""") + session_description:str= Field(..., description="""A description of the experimental session and data in the file.""") + session_start_time:datetime = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""") + timestamps_reference_time:datetime = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""") + acquisition:Optional[List[Union[DynamicTable, NWBDataInterface]]]= Field(default_factory=list, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""") + analysis:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""") + scratch:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""") + processing:Optional[List[ProcessingModule]]= Field(default_factory=list, description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""") + stimulus:NWBFileStimulus= Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""") + general:NWBFileGeneral= Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""") + intervals:Optional[NWBFileIntervals]= Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""") + units:Optional[Units]= Field(None, description="""Data about sorted spike units.""") + + +class NWBFileStimulus(ConfiguredBaseModel): + """ + Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. + """ + name:Literal["stimulus"]= Field("stimulus") + presentation:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Stimuli presented during the experiment.""") + templates:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""") + + +class NWBFileGeneral(ConfiguredBaseModel): + """ + Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. + """ + name:Literal["general"]= Field("general") + data_collection:Optional[str]= Field(None, description="""Notes about data collection and analysis.""") + experiment_description:Optional[str]= Field(None, description="""General description of the experiment.""") + experimenter:Optional[List[str]]= Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""") + institution:Optional[str]= Field(None, description="""Institution(s) where experiment was performed.""") + keywords:Optional[List[str]]= Field(default_factory=list, description="""Terms to search over.""") + lab:Optional[str]= Field(None, description="""Laboratory where experiment was performed.""") + notes:Optional[str]= Field(None, description="""Notes about the experiment.""") + pharmacology:Optional[str]= Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""") + protocol:Optional[str]= Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""") + related_publications:Optional[List[str]]= Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""") + session_id:Optional[str]= Field(None, description="""Lab-specific ID for the session.""") + slices:Optional[str]= Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""") + source_script:Optional[NWBFileGeneralSourceScript]= Field(None, description="""Script file or link to public source code used to create this NWB file.""") + stimulus:Optional[str]= Field(None, description="""Notes about stimuli, such as how and where they were presented.""") + surgery:Optional[str]= Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""") + virus:Optional[str]= Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""") + nwb_container:Optional[List[NWBContainer]]= Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""") + devices:Optional[List[Device]]= Field(default_factory=list, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""") + subject:Optional[Subject]= Field(None, description="""Information about the animal or person from which the data was measured.""") + extracellular_ephys:Optional[NWBFileGeneralExtracellularEphys]= Field(None, description="""Metadata related to extracellular electrophysiology.""") + intracellular_ephys:Optional[NWBFileGeneralIntracellularEphys]= Field(None, description="""Metadata related to intracellular electrophysiology.""") + optogenetics:Optional[List[OptogeneticStimulusSite]]= Field(default_factory=list, description="""Metadata describing optogenetic stimuluation.""") + optophysiology:Optional[List[ImagingPlane]]= Field(default_factory=list, description="""Metadata related to optophysiology.""") + + +class NWBFileGeneralSourceScript(ConfiguredBaseModel): + """ + Script file or link to public source code used to create this NWB file. + """ + name:Literal["source_script"]= Field("source_script") + file_name:Optional[str]= Field(None, description="""Name of script file.""") + value:str= Field(...) + + +class Subject(NWBContainer): + """ + Information about the animal or person from which the data was measured. + """ + name:Literal["subject"]= Field("subject") + age:Optional[str]= Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + date_of_birth:Optional[datetime ]= Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""") + description:Optional[str]= Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""") + genotype:Optional[str]= Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") + sex:Optional[str]= Field(None, description="""Gender of subject.""") + species:Optional[str]= Field(None, description="""Species of subject.""") + subject_id:Optional[str]= Field(None, description="""ID of animal/person used/participating in experiment (lab convention).""") + weight:Optional[str]= Field(None, description="""Weight at time of experiment, at time of surgery and at other important times.""") + + +class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): + """ + Metadata related to extracellular electrophysiology. + """ + name:Literal["extracellular_ephys"]= Field("extracellular_ephys") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Physical group of electrodes.""") + electrodes:Optional[NWBFileGeneralExtracellularEphysElectrodes]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + + +class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): + """ + A table of all electrodes (i.e. channels) used for recording. + """ + name:Literal["electrodes"]= Field("electrodes") + x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""") + y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""") + z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""") + imp:Optional[List[float]]= Field(default_factory=list, description="""Impedance of the channel.""") + location:Optional[List[str]]= Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + filtering:Optional[List[float]]= Field(default_factory=list, description="""Description of hardware filtering.""") + group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""") + group_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""") + rel_x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate in electrode group""") + rel_y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate in electrode group""") + rel_z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate in electrode group""") + reference:Optional[List[str]]= Field(default_factory=list, description="""Description of the reference used for this electrode.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): + """ + Metadata related to intracellular electrophysiology. + """ + name:Literal["intracellular_ephys"]= Field("intracellular_ephys") + filtering:Optional[str]= Field(None, description="""Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") + intracellular_electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""An intracellular electrode.""") + sweep_table:Optional[SweepTable]= Field(None, description="""The table which groups different PatchClampSeries together.""") + + +class NWBFileIntervals(ConfiguredBaseModel): + """ + Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data. + """ + name:Literal["intervals"]= Field("intervals") + epochs:Optional[TimeIntervals]= Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""") + trials:Optional[TimeIntervals]= Field(None, description="""Repeated experimental events that have a logical grouping.""") + invalid_times:Optional[TimeIntervals]= Field(None, description="""Time intervals that should be removed from analysis.""") + time_intervals:Optional[List[TimeIntervals]]= Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBFile.model_rebuild() +NWBFileStimulus.model_rebuild() +NWBFileGeneral.model_rebuild() +NWBFileGeneralSourceScript.model_rebuild() +Subject.model_rebuild() +NWBFileGeneralExtracellularEphys.model_rebuild() +NWBFileGeneralExtracellularEphysElectrodes.model_rebuild() +NWBFileGeneralIntracellularEphys.model_rebuild() +NWBFileIntervals.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py new file mode 100644 index 0000000..af4b605 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_icephys.py @@ -0,0 +1,321 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_0.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class PatchClampSeries(TimeSeries): + """ + An abstract base class for patch-clamp data - stimulus or response, current or voltage. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + data:List[float]= Field(default_factory=list, description="""Recorded voltage or current.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeries(PatchClampSeries): + """ + Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. + """ + name:str= Field(...) + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + bias_current:Optional[float]= Field(None, description="""Bias current, in amps.""") + bridge_balance:Optional[float]= Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation:Optional[float]= Field(None, description="""Capacitance compensation, in farads.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeriesData(ConfiguredBaseModel): + """ + Recorded voltage. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IZeroClampSeries(CurrentClampSeries): + """ + Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. + """ + name:str= Field(...) + bias_current:float= Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance:float= Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation:float= Field(..., description="""Capacitance compensation, in farads, fixed to 0.0.""") + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeries(PatchClampSeries): + """ + Stimulus current applied during current clamp recording. + """ + name:str= Field(...) + data:CurrentClampStimulusSeriesData= Field(..., description="""Stimulus current applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus current applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeries(PatchClampSeries): + """ + Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. + """ + name:str= Field(...) + data:VoltageClampSeriesData= Field(..., description="""Recorded current.""") + capacitance_fast:Optional[VoltageClampSeriesCapacitanceFast]= Field(None, description="""Fast capacitance, in farads.""") + capacitance_slow:Optional[VoltageClampSeriesCapacitanceSlow]= Field(None, description="""Slow capacitance, in farads.""") + resistance_comp_bandwidth:Optional[VoltageClampSeriesResistanceCompBandwidth]= Field(None, description="""Resistance compensation bandwidth, in hertz.""") + resistance_comp_correction:Optional[VoltageClampSeriesResistanceCompCorrection]= Field(None, description="""Resistance compensation correction, in percent.""") + resistance_comp_prediction:Optional[VoltageClampSeriesResistanceCompPrediction]= Field(None, description="""Resistance compensation prediction, in percent.""") + whole_cell_capacitance_comp:Optional[VoltageClampSeriesWholeCellCapacitanceComp]= Field(None, description="""Whole cell capacitance compensation, in farads.""") + whole_cell_series_resistance_comp:Optional[VoltageClampSeriesWholeCellSeriesResistanceComp]= Field(None, description="""Whole cell series resistance compensation, in ohms.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampSeriesData(ConfiguredBaseModel): + """ + Recorded current. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): + """ + Fast capacitance, in farads. + """ + name:Literal["capacitance_fast"]= Field("capacitance_fast") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): + """ + Slow capacitance, in farads. + """ + name:Literal["capacitance_slow"]= Field("capacitance_slow") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): + """ + Resistance compensation bandwidth, in hertz. + """ + name:Literal["resistance_comp_bandwidth"]= Field("resistance_comp_bandwidth") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): + """ + Resistance compensation correction, in percent. + """ + name:Literal["resistance_comp_correction"]= Field("resistance_comp_correction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): + """ + Resistance compensation prediction, in percent. + """ + name:Literal["resistance_comp_prediction"]= Field("resistance_comp_prediction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): + """ + Whole cell capacitance compensation, in farads. + """ + name:Literal["whole_cell_capacitance_comp"]= Field("whole_cell_capacitance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): + """ + Whole cell series resistance compensation, in ohms. + """ + name:Literal["whole_cell_series_resistance_comp"]= Field("whole_cell_series_resistance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""") + value:float= Field(...) + + +class VoltageClampStimulusSeries(PatchClampSeries): + """ + Stimulus voltage applied during a voltage clamp recording. + """ + name:str= Field(...) + data:VoltageClampStimulusSeriesData= Field(..., description="""Stimulus voltage applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus voltage applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IntracellularElectrode(NWBContainer): + """ + An intracellular electrode and its metadata. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + filtering:Optional[str]= Field(None, description="""Electrode specific filtering.""") + initial_access_resistance:Optional[str]= Field(None, description="""Initial access resistance.""") + location:Optional[str]= Field(None, description="""Location of the electrode. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + resistance:Optional[str]= Field(None, description="""Electrode resistance, in ohms.""") + seal:Optional[str]= Field(None, description="""Information about seal used for recording.""") + slice:Optional[str]= Field(None, description="""Information about slice used for recording.""") + + +class SweepTable(DynamicTable): + """ + The table which groups different PatchClampSeries together. + """ + name:str= Field(...) + sweep_number:Optional[List[int]]= Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""") + series:Optional[List[PatchClampSeries]]= Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""") + series_index:SweepTableSeriesIndex= Field(..., description="""Index for series.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class SweepTableSeriesIndex(VectorIndex): + """ + Index for series. + """ + name:Literal["series_index"]= Field("series_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +PatchClampSeries.model_rebuild() +CurrentClampSeries.model_rebuild() +CurrentClampSeriesData.model_rebuild() +IZeroClampSeries.model_rebuild() +CurrentClampStimulusSeries.model_rebuild() +CurrentClampStimulusSeriesData.model_rebuild() +VoltageClampSeries.model_rebuild() +VoltageClampSeriesData.model_rebuild() +VoltageClampSeriesCapacitanceFast.model_rebuild() +VoltageClampSeriesCapacitanceSlow.model_rebuild() +VoltageClampSeriesResistanceCompBandwidth.model_rebuild() +VoltageClampSeriesResistanceCompCorrection.model_rebuild() +VoltageClampSeriesResistanceCompPrediction.model_rebuild() +VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() +VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() +VoltageClampStimulusSeries.model_rebuild() +VoltageClampStimulusSeriesData.model_rebuild() +IntracellularElectrode.model_rebuild() +SweepTable.model_rebuild() +SweepTableSeriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py new file mode 100644 index 0000000..c5f64a0 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_image.py @@ -0,0 +1,171 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + Image, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class GrayscaleImage(Image): + """ + A grayscale image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBImage(Image): + """ + A color image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBAImage(Image): + """ + A color image with transparency. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImageSeries(TimeSeries): + """ + General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ImageSeriesData(ConfiguredBaseModel): + """ + Binary data representing images across frames. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, * z"], Number] + ]]= Field(None) + + +class ImageMaskSeries(ImageSeries): + """ + An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeries(ImageSeries): + """ + Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. + """ + name:str= Field(...) + distance:Optional[float]= Field(None, description="""Distance from camera/monitor to target/eye.""") + field_of_view:Optional[OpticalSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + orientation:Optional[str]= Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""") + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class IndexSeries(TimeSeries): + """ + Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Index of the frame in the referenced ImageSeries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +GrayscaleImage.model_rebuild() +RGBImage.model_rebuild() +RGBAImage.model_rebuild() +ImageSeries.model_rebuild() +ImageSeriesData.model_rebuild() +ImageMaskSeries.model_rebuild() +OpticalSeries.model_rebuild() +OpticalSeriesFieldOfView.model_rebuild() +IndexSeries.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_language.py similarity index 82% rename from nwb_linkml/src/nwb_linkml/models/nwb_language.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_language.py index c2064e5..e0472a8 100644 --- a/nwb_linkml/src/nwb_linkml/models/nwb_language.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_language.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py new file mode 100644 index 0000000..2632ea3 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_misc.py @@ -0,0 +1,265 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from ...hdmf_common.v1_1_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class AbstractFeatureSeries(TimeSeries): + """ + Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. + """ + name:str= Field(...) + data:AbstractFeatureSeriesData= Field(..., description="""Values of each feature at each time.""") + feature_units:Optional[List[str]]= Field(default_factory=list, description="""Units of each feature.""") + features:List[str]= Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class AbstractFeatureSeriesData(ConfiguredBaseModel): + """ + Values of each feature at each time. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class AnnotationSeries(TimeSeries): + """ + Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. + """ + name:str= Field(...) + data:List[str]= Field(default_factory=list, description="""Annotations made during an experiment.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class IntervalSeries(TimeSeries): + """ + Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeries(TimeSeries): + """ + Spectral analysis of a time series, e.g. of an LFP or a speech signal. + """ + name:str= Field(...) + data:DecompositionSeriesData= Field(..., description="""Data decomposed into frequency bands.""") + metric:str= Field(..., description="""The metric used, e.g. phase, amplitude, power.""") + bands:DecompositionSeriesBands= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeriesData(ConfiguredBaseModel): + """ + Data decomposed into frequency bands. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]]= Field(None) + + +class DecompositionSeriesBands(DynamicTable): + """ + Table for describing the bands that this series was generated from. There should be one row in this table for each band. + """ + name:Literal["bands"]= Field("bands") + band_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the band, e.g. theta.""") + band_limits:DecompositionSeriesBandsBandLimits= Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""") + band_mean:List[float]= Field(default_factory=list, description="""The mean Gaussian filters, in Hz.""") + band_stdev:List[float]= Field(default_factory=list, description="""The standard deviation of Gaussian filters, in Hz.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class DecompositionSeriesBandsBandLimits(VectorData): + """ + Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center. + """ + name:Literal["band_limits"]= Field("band_limits") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class Units(DynamicTable): + """ + Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. + """ + name:str= Field(...) + spike_times_index:Optional[UnitsSpikeTimesIndex]= Field(None, description="""Index into the spike_times dataset.""") + spike_times:Optional[UnitsSpikeTimes]= Field(None, description="""Spike times for each unit.""") + obs_intervals_index:Optional[UnitsObsIntervalsIndex]= Field(None, description="""Index into the obs_intervals dataset.""") + obs_intervals:Optional[UnitsObsIntervals]= Field(None, description="""Observation intervals for each unit.""") + electrodes_index:Optional[UnitsElectrodesIndex]= Field(None, description="""Index into electrodes.""") + electrodes:Optional[UnitsElectrodes]= Field(None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Electrode group that each spike unit came from.""") + waveform_mean:Optional[UnitsWaveformMean]= Field(None, description="""Spike waveform mean for each spike unit.""") + waveform_sd:Optional[UnitsWaveformSd]= Field(None, description="""Spike waveform standard deviation for each spike unit.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class UnitsSpikeTimesIndex(VectorIndex): + """ + Index into the spike_times dataset. + """ + name:Literal["spike_times_index"]= Field("spike_times_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class UnitsSpikeTimes(VectorData): + """ + Spike times for each unit. + """ + name:Literal["spike_times"]= Field("spike_times") + resolution:Optional[float]= Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class UnitsObsIntervalsIndex(VectorIndex): + """ + Index into the obs_intervals dataset. + """ + name:Literal["obs_intervals_index"]= Field("obs_intervals_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class UnitsObsIntervals(VectorData): + """ + Observation intervals for each unit. + """ + name:Literal["obs_intervals"]= Field("obs_intervals") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class UnitsElectrodesIndex(VectorIndex): + """ + Index into electrodes. + """ + name:Literal["electrodes_index"]= Field("electrodes_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class UnitsElectrodes(DynamicTableRegion): + """ + Electrode that each spike unit came from, specified using a DynamicTableRegion. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class UnitsWaveformMean(VectorData): + """ + Spike waveform mean for each spike unit. + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class UnitsWaveformSd(VectorData): + """ + Spike waveform standard deviation for each spike unit. + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +AbstractFeatureSeries.model_rebuild() +AbstractFeatureSeriesData.model_rebuild() +AnnotationSeries.model_rebuild() +IntervalSeries.model_rebuild() +DecompositionSeries.model_rebuild() +DecompositionSeriesData.model_rebuild() +DecompositionSeriesBands.model_rebuild() +DecompositionSeriesBandsBandLimits.model_rebuild() +Units.model_rebuild() +UnitsSpikeTimesIndex.model_rebuild() +UnitsSpikeTimes.model_rebuild() +UnitsObsIntervalsIndex.model_rebuild() +UnitsObsIntervals.model_rebuild() +UnitsElectrodesIndex.model_rebuild() +UnitsElectrodes.model_rebuild() +UnitsWaveformMean.model_rebuild() +UnitsWaveformSd.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py similarity index 90% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_ogen.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py index b934a59..6b3f70e 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_ogen.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ogen.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -14,13 +15,13 @@ else: from .core_nwb_base import ( TimeSeriesStartingTime, TimeSeries, - TimeSeriesSync, - NWBContainer + NWBContainer, + TimeSeriesSync ) metamodel_version = "None" -version = "None" +version = "2.2.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -59,6 +60,6 @@ class OptogeneticStimulusSite(NWBContainer): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# OptogeneticSeries.model_rebuild() -# OptogeneticStimulusSite.model_rebuild() +OptogeneticSeries.model_rebuild() +OptogeneticStimulusSite.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py new file mode 100644 index 0000000..117dd76 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_ophys.py @@ -0,0 +1,275 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from .core_nwb_image import ( + ImageSeriesData, + ImageSeries +) + +from ...hdmf_common.v1_1_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TwoPhotonSeries(ImageSeries): + """ + Image stack recorded over time from 2-photon microscope. + """ + name:str= Field(...) + pmt_gain:Optional[float]= Field(None, description="""Photomultiplier gain.""") + scan_line_rate:Optional[float]= Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") + field_of_view:Optional[TwoPhotonSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TwoPhotonSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[NDArray[Shape["2 width_height, 3 width_height_depth"], Float32]]= Field(None) + + +class RoiResponseSeries(TimeSeries): + """ + ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. + """ + name:str= Field(...) + data:RoiResponseSeriesData= Field(..., description="""Signals from ROIs.""") + rois:RoiResponseSeriesRois= Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class RoiResponseSeriesData(ConfiguredBaseModel): + """ + Signals from ROIs. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_ROIs"], Number] + ]]= Field(None) + + +class RoiResponseSeriesRois(DynamicTableRegion): + """ + DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. + """ + name:Literal["rois"]= Field("rois") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class DfOverF(NWBDataInterface): + """ + dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""") + + +class Fluorescence(NWBDataInterface): + """ + Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""") + + +class ImageSegmentation(NWBDataInterface): + """ + Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. + """ + name:str= Field(...) + plane_segmentation:List[PlaneSegmentation]= Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""") + + +class PlaneSegmentation(DynamicTable): + """ + Results from image segmentation of a specific imaging plane. + """ + name:str= Field(...) + image_mask:Optional[PlaneSegmentationImageMask]= Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""") + pixel_mask_index:Optional[PlaneSegmentationPixelMaskIndex]= Field(None, description="""Index into pixel_mask.""") + pixel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + voxel_mask_index:Optional[PlaneSegmentationVoxelMaskIndex]= Field(None, description="""Index into voxel_mask.""") + voxel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + reference_images:Optional[List[ImageSeries]]= Field(default_factory=list, description="""Image stacks that the segmentation masks apply to.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class PlaneSegmentationImageMask(VectorData): + """ + ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero. + """ + name:Literal["image_mask"]= Field("image_mask") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class PlaneSegmentationPixelMaskIndex(VectorIndex): + """ + Index into pixel_mask. + """ + name:Literal["pixel_mask_index"]= Field("pixel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class PlaneSegmentationVoxelMaskIndex(VectorIndex): + """ + Index into voxel_mask. + """ + name:Literal["voxel_mask_index"]= Field("voxel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class ImagingPlane(NWBContainer): + """ + An imaging plane and its metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the imaging plane.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate:float= Field(..., description="""Rate that images are acquired, in Hz.""") + indicator:str= Field(..., description="""Calcium indicator.""") + location:str= Field(..., description="""Location of the imaging plane. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + manifold:Optional[ImagingPlaneManifold]= Field(None, description="""DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.""") + origin_coords:Optional[ImagingPlaneOriginCoords]= Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""") + grid_spacing:Optional[ImagingPlaneGridSpacing]= Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""") + reference_frame:Optional[str]= Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""") + optical_channel:OpticalChannel= Field(..., description="""An optical channel used to record from an imaging plane.""") + + +class ImagingPlaneManifold(ConfiguredBaseModel): + """ + DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. + """ + name:Literal["manifold"]= Field("manifold") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["* height, * width, 3 x_y_z"], Float32], + NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32] + ]]= Field(None) + + +class ImagingPlaneOriginCoords(ConfiguredBaseModel): + """ + Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). + """ + name:Literal["origin_coords"]= Field("origin_coords") + unit:Optional[str]= Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""") + array:Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]]= Field(None) + + +class ImagingPlaneGridSpacing(ConfiguredBaseModel): + """ + Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. + """ + name:Literal["grid_spacing"]= Field("grid_spacing") + unit:Optional[str]= Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""") + array:Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]]= Field(None) + + +class OpticalChannel(NWBContainer): + """ + An optical channel used to record from an imaging plane. + """ + name:str= Field(...) + description:str= Field(..., description="""Description or other notes about the channel.""") + emission_lambda:float= Field(..., description="""Emission wavelength for channel, in nm.""") + + +class MotionCorrection(NWBDataInterface): + """ + An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). + """ + name:str= Field(...) + corrected_image_stack:List[CorrectedImageStack]= Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""") + + +class CorrectedImageStack(NWBDataInterface): + """ + Reuslts from motion correction of an image stack. + """ + name:str= Field(...) + corrected:ImageSeries= Field(..., description="""Image stack with frames shifted to the common coordinates.""") + xy_translation:TimeSeries= Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TwoPhotonSeries.model_rebuild() +TwoPhotonSeriesFieldOfView.model_rebuild() +RoiResponseSeries.model_rebuild() +RoiResponseSeriesData.model_rebuild() +RoiResponseSeriesRois.model_rebuild() +DfOverF.model_rebuild() +Fluorescence.model_rebuild() +ImageSegmentation.model_rebuild() +PlaneSegmentation.model_rebuild() +PlaneSegmentationImageMask.model_rebuild() +PlaneSegmentationPixelMaskIndex.model_rebuild() +PlaneSegmentationVoxelMaskIndex.model_rebuild() +ImagingPlane.model_rebuild() +ImagingPlaneManifold.model_rebuild() +ImagingPlaneOriginCoords.model_rebuild() +ImagingPlaneGridSpacing.model_rebuild() +OpticalChannel.model_rebuild() +MotionCorrection.model_rebuild() +CorrectedImageStack.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py new file mode 100644 index 0000000..3df82af --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/core_nwb_retinotopy.py @@ -0,0 +1,184 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + NWBData +) + +from .core_nwb_image import ( + GrayscaleImage +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class RetinotopyMap(NWBData): + """ + Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns] + """ + name:str= Field(...) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class AxisMap(RetinotopyMap): + """ + Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity) + """ + name:str= Field(...) + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class RetinotopyImage(GrayscaleImage): + """ + Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns] + """ + name:str= Field(...) + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImagingRetinotopy(NWBDataInterface): + """ + Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. NOTE: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). + """ + name:str= Field(...) + axis_1_phase_map:ImagingRetinotopyAxis1PhaseMap= Field(..., description="""Phase response to stimulus on the first measured axis.""") + axis_1_power_map:Optional[ImagingRetinotopyAxis1PowerMap]= Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_2_phase_map:ImagingRetinotopyAxis2PhaseMap= Field(..., description="""Phase response to stimulus on the second measured axis.""") + axis_2_power_map:Optional[ImagingRetinotopyAxis2PowerMap]= Field(None, description="""Power response to stimulus on the second measured axis.""") + sign_map:ImagingRetinotopySignMap= Field(..., description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""") + axis_descriptions:List[str]= Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""") + focal_depth_image:ImagingRetinotopyFocalDepthImage= Field(..., description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""") + vasculature_image:ImagingRetinotopyVasculatureImage= Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""") + + +class ImagingRetinotopyAxis1PhaseMap(AxisMap): + """ + Phase response to stimulus on the first measured axis. + """ + name:Literal["axis_1_phase_map"]= Field("axis_1_phase_map") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class ImagingRetinotopyAxis1PowerMap(AxisMap): + """ + Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_1_power_map"]= Field("axis_1_power_map") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class ImagingRetinotopyAxis2PhaseMap(AxisMap): + """ + Phase response to stimulus on the second measured axis. + """ + name:Literal["axis_2_phase_map"]= Field("axis_2_phase_map") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class ImagingRetinotopyAxis2PowerMap(AxisMap): + """ + Power response to stimulus on the second measured axis. + """ + name:Literal["axis_2_power_map"]= Field("axis_2_power_map") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class ImagingRetinotopySignMap(RetinotopyMap): + """ + Sine of the angle between the direction of the gradient in axis_1 and axis_2. + """ + name:Literal["sign_map"]= Field("sign_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyFocalDepthImage(RetinotopyImage): + """ + Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. + """ + name:Literal["focal_depth_image"]= Field("focal_depth_image") + focal_depth:Optional[float]= Field(None, description="""Focal depth offset, in meters.""") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImagingRetinotopyVasculatureImage(RetinotopyImage): + """ + Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] + """ + name:Literal["vasculature_image"]= Field("vasculature_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +RetinotopyMap.model_rebuild() +AxisMap.model_rebuild() +RetinotopyImage.model_rebuild() +ImagingRetinotopy.model_rebuild() +ImagingRetinotopyAxis1PhaseMap.model_rebuild() +ImagingRetinotopyAxis1PowerMap.model_rebuild() +ImagingRetinotopyAxis2PhaseMap.model_rebuild() +ImagingRetinotopyAxis2PowerMap.model_rebuild() +ImagingRetinotopySignMap.model_rebuild() +ImagingRetinotopyFocalDepthImage.model_rebuild() +ImagingRetinotopyVasculatureImage.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/namespace.py new file mode 100644 index 0000000..67806a4 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_0/namespace.py @@ -0,0 +1,143 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_0.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_1_0.hdmf_common_table import ( + Data, + Index, + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + Container, + DynamicTable +) + +from .core_nwb_retinotopy import ( + RetinotopyMap, + AxisMap, + RetinotopyImage, + ImagingRetinotopy +) + +from .core_nwb_image import ( + GrayscaleImage, + RGBImage, + RGBAImage, + ImageSeries, + ImageMaskSeries, + OpticalSeries, + IndexSeries +) + +from .core_nwb_base import ( + NWBData, + Image, + NWBContainer, + NWBDataInterface, + TimeSeries, + ProcessingModule, + Images +) + +from .core_nwb_ophys import ( + TwoPhotonSeries, + RoiResponseSeries, + DfOverF, + Fluorescence, + ImageSegmentation, + ImagingPlane, + MotionCorrection +) + +from .core_nwb_device import ( + Device +) + +from .core_nwb_ogen import ( + OptogeneticSeries, + OptogeneticStimulusSite +) + +from .core_nwb_icephys import ( + PatchClampSeries, + CurrentClampSeries, + IZeroClampSeries, + CurrentClampStimulusSeries, + VoltageClampSeries, + VoltageClampStimulusSeries, + IntracellularElectrode, + SweepTable +) + +from .core_nwb_ecephys import ( + ElectricalSeries, + SpikeEventSeries, + FeatureExtraction, + EventDetection, + EventWaveform, + FilteredEphys, + LFP, + ElectrodeGroup, + ClusterWaveforms, + Clustering +) + +from .core_nwb_behavior import ( + SpatialSeries, + BehavioralEpochs, + BehavioralEvents, + BehavioralTimeSeries, + PupilTracking, + EyeTracking, + CompassDirection, + Position +) + +from .core_nwb_misc import ( + AbstractFeatureSeries, + AnnotationSeries, + IntervalSeries, + DecompositionSeries, + Units +) + +from .core_nwb_file import ( + NWBFile +) + +from .core_nwb_epoch import ( + TimeIntervals +) + + +metamodel_version = "None" +version = "2.2.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py new file mode 100644 index 0000000..eef9aa1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_base.py @@ -0,0 +1,149 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_2.hdmf_common_table import ( + Container, + DynamicTable, + Data +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBData(Data): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class Image(NWBData): + """ + An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). + """ + name:str= Field(...) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + array:Optional[Union[ + NDArray[Shape["* x, * y"], Number], + NDArray[Shape["* x, * y, 3 r_g_b"], Number], + NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number] + ]]= Field(None) + + +class NWBContainer(Container): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class NWBDataInterface(NWBContainer): + """ + An abstract data type for a generic container storing collections of data, as opposed to metadata. + """ + name:str= Field(...) + + +class TimeSeries(NWBDataInterface): + """ + General purpose time series. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + data:TimeSeriesData= Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TimeSeriesData(ConfiguredBaseModel): + """ + Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. + """ + name:Literal["data"]= Field("data") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""") + resolution:Optional[float]= Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Any], + NDArray[Shape["* num_times, * num_DIM2"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3, * num_DIM4"], Any] + ]]= Field(None) + + +class TimeSeriesStartingTime(ConfiguredBaseModel): + """ + Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. + """ + name:Literal["starting_time"]= Field("starting_time") + rate:Optional[float]= Field(None, description="""Sampling rate, in Hz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + value:float= Field(...) + + +class TimeSeriesSync(ConfiguredBaseModel): + """ + Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. + """ + name:Literal["sync"]= Field("sync") + + +class ProcessingModule(NWBContainer): + """ + A collection of processed data. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of processed data.""") + nwb_data_interface:Optional[List[NWBDataInterface]]= Field(default_factory=list, description="""Data objects stored in this collection.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""Tables stored in this collection.""") + + +class Images(NWBDataInterface): + """ + A collection of images. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of images.""") + image:List[Image]= Field(default_factory=list, description="""Images stored in this collection.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBData.model_rebuild() +Image.model_rebuild() +NWBContainer.model_rebuild() +NWBDataInterface.model_rebuild() +TimeSeries.model_rebuild() +TimeSeriesData.model_rebuild() +TimeSeriesStartingTime.model_rebuild() +TimeSeriesSync.model_rebuild() +ProcessingModule.model_rebuild() +Images.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py new file mode 100644 index 0000000..25bf2a2 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_behavior.py @@ -0,0 +1,135 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from .core_nwb_misc import ( + IntervalSeries +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class SpatialSeries(TimeSeries): + """ + Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. + """ + name:str= Field(...) + data:SpatialSeriesData= Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""") + reference_frame:Optional[str]= Field(None, description="""Description defining what exactly 'straight-ahead' means.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpatialSeriesData(ConfiguredBaseModel): + """ + 1-D or 2-D array storing position or direction relative to some reference frame. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class BehavioralEpochs(NWBDataInterface): + """ + TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. + """ + name:str= Field(...) + interval_series:Optional[List[IntervalSeries]]= Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""") + + +class BehavioralEvents(NWBDataInterface): + """ + TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing behavioral events.""") + + +class BehavioralTimeSeries(NWBDataInterface): + """ + TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""") + + +class PupilTracking(NWBDataInterface): + """ + Eye-tracking data, representing pupil size. + """ + name:str= Field(...) + time_series:List[TimeSeries]= Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""") + + +class EyeTracking(NWBDataInterface): + """ + Eye-tracking data, representing direction of gaze. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""") + + +class CompassDirection(NWBDataInterface): + """ + With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""") + + +class Position(NWBDataInterface): + """ + Position data, whether along the x, x/y or x/y/z axis. + """ + name:str= Field(...) + spatial_series:List[SpatialSeries]= Field(default_factory=list, description="""SpatialSeries object containing position data.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +SpatialSeries.model_rebuild() +SpatialSeriesData.model_rebuild() +BehavioralEpochs.model_rebuild() +BehavioralEvents.model_rebuild() +BehavioralTimeSeries.model_rebuild() +PupilTracking.model_rebuild() +EyeTracking.model_rebuild() +CompassDirection.model_rebuild() +Position.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_device.py new file mode 100644 index 0000000..487ddaa --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_device.py @@ -0,0 +1,45 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBContainer +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Device(NWBContainer): + """ + Metadata about a data acquisition device, e.g., recording system, electrode, microscope. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""") + manufacturer:Optional[str]= Field(None, description="""The name of the manufacturer of the device.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Device.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py new file mode 100644 index 0000000..86699fa --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ecephys.py @@ -0,0 +1,238 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_2.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ElectricalSeries(TimeSeries): + """ + A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. + """ + name:str= Field(...) + data:ElectricalSeriesData= Field(..., description="""Recorded voltage data.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ElectricalSeriesData(ConfiguredBaseModel): + """ + Recorded voltage data. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and 'channel_conversion' (if present).""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_channels"], Number], + NDArray[Shape["* num_times, * num_channels, * num_samples"], Number] + ]]= Field(None) + + +class ElectricalSeriesElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class SpikeEventSeries(ElectricalSeries): + """ + Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). + """ + name:str= Field(...) + data:SpikeEventSeriesData= Field(..., description="""Spike waveforms.""") + timestamps:List[float]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpikeEventSeriesData(ConfiguredBaseModel): + """ + Spike waveforms. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""") + array:Optional[Union[ + NDArray[Shape["* num_events, * num_samples"], Number], + NDArray[Shape["* num_events, * num_samples, * num_channels"], Number] + ]]= Field(None) + + +class FeatureExtraction(NWBDataInterface): + """ + Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. + """ + name:str= Field(...) + description:List[str]= Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""") + features:FeatureExtractionFeatures= Field(..., description="""Multi-dimensional array of features extracted from each event.""") + times:List[float]= Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""") + electrodes:FeatureExtractionElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + + +class FeatureExtractionFeatures(ConfiguredBaseModel): + """ + Multi-dimensional array of features extracted from each event. + """ + name:Literal["features"]= Field("features") + array:Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]]= Field(None) + + +class FeatureExtractionElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class EventDetection(NWBDataInterface): + """ + Detected spike events from voltage trace(s). + """ + name:str= Field(...) + detection_method:str= Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""") + source_idx:List[int]= Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""") + times:List[float]= Field(default_factory=list, description="""Timestamps of events, in seconds.""") + + +class EventWaveform(NWBDataInterface): + """ + Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. + """ + name:str= Field(...) + spike_event_series:Optional[List[SpikeEventSeries]]= Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""") + + +class FilteredEphys(NWBDataInterface): + """ + Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""") + + +class LFP(NWBDataInterface): + """ + LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""") + + +class ElectrodeGroup(NWBContainer): + """ + A physical grouping of electrodes, e.g. a shank of an array. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this electrode group.""") + location:Optional[str]= Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""") + position:Optional[Any]= Field(None, description="""stereotaxic or common framework coordinates""") + + +class ClusterWaveforms(NWBDataInterface): + """ + DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. + """ + name:str= Field(...) + waveform_filtering:str= Field(..., description="""Filtering applied to data before generating mean/sd""") + waveform_mean:ClusterWaveformsWaveformMean= Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""") + waveform_sd:ClusterWaveformsWaveformSd= Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""") + + +class ClusterWaveformsWaveformMean(ConfiguredBaseModel): + """ + The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled) + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class ClusterWaveformsWaveformSd(ConfiguredBaseModel): + """ + Stdev of waveforms for each cluster, using the same indices as in mean + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class Clustering(NWBDataInterface): + """ + DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""") + num:List[int]= Field(default_factory=list, description="""Cluster number of each event""") + peak_over_rms:List[float]= Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""") + times:List[float]= Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ElectricalSeries.model_rebuild() +ElectricalSeriesData.model_rebuild() +ElectricalSeriesElectrodes.model_rebuild() +SpikeEventSeries.model_rebuild() +SpikeEventSeriesData.model_rebuild() +FeatureExtraction.model_rebuild() +FeatureExtractionFeatures.model_rebuild() +FeatureExtractionElectrodes.model_rebuild() +EventDetection.model_rebuild() +EventWaveform.model_rebuild() +FilteredEphys.model_rebuild() +LFP.model_rebuild() +ElectrodeGroup.model_rebuild() +ClusterWaveforms.model_rebuild() +ClusterWaveformsWaveformMean.model_rebuild() +ClusterWaveformsWaveformSd.model_rebuild() +Clustering.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py new file mode 100644 index 0000000..de73223 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_epoch.py @@ -0,0 +1,74 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_2.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TimeIntervals(DynamicTable): + """ + A container for aggregating epoch data and the TimeSeries that each epoch applies to. + """ + name:str= Field(...) + start_time:Optional[List[float]]= Field(default_factory=list, description="""Start time of epoch, in seconds.""") + stop_time:Optional[List[float]]= Field(default_factory=list, description="""Stop time of epoch, in seconds.""") + tags:Optional[List[str]]= Field(default_factory=list, description="""User-defined tags that identify or categorize events.""") + tags_index:Optional[TimeIntervalsTagsIndex]= Field(None, description="""Index for tags.""") + timeseries:Optional[List[Any]]= Field(default_factory=list, description="""An index into a TimeSeries object.""") + timeseries_index:Optional[TimeIntervalsTimeseriesIndex]= Field(None, description="""Index for timeseries.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class TimeIntervalsTagsIndex(VectorIndex): + """ + Index for tags. + """ + name:Literal["tags_index"]= Field("tags_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class TimeIntervalsTimeseriesIndex(VectorIndex): + """ + Index for timeseries. + """ + name:Literal["timeseries_index"]= Field("timeseries_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TimeIntervals.model_rebuild() +TimeIntervalsTagsIndex.model_rebuild() +TimeIntervalsTimeseriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py new file mode 100644 index 0000000..bda145b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_file.py @@ -0,0 +1,220 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_epoch import ( + TimeIntervals +) + +from .core_nwb_icephys import ( + SweepTable, + IntracellularElectrode +) + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeries, + ProcessingModule, + NWBContainer +) + +from .core_nwb_ogen import ( + OptogeneticStimulusSite +) + +from .core_nwb_ophys import ( + ImagingPlane +) + +from .core_nwb_misc import ( + Units +) + +from .core_nwb_device import ( + Device +) + +from ...hdmf_common.v1_1_2.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBFile(NWBContainer): + """ + An NWB:N file storing cellular-based neurophysiology data from a single experimental session. + """ + name:Literal["root"]= Field("root") + nwb_version:Optional[str]= Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""") + file_create_date:List[datetime ]= Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""") + identifier:str= Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""") + session_description:str= Field(..., description="""A description of the experimental session and data in the file.""") + session_start_time:datetime = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""") + timestamps_reference_time:datetime = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""") + acquisition:Optional[List[Union[DynamicTable, NWBDataInterface]]]= Field(default_factory=list, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""") + analysis:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""") + scratch:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""") + processing:Optional[List[ProcessingModule]]= Field(default_factory=list, description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""") + stimulus:NWBFileStimulus= Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""") + general:NWBFileGeneral= Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""") + intervals:Optional[NWBFileIntervals]= Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""") + units:Optional[Units]= Field(None, description="""Data about sorted spike units.""") + + +class NWBFileStimulus(ConfiguredBaseModel): + """ + Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. + """ + name:Literal["stimulus"]= Field("stimulus") + presentation:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Stimuli presented during the experiment.""") + templates:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""") + + +class NWBFileGeneral(ConfiguredBaseModel): + """ + Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. + """ + name:Literal["general"]= Field("general") + data_collection:Optional[str]= Field(None, description="""Notes about data collection and analysis.""") + experiment_description:Optional[str]= Field(None, description="""General description of the experiment.""") + experimenter:Optional[List[str]]= Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""") + institution:Optional[str]= Field(None, description="""Institution(s) where experiment was performed.""") + keywords:Optional[List[str]]= Field(default_factory=list, description="""Terms to search over.""") + lab:Optional[str]= Field(None, description="""Laboratory where experiment was performed.""") + notes:Optional[str]= Field(None, description="""Notes about the experiment.""") + pharmacology:Optional[str]= Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""") + protocol:Optional[str]= Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""") + related_publications:Optional[List[str]]= Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""") + session_id:Optional[str]= Field(None, description="""Lab-specific ID for the session.""") + slices:Optional[str]= Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""") + source_script:Optional[NWBFileGeneralSourceScript]= Field(None, description="""Script file or link to public source code used to create this NWB file.""") + stimulus:Optional[str]= Field(None, description="""Notes about stimuli, such as how and where they were presented.""") + surgery:Optional[str]= Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""") + virus:Optional[str]= Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""") + nwb_container:Optional[List[NWBContainer]]= Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""") + devices:Optional[List[Device]]= Field(default_factory=list, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""") + subject:Optional[Subject]= Field(None, description="""Information about the animal or person from which the data was measured.""") + extracellular_ephys:Optional[NWBFileGeneralExtracellularEphys]= Field(None, description="""Metadata related to extracellular electrophysiology.""") + intracellular_ephys:Optional[NWBFileGeneralIntracellularEphys]= Field(None, description="""Metadata related to intracellular electrophysiology.""") + optogenetics:Optional[List[OptogeneticStimulusSite]]= Field(default_factory=list, description="""Metadata describing optogenetic stimuluation.""") + optophysiology:Optional[List[ImagingPlane]]= Field(default_factory=list, description="""Metadata related to optophysiology.""") + + +class NWBFileGeneralSourceScript(ConfiguredBaseModel): + """ + Script file or link to public source code used to create this NWB file. + """ + name:Literal["source_script"]= Field("source_script") + file_name:Optional[str]= Field(None, description="""Name of script file.""") + value:str= Field(...) + + +class Subject(NWBContainer): + """ + Information about the animal or person from which the data was measured. + """ + name:Literal["subject"]= Field("subject") + age:Optional[str]= Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + date_of_birth:Optional[datetime ]= Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""") + description:Optional[str]= Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""") + genotype:Optional[str]= Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") + sex:Optional[str]= Field(None, description="""Gender of subject.""") + species:Optional[str]= Field(None, description="""Species of subject.""") + subject_id:Optional[str]= Field(None, description="""ID of animal/person used/participating in experiment (lab convention).""") + weight:Optional[str]= Field(None, description="""Weight at time of experiment, at time of surgery and at other important times.""") + + +class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): + """ + Metadata related to extracellular electrophysiology. + """ + name:Literal["extracellular_ephys"]= Field("extracellular_ephys") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Physical group of electrodes.""") + electrodes:Optional[NWBFileGeneralExtracellularEphysElectrodes]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + + +class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): + """ + A table of all electrodes (i.e. channels) used for recording. + """ + name:Literal["electrodes"]= Field("electrodes") + x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""") + y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""") + z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""") + imp:Optional[List[float]]= Field(default_factory=list, description="""Impedance of the channel.""") + location:Optional[List[str]]= Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + filtering:Optional[List[float]]= Field(default_factory=list, description="""Description of hardware filtering.""") + group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""") + group_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""") + rel_x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate in electrode group""") + rel_y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate in electrode group""") + rel_z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate in electrode group""") + reference:Optional[List[str]]= Field(default_factory=list, description="""Description of the reference used for this electrode.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): + """ + Metadata related to intracellular electrophysiology. + """ + name:Literal["intracellular_ephys"]= Field("intracellular_ephys") + filtering:Optional[str]= Field(None, description="""Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") + intracellular_electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""An intracellular electrode.""") + sweep_table:Optional[SweepTable]= Field(None, description="""The table which groups different PatchClampSeries together.""") + + +class NWBFileIntervals(ConfiguredBaseModel): + """ + Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data. + """ + name:Literal["intervals"]= Field("intervals") + epochs:Optional[TimeIntervals]= Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""") + trials:Optional[TimeIntervals]= Field(None, description="""Repeated experimental events that have a logical grouping.""") + invalid_times:Optional[TimeIntervals]= Field(None, description="""Time intervals that should be removed from analysis.""") + time_intervals:Optional[List[TimeIntervals]]= Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBFile.model_rebuild() +NWBFileStimulus.model_rebuild() +NWBFileGeneral.model_rebuild() +NWBFileGeneralSourceScript.model_rebuild() +Subject.model_rebuild() +NWBFileGeneralExtracellularEphys.model_rebuild() +NWBFileGeneralExtracellularEphysElectrodes.model_rebuild() +NWBFileGeneralIntracellularEphys.model_rebuild() +NWBFileIntervals.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py new file mode 100644 index 0000000..88f3309 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_icephys.py @@ -0,0 +1,321 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_2.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class PatchClampSeries(TimeSeries): + """ + An abstract base class for patch-clamp data - stimulus or response, current or voltage. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + data:List[float]= Field(default_factory=list, description="""Recorded voltage or current.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeries(PatchClampSeries): + """ + Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. + """ + name:str= Field(...) + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + bias_current:Optional[float]= Field(None, description="""Bias current, in amps.""") + bridge_balance:Optional[float]= Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation:Optional[float]= Field(None, description="""Capacitance compensation, in farads.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeriesData(ConfiguredBaseModel): + """ + Recorded voltage. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IZeroClampSeries(CurrentClampSeries): + """ + Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. + """ + name:str= Field(...) + bias_current:float= Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance:float= Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation:float= Field(..., description="""Capacitance compensation, in farads, fixed to 0.0.""") + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeries(PatchClampSeries): + """ + Stimulus current applied during current clamp recording. + """ + name:str= Field(...) + data:CurrentClampStimulusSeriesData= Field(..., description="""Stimulus current applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus current applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeries(PatchClampSeries): + """ + Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. + """ + name:str= Field(...) + data:VoltageClampSeriesData= Field(..., description="""Recorded current.""") + capacitance_fast:Optional[VoltageClampSeriesCapacitanceFast]= Field(None, description="""Fast capacitance, in farads.""") + capacitance_slow:Optional[VoltageClampSeriesCapacitanceSlow]= Field(None, description="""Slow capacitance, in farads.""") + resistance_comp_bandwidth:Optional[VoltageClampSeriesResistanceCompBandwidth]= Field(None, description="""Resistance compensation bandwidth, in hertz.""") + resistance_comp_correction:Optional[VoltageClampSeriesResistanceCompCorrection]= Field(None, description="""Resistance compensation correction, in percent.""") + resistance_comp_prediction:Optional[VoltageClampSeriesResistanceCompPrediction]= Field(None, description="""Resistance compensation prediction, in percent.""") + whole_cell_capacitance_comp:Optional[VoltageClampSeriesWholeCellCapacitanceComp]= Field(None, description="""Whole cell capacitance compensation, in farads.""") + whole_cell_series_resistance_comp:Optional[VoltageClampSeriesWholeCellSeriesResistanceComp]= Field(None, description="""Whole cell series resistance compensation, in ohms.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampSeriesData(ConfiguredBaseModel): + """ + Recorded current. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): + """ + Fast capacitance, in farads. + """ + name:Literal["capacitance_fast"]= Field("capacitance_fast") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): + """ + Slow capacitance, in farads. + """ + name:Literal["capacitance_slow"]= Field("capacitance_slow") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): + """ + Resistance compensation bandwidth, in hertz. + """ + name:Literal["resistance_comp_bandwidth"]= Field("resistance_comp_bandwidth") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): + """ + Resistance compensation correction, in percent. + """ + name:Literal["resistance_comp_correction"]= Field("resistance_comp_correction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): + """ + Resistance compensation prediction, in percent. + """ + name:Literal["resistance_comp_prediction"]= Field("resistance_comp_prediction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): + """ + Whole cell capacitance compensation, in farads. + """ + name:Literal["whole_cell_capacitance_comp"]= Field("whole_cell_capacitance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): + """ + Whole cell series resistance compensation, in ohms. + """ + name:Literal["whole_cell_series_resistance_comp"]= Field("whole_cell_series_resistance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""") + value:float= Field(...) + + +class VoltageClampStimulusSeries(PatchClampSeries): + """ + Stimulus voltage applied during a voltage clamp recording. + """ + name:str= Field(...) + data:VoltageClampStimulusSeriesData= Field(..., description="""Stimulus voltage applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus voltage applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IntracellularElectrode(NWBContainer): + """ + An intracellular electrode and its metadata. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + filtering:Optional[str]= Field(None, description="""Electrode specific filtering.""") + initial_access_resistance:Optional[str]= Field(None, description="""Initial access resistance.""") + location:Optional[str]= Field(None, description="""Location of the electrode. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + resistance:Optional[str]= Field(None, description="""Electrode resistance, in ohms.""") + seal:Optional[str]= Field(None, description="""Information about seal used for recording.""") + slice:Optional[str]= Field(None, description="""Information about slice used for recording.""") + + +class SweepTable(DynamicTable): + """ + The table which groups different PatchClampSeries together. + """ + name:str= Field(...) + sweep_number:Optional[List[int]]= Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""") + series:Optional[List[PatchClampSeries]]= Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""") + series_index:SweepTableSeriesIndex= Field(..., description="""Index for series.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class SweepTableSeriesIndex(VectorIndex): + """ + Index for series. + """ + name:Literal["series_index"]= Field("series_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +PatchClampSeries.model_rebuild() +CurrentClampSeries.model_rebuild() +CurrentClampSeriesData.model_rebuild() +IZeroClampSeries.model_rebuild() +CurrentClampStimulusSeries.model_rebuild() +CurrentClampStimulusSeriesData.model_rebuild() +VoltageClampSeries.model_rebuild() +VoltageClampSeriesData.model_rebuild() +VoltageClampSeriesCapacitanceFast.model_rebuild() +VoltageClampSeriesCapacitanceSlow.model_rebuild() +VoltageClampSeriesResistanceCompBandwidth.model_rebuild() +VoltageClampSeriesResistanceCompCorrection.model_rebuild() +VoltageClampSeriesResistanceCompPrediction.model_rebuild() +VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() +VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() +VoltageClampStimulusSeries.model_rebuild() +VoltageClampStimulusSeriesData.model_rebuild() +IntracellularElectrode.model_rebuild() +SweepTable.model_rebuild() +SweepTableSeriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py new file mode 100644 index 0000000..9b2712e --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_image.py @@ -0,0 +1,171 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + Image, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class GrayscaleImage(Image): + """ + A grayscale image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBImage(Image): + """ + A color image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBAImage(Image): + """ + A color image with transparency. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImageSeries(TimeSeries): + """ + General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ImageSeriesData(ConfiguredBaseModel): + """ + Binary data representing images across frames. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, * z"], Number] + ]]= Field(None) + + +class ImageMaskSeries(ImageSeries): + """ + An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeries(ImageSeries): + """ + Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. + """ + name:str= Field(...) + distance:Optional[float]= Field(None, description="""Distance from camera/monitor to target/eye.""") + field_of_view:Optional[OpticalSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + orientation:Optional[str]= Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""") + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class IndexSeries(TimeSeries): + """ + Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Index of the frame in the referenced ImageSeries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +GrayscaleImage.model_rebuild() +RGBImage.model_rebuild() +RGBAImage.model_rebuild() +ImageSeries.model_rebuild() +ImageSeriesData.model_rebuild() +ImageMaskSeries.model_rebuild() +OpticalSeries.model_rebuild() +OpticalSeriesFieldOfView.model_rebuild() +IndexSeries.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py new file mode 100644 index 0000000..4bd3bdf --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_misc.py @@ -0,0 +1,265 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from ...hdmf_common.v1_1_2.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class AbstractFeatureSeries(TimeSeries): + """ + Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. + """ + name:str= Field(...) + data:AbstractFeatureSeriesData= Field(..., description="""Values of each feature at each time.""") + feature_units:Optional[List[str]]= Field(default_factory=list, description="""Units of each feature.""") + features:List[str]= Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class AbstractFeatureSeriesData(ConfiguredBaseModel): + """ + Values of each feature at each time. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class AnnotationSeries(TimeSeries): + """ + Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. + """ + name:str= Field(...) + data:List[str]= Field(default_factory=list, description="""Annotations made during an experiment.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class IntervalSeries(TimeSeries): + """ + Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeries(TimeSeries): + """ + Spectral analysis of a time series, e.g. of an LFP or a speech signal. + """ + name:str= Field(...) + data:DecompositionSeriesData= Field(..., description="""Data decomposed into frequency bands.""") + metric:str= Field(..., description="""The metric used, e.g. phase, amplitude, power.""") + bands:DecompositionSeriesBands= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeriesData(ConfiguredBaseModel): + """ + Data decomposed into frequency bands. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]]= Field(None) + + +class DecompositionSeriesBands(DynamicTable): + """ + Table for describing the bands that this series was generated from. There should be one row in this table for each band. + """ + name:Literal["bands"]= Field("bands") + band_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the band, e.g. theta.""") + band_limits:DecompositionSeriesBandsBandLimits= Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""") + band_mean:List[float]= Field(default_factory=list, description="""The mean Gaussian filters, in Hz.""") + band_stdev:List[float]= Field(default_factory=list, description="""The standard deviation of Gaussian filters, in Hz.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class DecompositionSeriesBandsBandLimits(VectorData): + """ + Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center. + """ + name:Literal["band_limits"]= Field("band_limits") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class Units(DynamicTable): + """ + Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. + """ + name:str= Field(...) + spike_times_index:Optional[UnitsSpikeTimesIndex]= Field(None, description="""Index into the spike_times dataset.""") + spike_times:Optional[UnitsSpikeTimes]= Field(None, description="""Spike times for each unit.""") + obs_intervals_index:Optional[UnitsObsIntervalsIndex]= Field(None, description="""Index into the obs_intervals dataset.""") + obs_intervals:Optional[UnitsObsIntervals]= Field(None, description="""Observation intervals for each unit.""") + electrodes_index:Optional[UnitsElectrodesIndex]= Field(None, description="""Index into electrodes.""") + electrodes:Optional[UnitsElectrodes]= Field(None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Electrode group that each spike unit came from.""") + waveform_mean:Optional[UnitsWaveformMean]= Field(None, description="""Spike waveform mean for each spike unit.""") + waveform_sd:Optional[UnitsWaveformSd]= Field(None, description="""Spike waveform standard deviation for each spike unit.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class UnitsSpikeTimesIndex(VectorIndex): + """ + Index into the spike_times dataset. + """ + name:Literal["spike_times_index"]= Field("spike_times_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class UnitsSpikeTimes(VectorData): + """ + Spike times for each unit. + """ + name:Literal["spike_times"]= Field("spike_times") + resolution:Optional[float]= Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class UnitsObsIntervalsIndex(VectorIndex): + """ + Index into the obs_intervals dataset. + """ + name:Literal["obs_intervals_index"]= Field("obs_intervals_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class UnitsObsIntervals(VectorData): + """ + Observation intervals for each unit. + """ + name:Literal["obs_intervals"]= Field("obs_intervals") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class UnitsElectrodesIndex(VectorIndex): + """ + Index into electrodes. + """ + name:Literal["electrodes_index"]= Field("electrodes_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class UnitsElectrodes(DynamicTableRegion): + """ + Electrode that each spike unit came from, specified using a DynamicTableRegion. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class UnitsWaveformMean(VectorData): + """ + Spike waveform mean for each spike unit. + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class UnitsWaveformSd(VectorData): + """ + Spike waveform standard deviation for each spike unit. + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +AbstractFeatureSeries.model_rebuild() +AbstractFeatureSeriesData.model_rebuild() +AnnotationSeries.model_rebuild() +IntervalSeries.model_rebuild() +DecompositionSeries.model_rebuild() +DecompositionSeriesData.model_rebuild() +DecompositionSeriesBands.model_rebuild() +DecompositionSeriesBandsBandLimits.model_rebuild() +Units.model_rebuild() +UnitsSpikeTimesIndex.model_rebuild() +UnitsSpikeTimes.model_rebuild() +UnitsObsIntervalsIndex.model_rebuild() +UnitsObsIntervals.model_rebuild() +UnitsElectrodesIndex.model_rebuild() +UnitsElectrodes.model_rebuild() +UnitsWaveformMean.model_rebuild() +UnitsWaveformSd.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py new file mode 100644 index 0000000..0882804 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ogen.py @@ -0,0 +1,65 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeries, + NWBContainer, + TimeSeriesSync +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class OptogeneticSeries(TimeSeries): + """ + An optogenetic stimulus. + """ + name:str= Field(...) + data:List[float]= Field(default_factory=list, description="""Applied power for optogenetic stimulus, in watts.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OptogeneticStimulusSite(NWBContainer): + """ + A site of optogenetic stimulation. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of stimulation site.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + location:str= Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +OptogeneticSeries.model_rebuild() +OptogeneticStimulusSite.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py new file mode 100644 index 0000000..af5f121 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_ophys.py @@ -0,0 +1,275 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from .core_nwb_image import ( + ImageSeriesData, + ImageSeries +) + +from ...hdmf_common.v1_1_2.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TwoPhotonSeries(ImageSeries): + """ + Image stack recorded over time from 2-photon microscope. + """ + name:str= Field(...) + pmt_gain:Optional[float]= Field(None, description="""Photomultiplier gain.""") + scan_line_rate:Optional[float]= Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") + field_of_view:Optional[TwoPhotonSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TwoPhotonSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[NDArray[Shape["2 width_height, 3 width_height_depth"], Float32]]= Field(None) + + +class RoiResponseSeries(TimeSeries): + """ + ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. + """ + name:str= Field(...) + data:RoiResponseSeriesData= Field(..., description="""Signals from ROIs.""") + rois:RoiResponseSeriesRois= Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class RoiResponseSeriesData(ConfiguredBaseModel): + """ + Signals from ROIs. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_ROIs"], Number] + ]]= Field(None) + + +class RoiResponseSeriesRois(DynamicTableRegion): + """ + DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. + """ + name:Literal["rois"]= Field("rois") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class DfOverF(NWBDataInterface): + """ + dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""") + + +class Fluorescence(NWBDataInterface): + """ + Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""") + + +class ImageSegmentation(NWBDataInterface): + """ + Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. + """ + name:str= Field(...) + plane_segmentation:List[PlaneSegmentation]= Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""") + + +class PlaneSegmentation(DynamicTable): + """ + Results from image segmentation of a specific imaging plane. + """ + name:str= Field(...) + image_mask:Optional[PlaneSegmentationImageMask]= Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""") + pixel_mask_index:Optional[PlaneSegmentationPixelMaskIndex]= Field(None, description="""Index into pixel_mask.""") + pixel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + voxel_mask_index:Optional[PlaneSegmentationVoxelMaskIndex]= Field(None, description="""Index into voxel_mask.""") + voxel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + reference_images:Optional[List[ImageSeries]]= Field(default_factory=list, description="""Image stacks that the segmentation masks apply to.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class PlaneSegmentationImageMask(VectorData): + """ + ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero. + """ + name:Literal["image_mask"]= Field("image_mask") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class PlaneSegmentationPixelMaskIndex(VectorIndex): + """ + Index into pixel_mask. + """ + name:Literal["pixel_mask_index"]= Field("pixel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class PlaneSegmentationVoxelMaskIndex(VectorIndex): + """ + Index into voxel_mask. + """ + name:Literal["voxel_mask_index"]= Field("voxel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class ImagingPlane(NWBContainer): + """ + An imaging plane and its metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the imaging plane.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate:float= Field(..., description="""Rate that images are acquired, in Hz.""") + indicator:str= Field(..., description="""Calcium indicator.""") + location:str= Field(..., description="""Location of the imaging plane. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + manifold:Optional[ImagingPlaneManifold]= Field(None, description="""DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.""") + origin_coords:Optional[ImagingPlaneOriginCoords]= Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""") + grid_spacing:Optional[ImagingPlaneGridSpacing]= Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""") + reference_frame:Optional[str]= Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""") + optical_channel:OpticalChannel= Field(..., description="""An optical channel used to record from an imaging plane.""") + + +class ImagingPlaneManifold(ConfiguredBaseModel): + """ + DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. + """ + name:Literal["manifold"]= Field("manifold") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["* height, * width, 3 x_y_z"], Float32], + NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32] + ]]= Field(None) + + +class ImagingPlaneOriginCoords(ConfiguredBaseModel): + """ + Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). + """ + name:Literal["origin_coords"]= Field("origin_coords") + unit:Optional[str]= Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""") + array:Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]]= Field(None) + + +class ImagingPlaneGridSpacing(ConfiguredBaseModel): + """ + Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. + """ + name:Literal["grid_spacing"]= Field("grid_spacing") + unit:Optional[str]= Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""") + array:Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]]= Field(None) + + +class OpticalChannel(NWBContainer): + """ + An optical channel used to record from an imaging plane. + """ + name:str= Field(...) + description:str= Field(..., description="""Description or other notes about the channel.""") + emission_lambda:float= Field(..., description="""Emission wavelength for channel, in nm.""") + + +class MotionCorrection(NWBDataInterface): + """ + An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). + """ + name:str= Field(...) + corrected_image_stack:List[CorrectedImageStack]= Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""") + + +class CorrectedImageStack(NWBDataInterface): + """ + Reuslts from motion correction of an image stack. + """ + name:str= Field(...) + corrected:ImageSeries= Field(..., description="""Image stack with frames shifted to the common coordinates.""") + xy_translation:TimeSeries= Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TwoPhotonSeries.model_rebuild() +TwoPhotonSeriesFieldOfView.model_rebuild() +RoiResponseSeries.model_rebuild() +RoiResponseSeriesData.model_rebuild() +RoiResponseSeriesRois.model_rebuild() +DfOverF.model_rebuild() +Fluorescence.model_rebuild() +ImageSegmentation.model_rebuild() +PlaneSegmentation.model_rebuild() +PlaneSegmentationImageMask.model_rebuild() +PlaneSegmentationPixelMaskIndex.model_rebuild() +PlaneSegmentationVoxelMaskIndex.model_rebuild() +ImagingPlane.model_rebuild() +ImagingPlaneManifold.model_rebuild() +ImagingPlaneOriginCoords.model_rebuild() +ImagingPlaneGridSpacing.model_rebuild() +OpticalChannel.model_rebuild() +MotionCorrection.model_rebuild() +CorrectedImageStack.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py new file mode 100644 index 0000000..65d8377 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/core_nwb_retinotopy.py @@ -0,0 +1,184 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + NWBData +) + +from .core_nwb_image import ( + GrayscaleImage +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class RetinotopyMap(NWBData): + """ + Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns] + """ + name:str= Field(...) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class AxisMap(RetinotopyMap): + """ + Abstract two-dimensional map of responses to stimuli along a single response axis (e.g. eccentricity) + """ + name:str= Field(...) + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class RetinotopyImage(GrayscaleImage): + """ + Gray-scale image related to retinotopic mapping. Array structure: [num_rows][num_columns] + """ + name:str= Field(...) + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImagingRetinotopy(NWBDataInterface): + """ + Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. NOTE: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). + """ + name:str= Field(...) + axis_1_phase_map:ImagingRetinotopyAxis1PhaseMap= Field(..., description="""Phase response to stimulus on the first measured axis.""") + axis_1_power_map:Optional[ImagingRetinotopyAxis1PowerMap]= Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_2_phase_map:ImagingRetinotopyAxis2PhaseMap= Field(..., description="""Phase response to stimulus on the second measured axis.""") + axis_2_power_map:Optional[ImagingRetinotopyAxis2PowerMap]= Field(None, description="""Power response to stimulus on the second measured axis.""") + sign_map:ImagingRetinotopySignMap= Field(..., description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""") + axis_descriptions:List[str]= Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""") + focal_depth_image:ImagingRetinotopyFocalDepthImage= Field(..., description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""") + vasculature_image:ImagingRetinotopyVasculatureImage= Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""") + + +class ImagingRetinotopyAxis1PhaseMap(AxisMap): + """ + Phase response to stimulus on the first measured axis. + """ + name:Literal["axis_1_phase_map"]= Field("axis_1_phase_map") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class ImagingRetinotopyAxis1PowerMap(AxisMap): + """ + Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_1_power_map"]= Field("axis_1_power_map") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class ImagingRetinotopyAxis2PhaseMap(AxisMap): + """ + Phase response to stimulus on the second measured axis. + """ + name:Literal["axis_2_phase_map"]= Field("axis_2_phase_map") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class ImagingRetinotopyAxis2PowerMap(AxisMap): + """ + Power response to stimulus on the second measured axis. + """ + name:Literal["axis_2_power_map"]= Field("axis_2_power_map") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + + +class ImagingRetinotopySignMap(RetinotopyMap): + """ + Sine of the angle between the direction of the gradient in axis_1 and axis_2. + """ + name:Literal["sign_map"]= Field("sign_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyFocalDepthImage(RetinotopyImage): + """ + Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. + """ + name:Literal["focal_depth_image"]= Field("focal_depth_image") + focal_depth:Optional[float]= Field(None, description="""Focal depth offset, in meters.""") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImagingRetinotopyVasculatureImage(RetinotopyImage): + """ + Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] + """ + name:Literal["vasculature_image"]= Field("vasculature_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +RetinotopyMap.model_rebuild() +AxisMap.model_rebuild() +RetinotopyImage.model_rebuild() +ImagingRetinotopy.model_rebuild() +ImagingRetinotopyAxis1PhaseMap.model_rebuild() +ImagingRetinotopyAxis1PowerMap.model_rebuild() +ImagingRetinotopyAxis2PhaseMap.model_rebuild() +ImagingRetinotopyAxis2PowerMap.model_rebuild() +ImagingRetinotopySignMap.model_rebuild() +ImagingRetinotopyFocalDepthImage.model_rebuild() +ImagingRetinotopyVasculatureImage.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/namespace.py new file mode 100644 index 0000000..73510bf --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_1/namespace.py @@ -0,0 +1,143 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_2.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_1_2.hdmf_common_table import ( + Data, + Index, + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + Container, + DynamicTable +) + +from .core_nwb_retinotopy import ( + RetinotopyMap, + AxisMap, + RetinotopyImage, + ImagingRetinotopy +) + +from .core_nwb_image import ( + GrayscaleImage, + RGBImage, + RGBAImage, + ImageSeries, + ImageMaskSeries, + OpticalSeries, + IndexSeries +) + +from .core_nwb_base import ( + NWBData, + Image, + NWBContainer, + NWBDataInterface, + TimeSeries, + ProcessingModule, + Images +) + +from .core_nwb_ophys import ( + TwoPhotonSeries, + RoiResponseSeries, + DfOverF, + Fluorescence, + ImageSegmentation, + ImagingPlane, + MotionCorrection +) + +from .core_nwb_device import ( + Device +) + +from .core_nwb_ogen import ( + OptogeneticSeries, + OptogeneticStimulusSite +) + +from .core_nwb_icephys import ( + PatchClampSeries, + CurrentClampSeries, + IZeroClampSeries, + CurrentClampStimulusSeries, + VoltageClampSeries, + VoltageClampStimulusSeries, + IntracellularElectrode, + SweepTable +) + +from .core_nwb_ecephys import ( + ElectricalSeries, + SpikeEventSeries, + FeatureExtraction, + EventDetection, + EventWaveform, + FilteredEphys, + LFP, + ElectrodeGroup, + ClusterWaveforms, + Clustering +) + +from .core_nwb_behavior import ( + SpatialSeries, + BehavioralEpochs, + BehavioralEvents, + BehavioralTimeSeries, + PupilTracking, + EyeTracking, + CompassDirection, + Position +) + +from .core_nwb_misc import ( + AbstractFeatureSeries, + AnnotationSeries, + IntervalSeries, + DecompositionSeries, + Units +) + +from .core_nwb_file import ( + NWBFile +) + +from .core_nwb_epoch import ( + TimeIntervals +) + + +metamodel_version = "None" +version = "2.2.1" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py new file mode 100644 index 0000000..f2f4cf4 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_base.py @@ -0,0 +1,149 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + Container, + DynamicTable, + Data +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBData(Data): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class Image(NWBData): + """ + An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). + """ + name:str= Field(...) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + array:Optional[Union[ + NDArray[Shape["* x, * y"], Number], + NDArray[Shape["* x, * y, 3 r_g_b"], Number], + NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number] + ]]= Field(None) + + +class NWBContainer(Container): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class NWBDataInterface(NWBContainer): + """ + An abstract data type for a generic container storing collections of data, as opposed to metadata. + """ + name:str= Field(...) + + +class TimeSeries(NWBDataInterface): + """ + General purpose time series. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + data:TimeSeriesData= Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TimeSeriesData(ConfiguredBaseModel): + """ + Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. + """ + name:Literal["data"]= Field("data") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""") + resolution:Optional[float]= Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Any], + NDArray[Shape["* num_times, * num_DIM2"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3, * num_DIM4"], Any] + ]]= Field(None) + + +class TimeSeriesStartingTime(ConfiguredBaseModel): + """ + Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. + """ + name:Literal["starting_time"]= Field("starting_time") + rate:Optional[float]= Field(None, description="""Sampling rate, in Hz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + value:float= Field(...) + + +class TimeSeriesSync(ConfiguredBaseModel): + """ + Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. + """ + name:Literal["sync"]= Field("sync") + + +class ProcessingModule(NWBContainer): + """ + A collection of processed data. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of processed data.""") + nwb_data_interface:Optional[List[NWBDataInterface]]= Field(default_factory=list, description="""Data objects stored in this collection.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""Tables stored in this collection.""") + + +class Images(NWBDataInterface): + """ + A collection of images. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of images.""") + image:List[Image]= Field(default_factory=list, description="""Images stored in this collection.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBData.model_rebuild() +Image.model_rebuild() +NWBContainer.model_rebuild() +NWBDataInterface.model_rebuild() +TimeSeries.model_rebuild() +TimeSeriesData.model_rebuild() +TimeSeriesStartingTime.model_rebuild() +TimeSeriesSync.model_rebuild() +ProcessingModule.model_rebuild() +Images.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py new file mode 100644 index 0000000..3a59011 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_behavior.py @@ -0,0 +1,135 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from .core_nwb_misc import ( + IntervalSeries +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class SpatialSeries(TimeSeries): + """ + Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. + """ + name:str= Field(...) + data:SpatialSeriesData= Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""") + reference_frame:Optional[str]= Field(None, description="""Description defining what exactly 'straight-ahead' means.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpatialSeriesData(ConfiguredBaseModel): + """ + 1-D or 2-D array storing position or direction relative to some reference frame. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class BehavioralEpochs(NWBDataInterface): + """ + TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. + """ + name:str= Field(...) + interval_series:Optional[List[IntervalSeries]]= Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""") + + +class BehavioralEvents(NWBDataInterface): + """ + TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing behavioral events.""") + + +class BehavioralTimeSeries(NWBDataInterface): + """ + TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""") + + +class PupilTracking(NWBDataInterface): + """ + Eye-tracking data, representing pupil size. + """ + name:str= Field(...) + time_series:List[TimeSeries]= Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""") + + +class EyeTracking(NWBDataInterface): + """ + Eye-tracking data, representing direction of gaze. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""") + + +class CompassDirection(NWBDataInterface): + """ + With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""") + + +class Position(NWBDataInterface): + """ + Position data, whether along the x, x/y or x/y/z axis. + """ + name:str= Field(...) + spatial_series:List[SpatialSeries]= Field(default_factory=list, description="""SpatialSeries object containing position data.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +SpatialSeries.model_rebuild() +SpatialSeriesData.model_rebuild() +BehavioralEpochs.model_rebuild() +BehavioralEvents.model_rebuild() +BehavioralTimeSeries.model_rebuild() +PupilTracking.model_rebuild() +EyeTracking.model_rebuild() +CompassDirection.model_rebuild() +Position.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_device.py new file mode 100644 index 0000000..a9af780 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_device.py @@ -0,0 +1,45 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBContainer +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Device(NWBContainer): + """ + Metadata about a data acquisition device, e.g., recording system, electrode, microscope. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""") + manufacturer:Optional[str]= Field(None, description="""The name of the manufacturer of the device.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Device.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py new file mode 100644 index 0000000..f7cc2aa --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ecephys.py @@ -0,0 +1,250 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ElectricalSeries(TimeSeries): + """ + A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. + """ + name:str= Field(...) + data:ElectricalSeriesData= Field(..., description="""Recorded voltage data.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ElectricalSeriesData(ConfiguredBaseModel): + """ + Recorded voltage data. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and 'channel_conversion' (if present).""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_channels"], Number], + NDArray[Shape["* num_times, * num_channels, * num_samples"], Number] + ]]= Field(None) + + +class ElectricalSeriesElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SpikeEventSeries(ElectricalSeries): + """ + Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). + """ + name:str= Field(...) + data:SpikeEventSeriesData= Field(..., description="""Spike waveforms.""") + timestamps:List[float]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpikeEventSeriesData(ConfiguredBaseModel): + """ + Spike waveforms. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""") + array:Optional[Union[ + NDArray[Shape["* num_events, * num_samples"], Number], + NDArray[Shape["* num_events, * num_samples, * num_channels"], Number] + ]]= Field(None) + + +class FeatureExtraction(NWBDataInterface): + """ + Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. + """ + name:str= Field(...) + description:List[str]= Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""") + features:FeatureExtractionFeatures= Field(..., description="""Multi-dimensional array of features extracted from each event.""") + times:List[float]= Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""") + electrodes:FeatureExtractionElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + + +class FeatureExtractionFeatures(ConfiguredBaseModel): + """ + Multi-dimensional array of features extracted from each event. + """ + name:Literal["features"]= Field("features") + array:Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]]= Field(None) + + +class FeatureExtractionElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class EventDetection(NWBDataInterface): + """ + Detected spike events from voltage trace(s). + """ + name:str= Field(...) + detection_method:str= Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""") + source_idx:List[int]= Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""") + times:List[float]= Field(default_factory=list, description="""Timestamps of events, in seconds.""") + + +class EventWaveform(NWBDataInterface): + """ + Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. + """ + name:str= Field(...) + spike_event_series:Optional[List[SpikeEventSeries]]= Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""") + + +class FilteredEphys(NWBDataInterface): + """ + Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""") + + +class LFP(NWBDataInterface): + """ + LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""") + + +class ElectrodeGroup(NWBContainer): + """ + A physical grouping of electrodes, e.g. a shank of an array. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this electrode group.""") + location:Optional[str]= Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""") + position:Optional[Any]= Field(None, description="""stereotaxic or common framework coordinates""") + + +class ClusterWaveforms(NWBDataInterface): + """ + DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. + """ + name:str= Field(...) + waveform_filtering:str= Field(..., description="""Filtering applied to data before generating mean/sd""") + waveform_mean:ClusterWaveformsWaveformMean= Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""") + waveform_sd:ClusterWaveformsWaveformSd= Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""") + + +class ClusterWaveformsWaveformMean(ConfiguredBaseModel): + """ + The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled) + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class ClusterWaveformsWaveformSd(ConfiguredBaseModel): + """ + Stdev of waveforms for each cluster, using the same indices as in mean + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class Clustering(NWBDataInterface): + """ + DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""") + num:List[int]= Field(default_factory=list, description="""Cluster number of each event""") + peak_over_rms:List[float]= Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""") + times:List[float]= Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ElectricalSeries.model_rebuild() +ElectricalSeriesData.model_rebuild() +ElectricalSeriesElectrodes.model_rebuild() +SpikeEventSeries.model_rebuild() +SpikeEventSeriesData.model_rebuild() +FeatureExtraction.model_rebuild() +FeatureExtractionFeatures.model_rebuild() +FeatureExtractionElectrodes.model_rebuild() +EventDetection.model_rebuild() +EventWaveform.model_rebuild() +FilteredEphys.model_rebuild() +LFP.model_rebuild() +ElectrodeGroup.model_rebuild() +ClusterWaveforms.model_rebuild() +ClusterWaveformsWaveformMean.model_rebuild() +ClusterWaveformsWaveformSd.model_rebuild() +Clustering.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py new file mode 100644 index 0000000..2c97c46 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_epoch.py @@ -0,0 +1,76 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TimeIntervals(DynamicTable): + """ + A container for aggregating epoch data and the TimeSeries that each epoch applies to. + """ + name:str= Field(...) + start_time:Optional[List[float]]= Field(default_factory=list, description="""Start time of epoch, in seconds.""") + stop_time:Optional[List[float]]= Field(default_factory=list, description="""Stop time of epoch, in seconds.""") + tags:Optional[List[str]]= Field(default_factory=list, description="""User-defined tags that identify or categorize events.""") + tags_index:Optional[TimeIntervalsTagsIndex]= Field(None, description="""Index for tags.""") + timeseries:Optional[List[Any]]= Field(default_factory=list, description="""An index into a TimeSeries object.""") + timeseries_index:Optional[TimeIntervalsTimeseriesIndex]= Field(None, description="""Index for timeseries.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class TimeIntervalsTagsIndex(VectorIndex): + """ + Index for tags. + """ + name:Literal["tags_index"]= Field("tags_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class TimeIntervalsTimeseriesIndex(VectorIndex): + """ + Index for timeseries. + """ + name:Literal["timeseries_index"]= Field("timeseries_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TimeIntervals.model_rebuild() +TimeIntervalsTagsIndex.model_rebuild() +TimeIntervalsTimeseriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py new file mode 100644 index 0000000..c077ecc --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_file.py @@ -0,0 +1,220 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_epoch import ( + TimeIntervals +) + +from .core_nwb_icephys import ( + SweepTable, + IntracellularElectrode +) + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeries, + ProcessingModule, + NWBContainer +) + +from .core_nwb_ogen import ( + OptogeneticStimulusSite +) + +from .core_nwb_ophys import ( + ImagingPlane +) + +from .core_nwb_misc import ( + Units +) + +from .core_nwb_device import ( + Device +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBFile(NWBContainer): + """ + An NWB:N file storing cellular-based neurophysiology data from a single experimental session. + """ + name:Literal["root"]= Field("root") + nwb_version:Optional[str]= Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""") + file_create_date:List[datetime ]= Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""") + identifier:str= Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""") + session_description:str= Field(..., description="""A description of the experimental session and data in the file.""") + session_start_time:datetime = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""") + timestamps_reference_time:datetime = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""") + acquisition:Optional[List[Union[DynamicTable, NWBDataInterface]]]= Field(default_factory=list, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""") + analysis:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""") + scratch:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""") + processing:Optional[List[ProcessingModule]]= Field(default_factory=list, description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""") + stimulus:NWBFileStimulus= Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""") + general:NWBFileGeneral= Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""") + intervals:Optional[NWBFileIntervals]= Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""") + units:Optional[Units]= Field(None, description="""Data about sorted spike units.""") + + +class NWBFileStimulus(ConfiguredBaseModel): + """ + Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. + """ + name:Literal["stimulus"]= Field("stimulus") + presentation:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Stimuli presented during the experiment.""") + templates:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""") + + +class NWBFileGeneral(ConfiguredBaseModel): + """ + Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. + """ + name:Literal["general"]= Field("general") + data_collection:Optional[str]= Field(None, description="""Notes about data collection and analysis.""") + experiment_description:Optional[str]= Field(None, description="""General description of the experiment.""") + experimenter:Optional[List[str]]= Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""") + institution:Optional[str]= Field(None, description="""Institution(s) where experiment was performed.""") + keywords:Optional[List[str]]= Field(default_factory=list, description="""Terms to search over.""") + lab:Optional[str]= Field(None, description="""Laboratory where experiment was performed.""") + notes:Optional[str]= Field(None, description="""Notes about the experiment.""") + pharmacology:Optional[str]= Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""") + protocol:Optional[str]= Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""") + related_publications:Optional[List[str]]= Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""") + session_id:Optional[str]= Field(None, description="""Lab-specific ID for the session.""") + slices:Optional[str]= Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""") + source_script:Optional[NWBFileGeneralSourceScript]= Field(None, description="""Script file or link to public source code used to create this NWB file.""") + stimulus:Optional[str]= Field(None, description="""Notes about stimuli, such as how and where they were presented.""") + surgery:Optional[str]= Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""") + virus:Optional[str]= Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""") + nwb_container:Optional[List[NWBContainer]]= Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""") + devices:Optional[List[Device]]= Field(default_factory=list, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""") + subject:Optional[Subject]= Field(None, description="""Information about the animal or person from which the data was measured.""") + extracellular_ephys:Optional[NWBFileGeneralExtracellularEphys]= Field(None, description="""Metadata related to extracellular electrophysiology.""") + intracellular_ephys:Optional[NWBFileGeneralIntracellularEphys]= Field(None, description="""Metadata related to intracellular electrophysiology.""") + optogenetics:Optional[List[OptogeneticStimulusSite]]= Field(default_factory=list, description="""Metadata describing optogenetic stimuluation.""") + optophysiology:Optional[List[ImagingPlane]]= Field(default_factory=list, description="""Metadata related to optophysiology.""") + + +class NWBFileGeneralSourceScript(ConfiguredBaseModel): + """ + Script file or link to public source code used to create this NWB file. + """ + name:Literal["source_script"]= Field("source_script") + file_name:Optional[str]= Field(None, description="""Name of script file.""") + value:str= Field(...) + + +class Subject(NWBContainer): + """ + Information about the animal or person from which the data was measured. + """ + name:Literal["subject"]= Field("subject") + age:Optional[str]= Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + date_of_birth:Optional[datetime ]= Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""") + description:Optional[str]= Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""") + genotype:Optional[str]= Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") + sex:Optional[str]= Field(None, description="""Gender of subject.""") + species:Optional[str]= Field(None, description="""Species of subject.""") + subject_id:Optional[str]= Field(None, description="""ID of animal/person used/participating in experiment (lab convention).""") + weight:Optional[str]= Field(None, description="""Weight at time of experiment, at time of surgery and at other important times.""") + + +class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): + """ + Metadata related to extracellular electrophysiology. + """ + name:Literal["extracellular_ephys"]= Field("extracellular_ephys") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Physical group of electrodes.""") + electrodes:Optional[NWBFileGeneralExtracellularEphysElectrodes]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + + +class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): + """ + A table of all electrodes (i.e. channels) used for recording. + """ + name:Literal["electrodes"]= Field("electrodes") + x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""") + y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""") + z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""") + imp:Optional[List[float]]= Field(default_factory=list, description="""Impedance of the channel.""") + location:Optional[List[str]]= Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + filtering:Optional[List[float]]= Field(default_factory=list, description="""Description of hardware filtering.""") + group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""") + group_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""") + rel_x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate in electrode group""") + rel_y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate in electrode group""") + rel_z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate in electrode group""") + reference:Optional[List[str]]= Field(default_factory=list, description="""Description of the reference used for this electrode.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): + """ + Metadata related to intracellular electrophysiology. + """ + name:Literal["intracellular_ephys"]= Field("intracellular_ephys") + filtering:Optional[str]= Field(None, description="""Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") + intracellular_electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""An intracellular electrode.""") + sweep_table:Optional[SweepTable]= Field(None, description="""The table which groups different PatchClampSeries together.""") + + +class NWBFileIntervals(ConfiguredBaseModel): + """ + Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data. + """ + name:Literal["intervals"]= Field("intervals") + epochs:Optional[TimeIntervals]= Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""") + trials:Optional[TimeIntervals]= Field(None, description="""Repeated experimental events that have a logical grouping.""") + invalid_times:Optional[TimeIntervals]= Field(None, description="""Time intervals that should be removed from analysis.""") + time_intervals:Optional[List[TimeIntervals]]= Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBFile.model_rebuild() +NWBFileStimulus.model_rebuild() +NWBFileGeneral.model_rebuild() +NWBFileGeneralSourceScript.model_rebuild() +Subject.model_rebuild() +NWBFileGeneralExtracellularEphys.model_rebuild() +NWBFileGeneralExtracellularEphysElectrodes.model_rebuild() +NWBFileGeneralIntracellularEphys.model_rebuild() +NWBFileIntervals.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py new file mode 100644 index 0000000..894a3c1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_icephys.py @@ -0,0 +1,322 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class PatchClampSeries(TimeSeries): + """ + An abstract base class for patch-clamp data - stimulus or response, current or voltage. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + data:List[float]= Field(default_factory=list, description="""Recorded voltage or current.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeries(PatchClampSeries): + """ + Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. + """ + name:str= Field(...) + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + bias_current:Optional[float]= Field(None, description="""Bias current, in amps.""") + bridge_balance:Optional[float]= Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation:Optional[float]= Field(None, description="""Capacitance compensation, in farads.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeriesData(ConfiguredBaseModel): + """ + Recorded voltage. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IZeroClampSeries(CurrentClampSeries): + """ + Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. + """ + name:str= Field(...) + bias_current:float= Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance:float= Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation:float= Field(..., description="""Capacitance compensation, in farads, fixed to 0.0.""") + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeries(PatchClampSeries): + """ + Stimulus current applied during current clamp recording. + """ + name:str= Field(...) + data:CurrentClampStimulusSeriesData= Field(..., description="""Stimulus current applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus current applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeries(PatchClampSeries): + """ + Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. + """ + name:str= Field(...) + data:VoltageClampSeriesData= Field(..., description="""Recorded current.""") + capacitance_fast:Optional[VoltageClampSeriesCapacitanceFast]= Field(None, description="""Fast capacitance, in farads.""") + capacitance_slow:Optional[VoltageClampSeriesCapacitanceSlow]= Field(None, description="""Slow capacitance, in farads.""") + resistance_comp_bandwidth:Optional[VoltageClampSeriesResistanceCompBandwidth]= Field(None, description="""Resistance compensation bandwidth, in hertz.""") + resistance_comp_correction:Optional[VoltageClampSeriesResistanceCompCorrection]= Field(None, description="""Resistance compensation correction, in percent.""") + resistance_comp_prediction:Optional[VoltageClampSeriesResistanceCompPrediction]= Field(None, description="""Resistance compensation prediction, in percent.""") + whole_cell_capacitance_comp:Optional[VoltageClampSeriesWholeCellCapacitanceComp]= Field(None, description="""Whole cell capacitance compensation, in farads.""") + whole_cell_series_resistance_comp:Optional[VoltageClampSeriesWholeCellSeriesResistanceComp]= Field(None, description="""Whole cell series resistance compensation, in ohms.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampSeriesData(ConfiguredBaseModel): + """ + Recorded current. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): + """ + Fast capacitance, in farads. + """ + name:Literal["capacitance_fast"]= Field("capacitance_fast") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): + """ + Slow capacitance, in farads. + """ + name:Literal["capacitance_slow"]= Field("capacitance_slow") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): + """ + Resistance compensation bandwidth, in hertz. + """ + name:Literal["resistance_comp_bandwidth"]= Field("resistance_comp_bandwidth") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): + """ + Resistance compensation correction, in percent. + """ + name:Literal["resistance_comp_correction"]= Field("resistance_comp_correction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): + """ + Resistance compensation prediction, in percent. + """ + name:Literal["resistance_comp_prediction"]= Field("resistance_comp_prediction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): + """ + Whole cell capacitance compensation, in farads. + """ + name:Literal["whole_cell_capacitance_comp"]= Field("whole_cell_capacitance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): + """ + Whole cell series resistance compensation, in ohms. + """ + name:Literal["whole_cell_series_resistance_comp"]= Field("whole_cell_series_resistance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""") + value:float= Field(...) + + +class VoltageClampStimulusSeries(PatchClampSeries): + """ + Stimulus voltage applied during a voltage clamp recording. + """ + name:str= Field(...) + data:VoltageClampStimulusSeriesData= Field(..., description="""Stimulus voltage applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus voltage applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IntracellularElectrode(NWBContainer): + """ + An intracellular electrode and its metadata. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + filtering:Optional[str]= Field(None, description="""Electrode specific filtering.""") + initial_access_resistance:Optional[str]= Field(None, description="""Initial access resistance.""") + location:Optional[str]= Field(None, description="""Location of the electrode. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + resistance:Optional[str]= Field(None, description="""Electrode resistance, in ohms.""") + seal:Optional[str]= Field(None, description="""Information about seal used for recording.""") + slice:Optional[str]= Field(None, description="""Information about slice used for recording.""") + + +class SweepTable(DynamicTable): + """ + The table which groups different PatchClampSeries together. + """ + name:str= Field(...) + sweep_number:Optional[List[int]]= Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""") + series:Optional[List[PatchClampSeries]]= Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""") + series_index:SweepTableSeriesIndex= Field(..., description="""Index for series.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class SweepTableSeriesIndex(VectorIndex): + """ + Index for series. + """ + name:Literal["series_index"]= Field("series_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +PatchClampSeries.model_rebuild() +CurrentClampSeries.model_rebuild() +CurrentClampSeriesData.model_rebuild() +IZeroClampSeries.model_rebuild() +CurrentClampStimulusSeries.model_rebuild() +CurrentClampStimulusSeriesData.model_rebuild() +VoltageClampSeries.model_rebuild() +VoltageClampSeriesData.model_rebuild() +VoltageClampSeriesCapacitanceFast.model_rebuild() +VoltageClampSeriesCapacitanceSlow.model_rebuild() +VoltageClampSeriesResistanceCompBandwidth.model_rebuild() +VoltageClampSeriesResistanceCompCorrection.model_rebuild() +VoltageClampSeriesResistanceCompPrediction.model_rebuild() +VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() +VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() +VoltageClampStimulusSeries.model_rebuild() +VoltageClampStimulusSeriesData.model_rebuild() +IntracellularElectrode.model_rebuild() +SweepTable.model_rebuild() +SweepTableSeriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py new file mode 100644 index 0000000..657026f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_image.py @@ -0,0 +1,183 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + Image, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class GrayscaleImage(Image): + """ + A grayscale image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBImage(Image): + """ + A color image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBAImage(Image): + """ + A color image with transparency. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImageSeries(TimeSeries): + """ + General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ImageSeriesData(ConfiguredBaseModel): + """ + Binary data representing images across frames. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, * z"], Number] + ]]= Field(None) + + +class ImageMaskSeries(ImageSeries): + """ + An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeries(ImageSeries): + """ + Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. + """ + name:str= Field(...) + distance:Optional[float]= Field(None, description="""Distance from camera/monitor to target/eye.""") + field_of_view:Optional[OpticalSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:OpticalSeriesData= Field(..., description="""Images presented to subject, either grayscale or RGB""") + orientation:Optional[str]= Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class OpticalSeriesData(ConfiguredBaseModel): + """ + Images presented to subject, either grayscale or RGB + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], Number] + ]]= Field(None) + + +class IndexSeries(TimeSeries): + """ + Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Index of the frame in the referenced ImageSeries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +GrayscaleImage.model_rebuild() +RGBImage.model_rebuild() +RGBAImage.model_rebuild() +ImageSeries.model_rebuild() +ImageSeriesData.model_rebuild() +ImageMaskSeries.model_rebuild() +OpticalSeries.model_rebuild() +OpticalSeriesFieldOfView.model_rebuild() +OpticalSeriesData.model_rebuild() +IndexSeries.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py new file mode 100644 index 0000000..bc6a4b0 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_misc.py @@ -0,0 +1,304 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class AbstractFeatureSeries(TimeSeries): + """ + Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. + """ + name:str= Field(...) + data:AbstractFeatureSeriesData= Field(..., description="""Values of each feature at each time.""") + feature_units:Optional[List[str]]= Field(default_factory=list, description="""Units of each feature.""") + features:List[str]= Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class AbstractFeatureSeriesData(ConfiguredBaseModel): + """ + Values of each feature at each time. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class AnnotationSeries(TimeSeries): + """ + Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. + """ + name:str= Field(...) + data:List[str]= Field(default_factory=list, description="""Annotations made during an experiment.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class IntervalSeries(TimeSeries): + """ + Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeries(TimeSeries): + """ + Spectral analysis of a time series, e.g. of an LFP or a speech signal. + """ + name:str= Field(...) + data:DecompositionSeriesData= Field(..., description="""Data decomposed into frequency bands.""") + metric:str= Field(..., description="""The metric used, e.g. phase, amplitude, power.""") + bands:DecompositionSeriesBands= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeriesData(ConfiguredBaseModel): + """ + Data decomposed into frequency bands. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]]= Field(None) + + +class DecompositionSeriesBands(DynamicTable): + """ + Table for describing the bands that this series was generated from. There should be one row in this table for each band. + """ + name:Literal["bands"]= Field("bands") + band_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the band, e.g. theta.""") + band_limits:DecompositionSeriesBandsBandLimits= Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""") + band_mean:List[float]= Field(default_factory=list, description="""The mean Gaussian filters, in Hz.""") + band_stdev:List[float]= Field(default_factory=list, description="""The standard deviation of Gaussian filters, in Hz.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class DecompositionSeriesBandsBandLimits(VectorData): + """ + Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center. + """ + name:Literal["band_limits"]= Field("band_limits") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class Units(DynamicTable): + """ + Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. + """ + name:str= Field(...) + spike_times_index:Optional[UnitsSpikeTimesIndex]= Field(None, description="""Index into the spike_times dataset.""") + spike_times:Optional[UnitsSpikeTimes]= Field(None, description="""Spike times for each unit.""") + obs_intervals_index:Optional[UnitsObsIntervalsIndex]= Field(None, description="""Index into the obs_intervals dataset.""") + obs_intervals:Optional[UnitsObsIntervals]= Field(None, description="""Observation intervals for each unit.""") + electrodes_index:Optional[UnitsElectrodesIndex]= Field(None, description="""Index into electrodes.""") + electrodes:Optional[UnitsElectrodes]= Field(None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Electrode group that each spike unit came from.""") + waveform_mean:Optional[UnitsWaveformMean]= Field(None, description="""Spike waveform mean for each spike unit.""") + waveform_sd:Optional[UnitsWaveformSd]= Field(None, description="""Spike waveform standard deviation for each spike unit.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class UnitsSpikeTimesIndex(VectorIndex): + """ + Index into the spike_times dataset. + """ + name:Literal["spike_times_index"]= Field("spike_times_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class UnitsSpikeTimes(VectorData): + """ + Spike times for each unit. + """ + name:Literal["spike_times"]= Field("spike_times") + resolution:Optional[float]= Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsObsIntervalsIndex(VectorIndex): + """ + Index into the obs_intervals dataset. + """ + name:Literal["obs_intervals_index"]= Field("obs_intervals_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class UnitsObsIntervals(VectorData): + """ + Observation intervals for each unit. + """ + name:Literal["obs_intervals"]= Field("obs_intervals") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsElectrodesIndex(VectorIndex): + """ + Index into electrodes. + """ + name:Literal["electrodes_index"]= Field("electrodes_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class UnitsElectrodes(DynamicTableRegion): + """ + Electrode that each spike unit came from, specified using a DynamicTableRegion. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformMean(VectorData): + """ + Spike waveform mean for each spike unit. + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformSd(VectorData): + """ + Spike waveform standard deviation for each spike unit. + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +AbstractFeatureSeries.model_rebuild() +AbstractFeatureSeriesData.model_rebuild() +AnnotationSeries.model_rebuild() +IntervalSeries.model_rebuild() +DecompositionSeries.model_rebuild() +DecompositionSeriesData.model_rebuild() +DecompositionSeriesBands.model_rebuild() +DecompositionSeriesBandsBandLimits.model_rebuild() +Units.model_rebuild() +UnitsSpikeTimesIndex.model_rebuild() +UnitsSpikeTimes.model_rebuild() +UnitsObsIntervalsIndex.model_rebuild() +UnitsObsIntervals.model_rebuild() +UnitsElectrodesIndex.model_rebuild() +UnitsElectrodes.model_rebuild() +UnitsWaveformMean.model_rebuild() +UnitsWaveformSd.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py new file mode 100644 index 0000000..a25d1d2 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ogen.py @@ -0,0 +1,65 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeries, + NWBContainer, + TimeSeriesSync +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class OptogeneticSeries(TimeSeries): + """ + An optogenetic stimulus. + """ + name:str= Field(...) + data:List[float]= Field(default_factory=list, description="""Applied power for optogenetic stimulus, in watts.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OptogeneticStimulusSite(NWBContainer): + """ + A site of optogenetic stimulation. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of stimulation site.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + location:str= Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +OptogeneticSeries.model_rebuild() +OptogeneticStimulusSite.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py new file mode 100644 index 0000000..c555378 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_ophys.py @@ -0,0 +1,289 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from .core_nwb_image import ( + ImageSeriesData, + ImageSeries +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TwoPhotonSeries(ImageSeries): + """ + Image stack recorded over time from 2-photon microscope. + """ + name:str= Field(...) + pmt_gain:Optional[float]= Field(None, description="""Photomultiplier gain.""") + scan_line_rate:Optional[float]= Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") + field_of_view:Optional[TwoPhotonSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TwoPhotonSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[NDArray[Shape["2 width_height, 3 width_height_depth"], Float32]]= Field(None) + + +class RoiResponseSeries(TimeSeries): + """ + ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. + """ + name:str= Field(...) + data:RoiResponseSeriesData= Field(..., description="""Signals from ROIs.""") + rois:RoiResponseSeriesRois= Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class RoiResponseSeriesData(ConfiguredBaseModel): + """ + Signals from ROIs. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_ROIs"], Number] + ]]= Field(None) + + +class RoiResponseSeriesRois(DynamicTableRegion): + """ + DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. + """ + name:Literal["rois"]= Field("rois") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class DfOverF(NWBDataInterface): + """ + dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""") + + +class Fluorescence(NWBDataInterface): + """ + Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""") + + +class ImageSegmentation(NWBDataInterface): + """ + Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. + """ + name:str= Field(...) + plane_segmentation:List[PlaneSegmentation]= Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""") + + +class PlaneSegmentation(DynamicTable): + """ + Results from image segmentation of a specific imaging plane. + """ + name:str= Field(...) + image_mask:Optional[PlaneSegmentationImageMask]= Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""") + pixel_mask_index:Optional[PlaneSegmentationPixelMaskIndex]= Field(None, description="""Index into pixel_mask.""") + pixel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + voxel_mask_index:Optional[PlaneSegmentationVoxelMaskIndex]= Field(None, description="""Index into voxel_mask.""") + voxel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + reference_images:Optional[List[ImageSeries]]= Field(default_factory=list, description="""Image stacks that the segmentation masks apply to.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class PlaneSegmentationImageMask(VectorData): + """ + ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero. + """ + name:Literal["image_mask"]= Field("image_mask") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class PlaneSegmentationPixelMaskIndex(VectorIndex): + """ + Index into pixel_mask. + """ + name:Literal["pixel_mask_index"]= Field("pixel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class PlaneSegmentationVoxelMaskIndex(VectorIndex): + """ + Index into voxel_mask. + """ + name:Literal["voxel_mask_index"]= Field("voxel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class ImagingPlane(NWBContainer): + """ + An imaging plane and its metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the imaging plane.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate:float= Field(..., description="""Rate that images are acquired, in Hz.""") + indicator:str= Field(..., description="""Calcium indicator.""") + location:str= Field(..., description="""Location of the imaging plane. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + manifold:Optional[ImagingPlaneManifold]= Field(None, description="""DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.""") + origin_coords:Optional[ImagingPlaneOriginCoords]= Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""") + grid_spacing:Optional[ImagingPlaneGridSpacing]= Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""") + reference_frame:Optional[str]= Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""") + optical_channel:List[OpticalChannel]= Field(default_factory=list, description="""An optical channel used to record from an imaging plane.""") + + +class ImagingPlaneManifold(ConfiguredBaseModel): + """ + DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. + """ + name:Literal["manifold"]= Field("manifold") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["* height, * width, 3 x_y_z"], Float32], + NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32] + ]]= Field(None) + + +class ImagingPlaneOriginCoords(ConfiguredBaseModel): + """ + Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). + """ + name:Literal["origin_coords"]= Field("origin_coords") + unit:Optional[str]= Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""") + array:Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]]= Field(None) + + +class ImagingPlaneGridSpacing(ConfiguredBaseModel): + """ + Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. + """ + name:Literal["grid_spacing"]= Field("grid_spacing") + unit:Optional[str]= Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""") + array:Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]]= Field(None) + + +class OpticalChannel(NWBContainer): + """ + An optical channel used to record from an imaging plane. + """ + name:str= Field(...) + description:str= Field(..., description="""Description or other notes about the channel.""") + emission_lambda:float= Field(..., description="""Emission wavelength for channel, in nm.""") + + +class MotionCorrection(NWBDataInterface): + """ + An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). + """ + name:str= Field(...) + corrected_image_stack:List[CorrectedImageStack]= Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""") + + +class CorrectedImageStack(NWBDataInterface): + """ + Reuslts from motion correction of an image stack. + """ + name:str= Field(...) + corrected:ImageSeries= Field(..., description="""Image stack with frames shifted to the common coordinates.""") + xy_translation:TimeSeries= Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TwoPhotonSeries.model_rebuild() +TwoPhotonSeriesFieldOfView.model_rebuild() +RoiResponseSeries.model_rebuild() +RoiResponseSeriesData.model_rebuild() +RoiResponseSeriesRois.model_rebuild() +DfOverF.model_rebuild() +Fluorescence.model_rebuild() +ImageSegmentation.model_rebuild() +PlaneSegmentation.model_rebuild() +PlaneSegmentationImageMask.model_rebuild() +PlaneSegmentationPixelMaskIndex.model_rebuild() +PlaneSegmentationVoxelMaskIndex.model_rebuild() +ImagingPlane.model_rebuild() +ImagingPlaneManifold.model_rebuild() +ImagingPlaneOriginCoords.model_rebuild() +ImagingPlaneGridSpacing.model_rebuild() +OpticalChannel.model_rebuild() +MotionCorrection.model_rebuild() +CorrectedImageStack.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py similarity index 92% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_retinotopy.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py index be6f24c..87eb535 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_retinotopy.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/core_nwb_retinotopy.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -17,7 +18,7 @@ from .core_nwb_base import ( metamodel_version = "None" -version = "None" +version = "2.2.2" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -125,12 +126,12 @@ class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# ImagingRetinotopy.model_rebuild() -# ImagingRetinotopyAxis1PhaseMap.model_rebuild() -# ImagingRetinotopyAxis1PowerMap.model_rebuild() -# ImagingRetinotopyAxis2PhaseMap.model_rebuild() -# ImagingRetinotopyAxis2PowerMap.model_rebuild() -# ImagingRetinotopyFocalDepthImage.model_rebuild() -# ImagingRetinotopySignMap.model_rebuild() -# ImagingRetinotopyVasculatureImage.model_rebuild() +ImagingRetinotopy.model_rebuild() +ImagingRetinotopyAxis1PhaseMap.model_rebuild() +ImagingRetinotopyAxis1PowerMap.model_rebuild() +ImagingRetinotopyAxis2PhaseMap.model_rebuild() +ImagingRetinotopyAxis2PowerMap.model_rebuild() +ImagingRetinotopyFocalDepthImage.model_rebuild() +ImagingRetinotopySignMap.model_rebuild() +ImagingRetinotopyVasculatureImage.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/namespace.py new file mode 100644 index 0000000..7e0e3ac --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_2/namespace.py @@ -0,0 +1,140 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + Data, + Index, + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + Container, + DynamicTable +) + +from .core_nwb_retinotopy import ( + ImagingRetinotopy +) + +from .core_nwb_base import ( + NWBData, + Image, + NWBContainer, + NWBDataInterface, + TimeSeries, + ProcessingModule, + Images +) + +from .core_nwb_ophys import ( + TwoPhotonSeries, + RoiResponseSeries, + DfOverF, + Fluorescence, + ImageSegmentation, + ImagingPlane, + MotionCorrection +) + +from .core_nwb_device import ( + Device +) + +from .core_nwb_image import ( + GrayscaleImage, + RGBImage, + RGBAImage, + ImageSeries, + ImageMaskSeries, + OpticalSeries, + IndexSeries +) + +from .core_nwb_ogen import ( + OptogeneticSeries, + OptogeneticStimulusSite +) + +from .core_nwb_icephys import ( + PatchClampSeries, + CurrentClampSeries, + IZeroClampSeries, + CurrentClampStimulusSeries, + VoltageClampSeries, + VoltageClampStimulusSeries, + IntracellularElectrode, + SweepTable +) + +from .core_nwb_ecephys import ( + ElectricalSeries, + SpikeEventSeries, + FeatureExtraction, + EventDetection, + EventWaveform, + FilteredEphys, + LFP, + ElectrodeGroup, + ClusterWaveforms, + Clustering +) + +from .core_nwb_behavior import ( + SpatialSeries, + BehavioralEpochs, + BehavioralEvents, + BehavioralTimeSeries, + PupilTracking, + EyeTracking, + CompassDirection, + Position +) + +from .core_nwb_misc import ( + AbstractFeatureSeries, + AnnotationSeries, + IntervalSeries, + DecompositionSeries, + Units +) + +from .core_nwb_file import ( + NWBFile +) + +from .core_nwb_epoch import ( + TimeIntervals +) + + +metamodel_version = "None" +version = "2.2.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py new file mode 100644 index 0000000..c4f95c1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_base.py @@ -0,0 +1,149 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + Container, + DynamicTable, + Data +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBData(Data): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class Image(NWBData): + """ + An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). + """ + name:str= Field(...) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + array:Optional[Union[ + NDArray[Shape["* x, * y"], Number], + NDArray[Shape["* x, * y, 3 r_g_b"], Number], + NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number] + ]]= Field(None) + + +class NWBContainer(Container): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class NWBDataInterface(NWBContainer): + """ + An abstract data type for a generic container storing collections of data, as opposed to metadata. + """ + name:str= Field(...) + + +class TimeSeries(NWBDataInterface): + """ + General purpose time series. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + data:TimeSeriesData= Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TimeSeriesData(ConfiguredBaseModel): + """ + Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. + """ + name:Literal["data"]= Field("data") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""") + resolution:Optional[float]= Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Any], + NDArray[Shape["* num_times, * num_DIM2"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3, * num_DIM4"], Any] + ]]= Field(None) + + +class TimeSeriesStartingTime(ConfiguredBaseModel): + """ + Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. + """ + name:Literal["starting_time"]= Field("starting_time") + rate:Optional[float]= Field(None, description="""Sampling rate, in Hz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + value:float= Field(...) + + +class TimeSeriesSync(ConfiguredBaseModel): + """ + Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. + """ + name:Literal["sync"]= Field("sync") + + +class ProcessingModule(NWBContainer): + """ + A collection of processed data. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of processed data.""") + nwb_data_interface:Optional[List[NWBDataInterface]]= Field(default_factory=list, description="""Data objects stored in this collection.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""Tables stored in this collection.""") + + +class Images(NWBDataInterface): + """ + A collection of images. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of images.""") + image:List[Image]= Field(default_factory=list, description="""Images stored in this collection.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBData.model_rebuild() +Image.model_rebuild() +NWBContainer.model_rebuild() +NWBDataInterface.model_rebuild() +TimeSeries.model_rebuild() +TimeSeriesData.model_rebuild() +TimeSeriesStartingTime.model_rebuild() +TimeSeriesSync.model_rebuild() +ProcessingModule.model_rebuild() +Images.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py new file mode 100644 index 0000000..0a5c24d --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_behavior.py @@ -0,0 +1,135 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from .core_nwb_misc import ( + IntervalSeries +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class SpatialSeries(TimeSeries): + """ + Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. + """ + name:str= Field(...) + data:SpatialSeriesData= Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""") + reference_frame:Optional[str]= Field(None, description="""Description defining what exactly 'straight-ahead' means.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpatialSeriesData(ConfiguredBaseModel): + """ + 1-D or 2-D array storing position or direction relative to some reference frame. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class BehavioralEpochs(NWBDataInterface): + """ + TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. + """ + name:str= Field(...) + interval_series:Optional[List[IntervalSeries]]= Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""") + + +class BehavioralEvents(NWBDataInterface): + """ + TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing behavioral events.""") + + +class BehavioralTimeSeries(NWBDataInterface): + """ + TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""") + + +class PupilTracking(NWBDataInterface): + """ + Eye-tracking data, representing pupil size. + """ + name:str= Field(...) + time_series:List[TimeSeries]= Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""") + + +class EyeTracking(NWBDataInterface): + """ + Eye-tracking data, representing direction of gaze. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""") + + +class CompassDirection(NWBDataInterface): + """ + With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""") + + +class Position(NWBDataInterface): + """ + Position data, whether along the x, x/y or x/y/z axis. + """ + name:str= Field(...) + spatial_series:List[SpatialSeries]= Field(default_factory=list, description="""SpatialSeries object containing position data.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +SpatialSeries.model_rebuild() +SpatialSeriesData.model_rebuild() +BehavioralEpochs.model_rebuild() +BehavioralEvents.model_rebuild() +BehavioralTimeSeries.model_rebuild() +PupilTracking.model_rebuild() +EyeTracking.model_rebuild() +CompassDirection.model_rebuild() +Position.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_device.py new file mode 100644 index 0000000..b5dd1ee --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_device.py @@ -0,0 +1,45 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBContainer +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Device(NWBContainer): + """ + Metadata about a data acquisition device, e.g., recording system, electrode, microscope. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""") + manufacturer:Optional[str]= Field(None, description="""The name of the manufacturer of the device.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Device.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py new file mode 100644 index 0000000..40d23dc --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ecephys.py @@ -0,0 +1,250 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ElectricalSeries(TimeSeries): + """ + A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. + """ + name:str= Field(...) + data:ElectricalSeriesData= Field(..., description="""Recorded voltage data.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ElectricalSeriesData(ConfiguredBaseModel): + """ + Recorded voltage data. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and 'channel_conversion' (if present).""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_channels"], Number], + NDArray[Shape["* num_times, * num_channels, * num_samples"], Number] + ]]= Field(None) + + +class ElectricalSeriesElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SpikeEventSeries(ElectricalSeries): + """ + Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). + """ + name:str= Field(...) + data:SpikeEventSeriesData= Field(..., description="""Spike waveforms.""") + timestamps:List[float]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpikeEventSeriesData(ConfiguredBaseModel): + """ + Spike waveforms. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""") + array:Optional[Union[ + NDArray[Shape["* num_events, * num_samples"], Number], + NDArray[Shape["* num_events, * num_samples, * num_channels"], Number] + ]]= Field(None) + + +class FeatureExtraction(NWBDataInterface): + """ + Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. + """ + name:str= Field(...) + description:List[str]= Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""") + features:FeatureExtractionFeatures= Field(..., description="""Multi-dimensional array of features extracted from each event.""") + times:List[float]= Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""") + electrodes:FeatureExtractionElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + + +class FeatureExtractionFeatures(ConfiguredBaseModel): + """ + Multi-dimensional array of features extracted from each event. + """ + name:Literal["features"]= Field("features") + array:Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]]= Field(None) + + +class FeatureExtractionElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class EventDetection(NWBDataInterface): + """ + Detected spike events from voltage trace(s). + """ + name:str= Field(...) + detection_method:str= Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""") + source_idx:List[int]= Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""") + times:List[float]= Field(default_factory=list, description="""Timestamps of events, in seconds.""") + + +class EventWaveform(NWBDataInterface): + """ + Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. + """ + name:str= Field(...) + spike_event_series:Optional[List[SpikeEventSeries]]= Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""") + + +class FilteredEphys(NWBDataInterface): + """ + Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""") + + +class LFP(NWBDataInterface): + """ + LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""") + + +class ElectrodeGroup(NWBContainer): + """ + A physical grouping of electrodes, e.g. a shank of an array. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this electrode group.""") + location:Optional[str]= Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""") + position:Optional[Any]= Field(None, description="""stereotaxic or common framework coordinates""") + + +class ClusterWaveforms(NWBDataInterface): + """ + DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. + """ + name:str= Field(...) + waveform_filtering:str= Field(..., description="""Filtering applied to data before generating mean/sd""") + waveform_mean:ClusterWaveformsWaveformMean= Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""") + waveform_sd:ClusterWaveformsWaveformSd= Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""") + + +class ClusterWaveformsWaveformMean(ConfiguredBaseModel): + """ + The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled) + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class ClusterWaveformsWaveformSd(ConfiguredBaseModel): + """ + Stdev of waveforms for each cluster, using the same indices as in mean + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class Clustering(NWBDataInterface): + """ + DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""") + num:List[int]= Field(default_factory=list, description="""Cluster number of each event""") + peak_over_rms:List[float]= Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""") + times:List[float]= Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ElectricalSeries.model_rebuild() +ElectricalSeriesData.model_rebuild() +ElectricalSeriesElectrodes.model_rebuild() +SpikeEventSeries.model_rebuild() +SpikeEventSeriesData.model_rebuild() +FeatureExtraction.model_rebuild() +FeatureExtractionFeatures.model_rebuild() +FeatureExtractionElectrodes.model_rebuild() +EventDetection.model_rebuild() +EventWaveform.model_rebuild() +FilteredEphys.model_rebuild() +LFP.model_rebuild() +ElectrodeGroup.model_rebuild() +ClusterWaveforms.model_rebuild() +ClusterWaveformsWaveformMean.model_rebuild() +ClusterWaveformsWaveformSd.model_rebuild() +Clustering.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py new file mode 100644 index 0000000..18498bc --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_epoch.py @@ -0,0 +1,76 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TimeIntervals(DynamicTable): + """ + A container for aggregating epoch data and the TimeSeries that each epoch applies to. + """ + name:str= Field(...) + start_time:Optional[List[float]]= Field(default_factory=list, description="""Start time of epoch, in seconds.""") + stop_time:Optional[List[float]]= Field(default_factory=list, description="""Stop time of epoch, in seconds.""") + tags:Optional[List[str]]= Field(default_factory=list, description="""User-defined tags that identify or categorize events.""") + tags_index:Optional[TimeIntervalsTagsIndex]= Field(None, description="""Index for tags.""") + timeseries:Optional[List[Any]]= Field(default_factory=list, description="""An index into a TimeSeries object.""") + timeseries_index:Optional[TimeIntervalsTimeseriesIndex]= Field(None, description="""Index for timeseries.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class TimeIntervalsTagsIndex(VectorIndex): + """ + Index for tags. + """ + name:Literal["tags_index"]= Field("tags_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class TimeIntervalsTimeseriesIndex(VectorIndex): + """ + Index for timeseries. + """ + name:Literal["timeseries_index"]= Field("timeseries_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TimeIntervals.model_rebuild() +TimeIntervalsTagsIndex.model_rebuild() +TimeIntervalsTimeseriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py new file mode 100644 index 0000000..70c076c --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_file.py @@ -0,0 +1,238 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_epoch import ( + TimeIntervals +) + +from .core_nwb_base import ( + NWBData, + NWBDataInterface, + TimeSeries, + ProcessingModule, + NWBContainer +) + +from .core_nwb_icephys import ( + SweepTable, + IntracellularElectrode +) + +from .core_nwb_ogen import ( + OptogeneticStimulusSite +) + +from .core_nwb_ophys import ( + ImagingPlane +) + +from .core_nwb_misc import ( + Units +) + +from .core_nwb_device import ( + Device +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ScratchData(NWBData): + """ + Any one-off datasets + """ + name:str= Field(...) + notes:Optional[str]= Field(None, description="""Any notes the user has about the dataset being stored""") + + +class NWBFile(NWBContainer): + """ + An NWB:N file storing cellular-based neurophysiology data from a single experimental session. + """ + name:Literal["root"]= Field("root") + nwb_version:Optional[str]= Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""") + file_create_date:List[datetime ]= Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""") + identifier:str= Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""") + session_description:str= Field(..., description="""A description of the experimental session and data in the file.""") + session_start_time:datetime = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""") + timestamps_reference_time:datetime = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""") + acquisition:Optional[List[Union[DynamicTable, NWBDataInterface]]]= Field(default_factory=list, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""") + analysis:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""") + scratch:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""") + processing:Optional[List[ProcessingModule]]= Field(default_factory=list, description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""") + stimulus:NWBFileStimulus= Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""") + general:NWBFileGeneral= Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""") + intervals:Optional[NWBFileIntervals]= Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""") + units:Optional[Units]= Field(None, description="""Data about sorted spike units.""") + + +class NWBFileStimulus(ConfiguredBaseModel): + """ + Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. + """ + name:Literal["stimulus"]= Field("stimulus") + presentation:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Stimuli presented during the experiment.""") + templates:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""") + + +class NWBFileGeneral(ConfiguredBaseModel): + """ + Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. + """ + name:Literal["general"]= Field("general") + data_collection:Optional[str]= Field(None, description="""Notes about data collection and analysis.""") + experiment_description:Optional[str]= Field(None, description="""General description of the experiment.""") + experimenter:Optional[List[str]]= Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""") + institution:Optional[str]= Field(None, description="""Institution(s) where experiment was performed.""") + keywords:Optional[List[str]]= Field(default_factory=list, description="""Terms to search over.""") + lab:Optional[str]= Field(None, description="""Laboratory where experiment was performed.""") + notes:Optional[str]= Field(None, description="""Notes about the experiment.""") + pharmacology:Optional[str]= Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""") + protocol:Optional[str]= Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""") + related_publications:Optional[List[str]]= Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""") + session_id:Optional[str]= Field(None, description="""Lab-specific ID for the session.""") + slices:Optional[str]= Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""") + source_script:Optional[NWBFileGeneralSourceScript]= Field(None, description="""Script file or link to public source code used to create this NWB file.""") + stimulus:Optional[str]= Field(None, description="""Notes about stimuli, such as how and where they were presented.""") + surgery:Optional[str]= Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""") + virus:Optional[str]= Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""") + lab_meta_data:Optional[List[LabMetaData]]= Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""") + devices:Optional[List[Device]]= Field(default_factory=list, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""") + subject:Optional[Subject]= Field(None, description="""Information about the animal or person from which the data was measured.""") + extracellular_ephys:Optional[NWBFileGeneralExtracellularEphys]= Field(None, description="""Metadata related to extracellular electrophysiology.""") + intracellular_ephys:Optional[NWBFileGeneralIntracellularEphys]= Field(None, description="""Metadata related to intracellular electrophysiology.""") + optogenetics:Optional[List[OptogeneticStimulusSite]]= Field(default_factory=list, description="""Metadata describing optogenetic stimuluation.""") + optophysiology:Optional[List[ImagingPlane]]= Field(default_factory=list, description="""Metadata related to optophysiology.""") + + +class NWBFileGeneralSourceScript(ConfiguredBaseModel): + """ + Script file or link to public source code used to create this NWB file. + """ + name:Literal["source_script"]= Field("source_script") + file_name:Optional[str]= Field(None, description="""Name of script file.""") + value:str= Field(...) + + +class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): + """ + Metadata related to extracellular electrophysiology. + """ + name:Literal["extracellular_ephys"]= Field("extracellular_ephys") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Physical group of electrodes.""") + electrodes:Optional[NWBFileGeneralExtracellularEphysElectrodes]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + + +class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): + """ + A table of all electrodes (i.e. channels) used for recording. + """ + name:Literal["electrodes"]= Field("electrodes") + x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""") + y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""") + z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""") + imp:Optional[List[float]]= Field(default_factory=list, description="""Impedance of the channel.""") + location:Optional[List[str]]= Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + filtering:Optional[List[float]]= Field(default_factory=list, description="""Description of hardware filtering.""") + group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""") + group_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""") + rel_x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate in electrode group""") + rel_y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate in electrode group""") + rel_z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate in electrode group""") + reference:Optional[List[str]]= Field(default_factory=list, description="""Description of the reference used for this electrode.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): + """ + Metadata related to intracellular electrophysiology. + """ + name:Literal["intracellular_ephys"]= Field("intracellular_ephys") + filtering:Optional[str]= Field(None, description="""Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") + intracellular_electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""An intracellular electrode.""") + sweep_table:Optional[SweepTable]= Field(None, description="""The table which groups different PatchClampSeries together.""") + + +class NWBFileIntervals(ConfiguredBaseModel): + """ + Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data. + """ + name:Literal["intervals"]= Field("intervals") + epochs:Optional[TimeIntervals]= Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""") + trials:Optional[TimeIntervals]= Field(None, description="""Repeated experimental events that have a logical grouping.""") + invalid_times:Optional[TimeIntervals]= Field(None, description="""Time intervals that should be removed from analysis.""") + time_intervals:Optional[List[TimeIntervals]]= Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""") + + +class LabMetaData(NWBContainer): + """ + Lab-specific meta-data. + """ + name:str= Field(...) + + +class Subject(NWBContainer): + """ + Information about the animal or person from which the data was measured. + """ + name:str= Field(...) + age:Optional[str]= Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + date_of_birth:Optional[datetime ]= Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""") + description:Optional[str]= Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""") + genotype:Optional[str]= Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") + sex:Optional[str]= Field(None, description="""Gender of subject.""") + species:Optional[str]= Field(None, description="""Species of subject.""") + subject_id:Optional[str]= Field(None, description="""ID of animal/person used/participating in experiment (lab convention).""") + weight:Optional[str]= Field(None, description="""Weight at time of experiment, at time of surgery and at other important times.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ScratchData.model_rebuild() +NWBFile.model_rebuild() +NWBFileStimulus.model_rebuild() +NWBFileGeneral.model_rebuild() +NWBFileGeneralSourceScript.model_rebuild() +NWBFileGeneralExtracellularEphys.model_rebuild() +NWBFileGeneralExtracellularEphysElectrodes.model_rebuild() +NWBFileGeneralIntracellularEphys.model_rebuild() +NWBFileIntervals.model_rebuild() +LabMetaData.model_rebuild() +Subject.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py new file mode 100644 index 0000000..aacc322 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_icephys.py @@ -0,0 +1,322 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class PatchClampSeries(TimeSeries): + """ + An abstract base class for patch-clamp data - stimulus or response, current or voltage. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + data:List[float]= Field(default_factory=list, description="""Recorded voltage or current.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeries(PatchClampSeries): + """ + Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. + """ + name:str= Field(...) + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + bias_current:Optional[float]= Field(None, description="""Bias current, in amps.""") + bridge_balance:Optional[float]= Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation:Optional[float]= Field(None, description="""Capacitance compensation, in farads.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeriesData(ConfiguredBaseModel): + """ + Recorded voltage. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IZeroClampSeries(CurrentClampSeries): + """ + Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. + """ + name:str= Field(...) + bias_current:float= Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance:float= Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation:float= Field(..., description="""Capacitance compensation, in farads, fixed to 0.0.""") + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeries(PatchClampSeries): + """ + Stimulus current applied during current clamp recording. + """ + name:str= Field(...) + data:CurrentClampStimulusSeriesData= Field(..., description="""Stimulus current applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus current applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeries(PatchClampSeries): + """ + Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. + """ + name:str= Field(...) + data:VoltageClampSeriesData= Field(..., description="""Recorded current.""") + capacitance_fast:Optional[VoltageClampSeriesCapacitanceFast]= Field(None, description="""Fast capacitance, in farads.""") + capacitance_slow:Optional[VoltageClampSeriesCapacitanceSlow]= Field(None, description="""Slow capacitance, in farads.""") + resistance_comp_bandwidth:Optional[VoltageClampSeriesResistanceCompBandwidth]= Field(None, description="""Resistance compensation bandwidth, in hertz.""") + resistance_comp_correction:Optional[VoltageClampSeriesResistanceCompCorrection]= Field(None, description="""Resistance compensation correction, in percent.""") + resistance_comp_prediction:Optional[VoltageClampSeriesResistanceCompPrediction]= Field(None, description="""Resistance compensation prediction, in percent.""") + whole_cell_capacitance_comp:Optional[VoltageClampSeriesWholeCellCapacitanceComp]= Field(None, description="""Whole cell capacitance compensation, in farads.""") + whole_cell_series_resistance_comp:Optional[VoltageClampSeriesWholeCellSeriesResistanceComp]= Field(None, description="""Whole cell series resistance compensation, in ohms.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampSeriesData(ConfiguredBaseModel): + """ + Recorded current. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): + """ + Fast capacitance, in farads. + """ + name:Literal["capacitance_fast"]= Field("capacitance_fast") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): + """ + Slow capacitance, in farads. + """ + name:Literal["capacitance_slow"]= Field("capacitance_slow") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): + """ + Resistance compensation bandwidth, in hertz. + """ + name:Literal["resistance_comp_bandwidth"]= Field("resistance_comp_bandwidth") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): + """ + Resistance compensation correction, in percent. + """ + name:Literal["resistance_comp_correction"]= Field("resistance_comp_correction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): + """ + Resistance compensation prediction, in percent. + """ + name:Literal["resistance_comp_prediction"]= Field("resistance_comp_prediction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): + """ + Whole cell capacitance compensation, in farads. + """ + name:Literal["whole_cell_capacitance_comp"]= Field("whole_cell_capacitance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): + """ + Whole cell series resistance compensation, in ohms. + """ + name:Literal["whole_cell_series_resistance_comp"]= Field("whole_cell_series_resistance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""") + value:float= Field(...) + + +class VoltageClampStimulusSeries(PatchClampSeries): + """ + Stimulus voltage applied during a voltage clamp recording. + """ + name:str= Field(...) + data:VoltageClampStimulusSeriesData= Field(..., description="""Stimulus voltage applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus voltage applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IntracellularElectrode(NWBContainer): + """ + An intracellular electrode and its metadata. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + filtering:Optional[str]= Field(None, description="""Electrode specific filtering.""") + initial_access_resistance:Optional[str]= Field(None, description="""Initial access resistance.""") + location:Optional[str]= Field(None, description="""Location of the electrode. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + resistance:Optional[str]= Field(None, description="""Electrode resistance, in ohms.""") + seal:Optional[str]= Field(None, description="""Information about seal used for recording.""") + slice:Optional[str]= Field(None, description="""Information about slice used for recording.""") + + +class SweepTable(DynamicTable): + """ + The table which groups different PatchClampSeries together. + """ + name:str= Field(...) + sweep_number:Optional[List[int]]= Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""") + series:Optional[List[PatchClampSeries]]= Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""") + series_index:SweepTableSeriesIndex= Field(..., description="""Index for series.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class SweepTableSeriesIndex(VectorIndex): + """ + Index for series. + """ + name:Literal["series_index"]= Field("series_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +PatchClampSeries.model_rebuild() +CurrentClampSeries.model_rebuild() +CurrentClampSeriesData.model_rebuild() +IZeroClampSeries.model_rebuild() +CurrentClampStimulusSeries.model_rebuild() +CurrentClampStimulusSeriesData.model_rebuild() +VoltageClampSeries.model_rebuild() +VoltageClampSeriesData.model_rebuild() +VoltageClampSeriesCapacitanceFast.model_rebuild() +VoltageClampSeriesCapacitanceSlow.model_rebuild() +VoltageClampSeriesResistanceCompBandwidth.model_rebuild() +VoltageClampSeriesResistanceCompCorrection.model_rebuild() +VoltageClampSeriesResistanceCompPrediction.model_rebuild() +VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() +VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() +VoltageClampStimulusSeries.model_rebuild() +VoltageClampStimulusSeriesData.model_rebuild() +IntracellularElectrode.model_rebuild() +SweepTable.model_rebuild() +SweepTableSeriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py new file mode 100644 index 0000000..669e33e --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_image.py @@ -0,0 +1,183 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + Image, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class GrayscaleImage(Image): + """ + A grayscale image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBImage(Image): + """ + A color image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBAImage(Image): + """ + A color image with transparency. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImageSeries(TimeSeries): + """ + General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ImageSeriesData(ConfiguredBaseModel): + """ + Binary data representing images across frames. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, * z"], Number] + ]]= Field(None) + + +class ImageMaskSeries(ImageSeries): + """ + An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeries(ImageSeries): + """ + Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. + """ + name:str= Field(...) + distance:Optional[float]= Field(None, description="""Distance from camera/monitor to target/eye.""") + field_of_view:Optional[OpticalSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:OpticalSeriesData= Field(..., description="""Images presented to subject, either grayscale or RGB""") + orientation:Optional[str]= Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class OpticalSeriesData(ConfiguredBaseModel): + """ + Images presented to subject, either grayscale or RGB + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], Number] + ]]= Field(None) + + +class IndexSeries(TimeSeries): + """ + Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Index of the frame in the referenced ImageSeries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +GrayscaleImage.model_rebuild() +RGBImage.model_rebuild() +RGBAImage.model_rebuild() +ImageSeries.model_rebuild() +ImageSeriesData.model_rebuild() +ImageMaskSeries.model_rebuild() +OpticalSeries.model_rebuild() +OpticalSeriesFieldOfView.model_rebuild() +OpticalSeriesData.model_rebuild() +IndexSeries.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py new file mode 100644 index 0000000..1e26a11 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_misc.py @@ -0,0 +1,304 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class AbstractFeatureSeries(TimeSeries): + """ + Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. + """ + name:str= Field(...) + data:AbstractFeatureSeriesData= Field(..., description="""Values of each feature at each time.""") + feature_units:Optional[List[str]]= Field(default_factory=list, description="""Units of each feature.""") + features:List[str]= Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class AbstractFeatureSeriesData(ConfiguredBaseModel): + """ + Values of each feature at each time. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class AnnotationSeries(TimeSeries): + """ + Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. + """ + name:str= Field(...) + data:List[str]= Field(default_factory=list, description="""Annotations made during an experiment.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class IntervalSeries(TimeSeries): + """ + Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeries(TimeSeries): + """ + Spectral analysis of a time series, e.g. of an LFP or a speech signal. + """ + name:str= Field(...) + data:DecompositionSeriesData= Field(..., description="""Data decomposed into frequency bands.""") + metric:str= Field(..., description="""The metric used, e.g. phase, amplitude, power.""") + bands:DecompositionSeriesBands= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeriesData(ConfiguredBaseModel): + """ + Data decomposed into frequency bands. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]]= Field(None) + + +class DecompositionSeriesBands(DynamicTable): + """ + Table for describing the bands that this series was generated from. There should be one row in this table for each band. + """ + name:Literal["bands"]= Field("bands") + band_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the band, e.g. theta.""") + band_limits:DecompositionSeriesBandsBandLimits= Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""") + band_mean:List[float]= Field(default_factory=list, description="""The mean Gaussian filters, in Hz.""") + band_stdev:List[float]= Field(default_factory=list, description="""The standard deviation of Gaussian filters, in Hz.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class DecompositionSeriesBandsBandLimits(VectorData): + """ + Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center. + """ + name:Literal["band_limits"]= Field("band_limits") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class Units(DynamicTable): + """ + Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. + """ + name:str= Field(...) + spike_times_index:Optional[UnitsSpikeTimesIndex]= Field(None, description="""Index into the spike_times dataset.""") + spike_times:Optional[UnitsSpikeTimes]= Field(None, description="""Spike times for each unit.""") + obs_intervals_index:Optional[UnitsObsIntervalsIndex]= Field(None, description="""Index into the obs_intervals dataset.""") + obs_intervals:Optional[UnitsObsIntervals]= Field(None, description="""Observation intervals for each unit.""") + electrodes_index:Optional[UnitsElectrodesIndex]= Field(None, description="""Index into electrodes.""") + electrodes:Optional[UnitsElectrodes]= Field(None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Electrode group that each spike unit came from.""") + waveform_mean:Optional[UnitsWaveformMean]= Field(None, description="""Spike waveform mean for each spike unit.""") + waveform_sd:Optional[UnitsWaveformSd]= Field(None, description="""Spike waveform standard deviation for each spike unit.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class UnitsSpikeTimesIndex(VectorIndex): + """ + Index into the spike_times dataset. + """ + name:Literal["spike_times_index"]= Field("spike_times_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class UnitsSpikeTimes(VectorData): + """ + Spike times for each unit. + """ + name:Literal["spike_times"]= Field("spike_times") + resolution:Optional[float]= Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsObsIntervalsIndex(VectorIndex): + """ + Index into the obs_intervals dataset. + """ + name:Literal["obs_intervals_index"]= Field("obs_intervals_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class UnitsObsIntervals(VectorData): + """ + Observation intervals for each unit. + """ + name:Literal["obs_intervals"]= Field("obs_intervals") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsElectrodesIndex(VectorIndex): + """ + Index into electrodes. + """ + name:Literal["electrodes_index"]= Field("electrodes_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class UnitsElectrodes(DynamicTableRegion): + """ + Electrode that each spike unit came from, specified using a DynamicTableRegion. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformMean(VectorData): + """ + Spike waveform mean for each spike unit. + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformSd(VectorData): + """ + Spike waveform standard deviation for each spike unit. + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +AbstractFeatureSeries.model_rebuild() +AbstractFeatureSeriesData.model_rebuild() +AnnotationSeries.model_rebuild() +IntervalSeries.model_rebuild() +DecompositionSeries.model_rebuild() +DecompositionSeriesData.model_rebuild() +DecompositionSeriesBands.model_rebuild() +DecompositionSeriesBandsBandLimits.model_rebuild() +Units.model_rebuild() +UnitsSpikeTimesIndex.model_rebuild() +UnitsSpikeTimes.model_rebuild() +UnitsObsIntervalsIndex.model_rebuild() +UnitsObsIntervals.model_rebuild() +UnitsElectrodesIndex.model_rebuild() +UnitsElectrodes.model_rebuild() +UnitsWaveformMean.model_rebuild() +UnitsWaveformSd.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py new file mode 100644 index 0000000..6bcd72d --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ogen.py @@ -0,0 +1,65 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeries, + NWBContainer, + TimeSeriesSync +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class OptogeneticSeries(TimeSeries): + """ + An optogenetic stimulus. + """ + name:str= Field(...) + data:List[float]= Field(default_factory=list, description="""Applied power for optogenetic stimulus, in watts.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OptogeneticStimulusSite(NWBContainer): + """ + A site of optogenetic stimulation. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of stimulation site.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + location:str= Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +OptogeneticSeries.model_rebuild() +OptogeneticStimulusSite.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py new file mode 100644 index 0000000..6f6ce79 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_ophys.py @@ -0,0 +1,289 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from .core_nwb_image import ( + ImageSeriesData, + ImageSeries +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TwoPhotonSeries(ImageSeries): + """ + Image stack recorded over time from 2-photon microscope. + """ + name:str= Field(...) + pmt_gain:Optional[float]= Field(None, description="""Photomultiplier gain.""") + scan_line_rate:Optional[float]= Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") + field_of_view:Optional[TwoPhotonSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TwoPhotonSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[NDArray[Shape["2 width_height, 3 width_height_depth"], Float32]]= Field(None) + + +class RoiResponseSeries(TimeSeries): + """ + ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. + """ + name:str= Field(...) + data:RoiResponseSeriesData= Field(..., description="""Signals from ROIs.""") + rois:RoiResponseSeriesRois= Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class RoiResponseSeriesData(ConfiguredBaseModel): + """ + Signals from ROIs. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_ROIs"], Number] + ]]= Field(None) + + +class RoiResponseSeriesRois(DynamicTableRegion): + """ + DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. + """ + name:Literal["rois"]= Field("rois") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class DfOverF(NWBDataInterface): + """ + dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""") + + +class Fluorescence(NWBDataInterface): + """ + Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""") + + +class ImageSegmentation(NWBDataInterface): + """ + Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. + """ + name:str= Field(...) + plane_segmentation:List[PlaneSegmentation]= Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""") + + +class PlaneSegmentation(DynamicTable): + """ + Results from image segmentation of a specific imaging plane. + """ + name:str= Field(...) + image_mask:Optional[PlaneSegmentationImageMask]= Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""") + pixel_mask_index:Optional[PlaneSegmentationPixelMaskIndex]= Field(None, description="""Index into pixel_mask.""") + pixel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + voxel_mask_index:Optional[PlaneSegmentationVoxelMaskIndex]= Field(None, description="""Index into voxel_mask.""") + voxel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + reference_images:Optional[List[ImageSeries]]= Field(default_factory=list, description="""Image stacks that the segmentation masks apply to.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class PlaneSegmentationImageMask(VectorData): + """ + ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero. + """ + name:Literal["image_mask"]= Field("image_mask") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class PlaneSegmentationPixelMaskIndex(VectorIndex): + """ + Index into pixel_mask. + """ + name:Literal["pixel_mask_index"]= Field("pixel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class PlaneSegmentationVoxelMaskIndex(VectorIndex): + """ + Index into voxel_mask. + """ + name:Literal["voxel_mask_index"]= Field("voxel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class ImagingPlane(NWBContainer): + """ + An imaging plane and its metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the imaging plane.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate:Optional[float]= Field(None, description="""Rate that images are acquired, in Hz. If the corresponding TimeSeries is present, the rate should be stored there instead.""") + indicator:str= Field(..., description="""Calcium indicator.""") + location:str= Field(..., description="""Location of the imaging plane. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + manifold:Optional[ImagingPlaneManifold]= Field(None, description="""DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.""") + origin_coords:Optional[ImagingPlaneOriginCoords]= Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""") + grid_spacing:Optional[ImagingPlaneGridSpacing]= Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""") + reference_frame:Optional[str]= Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""") + optical_channel:List[OpticalChannel]= Field(default_factory=list, description="""An optical channel used to record from an imaging plane.""") + + +class ImagingPlaneManifold(ConfiguredBaseModel): + """ + DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. + """ + name:Literal["manifold"]= Field("manifold") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["* height, * width, 3 x_y_z"], Float32], + NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32] + ]]= Field(None) + + +class ImagingPlaneOriginCoords(ConfiguredBaseModel): + """ + Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). + """ + name:Literal["origin_coords"]= Field("origin_coords") + unit:Optional[str]= Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""") + array:Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]]= Field(None) + + +class ImagingPlaneGridSpacing(ConfiguredBaseModel): + """ + Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. + """ + name:Literal["grid_spacing"]= Field("grid_spacing") + unit:Optional[str]= Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""") + array:Optional[NDArray[Shape["2 x_y, 3 x_y_z"], Float32]]= Field(None) + + +class OpticalChannel(NWBContainer): + """ + An optical channel used to record from an imaging plane. + """ + name:str= Field(...) + description:str= Field(..., description="""Description or other notes about the channel.""") + emission_lambda:float= Field(..., description="""Emission wavelength for channel, in nm.""") + + +class MotionCorrection(NWBDataInterface): + """ + An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). + """ + name:str= Field(...) + corrected_image_stack:List[CorrectedImageStack]= Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""") + + +class CorrectedImageStack(NWBDataInterface): + """ + Reuslts from motion correction of an image stack. + """ + name:str= Field(...) + corrected:ImageSeries= Field(..., description="""Image stack with frames shifted to the common coordinates.""") + xy_translation:TimeSeries= Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TwoPhotonSeries.model_rebuild() +TwoPhotonSeriesFieldOfView.model_rebuild() +RoiResponseSeries.model_rebuild() +RoiResponseSeriesData.model_rebuild() +RoiResponseSeriesRois.model_rebuild() +DfOverF.model_rebuild() +Fluorescence.model_rebuild() +ImageSegmentation.model_rebuild() +PlaneSegmentation.model_rebuild() +PlaneSegmentationImageMask.model_rebuild() +PlaneSegmentationPixelMaskIndex.model_rebuild() +PlaneSegmentationVoxelMaskIndex.model_rebuild() +ImagingPlane.model_rebuild() +ImagingPlaneManifold.model_rebuild() +ImagingPlaneOriginCoords.model_rebuild() +ImagingPlaneGridSpacing.model_rebuild() +OpticalChannel.model_rebuild() +MotionCorrection.model_rebuild() +CorrectedImageStack.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py new file mode 100644 index 0000000..fdba800 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/core_nwb_retinotopy.py @@ -0,0 +1,137 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ImagingRetinotopy(NWBDataInterface): + """ + Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). + """ + name:str= Field(...) + axis_1_phase_map:ImagingRetinotopyAxis1PhaseMap= Field(..., description="""Phase response to stimulus on the first measured axis.""") + axis_1_power_map:Optional[ImagingRetinotopyAxis1PowerMap]= Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_2_phase_map:ImagingRetinotopyAxis2PhaseMap= Field(..., description="""Phase response to stimulus on the second measured axis.""") + axis_2_power_map:Optional[ImagingRetinotopyAxis2PowerMap]= Field(None, description="""Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_descriptions:List[str]= Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""") + focal_depth_image:Optional[ImagingRetinotopyFocalDepthImage]= Field(None, description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""") + sign_map:Optional[ImagingRetinotopySignMap]= Field(None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""") + vasculature_image:ImagingRetinotopyVasculatureImage= Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""") + + +class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the first measured axis. + """ + name:Literal["axis_1_phase_map"]= Field("axis_1_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): + """ + Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_1_power_map"]= Field("axis_1_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the second measured axis. + """ + name:Literal["axis_2_phase_map"]= Field("axis_2_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): + """ + Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_2_power_map"]= Field("axis_2_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): + """ + Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. + """ + name:Literal["focal_depth_image"]= Field("focal_depth_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + focal_depth:Optional[float]= Field(None, description="""Focal depth offset, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + +class ImagingRetinotopySignMap(ConfiguredBaseModel): + """ + Sine of the angle between the direction of the gradient in axis_1 and axis_2. + """ + name:Literal["sign_map"]= Field("sign_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): + """ + Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] + """ + name:Literal["vasculature_image"]= Field("vasculature_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ImagingRetinotopy.model_rebuild() +ImagingRetinotopyAxis1PhaseMap.model_rebuild() +ImagingRetinotopyAxis1PowerMap.model_rebuild() +ImagingRetinotopyAxis2PhaseMap.model_rebuild() +ImagingRetinotopyAxis2PowerMap.model_rebuild() +ImagingRetinotopyFocalDepthImage.model_rebuild() +ImagingRetinotopySignMap.model_rebuild() +ImagingRetinotopyVasculatureImage.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/namespace.py new file mode 100644 index 0000000..daa721d --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_4/namespace.py @@ -0,0 +1,146 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + Data, + Index, + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + Container, + DynamicTable +) + +from .core_nwb_retinotopy import ( + ImagingRetinotopy +) + +from .core_nwb_base import ( + NWBData, + Image, + NWBContainer, + NWBDataInterface, + TimeSeries, + ProcessingModule, + Images +) + +from .core_nwb_ophys import ( + TwoPhotonSeries, + RoiResponseSeries, + DfOverF, + Fluorescence, + ImageSegmentation, + PlaneSegmentation, + ImagingPlane, + OpticalChannel, + MotionCorrection, + CorrectedImageStack +) + +from .core_nwb_device import ( + Device +) + +from .core_nwb_image import ( + GrayscaleImage, + RGBImage, + RGBAImage, + ImageSeries, + ImageMaskSeries, + OpticalSeries, + IndexSeries +) + +from .core_nwb_ogen import ( + OptogeneticSeries, + OptogeneticStimulusSite +) + +from .core_nwb_icephys import ( + PatchClampSeries, + CurrentClampSeries, + IZeroClampSeries, + CurrentClampStimulusSeries, + VoltageClampSeries, + VoltageClampStimulusSeries, + IntracellularElectrode, + SweepTable +) + +from .core_nwb_ecephys import ( + ElectricalSeries, + SpikeEventSeries, + FeatureExtraction, + EventDetection, + EventWaveform, + FilteredEphys, + LFP, + ElectrodeGroup, + ClusterWaveforms, + Clustering +) + +from .core_nwb_behavior import ( + SpatialSeries, + BehavioralEpochs, + BehavioralEvents, + BehavioralTimeSeries, + PupilTracking, + EyeTracking, + CompassDirection, + Position +) + +from .core_nwb_misc import ( + AbstractFeatureSeries, + AnnotationSeries, + IntervalSeries, + DecompositionSeries, + Units +) + +from .core_nwb_file import ( + ScratchData, + NWBFile, + LabMetaData, + Subject +) + +from .core_nwb_epoch import ( + TimeIntervals +) + + +metamodel_version = "None" +version = "2.2.4" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py new file mode 100644 index 0000000..f3d91c8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_base.py @@ -0,0 +1,149 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + Container, + DynamicTable, + Data +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBData(Data): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class Image(NWBData): + """ + An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). + """ + name:str= Field(...) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + array:Optional[Union[ + NDArray[Shape["* x, * y"], Number], + NDArray[Shape["* x, * y, 3 r_g_b"], Number], + NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number] + ]]= Field(None) + + +class NWBContainer(Container): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class NWBDataInterface(NWBContainer): + """ + An abstract data type for a generic container storing collections of data, as opposed to metadata. + """ + name:str= Field(...) + + +class TimeSeries(NWBDataInterface): + """ + General purpose time series. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + data:TimeSeriesData= Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TimeSeriesData(ConfiguredBaseModel): + """ + Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. + """ + name:Literal["data"]= Field("data") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""") + resolution:Optional[float]= Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Any], + NDArray[Shape["* num_times, * num_DIM2"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3, * num_DIM4"], Any] + ]]= Field(None) + + +class TimeSeriesStartingTime(ConfiguredBaseModel): + """ + Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. + """ + name:Literal["starting_time"]= Field("starting_time") + rate:Optional[float]= Field(None, description="""Sampling rate, in Hz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + value:float= Field(...) + + +class TimeSeriesSync(ConfiguredBaseModel): + """ + Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. + """ + name:Literal["sync"]= Field("sync") + + +class ProcessingModule(NWBContainer): + """ + A collection of processed data. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of processed data.""") + nwb_data_interface:Optional[List[NWBDataInterface]]= Field(default_factory=list, description="""Data objects stored in this collection.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""Tables stored in this collection.""") + + +class Images(NWBDataInterface): + """ + A collection of images. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of images.""") + image:List[Image]= Field(default_factory=list, description="""Images stored in this collection.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBData.model_rebuild() +Image.model_rebuild() +NWBContainer.model_rebuild() +NWBDataInterface.model_rebuild() +TimeSeries.model_rebuild() +TimeSeriesData.model_rebuild() +TimeSeriesStartingTime.model_rebuild() +TimeSeriesSync.model_rebuild() +ProcessingModule.model_rebuild() +Images.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py new file mode 100644 index 0000000..d64f14c --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_behavior.py @@ -0,0 +1,135 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from .core_nwb_misc import ( + IntervalSeries +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class SpatialSeries(TimeSeries): + """ + Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. + """ + name:str= Field(...) + data:SpatialSeriesData= Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""") + reference_frame:Optional[str]= Field(None, description="""Description defining what exactly 'straight-ahead' means.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpatialSeriesData(ConfiguredBaseModel): + """ + 1-D or 2-D array storing position or direction relative to some reference frame. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class BehavioralEpochs(NWBDataInterface): + """ + TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. + """ + name:str= Field(...) + interval_series:Optional[List[IntervalSeries]]= Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""") + + +class BehavioralEvents(NWBDataInterface): + """ + TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing behavioral events.""") + + +class BehavioralTimeSeries(NWBDataInterface): + """ + TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""") + + +class PupilTracking(NWBDataInterface): + """ + Eye-tracking data, representing pupil size. + """ + name:str= Field(...) + time_series:List[TimeSeries]= Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""") + + +class EyeTracking(NWBDataInterface): + """ + Eye-tracking data, representing direction of gaze. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""") + + +class CompassDirection(NWBDataInterface): + """ + With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""") + + +class Position(NWBDataInterface): + """ + Position data, whether along the x, x/y or x/y/z axis. + """ + name:str= Field(...) + spatial_series:List[SpatialSeries]= Field(default_factory=list, description="""SpatialSeries object containing position data.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +SpatialSeries.model_rebuild() +SpatialSeriesData.model_rebuild() +BehavioralEpochs.model_rebuild() +BehavioralEvents.model_rebuild() +BehavioralTimeSeries.model_rebuild() +PupilTracking.model_rebuild() +EyeTracking.model_rebuild() +CompassDirection.model_rebuild() +Position.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_device.py new file mode 100644 index 0000000..501f181 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_device.py @@ -0,0 +1,45 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBContainer +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Device(NWBContainer): + """ + Metadata about a data acquisition device, e.g., recording system, electrode, microscope. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""") + manufacturer:Optional[str]= Field(None, description="""The name of the manufacturer of the device.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Device.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py new file mode 100644 index 0000000..ac9d643 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ecephys.py @@ -0,0 +1,250 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ElectricalSeries(TimeSeries): + """ + A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. + """ + name:str= Field(...) + data:ElectricalSeriesData= Field(..., description="""Recorded voltage data.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ElectricalSeriesData(ConfiguredBaseModel): + """ + Recorded voltage data. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and 'channel_conversion' (if present).""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_channels"], Number], + NDArray[Shape["* num_times, * num_channels, * num_samples"], Number] + ]]= Field(None) + + +class ElectricalSeriesElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SpikeEventSeries(ElectricalSeries): + """ + Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). + """ + name:str= Field(...) + data:SpikeEventSeriesData= Field(..., description="""Spike waveforms.""") + timestamps:List[float]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpikeEventSeriesData(ConfiguredBaseModel): + """ + Spike waveforms. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""") + array:Optional[Union[ + NDArray[Shape["* num_events, * num_samples"], Number], + NDArray[Shape["* num_events, * num_samples, * num_channels"], Number] + ]]= Field(None) + + +class FeatureExtraction(NWBDataInterface): + """ + Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. + """ + name:str= Field(...) + description:List[str]= Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""") + features:FeatureExtractionFeatures= Field(..., description="""Multi-dimensional array of features extracted from each event.""") + times:List[float]= Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""") + electrodes:FeatureExtractionElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + + +class FeatureExtractionFeatures(ConfiguredBaseModel): + """ + Multi-dimensional array of features extracted from each event. + """ + name:Literal["features"]= Field("features") + array:Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]]= Field(None) + + +class FeatureExtractionElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class EventDetection(NWBDataInterface): + """ + Detected spike events from voltage trace(s). + """ + name:str= Field(...) + detection_method:str= Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""") + source_idx:List[int]= Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""") + times:List[float]= Field(default_factory=list, description="""Timestamps of events, in seconds.""") + + +class EventWaveform(NWBDataInterface): + """ + Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. + """ + name:str= Field(...) + spike_event_series:Optional[List[SpikeEventSeries]]= Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""") + + +class FilteredEphys(NWBDataInterface): + """ + Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""") + + +class LFP(NWBDataInterface): + """ + LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""") + + +class ElectrodeGroup(NWBContainer): + """ + A physical grouping of electrodes, e.g. a shank of an array. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this electrode group.""") + location:Optional[str]= Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""") + position:Optional[Any]= Field(None, description="""stereotaxic or common framework coordinates""") + + +class ClusterWaveforms(NWBDataInterface): + """ + DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. + """ + name:str= Field(...) + waveform_filtering:str= Field(..., description="""Filtering applied to data before generating mean/sd""") + waveform_mean:ClusterWaveformsWaveformMean= Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""") + waveform_sd:ClusterWaveformsWaveformSd= Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""") + + +class ClusterWaveformsWaveformMean(ConfiguredBaseModel): + """ + The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled) + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class ClusterWaveformsWaveformSd(ConfiguredBaseModel): + """ + Stdev of waveforms for each cluster, using the same indices as in mean + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class Clustering(NWBDataInterface): + """ + DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""") + num:List[int]= Field(default_factory=list, description="""Cluster number of each event""") + peak_over_rms:List[float]= Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""") + times:List[float]= Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ElectricalSeries.model_rebuild() +ElectricalSeriesData.model_rebuild() +ElectricalSeriesElectrodes.model_rebuild() +SpikeEventSeries.model_rebuild() +SpikeEventSeriesData.model_rebuild() +FeatureExtraction.model_rebuild() +FeatureExtractionFeatures.model_rebuild() +FeatureExtractionElectrodes.model_rebuild() +EventDetection.model_rebuild() +EventWaveform.model_rebuild() +FilteredEphys.model_rebuild() +LFP.model_rebuild() +ElectrodeGroup.model_rebuild() +ClusterWaveforms.model_rebuild() +ClusterWaveformsWaveformMean.model_rebuild() +ClusterWaveformsWaveformSd.model_rebuild() +Clustering.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py new file mode 100644 index 0000000..fa15d0b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_epoch.py @@ -0,0 +1,76 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TimeIntervals(DynamicTable): + """ + A container for aggregating epoch data and the TimeSeries that each epoch applies to. + """ + name:str= Field(...) + start_time:Optional[List[float]]= Field(default_factory=list, description="""Start time of epoch, in seconds.""") + stop_time:Optional[List[float]]= Field(default_factory=list, description="""Stop time of epoch, in seconds.""") + tags:Optional[List[str]]= Field(default_factory=list, description="""User-defined tags that identify or categorize events.""") + tags_index:Optional[TimeIntervalsTagsIndex]= Field(None, description="""Index for tags.""") + timeseries:Optional[List[Any]]= Field(default_factory=list, description="""An index into a TimeSeries object.""") + timeseries_index:Optional[TimeIntervalsTimeseriesIndex]= Field(None, description="""Index for timeseries.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class TimeIntervalsTagsIndex(VectorIndex): + """ + Index for tags. + """ + name:Literal["tags_index"]= Field("tags_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class TimeIntervalsTimeseriesIndex(VectorIndex): + """ + Index for timeseries. + """ + name:Literal["timeseries_index"]= Field("timeseries_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TimeIntervals.model_rebuild() +TimeIntervalsTagsIndex.model_rebuild() +TimeIntervalsTimeseriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py new file mode 100644 index 0000000..651f110 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_file.py @@ -0,0 +1,238 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_epoch import ( + TimeIntervals +) + +from .core_nwb_base import ( + NWBData, + NWBDataInterface, + TimeSeries, + ProcessingModule, + NWBContainer +) + +from .core_nwb_icephys import ( + SweepTable, + IntracellularElectrode +) + +from .core_nwb_ogen import ( + OptogeneticStimulusSite +) + +from .core_nwb_ophys import ( + ImagingPlane +) + +from .core_nwb_misc import ( + Units +) + +from .core_nwb_device import ( + Device +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ScratchData(NWBData): + """ + Any one-off datasets + """ + name:str= Field(...) + notes:Optional[str]= Field(None, description="""Any notes the user has about the dataset being stored""") + + +class NWBFile(NWBContainer): + """ + An NWB:N file storing cellular-based neurophysiology data from a single experimental session. + """ + name:Literal["root"]= Field("root") + nwb_version:Optional[str]= Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""") + file_create_date:List[datetime ]= Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""") + identifier:str= Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""") + session_description:str= Field(..., description="""A description of the experimental session and data in the file.""") + session_start_time:datetime = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""") + timestamps_reference_time:datetime = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""") + acquisition:Optional[List[Union[DynamicTable, NWBDataInterface]]]= Field(default_factory=list, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""") + analysis:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""") + scratch:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""") + processing:Optional[List[ProcessingModule]]= Field(default_factory=list, description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""") + stimulus:NWBFileStimulus= Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""") + general:NWBFileGeneral= Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""") + intervals:Optional[NWBFileIntervals]= Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""") + units:Optional[Units]= Field(None, description="""Data about sorted spike units.""") + + +class NWBFileStimulus(ConfiguredBaseModel): + """ + Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. + """ + name:Literal["stimulus"]= Field("stimulus") + presentation:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Stimuli presented during the experiment.""") + templates:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""") + + +class NWBFileGeneral(ConfiguredBaseModel): + """ + Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. + """ + name:Literal["general"]= Field("general") + data_collection:Optional[str]= Field(None, description="""Notes about data collection and analysis.""") + experiment_description:Optional[str]= Field(None, description="""General description of the experiment.""") + experimenter:Optional[List[str]]= Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""") + institution:Optional[str]= Field(None, description="""Institution(s) where experiment was performed.""") + keywords:Optional[List[str]]= Field(default_factory=list, description="""Terms to search over.""") + lab:Optional[str]= Field(None, description="""Laboratory where experiment was performed.""") + notes:Optional[str]= Field(None, description="""Notes about the experiment.""") + pharmacology:Optional[str]= Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""") + protocol:Optional[str]= Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""") + related_publications:Optional[List[str]]= Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""") + session_id:Optional[str]= Field(None, description="""Lab-specific ID for the session.""") + slices:Optional[str]= Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""") + source_script:Optional[NWBFileGeneralSourceScript]= Field(None, description="""Script file or link to public source code used to create this NWB file.""") + stimulus:Optional[str]= Field(None, description="""Notes about stimuli, such as how and where they were presented.""") + surgery:Optional[str]= Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""") + virus:Optional[str]= Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""") + lab_meta_data:Optional[List[LabMetaData]]= Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""") + devices:Optional[List[Device]]= Field(default_factory=list, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""") + subject:Optional[Subject]= Field(None, description="""Information about the animal or person from which the data was measured.""") + extracellular_ephys:Optional[NWBFileGeneralExtracellularEphys]= Field(None, description="""Metadata related to extracellular electrophysiology.""") + intracellular_ephys:Optional[NWBFileGeneralIntracellularEphys]= Field(None, description="""Metadata related to intracellular electrophysiology.""") + optogenetics:Optional[List[OptogeneticStimulusSite]]= Field(default_factory=list, description="""Metadata describing optogenetic stimuluation.""") + optophysiology:Optional[List[ImagingPlane]]= Field(default_factory=list, description="""Metadata related to optophysiology.""") + + +class NWBFileGeneralSourceScript(ConfiguredBaseModel): + """ + Script file or link to public source code used to create this NWB file. + """ + name:Literal["source_script"]= Field("source_script") + file_name:Optional[str]= Field(None, description="""Name of script file.""") + value:str= Field(...) + + +class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): + """ + Metadata related to extracellular electrophysiology. + """ + name:Literal["extracellular_ephys"]= Field("extracellular_ephys") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Physical group of electrodes.""") + electrodes:Optional[NWBFileGeneralExtracellularEphysElectrodes]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + + +class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): + """ + A table of all electrodes (i.e. channels) used for recording. + """ + name:Literal["electrodes"]= Field("electrodes") + x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""") + y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""") + z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""") + imp:Optional[List[float]]= Field(default_factory=list, description="""Impedance of the channel.""") + location:Optional[List[str]]= Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + filtering:Optional[List[float]]= Field(default_factory=list, description="""Description of hardware filtering.""") + group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""") + group_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""") + rel_x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate in electrode group""") + rel_y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate in electrode group""") + rel_z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate in electrode group""") + reference:Optional[List[str]]= Field(default_factory=list, description="""Description of the reference used for this electrode.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): + """ + Metadata related to intracellular electrophysiology. + """ + name:Literal["intracellular_ephys"]= Field("intracellular_ephys") + filtering:Optional[str]= Field(None, description="""Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") + intracellular_electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""An intracellular electrode.""") + sweep_table:Optional[SweepTable]= Field(None, description="""The table which groups different PatchClampSeries together.""") + + +class NWBFileIntervals(ConfiguredBaseModel): + """ + Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data. + """ + name:Literal["intervals"]= Field("intervals") + epochs:Optional[TimeIntervals]= Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""") + trials:Optional[TimeIntervals]= Field(None, description="""Repeated experimental events that have a logical grouping.""") + invalid_times:Optional[TimeIntervals]= Field(None, description="""Time intervals that should be removed from analysis.""") + time_intervals:Optional[List[TimeIntervals]]= Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""") + + +class LabMetaData(NWBContainer): + """ + Lab-specific meta-data. + """ + name:str= Field(...) + + +class Subject(NWBContainer): + """ + Information about the animal or person from which the data was measured. + """ + name:str= Field(...) + age:Optional[str]= Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + date_of_birth:Optional[datetime ]= Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""") + description:Optional[str]= Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""") + genotype:Optional[str]= Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") + sex:Optional[str]= Field(None, description="""Gender of subject.""") + species:Optional[str]= Field(None, description="""Species of subject.""") + subject_id:Optional[str]= Field(None, description="""ID of animal/person used/participating in experiment (lab convention).""") + weight:Optional[str]= Field(None, description="""Weight at time of experiment, at time of surgery and at other important times.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ScratchData.model_rebuild() +NWBFile.model_rebuild() +NWBFileStimulus.model_rebuild() +NWBFileGeneral.model_rebuild() +NWBFileGeneralSourceScript.model_rebuild() +NWBFileGeneralExtracellularEphys.model_rebuild() +NWBFileGeneralExtracellularEphysElectrodes.model_rebuild() +NWBFileGeneralIntracellularEphys.model_rebuild() +NWBFileIntervals.model_rebuild() +LabMetaData.model_rebuild() +Subject.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py new file mode 100644 index 0000000..64012f6 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_icephys.py @@ -0,0 +1,322 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class PatchClampSeries(TimeSeries): + """ + An abstract base class for patch-clamp data - stimulus or response, current or voltage. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + data:List[float]= Field(default_factory=list, description="""Recorded voltage or current.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeries(PatchClampSeries): + """ + Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. + """ + name:str= Field(...) + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + bias_current:Optional[float]= Field(None, description="""Bias current, in amps.""") + bridge_balance:Optional[float]= Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation:Optional[float]= Field(None, description="""Capacitance compensation, in farads.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeriesData(ConfiguredBaseModel): + """ + Recorded voltage. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IZeroClampSeries(CurrentClampSeries): + """ + Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. + """ + name:str= Field(...) + bias_current:float= Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance:float= Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation:float= Field(..., description="""Capacitance compensation, in farads, fixed to 0.0.""") + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeries(PatchClampSeries): + """ + Stimulus current applied during current clamp recording. + """ + name:str= Field(...) + data:CurrentClampStimulusSeriesData= Field(..., description="""Stimulus current applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus current applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeries(PatchClampSeries): + """ + Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. + """ + name:str= Field(...) + data:VoltageClampSeriesData= Field(..., description="""Recorded current.""") + capacitance_fast:Optional[VoltageClampSeriesCapacitanceFast]= Field(None, description="""Fast capacitance, in farads.""") + capacitance_slow:Optional[VoltageClampSeriesCapacitanceSlow]= Field(None, description="""Slow capacitance, in farads.""") + resistance_comp_bandwidth:Optional[VoltageClampSeriesResistanceCompBandwidth]= Field(None, description="""Resistance compensation bandwidth, in hertz.""") + resistance_comp_correction:Optional[VoltageClampSeriesResistanceCompCorrection]= Field(None, description="""Resistance compensation correction, in percent.""") + resistance_comp_prediction:Optional[VoltageClampSeriesResistanceCompPrediction]= Field(None, description="""Resistance compensation prediction, in percent.""") + whole_cell_capacitance_comp:Optional[VoltageClampSeriesWholeCellCapacitanceComp]= Field(None, description="""Whole cell capacitance compensation, in farads.""") + whole_cell_series_resistance_comp:Optional[VoltageClampSeriesWholeCellSeriesResistanceComp]= Field(None, description="""Whole cell series resistance compensation, in ohms.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampSeriesData(ConfiguredBaseModel): + """ + Recorded current. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): + """ + Fast capacitance, in farads. + """ + name:Literal["capacitance_fast"]= Field("capacitance_fast") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): + """ + Slow capacitance, in farads. + """ + name:Literal["capacitance_slow"]= Field("capacitance_slow") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): + """ + Resistance compensation bandwidth, in hertz. + """ + name:Literal["resistance_comp_bandwidth"]= Field("resistance_comp_bandwidth") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): + """ + Resistance compensation correction, in percent. + """ + name:Literal["resistance_comp_correction"]= Field("resistance_comp_correction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): + """ + Resistance compensation prediction, in percent. + """ + name:Literal["resistance_comp_prediction"]= Field("resistance_comp_prediction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): + """ + Whole cell capacitance compensation, in farads. + """ + name:Literal["whole_cell_capacitance_comp"]= Field("whole_cell_capacitance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): + """ + Whole cell series resistance compensation, in ohms. + """ + name:Literal["whole_cell_series_resistance_comp"]= Field("whole_cell_series_resistance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""") + value:float= Field(...) + + +class VoltageClampStimulusSeries(PatchClampSeries): + """ + Stimulus voltage applied during a voltage clamp recording. + """ + name:str= Field(...) + data:VoltageClampStimulusSeriesData= Field(..., description="""Stimulus voltage applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus voltage applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IntracellularElectrode(NWBContainer): + """ + An intracellular electrode and its metadata. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + filtering:Optional[str]= Field(None, description="""Electrode specific filtering.""") + initial_access_resistance:Optional[str]= Field(None, description="""Initial access resistance.""") + location:Optional[str]= Field(None, description="""Location of the electrode. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + resistance:Optional[str]= Field(None, description="""Electrode resistance, in ohms.""") + seal:Optional[str]= Field(None, description="""Information about seal used for recording.""") + slice:Optional[str]= Field(None, description="""Information about slice used for recording.""") + + +class SweepTable(DynamicTable): + """ + The table which groups different PatchClampSeries together. + """ + name:str= Field(...) + sweep_number:Optional[List[int]]= Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""") + series:Optional[List[PatchClampSeries]]= Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""") + series_index:SweepTableSeriesIndex= Field(..., description="""Index for series.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class SweepTableSeriesIndex(VectorIndex): + """ + Index for series. + """ + name:Literal["series_index"]= Field("series_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +PatchClampSeries.model_rebuild() +CurrentClampSeries.model_rebuild() +CurrentClampSeriesData.model_rebuild() +IZeroClampSeries.model_rebuild() +CurrentClampStimulusSeries.model_rebuild() +CurrentClampStimulusSeriesData.model_rebuild() +VoltageClampSeries.model_rebuild() +VoltageClampSeriesData.model_rebuild() +VoltageClampSeriesCapacitanceFast.model_rebuild() +VoltageClampSeriesCapacitanceSlow.model_rebuild() +VoltageClampSeriesResistanceCompBandwidth.model_rebuild() +VoltageClampSeriesResistanceCompCorrection.model_rebuild() +VoltageClampSeriesResistanceCompPrediction.model_rebuild() +VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() +VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() +VoltageClampStimulusSeries.model_rebuild() +VoltageClampStimulusSeriesData.model_rebuild() +IntracellularElectrode.model_rebuild() +SweepTable.model_rebuild() +SweepTableSeriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py new file mode 100644 index 0000000..856ec71 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_image.py @@ -0,0 +1,183 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + Image, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class GrayscaleImage(Image): + """ + A grayscale image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBImage(Image): + """ + A color image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBAImage(Image): + """ + A color image with transparency. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImageSeries(TimeSeries): + """ + General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ImageSeriesData(ConfiguredBaseModel): + """ + Binary data representing images across frames. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, * z"], Number] + ]]= Field(None) + + +class ImageMaskSeries(ImageSeries): + """ + An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeries(ImageSeries): + """ + Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. + """ + name:str= Field(...) + distance:Optional[float]= Field(None, description="""Distance from camera/monitor to target/eye.""") + field_of_view:Optional[OpticalSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:OpticalSeriesData= Field(..., description="""Images presented to subject, either grayscale or RGB""") + orientation:Optional[str]= Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class OpticalSeriesData(ConfiguredBaseModel): + """ + Images presented to subject, either grayscale or RGB + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], Number] + ]]= Field(None) + + +class IndexSeries(TimeSeries): + """ + Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Index of the frame in the referenced ImageSeries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +GrayscaleImage.model_rebuild() +RGBImage.model_rebuild() +RGBAImage.model_rebuild() +ImageSeries.model_rebuild() +ImageSeriesData.model_rebuild() +ImageMaskSeries.model_rebuild() +OpticalSeries.model_rebuild() +OpticalSeriesFieldOfView.model_rebuild() +OpticalSeriesData.model_rebuild() +IndexSeries.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py new file mode 100644 index 0000000..6a3c06c --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_misc.py @@ -0,0 +1,304 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class AbstractFeatureSeries(TimeSeries): + """ + Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. + """ + name:str= Field(...) + data:AbstractFeatureSeriesData= Field(..., description="""Values of each feature at each time.""") + feature_units:Optional[List[str]]= Field(default_factory=list, description="""Units of each feature.""") + features:List[str]= Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class AbstractFeatureSeriesData(ConfiguredBaseModel): + """ + Values of each feature at each time. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class AnnotationSeries(TimeSeries): + """ + Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. + """ + name:str= Field(...) + data:List[str]= Field(default_factory=list, description="""Annotations made during an experiment.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class IntervalSeries(TimeSeries): + """ + Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeries(TimeSeries): + """ + Spectral analysis of a time series, e.g. of an LFP or a speech signal. + """ + name:str= Field(...) + data:DecompositionSeriesData= Field(..., description="""Data decomposed into frequency bands.""") + metric:str= Field(..., description="""The metric used, e.g. phase, amplitude, power.""") + bands:DecompositionSeriesBands= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeriesData(ConfiguredBaseModel): + """ + Data decomposed into frequency bands. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]]= Field(None) + + +class DecompositionSeriesBands(DynamicTable): + """ + Table for describing the bands that this series was generated from. There should be one row in this table for each band. + """ + name:Literal["bands"]= Field("bands") + band_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the band, e.g. theta.""") + band_limits:DecompositionSeriesBandsBandLimits= Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""") + band_mean:List[float]= Field(default_factory=list, description="""The mean Gaussian filters, in Hz.""") + band_stdev:List[float]= Field(default_factory=list, description="""The standard deviation of Gaussian filters, in Hz.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class DecompositionSeriesBandsBandLimits(VectorData): + """ + Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center. + """ + name:Literal["band_limits"]= Field("band_limits") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class Units(DynamicTable): + """ + Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. + """ + name:str= Field(...) + spike_times_index:Optional[UnitsSpikeTimesIndex]= Field(None, description="""Index into the spike_times dataset.""") + spike_times:Optional[UnitsSpikeTimes]= Field(None, description="""Spike times for each unit.""") + obs_intervals_index:Optional[UnitsObsIntervalsIndex]= Field(None, description="""Index into the obs_intervals dataset.""") + obs_intervals:Optional[UnitsObsIntervals]= Field(None, description="""Observation intervals for each unit.""") + electrodes_index:Optional[UnitsElectrodesIndex]= Field(None, description="""Index into electrodes.""") + electrodes:Optional[UnitsElectrodes]= Field(None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Electrode group that each spike unit came from.""") + waveform_mean:Optional[UnitsWaveformMean]= Field(None, description="""Spike waveform mean for each spike unit.""") + waveform_sd:Optional[UnitsWaveformSd]= Field(None, description="""Spike waveform standard deviation for each spike unit.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class UnitsSpikeTimesIndex(VectorIndex): + """ + Index into the spike_times dataset. + """ + name:Literal["spike_times_index"]= Field("spike_times_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class UnitsSpikeTimes(VectorData): + """ + Spike times for each unit. + """ + name:Literal["spike_times"]= Field("spike_times") + resolution:Optional[float]= Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsObsIntervalsIndex(VectorIndex): + """ + Index into the obs_intervals dataset. + """ + name:Literal["obs_intervals_index"]= Field("obs_intervals_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class UnitsObsIntervals(VectorData): + """ + Observation intervals for each unit. + """ + name:Literal["obs_intervals"]= Field("obs_intervals") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsElectrodesIndex(VectorIndex): + """ + Index into electrodes. + """ + name:Literal["electrodes_index"]= Field("electrodes_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class UnitsElectrodes(DynamicTableRegion): + """ + Electrode that each spike unit came from, specified using a DynamicTableRegion. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformMean(VectorData): + """ + Spike waveform mean for each spike unit. + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformSd(VectorData): + """ + Spike waveform standard deviation for each spike unit. + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +AbstractFeatureSeries.model_rebuild() +AbstractFeatureSeriesData.model_rebuild() +AnnotationSeries.model_rebuild() +IntervalSeries.model_rebuild() +DecompositionSeries.model_rebuild() +DecompositionSeriesData.model_rebuild() +DecompositionSeriesBands.model_rebuild() +DecompositionSeriesBandsBandLimits.model_rebuild() +Units.model_rebuild() +UnitsSpikeTimesIndex.model_rebuild() +UnitsSpikeTimes.model_rebuild() +UnitsObsIntervalsIndex.model_rebuild() +UnitsObsIntervals.model_rebuild() +UnitsElectrodesIndex.model_rebuild() +UnitsElectrodes.model_rebuild() +UnitsWaveformMean.model_rebuild() +UnitsWaveformSd.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py new file mode 100644 index 0000000..6e8e91a --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ogen.py @@ -0,0 +1,65 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeries, + NWBContainer, + TimeSeriesSync +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class OptogeneticSeries(TimeSeries): + """ + An optogenetic stimulus. + """ + name:str= Field(...) + data:List[float]= Field(default_factory=list, description="""Applied power for optogenetic stimulus, in watts.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OptogeneticStimulusSite(NWBContainer): + """ + A site of optogenetic stimulation. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of stimulation site.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + location:str= Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +OptogeneticSeries.model_rebuild() +OptogeneticStimulusSite.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py new file mode 100644 index 0000000..a5b9522 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_ophys.py @@ -0,0 +1,298 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from .core_nwb_image import ( + ImageSeriesData, + ImageSeries +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TwoPhotonSeries(ImageSeries): + """ + Image stack recorded over time from 2-photon microscope. + """ + name:str= Field(...) + pmt_gain:Optional[float]= Field(None, description="""Photomultiplier gain.""") + scan_line_rate:Optional[float]= Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") + field_of_view:Optional[TwoPhotonSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TwoPhotonSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class RoiResponseSeries(TimeSeries): + """ + ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. + """ + name:str= Field(...) + data:RoiResponseSeriesData= Field(..., description="""Signals from ROIs.""") + rois:RoiResponseSeriesRois= Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class RoiResponseSeriesData(ConfiguredBaseModel): + """ + Signals from ROIs. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_ROIs"], Number] + ]]= Field(None) + + +class RoiResponseSeriesRois(DynamicTableRegion): + """ + DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. + """ + name:Literal["rois"]= Field("rois") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class DfOverF(NWBDataInterface): + """ + dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""") + + +class Fluorescence(NWBDataInterface): + """ + Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""") + + +class ImageSegmentation(NWBDataInterface): + """ + Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. + """ + name:str= Field(...) + plane_segmentation:List[PlaneSegmentation]= Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""") + + +class PlaneSegmentation(DynamicTable): + """ + Results from image segmentation of a specific imaging plane. + """ + name:str= Field(...) + image_mask:Optional[PlaneSegmentationImageMask]= Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""") + pixel_mask_index:Optional[PlaneSegmentationPixelMaskIndex]= Field(None, description="""Index into pixel_mask.""") + pixel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + voxel_mask_index:Optional[PlaneSegmentationVoxelMaskIndex]= Field(None, description="""Index into voxel_mask.""") + voxel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + reference_images:Optional[List[ImageSeries]]= Field(default_factory=list, description="""Image stacks that the segmentation masks apply to.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + +class PlaneSegmentationImageMask(VectorData): + """ + ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero. + """ + name:Literal["image_mask"]= Field("image_mask") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class PlaneSegmentationPixelMaskIndex(VectorIndex): + """ + Index into pixel_mask. + """ + name:Literal["pixel_mask_index"]= Field("pixel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class PlaneSegmentationVoxelMaskIndex(VectorIndex): + """ + Index into voxel_mask. + """ + name:Literal["voxel_mask_index"]= Field("voxel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class ImagingPlane(NWBContainer): + """ + An imaging plane and its metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the imaging plane.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate:Optional[float]= Field(None, description="""Rate that images are acquired, in Hz. If the corresponding TimeSeries is present, the rate should be stored there instead.""") + indicator:str= Field(..., description="""Calcium indicator.""") + location:str= Field(..., description="""Location of the imaging plane. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + manifold:Optional[ImagingPlaneManifold]= Field(None, description="""DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.""") + origin_coords:Optional[ImagingPlaneOriginCoords]= Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""") + grid_spacing:Optional[ImagingPlaneGridSpacing]= Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""") + reference_frame:Optional[str]= Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""") + optical_channel:List[OpticalChannel]= Field(default_factory=list, description="""An optical channel used to record from an imaging plane.""") + + +class ImagingPlaneManifold(ConfiguredBaseModel): + """ + DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. + """ + name:Literal["manifold"]= Field("manifold") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["* height, * width, 3 x_y_z"], Float32], + NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32] + ]]= Field(None) + + +class ImagingPlaneOriginCoords(ConfiguredBaseModel): + """ + Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). + """ + name:Literal["origin_coords"]= Field("origin_coords") + unit:Optional[str]= Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["2 x_y"], Float32], + NDArray[Shape["2 x_y, 3 x_y_z"], Float32] + ]]= Field(None) + + +class ImagingPlaneGridSpacing(ConfiguredBaseModel): + """ + Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. + """ + name:Literal["grid_spacing"]= Field("grid_spacing") + unit:Optional[str]= Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["2 x_y"], Float32], + NDArray[Shape["2 x_y, 3 x_y_z"], Float32] + ]]= Field(None) + + +class OpticalChannel(NWBContainer): + """ + An optical channel used to record from an imaging plane. + """ + name:str= Field(...) + description:str= Field(..., description="""Description or other notes about the channel.""") + emission_lambda:float= Field(..., description="""Emission wavelength for channel, in nm.""") + + +class MotionCorrection(NWBDataInterface): + """ + An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). + """ + name:str= Field(...) + corrected_image_stack:List[CorrectedImageStack]= Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""") + + +class CorrectedImageStack(NWBDataInterface): + """ + Reuslts from motion correction of an image stack. + """ + name:str= Field(...) + corrected:ImageSeries= Field(..., description="""Image stack with frames shifted to the common coordinates.""") + xy_translation:TimeSeries= Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TwoPhotonSeries.model_rebuild() +TwoPhotonSeriesFieldOfView.model_rebuild() +RoiResponseSeries.model_rebuild() +RoiResponseSeriesData.model_rebuild() +RoiResponseSeriesRois.model_rebuild() +DfOverF.model_rebuild() +Fluorescence.model_rebuild() +ImageSegmentation.model_rebuild() +PlaneSegmentation.model_rebuild() +PlaneSegmentationImageMask.model_rebuild() +PlaneSegmentationPixelMaskIndex.model_rebuild() +PlaneSegmentationVoxelMaskIndex.model_rebuild() +ImagingPlane.model_rebuild() +ImagingPlaneManifold.model_rebuild() +ImagingPlaneOriginCoords.model_rebuild() +ImagingPlaneGridSpacing.model_rebuild() +OpticalChannel.model_rebuild() +MotionCorrection.model_rebuild() +CorrectedImageStack.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py new file mode 100644 index 0000000..9c969b6 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/core_nwb_retinotopy.py @@ -0,0 +1,137 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ImagingRetinotopy(NWBDataInterface): + """ + Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). + """ + name:str= Field(...) + axis_1_phase_map:ImagingRetinotopyAxis1PhaseMap= Field(..., description="""Phase response to stimulus on the first measured axis.""") + axis_1_power_map:Optional[ImagingRetinotopyAxis1PowerMap]= Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_2_phase_map:ImagingRetinotopyAxis2PhaseMap= Field(..., description="""Phase response to stimulus on the second measured axis.""") + axis_2_power_map:Optional[ImagingRetinotopyAxis2PowerMap]= Field(None, description="""Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_descriptions:List[str]= Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""") + focal_depth_image:Optional[ImagingRetinotopyFocalDepthImage]= Field(None, description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""") + sign_map:Optional[ImagingRetinotopySignMap]= Field(None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""") + vasculature_image:ImagingRetinotopyVasculatureImage= Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""") + + +class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the first measured axis. + """ + name:Literal["axis_1_phase_map"]= Field("axis_1_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): + """ + Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_1_power_map"]= Field("axis_1_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the second measured axis. + """ + name:Literal["axis_2_phase_map"]= Field("axis_2_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): + """ + Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_2_power_map"]= Field("axis_2_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): + """ + Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. + """ + name:Literal["focal_depth_image"]= Field("focal_depth_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + focal_depth:Optional[float]= Field(None, description="""Focal depth offset, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + +class ImagingRetinotopySignMap(ConfiguredBaseModel): + """ + Sine of the angle between the direction of the gradient in axis_1 and axis_2. + """ + name:Literal["sign_map"]= Field("sign_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): + """ + Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] + """ + name:Literal["vasculature_image"]= Field("vasculature_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ImagingRetinotopy.model_rebuild() +ImagingRetinotopyAxis1PhaseMap.model_rebuild() +ImagingRetinotopyAxis1PowerMap.model_rebuild() +ImagingRetinotopyAxis2PhaseMap.model_rebuild() +ImagingRetinotopyAxis2PowerMap.model_rebuild() +ImagingRetinotopyFocalDepthImage.model_rebuild() +ImagingRetinotopySignMap.model_rebuild() +ImagingRetinotopyVasculatureImage.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/namespace.py new file mode 100644 index 0000000..212ffbf --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_2_5/namespace.py @@ -0,0 +1,146 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_1_3.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_1_3.hdmf_common_table import ( + Data, + Index, + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + Container, + DynamicTable +) + +from .core_nwb_retinotopy import ( + ImagingRetinotopy +) + +from .core_nwb_base import ( + NWBData, + Image, + NWBContainer, + NWBDataInterface, + TimeSeries, + ProcessingModule, + Images +) + +from .core_nwb_ophys import ( + TwoPhotonSeries, + RoiResponseSeries, + DfOverF, + Fluorescence, + ImageSegmentation, + PlaneSegmentation, + ImagingPlane, + OpticalChannel, + MotionCorrection, + CorrectedImageStack +) + +from .core_nwb_device import ( + Device +) + +from .core_nwb_image import ( + GrayscaleImage, + RGBImage, + RGBAImage, + ImageSeries, + ImageMaskSeries, + OpticalSeries, + IndexSeries +) + +from .core_nwb_ogen import ( + OptogeneticSeries, + OptogeneticStimulusSite +) + +from .core_nwb_icephys import ( + PatchClampSeries, + CurrentClampSeries, + IZeroClampSeries, + CurrentClampStimulusSeries, + VoltageClampSeries, + VoltageClampStimulusSeries, + IntracellularElectrode, + SweepTable +) + +from .core_nwb_ecephys import ( + ElectricalSeries, + SpikeEventSeries, + FeatureExtraction, + EventDetection, + EventWaveform, + FilteredEphys, + LFP, + ElectrodeGroup, + ClusterWaveforms, + Clustering +) + +from .core_nwb_behavior import ( + SpatialSeries, + BehavioralEpochs, + BehavioralEvents, + BehavioralTimeSeries, + PupilTracking, + EyeTracking, + CompassDirection, + Position +) + +from .core_nwb_misc import ( + AbstractFeatureSeries, + AnnotationSeries, + IntervalSeries, + DecompositionSeries, + Units +) + +from .core_nwb_file import ( + ScratchData, + NWBFile, + LabMetaData, + Subject +) + +from .core_nwb_epoch import ( + TimeIntervals +) + + +metamodel_version = "None" +version = "2.2.5" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py new file mode 100644 index 0000000..353e4ec --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_base.py @@ -0,0 +1,153 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_5_0.hdmf_common_base import ( + Container, + Data +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBData(Data): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class Image(NWBData): + """ + An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). + """ + name:str= Field(...) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + array:Optional[Union[ + NDArray[Shape["* x, * y"], Number], + NDArray[Shape["* x, * y, 3 r_g_b"], Number], + NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number] + ]]= Field(None) + + +class NWBContainer(Container): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class NWBDataInterface(NWBContainer): + """ + An abstract data type for a generic container storing collections of data, as opposed to metadata. + """ + name:str= Field(...) + + +class TimeSeries(NWBDataInterface): + """ + General purpose time series. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + data:TimeSeriesData= Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TimeSeriesData(ConfiguredBaseModel): + """ + Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. + """ + name:Literal["data"]= Field("data") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""") + resolution:Optional[float]= Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + continuity:Optional[str]= Field(None, description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Any], + NDArray[Shape["* num_times, * num_DIM2"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3, * num_DIM4"], Any] + ]]= Field(None) + + +class TimeSeriesStartingTime(ConfiguredBaseModel): + """ + Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. + """ + name:Literal["starting_time"]= Field("starting_time") + rate:Optional[float]= Field(None, description="""Sampling rate, in Hz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + value:float= Field(...) + + +class TimeSeriesSync(ConfiguredBaseModel): + """ + Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. + """ + name:Literal["sync"]= Field("sync") + + +class ProcessingModule(NWBContainer): + """ + A collection of processed data. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of processed data.""") + nwb_data_interface:Optional[List[NWBDataInterface]]= Field(default_factory=list, description="""Data objects stored in this collection.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""Tables stored in this collection.""") + + +class Images(NWBDataInterface): + """ + A collection of images. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of images.""") + image:List[Image]= Field(default_factory=list, description="""Images stored in this collection.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBData.model_rebuild() +Image.model_rebuild() +NWBContainer.model_rebuild() +NWBDataInterface.model_rebuild() +TimeSeries.model_rebuild() +TimeSeriesData.model_rebuild() +TimeSeriesStartingTime.model_rebuild() +TimeSeriesSync.model_rebuild() +ProcessingModule.model_rebuild() +Images.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py new file mode 100644 index 0000000..832203c --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_behavior.py @@ -0,0 +1,135 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from .core_nwb_misc import ( + IntervalSeries +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class SpatialSeries(TimeSeries): + """ + Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. + """ + name:str= Field(...) + data:SpatialSeriesData= Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""") + reference_frame:Optional[str]= Field(None, description="""Description defining what exactly 'straight-ahead' means.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpatialSeriesData(ConfiguredBaseModel): + """ + 1-D or 2-D array storing position or direction relative to some reference frame. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class BehavioralEpochs(NWBDataInterface): + """ + TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. + """ + name:str= Field(...) + interval_series:Optional[List[IntervalSeries]]= Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""") + + +class BehavioralEvents(NWBDataInterface): + """ + TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing behavioral events.""") + + +class BehavioralTimeSeries(NWBDataInterface): + """ + TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""") + + +class PupilTracking(NWBDataInterface): + """ + Eye-tracking data, representing pupil size. + """ + name:str= Field(...) + time_series:List[TimeSeries]= Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""") + + +class EyeTracking(NWBDataInterface): + """ + Eye-tracking data, representing direction of gaze. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""") + + +class CompassDirection(NWBDataInterface): + """ + With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""") + + +class Position(NWBDataInterface): + """ + Position data, whether along the x, x/y or x/y/z axis. + """ + name:str= Field(...) + spatial_series:List[SpatialSeries]= Field(default_factory=list, description="""SpatialSeries object containing position data.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +SpatialSeries.model_rebuild() +SpatialSeriesData.model_rebuild() +BehavioralEpochs.model_rebuild() +BehavioralEvents.model_rebuild() +BehavioralTimeSeries.model_rebuild() +PupilTracking.model_rebuild() +EyeTracking.model_rebuild() +CompassDirection.model_rebuild() +Position.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_device.py new file mode 100644 index 0000000..1feb89b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_device.py @@ -0,0 +1,45 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBContainer +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Device(NWBContainer): + """ + Metadata about a data acquisition device, e.g., recording system, electrode, microscope. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""") + manufacturer:Optional[str]= Field(None, description="""The name of the manufacturer of the device.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Device.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py new file mode 100644 index 0000000..728e4dc --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ecephys.py @@ -0,0 +1,252 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ElectricalSeries(TimeSeries): + """ + A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. + """ + name:str= Field(...) + filtering:Optional[str]= Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""") + data:ElectricalSeriesData= Field(..., description="""Recorded voltage data.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ElectricalSeriesData(ConfiguredBaseModel): + """ + Recorded voltage data. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and 'channel_conversion' (if present).""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_channels"], Number], + NDArray[Shape["* num_times, * num_channels, * num_samples"], Number] + ]]= Field(None) + + +class ElectricalSeriesElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SpikeEventSeries(ElectricalSeries): + """ + Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). + """ + name:str= Field(...) + data:SpikeEventSeriesData= Field(..., description="""Spike waveforms.""") + timestamps:List[float]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""") + filtering:Optional[str]= Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpikeEventSeriesData(ConfiguredBaseModel): + """ + Spike waveforms. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""") + array:Optional[Union[ + NDArray[Shape["* num_events, * num_samples"], Number], + NDArray[Shape["* num_events, * num_samples, * num_channels"], Number] + ]]= Field(None) + + +class FeatureExtraction(NWBDataInterface): + """ + Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. + """ + name:str= Field(...) + description:List[str]= Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""") + features:FeatureExtractionFeatures= Field(..., description="""Multi-dimensional array of features extracted from each event.""") + times:List[float]= Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""") + electrodes:FeatureExtractionElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + + +class FeatureExtractionFeatures(ConfiguredBaseModel): + """ + Multi-dimensional array of features extracted from each event. + """ + name:Literal["features"]= Field("features") + array:Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]]= Field(None) + + +class FeatureExtractionElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class EventDetection(NWBDataInterface): + """ + Detected spike events from voltage trace(s). + """ + name:str= Field(...) + detection_method:str= Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""") + source_idx:List[int]= Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""") + times:List[float]= Field(default_factory=list, description="""Timestamps of events, in seconds.""") + + +class EventWaveform(NWBDataInterface): + """ + Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. + """ + name:str= Field(...) + spike_event_series:Optional[List[SpikeEventSeries]]= Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""") + + +class FilteredEphys(NWBDataInterface): + """ + Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""") + + +class LFP(NWBDataInterface): + """ + LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""") + + +class ElectrodeGroup(NWBContainer): + """ + A physical grouping of electrodes, e.g. a shank of an array. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this electrode group.""") + location:Optional[str]= Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""") + position:Optional[Any]= Field(None, description="""stereotaxic or common framework coordinates""") + + +class ClusterWaveforms(NWBDataInterface): + """ + DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. + """ + name:str= Field(...) + waveform_filtering:str= Field(..., description="""Filtering applied to data before generating mean/sd""") + waveform_mean:ClusterWaveformsWaveformMean= Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""") + waveform_sd:ClusterWaveformsWaveformSd= Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""") + + +class ClusterWaveformsWaveformMean(ConfiguredBaseModel): + """ + The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled) + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class ClusterWaveformsWaveformSd(ConfiguredBaseModel): + """ + Stdev of waveforms for each cluster, using the same indices as in mean + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class Clustering(NWBDataInterface): + """ + DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""") + num:List[int]= Field(default_factory=list, description="""Cluster number of each event""") + peak_over_rms:List[float]= Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""") + times:List[float]= Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ElectricalSeries.model_rebuild() +ElectricalSeriesData.model_rebuild() +ElectricalSeriesElectrodes.model_rebuild() +SpikeEventSeries.model_rebuild() +SpikeEventSeriesData.model_rebuild() +FeatureExtraction.model_rebuild() +FeatureExtractionFeatures.model_rebuild() +FeatureExtractionElectrodes.model_rebuild() +EventDetection.model_rebuild() +EventWaveform.model_rebuild() +FilteredEphys.model_rebuild() +LFP.model_rebuild() +ElectrodeGroup.model_rebuild() +ClusterWaveforms.model_rebuild() +ClusterWaveformsWaveformMean.model_rebuild() +ClusterWaveformsWaveformSd.model_rebuild() +Clustering.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py new file mode 100644 index 0000000..62fe096 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_epoch.py @@ -0,0 +1,87 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TimeIntervals(DynamicTable): + """ + A container for aggregating epoch data and the TimeSeries that each epoch applies to. + """ + name:str= Field(...) + start_time:Optional[List[float]]= Field(default_factory=list, description="""Start time of epoch, in seconds.""") + stop_time:Optional[List[float]]= Field(default_factory=list, description="""Stop time of epoch, in seconds.""") + tags:Optional[List[str]]= Field(default_factory=list, description="""User-defined tags that identify or categorize events.""") + tags_index:Optional[TimeIntervalsTagsIndex]= Field(None, description="""Index for tags.""") + timeseries:Optional[List[Any]]= Field(default_factory=list, description="""An index into a TimeSeries object.""") + timeseries_index:Optional[TimeIntervalsTimeseriesIndex]= Field(None, description="""Index for timeseries.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class TimeIntervalsTagsIndex(VectorIndex): + """ + Index for tags. + """ + name:Literal["tags_index"]= Field("tags_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class TimeIntervalsTimeseriesIndex(VectorIndex): + """ + Index for timeseries. + """ + name:Literal["timeseries_index"]= Field("timeseries_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TimeIntervals.model_rebuild() +TimeIntervalsTagsIndex.model_rebuild() +TimeIntervalsTimeseriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py new file mode 100644 index 0000000..48994fd --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_file.py @@ -0,0 +1,237 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_epoch import ( + TimeIntervals +) + +from .core_nwb_base import ( + NWBData, + NWBDataInterface, + TimeSeries, + ProcessingModule, + NWBContainer +) + +from .core_nwb_icephys import ( + SweepTable, + IntracellularElectrode +) + +from .core_nwb_ogen import ( + OptogeneticStimulusSite +) + +from .core_nwb_ophys import ( + ImagingPlane +) + +from .core_nwb_misc import ( + Units +) + +from .core_nwb_device import ( + Device +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ScratchData(NWBData): + """ + Any one-off datasets + """ + name:str= Field(...) + notes:Optional[str]= Field(None, description="""Any notes the user has about the dataset being stored""") + + +class NWBFile(NWBContainer): + """ + An NWB:N file storing cellular-based neurophysiology data from a single experimental session. + """ + name:Literal["root"]= Field("root") + nwb_version:Optional[str]= Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""") + file_create_date:List[datetime ]= Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""") + identifier:str= Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""") + session_description:str= Field(..., description="""A description of the experimental session and data in the file.""") + session_start_time:datetime = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""") + timestamps_reference_time:datetime = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""") + acquisition:Optional[List[Union[DynamicTable, NWBDataInterface]]]= Field(default_factory=list, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""") + analysis:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""") + scratch:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""") + processing:Optional[List[ProcessingModule]]= Field(default_factory=list, description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""") + stimulus:NWBFileStimulus= Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""") + general:NWBFileGeneral= Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""") + intervals:Optional[NWBFileIntervals]= Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""") + units:Optional[Units]= Field(None, description="""Data about sorted spike units.""") + + +class NWBFileStimulus(ConfiguredBaseModel): + """ + Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. + """ + name:Literal["stimulus"]= Field("stimulus") + presentation:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Stimuli presented during the experiment.""") + templates:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""") + + +class NWBFileGeneral(ConfiguredBaseModel): + """ + Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. + """ + name:Literal["general"]= Field("general") + data_collection:Optional[str]= Field(None, description="""Notes about data collection and analysis.""") + experiment_description:Optional[str]= Field(None, description="""General description of the experiment.""") + experimenter:Optional[List[str]]= Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""") + institution:Optional[str]= Field(None, description="""Institution(s) where experiment was performed.""") + keywords:Optional[List[str]]= Field(default_factory=list, description="""Terms to search over.""") + lab:Optional[str]= Field(None, description="""Laboratory where experiment was performed.""") + notes:Optional[str]= Field(None, description="""Notes about the experiment.""") + pharmacology:Optional[str]= Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""") + protocol:Optional[str]= Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""") + related_publications:Optional[List[str]]= Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""") + session_id:Optional[str]= Field(None, description="""Lab-specific ID for the session.""") + slices:Optional[str]= Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""") + source_script:Optional[NWBFileGeneralSourceScript]= Field(None, description="""Script file or link to public source code used to create this NWB file.""") + stimulus:Optional[str]= Field(None, description="""Notes about stimuli, such as how and where they were presented.""") + surgery:Optional[str]= Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""") + virus:Optional[str]= Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""") + lab_meta_data:Optional[List[LabMetaData]]= Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""") + devices:Optional[List[Device]]= Field(default_factory=list, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""") + subject:Optional[Subject]= Field(None, description="""Information about the animal or person from which the data was measured.""") + extracellular_ephys:Optional[NWBFileGeneralExtracellularEphys]= Field(None, description="""Metadata related to extracellular electrophysiology.""") + intracellular_ephys:Optional[NWBFileGeneralIntracellularEphys]= Field(None, description="""Metadata related to intracellular electrophysiology.""") + optogenetics:Optional[List[OptogeneticStimulusSite]]= Field(default_factory=list, description="""Metadata describing optogenetic stimuluation.""") + optophysiology:Optional[List[ImagingPlane]]= Field(default_factory=list, description="""Metadata related to optophysiology.""") + + +class NWBFileGeneralSourceScript(ConfiguredBaseModel): + """ + Script file or link to public source code used to create this NWB file. + """ + name:Literal["source_script"]= Field("source_script") + file_name:Optional[str]= Field(None, description="""Name of script file.""") + value:str= Field(...) + + +class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): + """ + Metadata related to extracellular electrophysiology. + """ + name:Literal["extracellular_ephys"]= Field("extracellular_ephys") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Physical group of electrodes.""") + electrodes:Optional[NWBFileGeneralExtracellularEphysElectrodes]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + + +class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): + """ + A table of all electrodes (i.e. channels) used for recording. + """ + name:Literal["electrodes"]= Field("electrodes") + x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""") + y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""") + z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""") + imp:Optional[List[float]]= Field(default_factory=list, description="""Impedance of the channel, in ohms.""") + location:Optional[List[str]]= Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + filtering:Optional[List[float]]= Field(default_factory=list, description="""Description of hardware filtering, including the filter name and frequency cutoffs.""") + group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""") + group_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""") + rel_x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate in electrode group""") + rel_y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate in electrode group""") + rel_z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate in electrode group""") + reference:Optional[List[str]]= Field(default_factory=list, description="""Description of the reference used for this electrode.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): + """ + Metadata related to intracellular electrophysiology. + """ + name:Literal["intracellular_ephys"]= Field("intracellular_ephys") + filtering:Optional[str]= Field(None, description="""Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") + intracellular_electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""An intracellular electrode.""") + sweep_table:Optional[SweepTable]= Field(None, description="""The table which groups different PatchClampSeries together.""") + + +class NWBFileIntervals(ConfiguredBaseModel): + """ + Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data. + """ + name:Literal["intervals"]= Field("intervals") + epochs:Optional[TimeIntervals]= Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""") + trials:Optional[TimeIntervals]= Field(None, description="""Repeated experimental events that have a logical grouping.""") + invalid_times:Optional[TimeIntervals]= Field(None, description="""Time intervals that should be removed from analysis.""") + time_intervals:Optional[List[TimeIntervals]]= Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""") + + +class LabMetaData(NWBContainer): + """ + Lab-specific meta-data. + """ + name:str= Field(...) + + +class Subject(NWBContainer): + """ + Information about the animal or person from which the data was measured. + """ + name:str= Field(...) + age:Optional[str]= Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + date_of_birth:Optional[datetime ]= Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""") + description:Optional[str]= Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""") + genotype:Optional[str]= Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") + sex:Optional[str]= Field(None, description="""Gender of subject.""") + species:Optional[str]= Field(None, description="""Species of subject.""") + strain:Optional[str]= Field(None, description="""Strain of subject.""") + subject_id:Optional[str]= Field(None, description="""ID of animal/person used/participating in experiment (lab convention).""") + weight:Optional[str]= Field(None, description="""Weight at time of experiment, at time of surgery and at other important times.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ScratchData.model_rebuild() +NWBFile.model_rebuild() +NWBFileStimulus.model_rebuild() +NWBFileGeneral.model_rebuild() +NWBFileGeneralSourceScript.model_rebuild() +NWBFileGeneralExtracellularEphys.model_rebuild() +NWBFileGeneralExtracellularEphysElectrodes.model_rebuild() +NWBFileGeneralIntracellularEphys.model_rebuild() +NWBFileIntervals.model_rebuild() +LabMetaData.model_rebuild() +Subject.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py new file mode 100644 index 0000000..68a0727 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_icephys.py @@ -0,0 +1,327 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class PatchClampSeries(TimeSeries): + """ + An abstract base class for patch-clamp data - stimulus or response, current or voltage. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + data:List[float]= Field(default_factory=list, description="""Recorded voltage or current.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeries(PatchClampSeries): + """ + Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. + """ + name:str= Field(...) + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + bias_current:Optional[float]= Field(None, description="""Bias current, in amps.""") + bridge_balance:Optional[float]= Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation:Optional[float]= Field(None, description="""Capacitance compensation, in farads.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeriesData(ConfiguredBaseModel): + """ + Recorded voltage. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IZeroClampSeries(CurrentClampSeries): + """ + Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""") + bias_current:float= Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance:float= Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation:float= Field(..., description="""Capacitance compensation, in farads, fixed to 0.0.""") + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeries(PatchClampSeries): + """ + Stimulus current applied during current clamp recording. + """ + name:str= Field(...) + data:CurrentClampStimulusSeriesData= Field(..., description="""Stimulus current applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus current applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeries(PatchClampSeries): + """ + Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. + """ + name:str= Field(...) + data:VoltageClampSeriesData= Field(..., description="""Recorded current.""") + capacitance_fast:Optional[VoltageClampSeriesCapacitanceFast]= Field(None, description="""Fast capacitance, in farads.""") + capacitance_slow:Optional[VoltageClampSeriesCapacitanceSlow]= Field(None, description="""Slow capacitance, in farads.""") + resistance_comp_bandwidth:Optional[VoltageClampSeriesResistanceCompBandwidth]= Field(None, description="""Resistance compensation bandwidth, in hertz.""") + resistance_comp_correction:Optional[VoltageClampSeriesResistanceCompCorrection]= Field(None, description="""Resistance compensation correction, in percent.""") + resistance_comp_prediction:Optional[VoltageClampSeriesResistanceCompPrediction]= Field(None, description="""Resistance compensation prediction, in percent.""") + whole_cell_capacitance_comp:Optional[VoltageClampSeriesWholeCellCapacitanceComp]= Field(None, description="""Whole cell capacitance compensation, in farads.""") + whole_cell_series_resistance_comp:Optional[VoltageClampSeriesWholeCellSeriesResistanceComp]= Field(None, description="""Whole cell series resistance compensation, in ohms.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampSeriesData(ConfiguredBaseModel): + """ + Recorded current. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): + """ + Fast capacitance, in farads. + """ + name:Literal["capacitance_fast"]= Field("capacitance_fast") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): + """ + Slow capacitance, in farads. + """ + name:Literal["capacitance_slow"]= Field("capacitance_slow") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): + """ + Resistance compensation bandwidth, in hertz. + """ + name:Literal["resistance_comp_bandwidth"]= Field("resistance_comp_bandwidth") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): + """ + Resistance compensation correction, in percent. + """ + name:Literal["resistance_comp_correction"]= Field("resistance_comp_correction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): + """ + Resistance compensation prediction, in percent. + """ + name:Literal["resistance_comp_prediction"]= Field("resistance_comp_prediction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): + """ + Whole cell capacitance compensation, in farads. + """ + name:Literal["whole_cell_capacitance_comp"]= Field("whole_cell_capacitance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): + """ + Whole cell series resistance compensation, in ohms. + """ + name:Literal["whole_cell_series_resistance_comp"]= Field("whole_cell_series_resistance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""") + value:float= Field(...) + + +class VoltageClampStimulusSeries(PatchClampSeries): + """ + Stimulus voltage applied during a voltage clamp recording. + """ + name:str= Field(...) + data:VoltageClampStimulusSeriesData= Field(..., description="""Stimulus voltage applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus voltage applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IntracellularElectrode(NWBContainer): + """ + An intracellular electrode and its metadata. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + filtering:Optional[str]= Field(None, description="""Electrode specific filtering.""") + initial_access_resistance:Optional[str]= Field(None, description="""Initial access resistance.""") + location:Optional[str]= Field(None, description="""Location of the electrode. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + resistance:Optional[str]= Field(None, description="""Electrode resistance, in ohms.""") + seal:Optional[str]= Field(None, description="""Information about seal used for recording.""") + slice:Optional[str]= Field(None, description="""Information about slice used for recording.""") + + +class SweepTable(DynamicTable): + """ + The table which groups different PatchClampSeries together. + """ + name:str= Field(...) + sweep_number:Optional[List[int]]= Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""") + series:Optional[List[PatchClampSeries]]= Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""") + series_index:SweepTableSeriesIndex= Field(..., description="""Index for series.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class SweepTableSeriesIndex(VectorIndex): + """ + Index for series. + """ + name:Literal["series_index"]= Field("series_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +PatchClampSeries.model_rebuild() +CurrentClampSeries.model_rebuild() +CurrentClampSeriesData.model_rebuild() +IZeroClampSeries.model_rebuild() +CurrentClampStimulusSeries.model_rebuild() +CurrentClampStimulusSeriesData.model_rebuild() +VoltageClampSeries.model_rebuild() +VoltageClampSeriesData.model_rebuild() +VoltageClampSeriesCapacitanceFast.model_rebuild() +VoltageClampSeriesCapacitanceSlow.model_rebuild() +VoltageClampSeriesResistanceCompBandwidth.model_rebuild() +VoltageClampSeriesResistanceCompCorrection.model_rebuild() +VoltageClampSeriesResistanceCompPrediction.model_rebuild() +VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() +VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() +VoltageClampStimulusSeries.model_rebuild() +VoltageClampStimulusSeriesData.model_rebuild() +IntracellularElectrode.model_rebuild() +SweepTable.model_rebuild() +SweepTableSeriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py new file mode 100644 index 0000000..2b78c9f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_image.py @@ -0,0 +1,183 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + Image, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class GrayscaleImage(Image): + """ + A grayscale image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBImage(Image): + """ + A color image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBAImage(Image): + """ + A color image with transparency. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImageSeries(TimeSeries): + """ + General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ImageSeriesData(ConfiguredBaseModel): + """ + Binary data representing images across frames. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, * z"], Number] + ]]= Field(None) + + +class ImageMaskSeries(ImageSeries): + """ + An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. + """ + name:str= Field(...) + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeries(ImageSeries): + """ + Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. + """ + name:str= Field(...) + distance:Optional[float]= Field(None, description="""Distance from camera/monitor to target/eye.""") + field_of_view:Optional[OpticalSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:OpticalSeriesData= Field(..., description="""Images presented to subject, either grayscale or RGB""") + orientation:Optional[str]= Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class OpticalSeriesData(ConfiguredBaseModel): + """ + Images presented to subject, either grayscale or RGB + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], Number] + ]]= Field(None) + + +class IndexSeries(TimeSeries): + """ + Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Index of the frame in the referenced ImageSeries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +GrayscaleImage.model_rebuild() +RGBImage.model_rebuild() +RGBAImage.model_rebuild() +ImageSeries.model_rebuild() +ImageSeriesData.model_rebuild() +ImageMaskSeries.model_rebuild() +OpticalSeries.model_rebuild() +OpticalSeriesFieldOfView.model_rebuild() +OpticalSeriesData.model_rebuild() +IndexSeries.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py new file mode 100644 index 0000000..666340b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_misc.py @@ -0,0 +1,389 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class AbstractFeatureSeries(TimeSeries): + """ + Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. + """ + name:str= Field(...) + data:AbstractFeatureSeriesData= Field(..., description="""Values of each feature at each time.""") + feature_units:Optional[List[str]]= Field(default_factory=list, description="""Units of each feature.""") + features:List[str]= Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class AbstractFeatureSeriesData(ConfiguredBaseModel): + """ + Values of each feature at each time. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class AnnotationSeries(TimeSeries): + """ + Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. + """ + name:str= Field(...) + data:List[str]= Field(default_factory=list, description="""Annotations made during an experiment.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class IntervalSeries(TimeSeries): + """ + Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeries(TimeSeries): + """ + Spectral analysis of a time series, e.g. of an LFP or a speech signal. + """ + name:str= Field(...) + data:DecompositionSeriesData= Field(..., description="""Data decomposed into frequency bands.""") + metric:str= Field(..., description="""The metric used, e.g. phase, amplitude, power.""") + source_channels:Optional[DecompositionSeriesSourceChannels]= Field(None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""") + bands:DecompositionSeriesBands= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeriesData(ConfiguredBaseModel): + """ + Data decomposed into frequency bands. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]]= Field(None) + + +class DecompositionSeriesSourceChannels(DynamicTableRegion): + """ + DynamicTableRegion pointer to the channels that this decomposition series was generated from. + """ + name:Literal["source_channels"]= Field("source_channels") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class DecompositionSeriesBands(DynamicTable): + """ + Table for describing the bands that this series was generated from. There should be one row in this table for each band. + """ + name:Literal["bands"]= Field("bands") + band_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the band, e.g. theta.""") + band_limits:DecompositionSeriesBandsBandLimits= Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""") + band_mean:List[float]= Field(default_factory=list, description="""The mean Gaussian filters, in Hz.""") + band_stdev:List[float]= Field(default_factory=list, description="""The standard deviation of Gaussian filters, in Hz.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class DecompositionSeriesBandsBandLimits(VectorData): + """ + Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center. + """ + name:Literal["band_limits"]= Field("band_limits") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class Units(DynamicTable): + """ + Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. + """ + name:str= Field(...) + spike_times_index:Optional[UnitsSpikeTimesIndex]= Field(None, description="""Index into the spike_times dataset.""") + spike_times:Optional[UnitsSpikeTimes]= Field(None, description="""Spike times for each unit.""") + obs_intervals_index:Optional[UnitsObsIntervalsIndex]= Field(None, description="""Index into the obs_intervals dataset.""") + obs_intervals:Optional[UnitsObsIntervals]= Field(None, description="""Observation intervals for each unit.""") + electrodes_index:Optional[UnitsElectrodesIndex]= Field(None, description="""Index into electrodes.""") + electrodes:Optional[UnitsElectrodes]= Field(None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Electrode group that each spike unit came from.""") + waveform_mean:Optional[UnitsWaveformMean]= Field(None, description="""Spike waveform mean for each spike unit.""") + waveform_sd:Optional[UnitsWaveformSd]= Field(None, description="""Spike waveform standard deviation for each spike unit.""") + waveforms:Optional[UnitsWaveforms]= Field(None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""") + waveforms_index:Optional[UnitsWaveformsIndex]= Field(None, description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""") + waveforms_index_index:Optional[UnitsWaveformsIndexIndex]= Field(None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class UnitsSpikeTimesIndex(VectorIndex): + """ + Index into the spike_times dataset. + """ + name:Literal["spike_times_index"]= Field("spike_times_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsSpikeTimes(VectorData): + """ + Spike times for each unit. + """ + name:Literal["spike_times"]= Field("spike_times") + resolution:Optional[float]= Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsObsIntervalsIndex(VectorIndex): + """ + Index into the obs_intervals dataset. + """ + name:Literal["obs_intervals_index"]= Field("obs_intervals_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsObsIntervals(VectorData): + """ + Observation intervals for each unit. + """ + name:Literal["obs_intervals"]= Field("obs_intervals") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsElectrodesIndex(VectorIndex): + """ + Index into electrodes. + """ + name:Literal["electrodes_index"]= Field("electrodes_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsElectrodes(DynamicTableRegion): + """ + Electrode that each spike unit came from, specified using a DynamicTableRegion. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformMean(VectorData): + """ + Spike waveform mean for each spike unit. + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformSd(VectorData): + """ + Spike waveform standard deviation for each spike unit. + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveforms(VectorData): + """ + Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same. + """ + name:Literal["waveforms"]= Field("waveforms") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformsIndex(VectorIndex): + """ + Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail. + """ + name:Literal["waveforms_index"]= Field("waveforms_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformsIndexIndex(VectorIndex): + """ + Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail. + """ + name:Literal["waveforms_index_index"]= Field("waveforms_index_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +AbstractFeatureSeries.model_rebuild() +AbstractFeatureSeriesData.model_rebuild() +AnnotationSeries.model_rebuild() +IntervalSeries.model_rebuild() +DecompositionSeries.model_rebuild() +DecompositionSeriesData.model_rebuild() +DecompositionSeriesSourceChannels.model_rebuild() +DecompositionSeriesBands.model_rebuild() +DecompositionSeriesBandsBandLimits.model_rebuild() +Units.model_rebuild() +UnitsSpikeTimesIndex.model_rebuild() +UnitsSpikeTimes.model_rebuild() +UnitsObsIntervalsIndex.model_rebuild() +UnitsObsIntervals.model_rebuild() +UnitsElectrodesIndex.model_rebuild() +UnitsElectrodes.model_rebuild() +UnitsWaveformMean.model_rebuild() +UnitsWaveformSd.model_rebuild() +UnitsWaveforms.model_rebuild() +UnitsWaveformsIndex.model_rebuild() +UnitsWaveformsIndexIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py new file mode 100644 index 0000000..c9f9047 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ogen.py @@ -0,0 +1,65 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeries, + NWBContainer, + TimeSeriesSync +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class OptogeneticSeries(TimeSeries): + """ + An optogenetic stimulus. + """ + name:str= Field(...) + data:List[float]= Field(default_factory=list, description="""Applied power for optogenetic stimulus, in watts.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OptogeneticStimulusSite(NWBContainer): + """ + A site of optogenetic stimulation. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of stimulation site.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + location:str= Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +OptogeneticSeries.model_rebuild() +OptogeneticStimulusSite.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py new file mode 100644 index 0000000..61d6c02 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_ophys.py @@ -0,0 +1,309 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from .core_nwb_image import ( + ImageSeriesData, + ImageSeries +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TwoPhotonSeries(ImageSeries): + """ + Image stack recorded over time from 2-photon microscope. + """ + name:str= Field(...) + pmt_gain:Optional[float]= Field(None, description="""Photomultiplier gain.""") + scan_line_rate:Optional[float]= Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") + field_of_view:Optional[TwoPhotonSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:Optional[ImageSeriesData]= Field(None, description="""Binary data representing images across frames.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TwoPhotonSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class RoiResponseSeries(TimeSeries): + """ + ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. + """ + name:str= Field(...) + data:RoiResponseSeriesData= Field(..., description="""Signals from ROIs.""") + rois:RoiResponseSeriesRois= Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class RoiResponseSeriesData(ConfiguredBaseModel): + """ + Signals from ROIs. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_ROIs"], Number] + ]]= Field(None) + + +class RoiResponseSeriesRois(DynamicTableRegion): + """ + DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. + """ + name:Literal["rois"]= Field("rois") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class DfOverF(NWBDataInterface): + """ + dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""") + + +class Fluorescence(NWBDataInterface): + """ + Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""") + + +class ImageSegmentation(NWBDataInterface): + """ + Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. + """ + name:str= Field(...) + plane_segmentation:List[PlaneSegmentation]= Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""") + + +class PlaneSegmentation(DynamicTable): + """ + Results from image segmentation of a specific imaging plane. + """ + name:str= Field(...) + image_mask:Optional[PlaneSegmentationImageMask]= Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""") + pixel_mask_index:Optional[PlaneSegmentationPixelMaskIndex]= Field(None, description="""Index into pixel_mask.""") + pixel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + voxel_mask_index:Optional[PlaneSegmentationVoxelMaskIndex]= Field(None, description="""Index into voxel_mask.""") + voxel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + reference_images:Optional[List[ImageSeries]]= Field(default_factory=list, description="""Image stacks that the segmentation masks apply to.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class PlaneSegmentationImageMask(VectorData): + """ + ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero. + """ + name:Literal["image_mask"]= Field("image_mask") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class PlaneSegmentationPixelMaskIndex(VectorIndex): + """ + Index into pixel_mask. + """ + name:Literal["pixel_mask_index"]= Field("pixel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class PlaneSegmentationVoxelMaskIndex(VectorIndex): + """ + Index into voxel_mask. + """ + name:Literal["voxel_mask_index"]= Field("voxel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class ImagingPlane(NWBContainer): + """ + An imaging plane and its metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the imaging plane.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate:Optional[float]= Field(None, description="""Rate that images are acquired, in Hz. If the corresponding TimeSeries is present, the rate should be stored there instead.""") + indicator:str= Field(..., description="""Calcium indicator.""") + location:str= Field(..., description="""Location of the imaging plane. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + manifold:Optional[ImagingPlaneManifold]= Field(None, description="""DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.""") + origin_coords:Optional[ImagingPlaneOriginCoords]= Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""") + grid_spacing:Optional[ImagingPlaneGridSpacing]= Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""") + reference_frame:Optional[str]= Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""") + optical_channel:List[OpticalChannel]= Field(default_factory=list, description="""An optical channel used to record from an imaging plane.""") + + +class ImagingPlaneManifold(ConfiguredBaseModel): + """ + DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. + """ + name:Literal["manifold"]= Field("manifold") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["* height, * width, 3 x_y_z"], Float32], + NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32] + ]]= Field(None) + + +class ImagingPlaneOriginCoords(ConfiguredBaseModel): + """ + Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). + """ + name:Literal["origin_coords"]= Field("origin_coords") + unit:Optional[str]= Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["2 x_y"], Float32], + NDArray[Shape["2 x_y, 3 x_y_z"], Float32] + ]]= Field(None) + + +class ImagingPlaneGridSpacing(ConfiguredBaseModel): + """ + Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. + """ + name:Literal["grid_spacing"]= Field("grid_spacing") + unit:Optional[str]= Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["2 x_y"], Float32], + NDArray[Shape["2 x_y, 3 x_y_z"], Float32] + ]]= Field(None) + + +class OpticalChannel(NWBContainer): + """ + An optical channel used to record from an imaging plane. + """ + name:str= Field(...) + description:str= Field(..., description="""Description or other notes about the channel.""") + emission_lambda:float= Field(..., description="""Emission wavelength for channel, in nm.""") + + +class MotionCorrection(NWBDataInterface): + """ + An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). + """ + name:str= Field(...) + corrected_image_stack:List[CorrectedImageStack]= Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""") + + +class CorrectedImageStack(NWBDataInterface): + """ + Reuslts from motion correction of an image stack. + """ + name:str= Field(...) + corrected:ImageSeries= Field(..., description="""Image stack with frames shifted to the common coordinates.""") + xy_translation:TimeSeries= Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TwoPhotonSeries.model_rebuild() +TwoPhotonSeriesFieldOfView.model_rebuild() +RoiResponseSeries.model_rebuild() +RoiResponseSeriesData.model_rebuild() +RoiResponseSeriesRois.model_rebuild() +DfOverF.model_rebuild() +Fluorescence.model_rebuild() +ImageSegmentation.model_rebuild() +PlaneSegmentation.model_rebuild() +PlaneSegmentationImageMask.model_rebuild() +PlaneSegmentationPixelMaskIndex.model_rebuild() +PlaneSegmentationVoxelMaskIndex.model_rebuild() +ImagingPlane.model_rebuild() +ImagingPlaneManifold.model_rebuild() +ImagingPlaneOriginCoords.model_rebuild() +ImagingPlaneGridSpacing.model_rebuild() +OpticalChannel.model_rebuild() +MotionCorrection.model_rebuild() +CorrectedImageStack.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py new file mode 100644 index 0000000..bf3e3d4 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/core_nwb_retinotopy.py @@ -0,0 +1,137 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ImagingRetinotopy(NWBDataInterface): + """ + Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). + """ + name:str= Field(...) + axis_1_phase_map:ImagingRetinotopyAxis1PhaseMap= Field(..., description="""Phase response to stimulus on the first measured axis.""") + axis_1_power_map:Optional[ImagingRetinotopyAxis1PowerMap]= Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_2_phase_map:ImagingRetinotopyAxis2PhaseMap= Field(..., description="""Phase response to stimulus on the second measured axis.""") + axis_2_power_map:Optional[ImagingRetinotopyAxis2PowerMap]= Field(None, description="""Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_descriptions:List[str]= Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""") + focal_depth_image:Optional[ImagingRetinotopyFocalDepthImage]= Field(None, description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""") + sign_map:Optional[ImagingRetinotopySignMap]= Field(None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""") + vasculature_image:ImagingRetinotopyVasculatureImage= Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""") + + +class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the first measured axis. + """ + name:Literal["axis_1_phase_map"]= Field("axis_1_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): + """ + Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_1_power_map"]= Field("axis_1_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the second measured axis. + """ + name:Literal["axis_2_phase_map"]= Field("axis_2_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): + """ + Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_2_power_map"]= Field("axis_2_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): + """ + Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. + """ + name:Literal["focal_depth_image"]= Field("focal_depth_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + focal_depth:Optional[float]= Field(None, description="""Focal depth offset, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + +class ImagingRetinotopySignMap(ConfiguredBaseModel): + """ + Sine of the angle between the direction of the gradient in axis_1 and axis_2. + """ + name:Literal["sign_map"]= Field("sign_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): + """ + Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] + """ + name:Literal["vasculature_image"]= Field("vasculature_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ImagingRetinotopy.model_rebuild() +ImagingRetinotopyAxis1PhaseMap.model_rebuild() +ImagingRetinotopyAxis1PowerMap.model_rebuild() +ImagingRetinotopyAxis2PhaseMap.model_rebuild() +ImagingRetinotopyAxis2PowerMap.model_rebuild() +ImagingRetinotopyFocalDepthImage.model_rebuild() +ImagingRetinotopySignMap.model_rebuild() +ImagingRetinotopyVasculatureImage.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/namespace.py new file mode 100644 index 0000000..61d17ea --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_3_0/namespace.py @@ -0,0 +1,158 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_experimental.v0_1_0.hdmf_experimental_resources import ( + ExternalResources +) + +from ...hdmf_common.v1_5_0.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_5_0.hdmf_common_base import ( + Data, + Container, + SimpleMultiContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + DynamicTable, + AlignedDynamicTable +) + +from ...hdmf_experimental.v0_1_0.hdmf_experimental_experimental import ( + EnumData +) + +from .core_nwb_retinotopy import ( + ImagingRetinotopy +) + +from .core_nwb_base import ( + NWBData, + Image, + NWBContainer, + NWBDataInterface, + TimeSeries, + ProcessingModule, + Images +) + +from .core_nwb_ophys import ( + TwoPhotonSeries, + RoiResponseSeries, + DfOverF, + Fluorescence, + ImageSegmentation, + PlaneSegmentation, + ImagingPlane, + OpticalChannel, + MotionCorrection, + CorrectedImageStack +) + +from .core_nwb_device import ( + Device +) + +from .core_nwb_image import ( + GrayscaleImage, + RGBImage, + RGBAImage, + ImageSeries, + ImageMaskSeries, + OpticalSeries, + IndexSeries +) + +from .core_nwb_ogen import ( + OptogeneticSeries, + OptogeneticStimulusSite +) + +from .core_nwb_icephys import ( + PatchClampSeries, + CurrentClampSeries, + IZeroClampSeries, + CurrentClampStimulusSeries, + VoltageClampSeries, + VoltageClampStimulusSeries, + IntracellularElectrode, + SweepTable +) + +from .core_nwb_ecephys import ( + ElectricalSeries, + SpikeEventSeries, + FeatureExtraction, + EventDetection, + EventWaveform, + FilteredEphys, + LFP, + ElectrodeGroup, + ClusterWaveforms, + Clustering +) + +from .core_nwb_behavior import ( + SpatialSeries, + BehavioralEpochs, + BehavioralEvents, + BehavioralTimeSeries, + PupilTracking, + EyeTracking, + CompassDirection, + Position +) + +from .core_nwb_misc import ( + AbstractFeatureSeries, + AnnotationSeries, + IntervalSeries, + DecompositionSeries, + Units +) + +from .core_nwb_file import ( + ScratchData, + NWBFile, + LabMetaData, + Subject +) + +from .core_nwb_epoch import ( + TimeIntervals +) + + +metamodel_version = "None" +version = "2.3.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py new file mode 100644 index 0000000..cd0e621 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_base.py @@ -0,0 +1,169 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_5_0.hdmf_common_base import ( + Container, + Data +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable, + VectorData +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBData(Data): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class TimeSeriesReferenceVectorData(VectorData): + """ + Column storing references to a TimeSeries (rows). For each TimeSeries this VectorData column stores the start_index and count to indicate the range in time to be selected as well as an object reference to the TimeSeries. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class Image(NWBData): + """ + An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). + """ + name:str= Field(...) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + array:Optional[Union[ + NDArray[Shape["* x, * y"], Number], + NDArray[Shape["* x, * y, 3 r_g_b"], Number], + NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number] + ]]= Field(None) + + +class NWBContainer(Container): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class NWBDataInterface(NWBContainer): + """ + An abstract data type for a generic container storing collections of data, as opposed to metadata. + """ + name:str= Field(...) + + +class TimeSeries(NWBDataInterface): + """ + General purpose time series. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + data:TimeSeriesData= Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TimeSeriesData(ConfiguredBaseModel): + """ + Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. + """ + name:Literal["data"]= Field("data") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""") + resolution:Optional[float]= Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + continuity:Optional[str]= Field(None, description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Any], + NDArray[Shape["* num_times, * num_DIM2"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3, * num_DIM4"], Any] + ]]= Field(None) + + +class TimeSeriesStartingTime(ConfiguredBaseModel): + """ + Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. + """ + name:Literal["starting_time"]= Field("starting_time") + rate:Optional[float]= Field(None, description="""Sampling rate, in Hz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + value:float= Field(...) + + +class TimeSeriesSync(ConfiguredBaseModel): + """ + Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. + """ + name:Literal["sync"]= Field("sync") + + +class ProcessingModule(NWBContainer): + """ + A collection of processed data. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of processed data.""") + nwb_data_interface:Optional[List[NWBDataInterface]]= Field(default_factory=list, description="""Data objects stored in this collection.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""Tables stored in this collection.""") + + +class Images(NWBDataInterface): + """ + A collection of images. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of images.""") + image:List[Image]= Field(default_factory=list, description="""Images stored in this collection.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBData.model_rebuild() +TimeSeriesReferenceVectorData.model_rebuild() +Image.model_rebuild() +NWBContainer.model_rebuild() +NWBDataInterface.model_rebuild() +TimeSeries.model_rebuild() +TimeSeriesData.model_rebuild() +TimeSeriesStartingTime.model_rebuild() +TimeSeriesSync.model_rebuild() +ProcessingModule.model_rebuild() +Images.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py new file mode 100644 index 0000000..98f2b50 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_behavior.py @@ -0,0 +1,135 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from .core_nwb_misc import ( + IntervalSeries +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class SpatialSeries(TimeSeries): + """ + Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. + """ + name:str= Field(...) + data:SpatialSeriesData= Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""") + reference_frame:Optional[str]= Field(None, description="""Description defining what exactly 'straight-ahead' means.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpatialSeriesData(ConfiguredBaseModel): + """ + 1-D or 2-D array storing position or direction relative to some reference frame. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class BehavioralEpochs(NWBDataInterface): + """ + TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. + """ + name:str= Field(...) + interval_series:Optional[List[IntervalSeries]]= Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""") + + +class BehavioralEvents(NWBDataInterface): + """ + TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing behavioral events.""") + + +class BehavioralTimeSeries(NWBDataInterface): + """ + TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""") + + +class PupilTracking(NWBDataInterface): + """ + Eye-tracking data, representing pupil size. + """ + name:str= Field(...) + time_series:List[TimeSeries]= Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""") + + +class EyeTracking(NWBDataInterface): + """ + Eye-tracking data, representing direction of gaze. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""") + + +class CompassDirection(NWBDataInterface): + """ + With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""") + + +class Position(NWBDataInterface): + """ + Position data, whether along the x, x/y or x/y/z axis. + """ + name:str= Field(...) + spatial_series:List[SpatialSeries]= Field(default_factory=list, description="""SpatialSeries object containing position data.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +SpatialSeries.model_rebuild() +SpatialSeriesData.model_rebuild() +BehavioralEpochs.model_rebuild() +BehavioralEvents.model_rebuild() +BehavioralTimeSeries.model_rebuild() +PupilTracking.model_rebuild() +EyeTracking.model_rebuild() +CompassDirection.model_rebuild() +Position.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_device.py new file mode 100644 index 0000000..ae5c7c4 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_device.py @@ -0,0 +1,45 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBContainer +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Device(NWBContainer): + """ + Metadata about a data acquisition device, e.g., recording system, electrode, microscope. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""") + manufacturer:Optional[str]= Field(None, description="""The name of the manufacturer of the device.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Device.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py new file mode 100644 index 0000000..bf11eb2 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ecephys.py @@ -0,0 +1,252 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ElectricalSeries(TimeSeries): + """ + A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. + """ + name:str= Field(...) + filtering:Optional[str]= Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""") + data:ElectricalSeriesData= Field(..., description="""Recorded voltage data.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ElectricalSeriesData(ConfiguredBaseModel): + """ + Recorded voltage data. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and 'channel_conversion' (if present).""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_channels"], Number], + NDArray[Shape["* num_times, * num_channels, * num_samples"], Number] + ]]= Field(None) + + +class ElectricalSeriesElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SpikeEventSeries(ElectricalSeries): + """ + Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). + """ + name:str= Field(...) + data:SpikeEventSeriesData= Field(..., description="""Spike waveforms.""") + timestamps:List[float]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""") + filtering:Optional[str]= Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpikeEventSeriesData(ConfiguredBaseModel): + """ + Spike waveforms. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""") + array:Optional[Union[ + NDArray[Shape["* num_events, * num_samples"], Number], + NDArray[Shape["* num_events, * num_samples, * num_channels"], Number] + ]]= Field(None) + + +class FeatureExtraction(NWBDataInterface): + """ + Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. + """ + name:str= Field(...) + description:List[str]= Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""") + features:FeatureExtractionFeatures= Field(..., description="""Multi-dimensional array of features extracted from each event.""") + times:List[float]= Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""") + electrodes:FeatureExtractionElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + + +class FeatureExtractionFeatures(ConfiguredBaseModel): + """ + Multi-dimensional array of features extracted from each event. + """ + name:Literal["features"]= Field("features") + array:Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]]= Field(None) + + +class FeatureExtractionElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class EventDetection(NWBDataInterface): + """ + Detected spike events from voltage trace(s). + """ + name:str= Field(...) + detection_method:str= Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""") + source_idx:List[int]= Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""") + times:List[float]= Field(default_factory=list, description="""Timestamps of events, in seconds.""") + + +class EventWaveform(NWBDataInterface): + """ + Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. + """ + name:str= Field(...) + spike_event_series:Optional[List[SpikeEventSeries]]= Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""") + + +class FilteredEphys(NWBDataInterface): + """ + Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""") + + +class LFP(NWBDataInterface): + """ + LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""") + + +class ElectrodeGroup(NWBContainer): + """ + A physical grouping of electrodes, e.g. a shank of an array. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this electrode group.""") + location:Optional[str]= Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""") + position:Optional[Any]= Field(None, description="""stereotaxic or common framework coordinates""") + + +class ClusterWaveforms(NWBDataInterface): + """ + DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. + """ + name:str= Field(...) + waveform_filtering:str= Field(..., description="""Filtering applied to data before generating mean/sd""") + waveform_mean:ClusterWaveformsWaveformMean= Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""") + waveform_sd:ClusterWaveformsWaveformSd= Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""") + + +class ClusterWaveformsWaveformMean(ConfiguredBaseModel): + """ + The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled) + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class ClusterWaveformsWaveformSd(ConfiguredBaseModel): + """ + Stdev of waveforms for each cluster, using the same indices as in mean + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class Clustering(NWBDataInterface): + """ + DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""") + num:List[int]= Field(default_factory=list, description="""Cluster number of each event""") + peak_over_rms:List[float]= Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""") + times:List[float]= Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ElectricalSeries.model_rebuild() +ElectricalSeriesData.model_rebuild() +ElectricalSeriesElectrodes.model_rebuild() +SpikeEventSeries.model_rebuild() +SpikeEventSeriesData.model_rebuild() +FeatureExtraction.model_rebuild() +FeatureExtractionFeatures.model_rebuild() +FeatureExtractionElectrodes.model_rebuild() +EventDetection.model_rebuild() +EventWaveform.model_rebuild() +FilteredEphys.model_rebuild() +LFP.model_rebuild() +ElectrodeGroup.model_rebuild() +ClusterWaveforms.model_rebuild() +ClusterWaveformsWaveformMean.model_rebuild() +ClusterWaveformsWaveformSd.model_rebuild() +Clustering.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py new file mode 100644 index 0000000..b308c7e --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_epoch.py @@ -0,0 +1,87 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TimeIntervals(DynamicTable): + """ + A container for aggregating epoch data and the TimeSeries that each epoch applies to. + """ + name:str= Field(...) + start_time:Optional[List[float]]= Field(default_factory=list, description="""Start time of epoch, in seconds.""") + stop_time:Optional[List[float]]= Field(default_factory=list, description="""Stop time of epoch, in seconds.""") + tags:Optional[List[str]]= Field(default_factory=list, description="""User-defined tags that identify or categorize events.""") + tags_index:Optional[TimeIntervalsTagsIndex]= Field(None, description="""Index for tags.""") + timeseries:Optional[List[Any]]= Field(default_factory=list, description="""An index into a TimeSeries object.""") + timeseries_index:Optional[TimeIntervalsTimeseriesIndex]= Field(None, description="""Index for timeseries.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class TimeIntervalsTagsIndex(VectorIndex): + """ + Index for tags. + """ + name:Literal["tags_index"]= Field("tags_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class TimeIntervalsTimeseriesIndex(VectorIndex): + """ + Index for timeseries. + """ + name:Literal["timeseries_index"]= Field("timeseries_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TimeIntervals.model_rebuild() +TimeIntervalsTagsIndex.model_rebuild() +TimeIntervalsTimeseriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py new file mode 100644 index 0000000..86b83bd --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_file.py @@ -0,0 +1,247 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_epoch import ( + TimeIntervals +) + +from .core_nwb_base import ( + NWBData, + NWBDataInterface, + TimeSeries, + ProcessingModule, + NWBContainer +) + +from .core_nwb_icephys import ( + SweepTable, + IntracellularRecordingsTable, + IntracellularElectrode, + ExperimentalConditionsTable, + RepetitionsTable, + SimultaneousRecordingsTable, + SequentialRecordingsTable +) + +from .core_nwb_ogen import ( + OptogeneticStimulusSite +) + +from .core_nwb_ophys import ( + ImagingPlane +) + +from .core_nwb_misc import ( + Units +) + +from .core_nwb_device import ( + Device +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ScratchData(NWBData): + """ + Any one-off datasets + """ + name:str= Field(...) + notes:Optional[str]= Field(None, description="""Any notes the user has about the dataset being stored""") + + +class NWBFile(NWBContainer): + """ + An NWB:N file storing cellular-based neurophysiology data from a single experimental session. + """ + name:Literal["root"]= Field("root") + nwb_version:Optional[str]= Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""") + file_create_date:List[datetime ]= Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""") + identifier:str= Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""") + session_description:str= Field(..., description="""A description of the experimental session and data in the file.""") + session_start_time:datetime = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""") + timestamps_reference_time:datetime = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""") + acquisition:Optional[List[Union[DynamicTable, NWBDataInterface]]]= Field(default_factory=list, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""") + analysis:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""") + scratch:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""") + processing:Optional[List[ProcessingModule]]= Field(default_factory=list, description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""") + stimulus:NWBFileStimulus= Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""") + general:NWBFileGeneral= Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""") + intervals:Optional[NWBFileIntervals]= Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""") + units:Optional[Units]= Field(None, description="""Data about sorted spike units.""") + + +class NWBFileStimulus(ConfiguredBaseModel): + """ + Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. + """ + name:Literal["stimulus"]= Field("stimulus") + presentation:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Stimuli presented during the experiment.""") + templates:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""") + + +class NWBFileGeneral(ConfiguredBaseModel): + """ + Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. + """ + name:Literal["general"]= Field("general") + data_collection:Optional[str]= Field(None, description="""Notes about data collection and analysis.""") + experiment_description:Optional[str]= Field(None, description="""General description of the experiment.""") + experimenter:Optional[List[str]]= Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""") + institution:Optional[str]= Field(None, description="""Institution(s) where experiment was performed.""") + keywords:Optional[List[str]]= Field(default_factory=list, description="""Terms to search over.""") + lab:Optional[str]= Field(None, description="""Laboratory where experiment was performed.""") + notes:Optional[str]= Field(None, description="""Notes about the experiment.""") + pharmacology:Optional[str]= Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""") + protocol:Optional[str]= Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""") + related_publications:Optional[List[str]]= Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""") + session_id:Optional[str]= Field(None, description="""Lab-specific ID for the session.""") + slices:Optional[str]= Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""") + source_script:Optional[NWBFileGeneralSourceScript]= Field(None, description="""Script file or link to public source code used to create this NWB file.""") + stimulus:Optional[str]= Field(None, description="""Notes about stimuli, such as how and where they were presented.""") + surgery:Optional[str]= Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""") + virus:Optional[str]= Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""") + lab_meta_data:Optional[List[LabMetaData]]= Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""") + devices:Optional[List[Device]]= Field(default_factory=list, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""") + subject:Optional[Subject]= Field(None, description="""Information about the animal or person from which the data was measured.""") + extracellular_ephys:Optional[NWBFileGeneralExtracellularEphys]= Field(None, description="""Metadata related to extracellular electrophysiology.""") + intracellular_ephys:Optional[NWBFileGeneralIntracellularEphys]= Field(None, description="""Metadata related to intracellular electrophysiology.""") + optogenetics:Optional[List[OptogeneticStimulusSite]]= Field(default_factory=list, description="""Metadata describing optogenetic stimuluation.""") + optophysiology:Optional[List[ImagingPlane]]= Field(default_factory=list, description="""Metadata related to optophysiology.""") + + +class NWBFileGeneralSourceScript(ConfiguredBaseModel): + """ + Script file or link to public source code used to create this NWB file. + """ + name:Literal["source_script"]= Field("source_script") + file_name:Optional[str]= Field(None, description="""Name of script file.""") + value:str= Field(...) + + +class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): + """ + Metadata related to extracellular electrophysiology. + """ + name:Literal["extracellular_ephys"]= Field("extracellular_ephys") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Physical group of electrodes.""") + electrodes:Optional[NWBFileGeneralExtracellularEphysElectrodes]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + + +class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): + """ + A table of all electrodes (i.e. channels) used for recording. + """ + name:Literal["electrodes"]= Field("electrodes") + x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""") + y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""") + z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""") + imp:Optional[List[float]]= Field(default_factory=list, description="""Impedance of the channel, in ohms.""") + location:Optional[List[str]]= Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + filtering:Optional[List[str]]= Field(default_factory=list, description="""Description of hardware filtering, including the filter name and frequency cutoffs.""") + group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""") + group_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""") + rel_x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate in electrode group""") + rel_y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate in electrode group""") + rel_z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate in electrode group""") + reference:Optional[List[str]]= Field(default_factory=list, description="""Description of the reference used for this electrode.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): + """ + Metadata related to intracellular electrophysiology. + """ + name:Literal["intracellular_ephys"]= Field("intracellular_ephys") + filtering:Optional[str]= Field(None, description="""[DEPRECATED] Use IntracellularElectrode.filtering instead. Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") + intracellular_electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""An intracellular electrode.""") + sweep_table:Optional[SweepTable]= Field(None, description="""[DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tabels. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions tables provide enhanced support for experiment metadata.""") + intracellular_recordings:Optional[IntracellularRecordingsTable]= Field(None, description="""A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response are recorded as as part of an experiment. In this case both, the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used.""") + simultaneous_recordings:Optional[SimultaneousRecordingsTable]= Field(None, description="""A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes""") + sequential_recordings:Optional[SequentialRecordingsTable]= Field(None, description="""A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where the a sequence of stimuli of the same type with varying parameters have been presented in a sequence.""") + repetitions:Optional[RepetitionsTable]= Field(None, description="""A table for grouping different sequential intracellular recordings together. With each SequentialRecording typically representing a particular type of stimulus, the RepetitionsTable table is typically used to group sets of stimuli applied in sequence.""") + experimental_conditions:Optional[ExperimentalConditionsTable]= Field(None, description="""A table for grouping different intracellular recording repetitions together that belong to the same experimental experimental_conditions.""") + + +class NWBFileIntervals(ConfiguredBaseModel): + """ + Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data. + """ + name:Literal["intervals"]= Field("intervals") + epochs:Optional[TimeIntervals]= Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""") + trials:Optional[TimeIntervals]= Field(None, description="""Repeated experimental events that have a logical grouping.""") + invalid_times:Optional[TimeIntervals]= Field(None, description="""Time intervals that should be removed from analysis.""") + time_intervals:Optional[List[TimeIntervals]]= Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""") + + +class LabMetaData(NWBContainer): + """ + Lab-specific meta-data. + """ + name:str= Field(...) + + +class Subject(NWBContainer): + """ + Information about the animal or person from which the data was measured. + """ + name:str= Field(...) + age:Optional[str]= Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + date_of_birth:Optional[datetime ]= Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""") + description:Optional[str]= Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""") + genotype:Optional[str]= Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") + sex:Optional[str]= Field(None, description="""Gender of subject.""") + species:Optional[str]= Field(None, description="""Species of subject.""") + strain:Optional[str]= Field(None, description="""Strain of subject.""") + subject_id:Optional[str]= Field(None, description="""ID of animal/person used/participating in experiment (lab convention).""") + weight:Optional[str]= Field(None, description="""Weight at time of experiment, at time of surgery and at other important times.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ScratchData.model_rebuild() +NWBFile.model_rebuild() +NWBFileStimulus.model_rebuild() +NWBFileGeneral.model_rebuild() +NWBFileGeneralSourceScript.model_rebuild() +NWBFileGeneralExtracellularEphys.model_rebuild() +NWBFileGeneralExtracellularEphysElectrodes.model_rebuild() +NWBFileGeneralIntracellularEphys.model_rebuild() +NWBFileIntervals.model_rebuild() +LabMetaData.model_rebuild() +Subject.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py new file mode 100644 index 0000000..d722809 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_icephys.py @@ -0,0 +1,601 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeriesReferenceVectorData, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable, + AlignedDynamicTable +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class PatchClampSeries(TimeSeries): + """ + An abstract base class for patch-clamp data - stimulus or response, current or voltage. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + data:List[float]= Field(default_factory=list, description="""Recorded voltage or current.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeries(PatchClampSeries): + """ + Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. + """ + name:str= Field(...) + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + bias_current:Optional[float]= Field(None, description="""Bias current, in amps.""") + bridge_balance:Optional[float]= Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation:Optional[float]= Field(None, description="""Capacitance compensation, in farads.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeriesData(ConfiguredBaseModel): + """ + Recorded voltage. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IZeroClampSeries(CurrentClampSeries): + """ + Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""") + bias_current:float= Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance:float= Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation:float= Field(..., description="""Capacitance compensation, in farads, fixed to 0.0.""") + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeries(PatchClampSeries): + """ + Stimulus current applied during current clamp recording. + """ + name:str= Field(...) + data:CurrentClampStimulusSeriesData= Field(..., description="""Stimulus current applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus current applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeries(PatchClampSeries): + """ + Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. + """ + name:str= Field(...) + data:VoltageClampSeriesData= Field(..., description="""Recorded current.""") + capacitance_fast:Optional[VoltageClampSeriesCapacitanceFast]= Field(None, description="""Fast capacitance, in farads.""") + capacitance_slow:Optional[VoltageClampSeriesCapacitanceSlow]= Field(None, description="""Slow capacitance, in farads.""") + resistance_comp_bandwidth:Optional[VoltageClampSeriesResistanceCompBandwidth]= Field(None, description="""Resistance compensation bandwidth, in hertz.""") + resistance_comp_correction:Optional[VoltageClampSeriesResistanceCompCorrection]= Field(None, description="""Resistance compensation correction, in percent.""") + resistance_comp_prediction:Optional[VoltageClampSeriesResistanceCompPrediction]= Field(None, description="""Resistance compensation prediction, in percent.""") + whole_cell_capacitance_comp:Optional[VoltageClampSeriesWholeCellCapacitanceComp]= Field(None, description="""Whole cell capacitance compensation, in farads.""") + whole_cell_series_resistance_comp:Optional[VoltageClampSeriesWholeCellSeriesResistanceComp]= Field(None, description="""Whole cell series resistance compensation, in ohms.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampSeriesData(ConfiguredBaseModel): + """ + Recorded current. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): + """ + Fast capacitance, in farads. + """ + name:Literal["capacitance_fast"]= Field("capacitance_fast") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): + """ + Slow capacitance, in farads. + """ + name:Literal["capacitance_slow"]= Field("capacitance_slow") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): + """ + Resistance compensation bandwidth, in hertz. + """ + name:Literal["resistance_comp_bandwidth"]= Field("resistance_comp_bandwidth") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): + """ + Resistance compensation correction, in percent. + """ + name:Literal["resistance_comp_correction"]= Field("resistance_comp_correction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): + """ + Resistance compensation prediction, in percent. + """ + name:Literal["resistance_comp_prediction"]= Field("resistance_comp_prediction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): + """ + Whole cell capacitance compensation, in farads. + """ + name:Literal["whole_cell_capacitance_comp"]= Field("whole_cell_capacitance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): + """ + Whole cell series resistance compensation, in ohms. + """ + name:Literal["whole_cell_series_resistance_comp"]= Field("whole_cell_series_resistance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""") + value:float= Field(...) + + +class VoltageClampStimulusSeries(PatchClampSeries): + """ + Stimulus voltage applied during a voltage clamp recording. + """ + name:str= Field(...) + data:VoltageClampStimulusSeriesData= Field(..., description="""Stimulus voltage applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus voltage applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + value:Any= Field(...) + + +class IntracellularElectrode(NWBContainer): + """ + An intracellular electrode and its metadata. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + filtering:Optional[str]= Field(None, description="""Electrode specific filtering.""") + initial_access_resistance:Optional[str]= Field(None, description="""Initial access resistance.""") + location:Optional[str]= Field(None, description="""Location of the electrode. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + resistance:Optional[str]= Field(None, description="""Electrode resistance, in ohms.""") + seal:Optional[str]= Field(None, description="""Information about seal used for recording.""") + slice:Optional[str]= Field(None, description="""Information about slice used for recording.""") + + +class SweepTable(DynamicTable): + """ + [DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tables. Additional SequentialRecordingsTable, RepetitionsTable, and ExperimentalConditions tables provide enhanced support for experiment metadata. + """ + name:str= Field(...) + sweep_number:Optional[List[int]]= Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""") + series:Optional[List[PatchClampSeries]]= Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""") + series_index:SweepTableSeriesIndex= Field(..., description="""Index for series.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class SweepTableSeriesIndex(VectorIndex): + """ + Index for series. + """ + name:Literal["series_index"]= Field("series_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class IntracellularElectrodesTable(DynamicTable): + """ + Table for storing intracellular electrode related metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""Column for storing the reference to the intracellular electrode.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class IntracellularStimuliTable(DynamicTable): + """ + Table for storing intracellular stimulus related metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + stimulus:IntracellularStimuliTableStimulus= Field(..., description="""Column storing the reference to the recorded stimulus for the recording (rows).""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class IntracellularStimuliTableStimulus(TimeSeriesReferenceVectorData): + """ + Column storing the reference to the recorded stimulus for the recording (rows). + """ + name:Literal["stimulus"]= Field("stimulus") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class IntracellularResponsesTable(DynamicTable): + """ + Table for storing intracellular response related metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + response:IntracellularResponsesTableResponse= Field(..., description="""Column storing the reference to the recorded response for the recording (rows)""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class IntracellularResponsesTableResponse(TimeSeriesReferenceVectorData): + """ + Column storing the reference to the recorded response for the recording (rows) + """ + name:Literal["response"]= Field("response") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class IntracellularRecordingsTable(AlignedDynamicTable): + """ + A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response is recorded as part of an experiment. In this case, both the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used. + """ + name:Literal["intracellular_recordings"]= Field("intracellular_recordings") + description:Optional[str]= Field(None, description="""Description of the contents of this table. Inherited from AlignedDynamicTable and overwritten here to fix the value of the attribute.""") + electrodes:IntracellularElectrodesTable= Field(..., description="""Table for storing intracellular electrode related metadata.""") + stimuli:IntracellularStimuliTable= Field(..., description="""Table for storing intracellular stimulus related metadata.""") + responses:IntracellularResponsesTable= Field(..., description="""Table for storing intracellular response related metadata.""") + categories:Optional[str]= Field(None, description="""The names of the categories in this AlignedDynamicTable. Each category is represented by one DynamicTable stored in the parent group. This attribute should be used to specify an order of categories and the category names must match the names of the corresponding DynamicTable in the group.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""A DynamicTable representing a particular category for columns in the AlignedDynamicTable parent container. The table MUST be aligned with (i.e., have the same number of rows) as all other DynamicTables stored in the AlignedDynamicTable parent container. The name of the category is given by the name of the DynamicTable and its description by the description attribute of the DynamicTable.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class SimultaneousRecordingsTable(DynamicTable): + """ + A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes. + """ + name:Literal["simultaneous_recordings"]= Field("simultaneous_recordings") + recordings:SimultaneousRecordingsTableRecordings= Field(..., description="""A reference to one or more rows in the IntracellularRecordingsTable table.""") + recordings_index:SimultaneousRecordingsTableRecordingsIndex= Field(..., description="""Index dataset for the recordings column.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class SimultaneousRecordingsTableRecordings(DynamicTableRegion): + """ + A reference to one or more rows in the IntracellularRecordingsTable table. + """ + name:Literal["recordings"]= Field("recordings") + table:Optional[IntracellularRecordingsTable]= Field(None, description="""Reference to the IntracellularRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SimultaneousRecordingsTableRecordingsIndex(VectorIndex): + """ + Index dataset for the recordings column. + """ + name:Literal["recordings_index"]= Field("recordings_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SequentialRecordingsTable(DynamicTable): + """ + A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where a sequence of stimuli of the same type with varying parameters have been presented in a sequence. + """ + name:Literal["sequential_recordings"]= Field("sequential_recordings") + simultaneous_recordings:SequentialRecordingsTableSimultaneousRecordings= Field(..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""") + simultaneous_recordings_index:SequentialRecordingsTableSimultaneousRecordingsIndex= Field(..., description="""Index dataset for the simultaneous_recordings column.""") + stimulus_type:Optional[List[str]]= Field(default_factory=list, description="""The type of stimulus used for the sequential recording.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion): + """ + A reference to one or more rows in the SimultaneousRecordingsTable table. + """ + name:Literal["simultaneous_recordings"]= Field("simultaneous_recordings") + table:Optional[SimultaneousRecordingsTable]= Field(None, description="""Reference to the SimultaneousRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SequentialRecordingsTableSimultaneousRecordingsIndex(VectorIndex): + """ + Index dataset for the simultaneous_recordings column. + """ + name:Literal["simultaneous_recordings_index"]= Field("simultaneous_recordings_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class RepetitionsTable(DynamicTable): + """ + A table for grouping different sequential intracellular recordings together. With each SequentialRecording typically representing a particular type of stimulus, the RepetitionsTable table is typically used to group sets of stimuli applied in sequence. + """ + name:Literal["repetitions"]= Field("repetitions") + sequential_recordings:RepetitionsTableSequentialRecordings= Field(..., description="""A reference to one or more rows in the SequentialRecordingsTable table.""") + sequential_recordings_index:RepetitionsTableSequentialRecordingsIndex= Field(..., description="""Index dataset for the sequential_recordings column.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class RepetitionsTableSequentialRecordings(DynamicTableRegion): + """ + A reference to one or more rows in the SequentialRecordingsTable table. + """ + name:Literal["sequential_recordings"]= Field("sequential_recordings") + table:Optional[SequentialRecordingsTable]= Field(None, description="""Reference to the SequentialRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class RepetitionsTableSequentialRecordingsIndex(VectorIndex): + """ + Index dataset for the sequential_recordings column. + """ + name:Literal["sequential_recordings_index"]= Field("sequential_recordings_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class ExperimentalConditionsTable(DynamicTable): + """ + A table for grouping different intracellular recording repetitions together that belong to the same experimental condition. + """ + name:Literal["experimental_conditions"]= Field("experimental_conditions") + repetitions:ExperimentalConditionsTableRepetitions= Field(..., description="""A reference to one or more rows in the RepetitionsTable table.""") + repetitions_index:ExperimentalConditionsTableRepetitionsIndex= Field(..., description="""Index dataset for the repetitions column.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class ExperimentalConditionsTableRepetitions(DynamicTableRegion): + """ + A reference to one or more rows in the RepetitionsTable table. + """ + name:Literal["repetitions"]= Field("repetitions") + table:Optional[RepetitionsTable]= Field(None, description="""Reference to the RepetitionsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class ExperimentalConditionsTableRepetitionsIndex(VectorIndex): + """ + Index dataset for the repetitions column. + """ + name:Literal["repetitions_index"]= Field("repetitions_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +PatchClampSeries.model_rebuild() +CurrentClampSeries.model_rebuild() +CurrentClampSeriesData.model_rebuild() +IZeroClampSeries.model_rebuild() +CurrentClampStimulusSeries.model_rebuild() +CurrentClampStimulusSeriesData.model_rebuild() +VoltageClampSeries.model_rebuild() +VoltageClampSeriesData.model_rebuild() +VoltageClampSeriesCapacitanceFast.model_rebuild() +VoltageClampSeriesCapacitanceSlow.model_rebuild() +VoltageClampSeriesResistanceCompBandwidth.model_rebuild() +VoltageClampSeriesResistanceCompCorrection.model_rebuild() +VoltageClampSeriesResistanceCompPrediction.model_rebuild() +VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() +VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() +VoltageClampStimulusSeries.model_rebuild() +VoltageClampStimulusSeriesData.model_rebuild() +IntracellularElectrode.model_rebuild() +SweepTable.model_rebuild() +SweepTableSeriesIndex.model_rebuild() +IntracellularElectrodesTable.model_rebuild() +IntracellularStimuliTable.model_rebuild() +IntracellularStimuliTableStimulus.model_rebuild() +IntracellularResponsesTable.model_rebuild() +IntracellularResponsesTableResponse.model_rebuild() +IntracellularRecordingsTable.model_rebuild() +SimultaneousRecordingsTable.model_rebuild() +SimultaneousRecordingsTableRecordings.model_rebuild() +SimultaneousRecordingsTableRecordingsIndex.model_rebuild() +SequentialRecordingsTable.model_rebuild() +SequentialRecordingsTableSimultaneousRecordings.model_rebuild() +SequentialRecordingsTableSimultaneousRecordingsIndex.model_rebuild() +RepetitionsTable.model_rebuild() +RepetitionsTableSequentialRecordings.model_rebuild() +RepetitionsTableSequentialRecordingsIndex.model_rebuild() +ExperimentalConditionsTable.model_rebuild() +ExperimentalConditionsTableRepetitions.model_rebuild() +ExperimentalConditionsTableRepetitionsIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py new file mode 100644 index 0000000..0a9cb60 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_image.py @@ -0,0 +1,183 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + Image, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class GrayscaleImage(Image): + """ + A grayscale image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBImage(Image): + """ + A color image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBAImage(Image): + """ + A color image with transparency. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImageSeries(TimeSeries): + """ + General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. + """ + name:str= Field(...) + data:ImageSeriesData= Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ImageSeriesData(ConfiguredBaseModel): + """ + Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, * z"], Number] + ]]= Field(None) + + +class ImageMaskSeries(ImageSeries): + """ + An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. + """ + name:str= Field(...) + data:ImageSeriesData= Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeries(ImageSeries): + """ + Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. + """ + name:str= Field(...) + distance:Optional[float]= Field(None, description="""Distance from camera/monitor to target/eye.""") + field_of_view:Optional[OpticalSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:OpticalSeriesData= Field(..., description="""Images presented to subject, either grayscale or RGB""") + orientation:Optional[str]= Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class OpticalSeriesData(ConfiguredBaseModel): + """ + Images presented to subject, either grayscale or RGB + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], Number] + ]]= Field(None) + + +class IndexSeries(TimeSeries): + """ + Stores indices to image frames stored in an ImageSeries. The purpose of the ImageIndexSeries is to allow a static image stack to be stored somewhere, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced ImageSeries, and the timestamps array indicates when that image was displayed. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Index of the frame in the referenced ImageSeries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +GrayscaleImage.model_rebuild() +RGBImage.model_rebuild() +RGBAImage.model_rebuild() +ImageSeries.model_rebuild() +ImageSeriesData.model_rebuild() +ImageMaskSeries.model_rebuild() +OpticalSeries.model_rebuild() +OpticalSeriesFieldOfView.model_rebuild() +OpticalSeriesData.model_rebuild() +IndexSeries.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py new file mode 100644 index 0000000..5e103ef --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_misc.py @@ -0,0 +1,389 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class AbstractFeatureSeries(TimeSeries): + """ + Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. + """ + name:str= Field(...) + data:AbstractFeatureSeriesData= Field(..., description="""Values of each feature at each time.""") + feature_units:Optional[List[str]]= Field(default_factory=list, description="""Units of each feature.""") + features:List[str]= Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class AbstractFeatureSeriesData(ConfiguredBaseModel): + """ + Values of each feature at each time. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class AnnotationSeries(TimeSeries): + """ + Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. + """ + name:str= Field(...) + data:List[str]= Field(default_factory=list, description="""Annotations made during an experiment.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class IntervalSeries(TimeSeries): + """ + Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeries(TimeSeries): + """ + Spectral analysis of a time series, e.g. of an LFP or a speech signal. + """ + name:str= Field(...) + data:DecompositionSeriesData= Field(..., description="""Data decomposed into frequency bands.""") + metric:str= Field(..., description="""The metric used, e.g. phase, amplitude, power.""") + source_channels:Optional[DecompositionSeriesSourceChannels]= Field(None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""") + bands:DecompositionSeriesBands= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeriesData(ConfiguredBaseModel): + """ + Data decomposed into frequency bands. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]]= Field(None) + + +class DecompositionSeriesSourceChannels(DynamicTableRegion): + """ + DynamicTableRegion pointer to the channels that this decomposition series was generated from. + """ + name:Literal["source_channels"]= Field("source_channels") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class DecompositionSeriesBands(DynamicTable): + """ + Table for describing the bands that this series was generated from. There should be one row in this table for each band. + """ + name:Literal["bands"]= Field("bands") + band_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the band, e.g. theta.""") + band_limits:DecompositionSeriesBandsBandLimits= Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""") + band_mean:List[float]= Field(default_factory=list, description="""The mean Gaussian filters, in Hz.""") + band_stdev:List[float]= Field(default_factory=list, description="""The standard deviation of Gaussian filters, in Hz.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class DecompositionSeriesBandsBandLimits(VectorData): + """ + Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center. + """ + name:Literal["band_limits"]= Field("band_limits") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class Units(DynamicTable): + """ + Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. + """ + name:str= Field(...) + spike_times_index:Optional[UnitsSpikeTimesIndex]= Field(None, description="""Index into the spike_times dataset.""") + spike_times:Optional[UnitsSpikeTimes]= Field(None, description="""Spike times for each unit.""") + obs_intervals_index:Optional[UnitsObsIntervalsIndex]= Field(None, description="""Index into the obs_intervals dataset.""") + obs_intervals:Optional[UnitsObsIntervals]= Field(None, description="""Observation intervals for each unit.""") + electrodes_index:Optional[UnitsElectrodesIndex]= Field(None, description="""Index into electrodes.""") + electrodes:Optional[UnitsElectrodes]= Field(None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Electrode group that each spike unit came from.""") + waveform_mean:Optional[UnitsWaveformMean]= Field(None, description="""Spike waveform mean for each spike unit.""") + waveform_sd:Optional[UnitsWaveformSd]= Field(None, description="""Spike waveform standard deviation for each spike unit.""") + waveforms:Optional[UnitsWaveforms]= Field(None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""") + waveforms_index:Optional[UnitsWaveformsIndex]= Field(None, description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""") + waveforms_index_index:Optional[UnitsWaveformsIndexIndex]= Field(None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class UnitsSpikeTimesIndex(VectorIndex): + """ + Index into the spike_times dataset. + """ + name:Literal["spike_times_index"]= Field("spike_times_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsSpikeTimes(VectorData): + """ + Spike times for each unit. + """ + name:Literal["spike_times"]= Field("spike_times") + resolution:Optional[float]= Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsObsIntervalsIndex(VectorIndex): + """ + Index into the obs_intervals dataset. + """ + name:Literal["obs_intervals_index"]= Field("obs_intervals_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsObsIntervals(VectorData): + """ + Observation intervals for each unit. + """ + name:Literal["obs_intervals"]= Field("obs_intervals") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsElectrodesIndex(VectorIndex): + """ + Index into electrodes. + """ + name:Literal["electrodes_index"]= Field("electrodes_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsElectrodes(DynamicTableRegion): + """ + Electrode that each spike unit came from, specified using a DynamicTableRegion. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformMean(VectorData): + """ + Spike waveform mean for each spike unit. + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformSd(VectorData): + """ + Spike waveform standard deviation for each spike unit. + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveforms(VectorData): + """ + Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same. + """ + name:Literal["waveforms"]= Field("waveforms") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformsIndex(VectorIndex): + """ + Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail. + """ + name:Literal["waveforms_index"]= Field("waveforms_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformsIndexIndex(VectorIndex): + """ + Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail. + """ + name:Literal["waveforms_index_index"]= Field("waveforms_index_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +AbstractFeatureSeries.model_rebuild() +AbstractFeatureSeriesData.model_rebuild() +AnnotationSeries.model_rebuild() +IntervalSeries.model_rebuild() +DecompositionSeries.model_rebuild() +DecompositionSeriesData.model_rebuild() +DecompositionSeriesSourceChannels.model_rebuild() +DecompositionSeriesBands.model_rebuild() +DecompositionSeriesBandsBandLimits.model_rebuild() +Units.model_rebuild() +UnitsSpikeTimesIndex.model_rebuild() +UnitsSpikeTimes.model_rebuild() +UnitsObsIntervalsIndex.model_rebuild() +UnitsObsIntervals.model_rebuild() +UnitsElectrodesIndex.model_rebuild() +UnitsElectrodes.model_rebuild() +UnitsWaveformMean.model_rebuild() +UnitsWaveformSd.model_rebuild() +UnitsWaveforms.model_rebuild() +UnitsWaveformsIndex.model_rebuild() +UnitsWaveformsIndexIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py new file mode 100644 index 0000000..c5e8346 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ogen.py @@ -0,0 +1,65 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeries, + NWBContainer, + TimeSeriesSync +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class OptogeneticSeries(TimeSeries): + """ + An optogenetic stimulus. + """ + name:str= Field(...) + data:List[float]= Field(default_factory=list, description="""Applied power for optogenetic stimulus, in watts.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OptogeneticStimulusSite(NWBContainer): + """ + A site of optogenetic stimulation. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of stimulation site.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + location:str= Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +OptogeneticSeries.model_rebuild() +OptogeneticStimulusSite.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py new file mode 100644 index 0000000..2501a3d --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_ophys.py @@ -0,0 +1,309 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from .core_nwb_image import ( + ImageSeriesData, + ImageSeries +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TwoPhotonSeries(ImageSeries): + """ + Image stack recorded over time from 2-photon microscope. + """ + name:str= Field(...) + pmt_gain:Optional[float]= Field(None, description="""Photomultiplier gain.""") + scan_line_rate:Optional[float]= Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") + field_of_view:Optional[TwoPhotonSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:ImageSeriesData= Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TwoPhotonSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class RoiResponseSeries(TimeSeries): + """ + ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. + """ + name:str= Field(...) + data:RoiResponseSeriesData= Field(..., description="""Signals from ROIs.""") + rois:RoiResponseSeriesRois= Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class RoiResponseSeriesData(ConfiguredBaseModel): + """ + Signals from ROIs. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_ROIs"], Number] + ]]= Field(None) + + +class RoiResponseSeriesRois(DynamicTableRegion): + """ + DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. + """ + name:Literal["rois"]= Field("rois") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class DfOverF(NWBDataInterface): + """ + dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""") + + +class Fluorescence(NWBDataInterface): + """ + Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""") + + +class ImageSegmentation(NWBDataInterface): + """ + Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. + """ + name:str= Field(...) + plane_segmentation:List[PlaneSegmentation]= Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""") + + +class PlaneSegmentation(DynamicTable): + """ + Results from image segmentation of a specific imaging plane. + """ + name:str= Field(...) + image_mask:Optional[PlaneSegmentationImageMask]= Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""") + pixel_mask_index:Optional[PlaneSegmentationPixelMaskIndex]= Field(None, description="""Index into pixel_mask.""") + pixel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + voxel_mask_index:Optional[PlaneSegmentationVoxelMaskIndex]= Field(None, description="""Index into voxel_mask.""") + voxel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + reference_images:Optional[List[ImageSeries]]= Field(default_factory=list, description="""Image stacks that the segmentation masks apply to.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class PlaneSegmentationImageMask(VectorData): + """ + ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero. + """ + name:Literal["image_mask"]= Field("image_mask") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class PlaneSegmentationPixelMaskIndex(VectorIndex): + """ + Index into pixel_mask. + """ + name:Literal["pixel_mask_index"]= Field("pixel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class PlaneSegmentationVoxelMaskIndex(VectorIndex): + """ + Index into voxel_mask. + """ + name:Literal["voxel_mask_index"]= Field("voxel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class ImagingPlane(NWBContainer): + """ + An imaging plane and its metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the imaging plane.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate:Optional[float]= Field(None, description="""Rate that images are acquired, in Hz. If the corresponding TimeSeries is present, the rate should be stored there instead.""") + indicator:str= Field(..., description="""Calcium indicator.""") + location:str= Field(..., description="""Location of the imaging plane. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + manifold:Optional[ImagingPlaneManifold]= Field(None, description="""DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.""") + origin_coords:Optional[ImagingPlaneOriginCoords]= Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""") + grid_spacing:Optional[ImagingPlaneGridSpacing]= Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""") + reference_frame:Optional[str]= Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""") + optical_channel:List[OpticalChannel]= Field(default_factory=list, description="""An optical channel used to record from an imaging plane.""") + + +class ImagingPlaneManifold(ConfiguredBaseModel): + """ + DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. + """ + name:Literal["manifold"]= Field("manifold") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["* height, * width, 3 x_y_z"], Float32], + NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32] + ]]= Field(None) + + +class ImagingPlaneOriginCoords(ConfiguredBaseModel): + """ + Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). + """ + name:Literal["origin_coords"]= Field("origin_coords") + unit:Optional[str]= Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["2 x_y"], Float32], + NDArray[Shape["2 x_y, 3 x_y_z"], Float32] + ]]= Field(None) + + +class ImagingPlaneGridSpacing(ConfiguredBaseModel): + """ + Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. + """ + name:Literal["grid_spacing"]= Field("grid_spacing") + unit:Optional[str]= Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["2 x_y"], Float32], + NDArray[Shape["2 x_y, 3 x_y_z"], Float32] + ]]= Field(None) + + +class OpticalChannel(NWBContainer): + """ + An optical channel used to record from an imaging plane. + """ + name:str= Field(...) + description:str= Field(..., description="""Description or other notes about the channel.""") + emission_lambda:float= Field(..., description="""Emission wavelength for channel, in nm.""") + + +class MotionCorrection(NWBDataInterface): + """ + An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). + """ + name:str= Field(...) + corrected_image_stack:List[CorrectedImageStack]= Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""") + + +class CorrectedImageStack(NWBDataInterface): + """ + Reuslts from motion correction of an image stack. + """ + name:str= Field(...) + corrected:ImageSeries= Field(..., description="""Image stack with frames shifted to the common coordinates.""") + xy_translation:TimeSeries= Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TwoPhotonSeries.model_rebuild() +TwoPhotonSeriesFieldOfView.model_rebuild() +RoiResponseSeries.model_rebuild() +RoiResponseSeriesData.model_rebuild() +RoiResponseSeriesRois.model_rebuild() +DfOverF.model_rebuild() +Fluorescence.model_rebuild() +ImageSegmentation.model_rebuild() +PlaneSegmentation.model_rebuild() +PlaneSegmentationImageMask.model_rebuild() +PlaneSegmentationPixelMaskIndex.model_rebuild() +PlaneSegmentationVoxelMaskIndex.model_rebuild() +ImagingPlane.model_rebuild() +ImagingPlaneManifold.model_rebuild() +ImagingPlaneOriginCoords.model_rebuild() +ImagingPlaneGridSpacing.model_rebuild() +OpticalChannel.model_rebuild() +MotionCorrection.model_rebuild() +CorrectedImageStack.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py new file mode 100644 index 0000000..80b88f1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/core_nwb_retinotopy.py @@ -0,0 +1,137 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ImagingRetinotopy(NWBDataInterface): + """ + Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). + """ + name:str= Field(...) + axis_1_phase_map:ImagingRetinotopyAxis1PhaseMap= Field(..., description="""Phase response to stimulus on the first measured axis.""") + axis_1_power_map:Optional[ImagingRetinotopyAxis1PowerMap]= Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_2_phase_map:ImagingRetinotopyAxis2PhaseMap= Field(..., description="""Phase response to stimulus on the second measured axis.""") + axis_2_power_map:Optional[ImagingRetinotopyAxis2PowerMap]= Field(None, description="""Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_descriptions:List[str]= Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""") + focal_depth_image:Optional[ImagingRetinotopyFocalDepthImage]= Field(None, description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""") + sign_map:Optional[ImagingRetinotopySignMap]= Field(None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""") + vasculature_image:ImagingRetinotopyVasculatureImage= Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""") + + +class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the first measured axis. + """ + name:Literal["axis_1_phase_map"]= Field("axis_1_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): + """ + Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_1_power_map"]= Field("axis_1_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the second measured axis. + """ + name:Literal["axis_2_phase_map"]= Field("axis_2_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): + """ + Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_2_power_map"]= Field("axis_2_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): + """ + Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. + """ + name:Literal["focal_depth_image"]= Field("focal_depth_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + focal_depth:Optional[float]= Field(None, description="""Focal depth offset, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + +class ImagingRetinotopySignMap(ConfiguredBaseModel): + """ + Sine of the angle between the direction of the gradient in axis_1 and axis_2. + """ + name:Literal["sign_map"]= Field("sign_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): + """ + Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] + """ + name:Literal["vasculature_image"]= Field("vasculature_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ImagingRetinotopy.model_rebuild() +ImagingRetinotopyAxis1PhaseMap.model_rebuild() +ImagingRetinotopyAxis1PowerMap.model_rebuild() +ImagingRetinotopyAxis2PhaseMap.model_rebuild() +ImagingRetinotopyAxis2PowerMap.model_rebuild() +ImagingRetinotopyFocalDepthImage.model_rebuild() +ImagingRetinotopySignMap.model_rebuild() +ImagingRetinotopyVasculatureImage.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/namespace.py new file mode 100644 index 0000000..ac86e0b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_4_0/namespace.py @@ -0,0 +1,167 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_experimental.v0_1_0.hdmf_experimental_resources import ( + ExternalResources +) + +from ...hdmf_common.v1_5_0.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_5_0.hdmf_common_base import ( + Data, + Container, + SimpleMultiContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + DynamicTable, + AlignedDynamicTable +) + +from ...hdmf_experimental.v0_1_0.hdmf_experimental_experimental import ( + EnumData +) + +from .core_nwb_retinotopy import ( + ImagingRetinotopy +) + +from .core_nwb_base import ( + NWBData, + TimeSeriesReferenceVectorData, + Image, + NWBContainer, + NWBDataInterface, + TimeSeries, + ProcessingModule, + Images +) + +from .core_nwb_ophys import ( + TwoPhotonSeries, + RoiResponseSeries, + DfOverF, + Fluorescence, + ImageSegmentation, + PlaneSegmentation, + ImagingPlane, + OpticalChannel, + MotionCorrection, + CorrectedImageStack +) + +from .core_nwb_device import ( + Device +) + +from .core_nwb_image import ( + GrayscaleImage, + RGBImage, + RGBAImage, + ImageSeries, + ImageMaskSeries, + OpticalSeries, + IndexSeries +) + +from .core_nwb_ogen import ( + OptogeneticSeries, + OptogeneticStimulusSite +) + +from .core_nwb_icephys import ( + PatchClampSeries, + CurrentClampSeries, + IZeroClampSeries, + CurrentClampStimulusSeries, + VoltageClampSeries, + VoltageClampStimulusSeries, + IntracellularElectrode, + SweepTable, + IntracellularElectrodesTable, + IntracellularStimuliTable, + IntracellularResponsesTable, + IntracellularRecordingsTable, + SimultaneousRecordingsTable, + SequentialRecordingsTable, + RepetitionsTable, + ExperimentalConditionsTable +) + +from .core_nwb_ecephys import ( + ElectricalSeries, + SpikeEventSeries, + FeatureExtraction, + EventDetection, + EventWaveform, + FilteredEphys, + LFP, + ElectrodeGroup, + ClusterWaveforms, + Clustering +) + +from .core_nwb_behavior import ( + SpatialSeries, + BehavioralEpochs, + BehavioralEvents, + BehavioralTimeSeries, + PupilTracking, + EyeTracking, + CompassDirection, + Position +) + +from .core_nwb_misc import ( + AbstractFeatureSeries, + AnnotationSeries, + IntervalSeries, + DecompositionSeries, + Units +) + +from .core_nwb_file import ( + ScratchData, + NWBFile, + LabMetaData, + Subject +) + +from .core_nwb_epoch import ( + TimeIntervals +) + + +metamodel_version = "None" +version = "2.4.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py similarity index 93% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_base.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py index 3296695..b8ac0c9 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_base.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -11,19 +12,19 @@ else: from typing_extensions import Literal -from .hdmf_common_base import ( - Data, - Container +from ...hdmf_common.v1_5_0.hdmf_common_base import ( + Container, + Data ) -from .hdmf_common_table import ( +from ...hdmf_common.v1_5_0.hdmf_common_table import ( DynamicTable, VectorData ) metamodel_version = "None" -version = "None" +version = "2.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -172,17 +173,17 @@ class ImagesOrderOfImages(ImageReferences): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# NWBData.model_rebuild() -# TimeSeriesReferenceVectorData.model_rebuild() -# Image.model_rebuild() -# ImageReferences.model_rebuild() -# NWBContainer.model_rebuild() -# NWBDataInterface.model_rebuild() -# TimeSeries.model_rebuild() -# TimeSeriesData.model_rebuild() -# TimeSeriesStartingTime.model_rebuild() -# TimeSeriesSync.model_rebuild() -# ProcessingModule.model_rebuild() -# Images.model_rebuild() -# ImagesOrderOfImages.model_rebuild() +NWBData.model_rebuild() +TimeSeriesReferenceVectorData.model_rebuild() +Image.model_rebuild() +ImageReferences.model_rebuild() +NWBContainer.model_rebuild() +NWBDataInterface.model_rebuild() +TimeSeries.model_rebuild() +TimeSeriesData.model_rebuild() +TimeSeriesStartingTime.model_rebuild() +TimeSeriesSync.model_rebuild() +ProcessingModule.model_rebuild() +Images.model_rebuild() +ImagesOrderOfImages.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py similarity index 92% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_behavior.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py index 9c807a2..c099299 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_behavior.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_behavior.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -12,10 +13,10 @@ else: from .core_nwb_base import ( - TimeSeriesStartingTime, - TimeSeries, + NWBDataInterface, TimeSeriesSync, - NWBDataInterface + TimeSeriesStartingTime, + TimeSeries ) from .core_nwb_misc import ( @@ -24,7 +25,7 @@ from .core_nwb_misc import ( metamodel_version = "None" -version = "None" +version = "2.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -124,13 +125,13 @@ class Position(NWBDataInterface): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# SpatialSeries.model_rebuild() -# SpatialSeriesData.model_rebuild() -# BehavioralEpochs.model_rebuild() -# BehavioralEvents.model_rebuild() -# BehavioralTimeSeries.model_rebuild() -# PupilTracking.model_rebuild() -# EyeTracking.model_rebuild() -# CompassDirection.model_rebuild() -# Position.model_rebuild() +SpatialSeries.model_rebuild() +SpatialSeriesData.model_rebuild() +BehavioralEpochs.model_rebuild() +BehavioralEvents.model_rebuild() +BehavioralTimeSeries.model_rebuild() +PupilTracking.model_rebuild() +EyeTracking.model_rebuild() +CompassDirection.model_rebuild() +Position.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_device.py new file mode 100644 index 0000000..29026bb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_device.py @@ -0,0 +1,45 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBContainer +) + + +metamodel_version = "None" +version = "2.5.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Device(NWBContainer): + """ + Metadata about a data acquisition device, e.g., recording system, electrode, microscope. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""") + manufacturer:Optional[str]= Field(None, description="""The name of the manufacturer of the device.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Device.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py similarity index 94% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_ecephys.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py index 6cb400b..1b6ccc3 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_ecephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ecephys.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -12,21 +13,21 @@ else: from .core_nwb_base import ( - TimeSeriesStartingTime, - NWBContainer, + NWBDataInterface, TimeSeriesSync, + TimeSeriesStartingTime, TimeSeries, - NWBDataInterface + NWBContainer ) -from .hdmf_common_table import ( - DynamicTable, - DynamicTableRegion +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable ) metamodel_version = "None" -version = "None" +version = "2.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -231,21 +232,21 @@ class Clustering(NWBDataInterface): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# ElectricalSeries.model_rebuild() -# ElectricalSeriesData.model_rebuild() -# ElectricalSeriesElectrodes.model_rebuild() -# SpikeEventSeries.model_rebuild() -# SpikeEventSeriesData.model_rebuild() -# FeatureExtraction.model_rebuild() -# FeatureExtractionFeatures.model_rebuild() -# FeatureExtractionElectrodes.model_rebuild() -# EventDetection.model_rebuild() -# EventWaveform.model_rebuild() -# FilteredEphys.model_rebuild() -# LFP.model_rebuild() -# ElectrodeGroup.model_rebuild() -# ClusterWaveforms.model_rebuild() -# ClusterWaveformsWaveformMean.model_rebuild() -# ClusterWaveformsWaveformSd.model_rebuild() -# Clustering.model_rebuild() +ElectricalSeries.model_rebuild() +ElectricalSeriesData.model_rebuild() +ElectricalSeriesElectrodes.model_rebuild() +SpikeEventSeries.model_rebuild() +SpikeEventSeriesData.model_rebuild() +FeatureExtraction.model_rebuild() +FeatureExtractionFeatures.model_rebuild() +FeatureExtractionElectrodes.model_rebuild() +EventDetection.model_rebuild() +EventWaveform.model_rebuild() +FilteredEphys.model_rebuild() +LFP.model_rebuild() +ElectrodeGroup.model_rebuild() +ClusterWaveforms.model_rebuild() +ClusterWaveformsWaveformMean.model_rebuild() +ClusterWaveformsWaveformSd.model_rebuild() +Clustering.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py similarity index 88% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_epoch.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py index 3da4340..0ef43a1 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_epoch.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_epoch.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -11,10 +12,10 @@ else: from typing_extensions import Literal -from .hdmf_common_table import ( +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable, VectorIndex, - VectorData, - DynamicTable + VectorData ) from .core_nwb_base import ( @@ -23,7 +24,7 @@ from .core_nwb_base import ( metamodel_version = "None" -version = "None" +version = "2.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -98,8 +99,8 @@ class TimeIntervalsTimeseriesIndex(VectorIndex): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# TimeIntervals.model_rebuild() -# TimeIntervalsTagsIndex.model_rebuild() -# TimeIntervalsTimeseries.model_rebuild() -# TimeIntervalsTimeseriesIndex.model_rebuild() +TimeIntervals.model_rebuild() +TimeIntervalsTagsIndex.model_rebuild() +TimeIntervalsTimeseries.model_rebuild() +TimeIntervalsTimeseriesIndex.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py new file mode 100644 index 0000000..886fddf --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_file.py @@ -0,0 +1,248 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_epoch import ( + TimeIntervals +) + +from .core_nwb_base import ( + NWBData, + NWBDataInterface, + Images, + TimeSeries, + ProcessingModule, + NWBContainer +) + +from .core_nwb_icephys import ( + SweepTable, + IntracellularRecordingsTable, + IntracellularElectrode, + ExperimentalConditionsTable, + RepetitionsTable, + SimultaneousRecordingsTable, + SequentialRecordingsTable +) + +from .core_nwb_ogen import ( + OptogeneticStimulusSite +) + +from .core_nwb_ophys import ( + ImagingPlane +) + +from .core_nwb_misc import ( + Units +) + +from .core_nwb_device import ( + Device +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.5.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ScratchData(NWBData): + """ + Any one-off datasets + """ + name:str= Field(...) + notes:Optional[str]= Field(None, description="""Any notes the user has about the dataset being stored""") + + +class NWBFile(NWBContainer): + """ + An NWB:N file storing cellular-based neurophysiology data from a single experimental session. + """ + name:Literal["root"]= Field("root") + nwb_version:Optional[str]= Field(None, description="""File version string. Use semantic versioning, e.g. 1.2.1. This will be the name of the format with trailing major, minor and patch numbers.""") + file_create_date:List[datetime ]= Field(default_factory=list, description="""A record of the date the file was created and of subsequent modifications. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. The file can be created after the experiment was run, so this may differ from the experiment start time. Each modification to the nwb file adds a new entry to the array.""") + identifier:str= Field(..., description="""A unique text identifier for the file. For example, concatenated lab name, file creation date/time and experimentalist, or a hash of these and/or other values. The goal is that the string should be unique to all other files.""") + session_description:str= Field(..., description="""A description of the experimental session and data in the file.""") + session_start_time:datetime = Field(..., description="""Date and time of the experiment/session start. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds.""") + timestamps_reference_time:datetime = Field(..., description="""Date and time corresponding to time zero of all timestamps. The date is stored in UTC with local timezone offset as ISO 8601 extended formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in \"Z\" with no timezone offset. Date accuracy is up to milliseconds. All times stored in the file use this time as reference (i.e., time zero).""") + acquisition:Optional[List[Union[DynamicTable, NWBDataInterface]]]= Field(default_factory=list, description="""Data streams recorded from the system, including ephys, ophys, tracking, etc. This group should be read-only after the experiment is completed and timestamps are corrected to a common timebase. The data stored here may be links to raw data stored in external NWB files. This will allow keeping bulky raw data out of the file while preserving the option of keeping some/all in the file. Acquired data includes tracking and experimental data streams (i.e., everything measured from the system). If bulky data is stored in the /acquisition group, the data can exist in a separate NWB file that is linked to by the file being used for processing and analysis.""") + analysis:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""Lab-specific and custom scientific analysis of data. There is no defined format for the content of this group - the format is up to the individual user/lab. To facilitate sharing analysis data between labs, the contents here should be stored in standard types (e.g., neurodata_types) and appropriately documented. The file can store lab-specific and custom data analysis without restriction on its form or schema, reducing data formatting restrictions on end users. Such data should be placed in the analysis group. The analysis data should be documented so that it could be shared with other labs.""") + scratch:Optional[List[Union[DynamicTable, NWBContainer]]]= Field(default_factory=list, description="""A place to store one-off analysis results. Data placed here is not intended for sharing. By placing data here, users acknowledge that there is no guarantee that their data meets any standard.""") + processing:Optional[List[ProcessingModule]]= Field(default_factory=list, description="""The home for ProcessingModules. These modules perform intermediate analysis of data that is necessary to perform before scientific analysis. Examples include spike clustering, extracting position from tracking data, stitching together image slices. ProcessingModules can be large and express many data sets from relatively complex analysis (e.g., spike detection and clustering) or small, representing extraction of position information from tracking video, or even binary lick/no-lick decisions. Common software tools (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' refers to intermediate analysis of the acquired data to make it more amenable to scientific analysis.""") + stimulus:NWBFileStimulus= Field(..., description="""Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file.""") + general:NWBFileGeneral= Field(..., description="""Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them.""") + intervals:Optional[NWBFileIntervals]= Field(None, description="""Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data.""") + units:Optional[Units]= Field(None, description="""Data about sorted spike units.""") + + +class NWBFileStimulus(ConfiguredBaseModel): + """ + Data pushed into the system (eg, video stimulus, sound, voltage, etc) and secondary representations of that data (eg, measurements of something used as a stimulus). This group should be made read-only after experiment complete and timestamps are corrected to common timebase. Stores both presented stimuli and stimulus templates, the latter in case the same stimulus is presented multiple times, or is pulled from an external stimulus library. Stimuli are here defined as any signal that is pushed into the system as part of the experiment (eg, sound, video, voltage, etc). Many different experiments can use the same stimuli, and stimuli can be re-used during an experiment. The stimulus group is organized so that one version of template stimuli can be stored and these be used multiple times. These templates can exist in the present file or can be linked to a remote library file. + """ + name:Literal["stimulus"]= Field("stimulus") + presentation:Optional[List[TimeSeries]]= Field(default_factory=list, description="""Stimuli presented during the experiment.""") + templates:Optional[List[Union[Images, TimeSeries]]]= Field(default_factory=list, description="""Template stimuli. Timestamps in templates are based on stimulus design and are relative to the beginning of the stimulus. When templates are used, the stimulus instances must convert presentation times to the experiment`s time reference frame.""") + + +class NWBFileGeneral(ConfiguredBaseModel): + """ + Experimental metadata, including protocol, notes and description of hardware device(s). The metadata stored in this section should be used to describe the experiment. Metadata necessary for interpreting the data is stored with the data. General experimental metadata, including animal strain, experimental protocols, experimenter, devices, etc, are stored under 'general'. Core metadata (e.g., that required to interpret data fields) is stored with the data itself, and implicitly defined by the file specification (e.g., time is in seconds). The strategy used here for storing non-core metadata is to use free-form text fields, such as would appear in sentences or paragraphs from a Methods section. Metadata fields are text to enable them to be more general, for example to represent ranges instead of numerical values. Machine-readable metadata is stored as attributes to these free-form datasets. All entries in the below table are to be included when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) should not be created unless there is data to store within them. + """ + name:Literal["general"]= Field("general") + data_collection:Optional[str]= Field(None, description="""Notes about data collection and analysis.""") + experiment_description:Optional[str]= Field(None, description="""General description of the experiment.""") + experimenter:Optional[List[str]]= Field(default_factory=list, description="""Name of person(s) who performed the experiment. Can also specify roles of different people involved.""") + institution:Optional[str]= Field(None, description="""Institution(s) where experiment was performed.""") + keywords:Optional[List[str]]= Field(default_factory=list, description="""Terms to search over.""") + lab:Optional[str]= Field(None, description="""Laboratory where experiment was performed.""") + notes:Optional[str]= Field(None, description="""Notes about the experiment.""") + pharmacology:Optional[str]= Field(None, description="""Description of drugs used, including how and when they were administered. Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc.""") + protocol:Optional[str]= Field(None, description="""Experimental protocol, if applicable. e.g., include IACUC protocol number.""") + related_publications:Optional[List[str]]= Field(default_factory=list, description="""Publication information. PMID, DOI, URL, etc.""") + session_id:Optional[str]= Field(None, description="""Lab-specific ID for the session.""") + slices:Optional[str]= Field(None, description="""Description of slices, including information about preparation thickness, orientation, temperature, and bath solution.""") + source_script:Optional[NWBFileGeneralSourceScript]= Field(None, description="""Script file or link to public source code used to create this NWB file.""") + stimulus:Optional[str]= Field(None, description="""Notes about stimuli, such as how and where they were presented.""") + surgery:Optional[str]= Field(None, description="""Narrative description about surgery/surgeries, including date(s) and who performed surgery.""") + virus:Optional[str]= Field(None, description="""Information about virus(es) used in experiments, including virus ID, source, date made, injection location, volume, etc.""") + lab_meta_data:Optional[List[LabMetaData]]= Field(default_factory=list, description="""Place-holder than can be extended so that lab-specific meta-data can be placed in /general.""") + devices:Optional[List[Device]]= Field(default_factory=list, description="""Description of hardware devices used during experiment, e.g., monitors, ADC boards, microscopes, etc.""") + subject:Optional[Subject]= Field(None, description="""Information about the animal or person from which the data was measured.""") + extracellular_ephys:Optional[NWBFileGeneralExtracellularEphys]= Field(None, description="""Metadata related to extracellular electrophysiology.""") + intracellular_ephys:Optional[NWBFileGeneralIntracellularEphys]= Field(None, description="""Metadata related to intracellular electrophysiology.""") + optogenetics:Optional[List[OptogeneticStimulusSite]]= Field(default_factory=list, description="""Metadata describing optogenetic stimuluation.""") + optophysiology:Optional[List[ImagingPlane]]= Field(default_factory=list, description="""Metadata related to optophysiology.""") + + +class NWBFileGeneralSourceScript(ConfiguredBaseModel): + """ + Script file or link to public source code used to create this NWB file. + """ + name:Literal["source_script"]= Field("source_script") + file_name:Optional[str]= Field(None, description="""Name of script file.""") + value:str= Field(...) + + +class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): + """ + Metadata related to extracellular electrophysiology. + """ + name:Literal["extracellular_ephys"]= Field("extracellular_ephys") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Physical group of electrodes.""") + electrodes:Optional[NWBFileGeneralExtracellularEphysElectrodes]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + + +class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): + """ + A table of all electrodes (i.e. channels) used for recording. + """ + name:Literal["electrodes"]= Field("electrodes") + x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""") + y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""") + z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""") + imp:Optional[List[float]]= Field(default_factory=list, description="""Impedance of the channel, in ohms.""") + location:Optional[List[str]]= Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + filtering:Optional[List[str]]= Field(default_factory=list, description="""Description of hardware filtering, including the filter name and frequency cutoffs.""") + group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""") + group_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""") + rel_x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate in electrode group""") + rel_y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate in electrode group""") + rel_z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate in electrode group""") + reference:Optional[List[str]]= Field(default_factory=list, description="""Description of the reference electrode and/or reference scheme used for this electrode, e.g., \"stainless steel skull screw\" or \"online common average referencing\".""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): + """ + Metadata related to intracellular electrophysiology. + """ + name:Literal["intracellular_ephys"]= Field("intracellular_ephys") + filtering:Optional[str]= Field(None, description="""[DEPRECATED] Use IntracellularElectrode.filtering instead. Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") + intracellular_electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""An intracellular electrode.""") + sweep_table:Optional[SweepTable]= Field(None, description="""[DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tabels. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions tables provide enhanced support for experiment metadata.""") + intracellular_recordings:Optional[IntracellularRecordingsTable]= Field(None, description="""A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response are recorded as as part of an experiment. In this case both, the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used.""") + simultaneous_recordings:Optional[SimultaneousRecordingsTable]= Field(None, description="""A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes""") + sequential_recordings:Optional[SequentialRecordingsTable]= Field(None, description="""A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where the a sequence of stimuli of the same type with varying parameters have been presented in a sequence.""") + repetitions:Optional[RepetitionsTable]= Field(None, description="""A table for grouping different sequential intracellular recordings together. With each SequentialRecording typically representing a particular type of stimulus, the RepetitionsTable table is typically used to group sets of stimuli applied in sequence.""") + experimental_conditions:Optional[ExperimentalConditionsTable]= Field(None, description="""A table for grouping different intracellular recording repetitions together that belong to the same experimental experimental_conditions.""") + + +class NWBFileIntervals(ConfiguredBaseModel): + """ + Experimental intervals, whether that be logically distinct sub-experiments having a particular scientific goal, trials (see trials subgroup) during an experiment, or epochs (see epochs subgroup) deriving from analysis of data. + """ + name:Literal["intervals"]= Field("intervals") + epochs:Optional[TimeIntervals]= Field(None, description="""Divisions in time marking experimental stages or sub-divisions of a single recording session.""") + trials:Optional[TimeIntervals]= Field(None, description="""Repeated experimental events that have a logical grouping.""") + invalid_times:Optional[TimeIntervals]= Field(None, description="""Time intervals that should be removed from analysis.""") + time_intervals:Optional[List[TimeIntervals]]= Field(default_factory=list, description="""Optional additional table(s) for describing other experimental time intervals.""") + + +class LabMetaData(NWBContainer): + """ + Lab-specific meta-data. + """ + name:str= Field(...) + + +class Subject(NWBContainer): + """ + Information about the animal or person from which the data was measured. + """ + name:str= Field(...) + age:Optional[str]= Field(None, description="""Age of subject. Can be supplied instead of 'date_of_birth'.""") + date_of_birth:Optional[datetime ]= Field(None, description="""Date of birth of subject. Can be supplied instead of 'age'.""") + description:Optional[str]= Field(None, description="""Description of subject and where subject came from (e.g., breeder, if animal).""") + genotype:Optional[str]= Field(None, description="""Genetic strain. If absent, assume Wild Type (WT).""") + sex:Optional[str]= Field(None, description="""Gender of subject.""") + species:Optional[str]= Field(None, description="""Species of subject.""") + strain:Optional[str]= Field(None, description="""Strain of subject.""") + subject_id:Optional[str]= Field(None, description="""ID of animal/person used/participating in experiment (lab convention).""") + weight:Optional[str]= Field(None, description="""Weight at time of experiment, at time of surgery and at other important times.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ScratchData.model_rebuild() +NWBFile.model_rebuild() +NWBFileStimulus.model_rebuild() +NWBFileGeneral.model_rebuild() +NWBFileGeneralSourceScript.model_rebuild() +NWBFileGeneralExtracellularEphys.model_rebuild() +NWBFileGeneralExtracellularEphysElectrodes.model_rebuild() +NWBFileGeneralIntracellularEphys.model_rebuild() +NWBFileIntervals.model_rebuild() +LabMetaData.model_rebuild() +Subject.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py similarity index 95% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_icephys.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py index d9dc28f..6b7434e 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_icephys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_icephys.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -12,24 +13,24 @@ else: from .core_nwb_base import ( - TimeSeriesStartingTime, - NWBContainer, - TimeSeriesReferenceVectorData, TimeSeriesSync, - TimeSeries + TimeSeriesStartingTime, + TimeSeriesReferenceVectorData, + TimeSeries, + NWBContainer ) -from .hdmf_common_table import ( - AlignedDynamicTable, +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, VectorIndex, - DynamicTable, VectorData, - DynamicTableRegion + DynamicTable, + AlignedDynamicTable ) metamodel_version = "None" -version = "None" +version = "2.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -560,42 +561,42 @@ class ExperimentalConditionsTableRepetitionsIndex(VectorIndex): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# PatchClampSeries.model_rebuild() -# CurrentClampSeries.model_rebuild() -# CurrentClampSeriesData.model_rebuild() -# IZeroClampSeries.model_rebuild() -# CurrentClampStimulusSeries.model_rebuild() -# CurrentClampStimulusSeriesData.model_rebuild() -# VoltageClampSeries.model_rebuild() -# VoltageClampSeriesData.model_rebuild() -# VoltageClampSeriesCapacitanceFast.model_rebuild() -# VoltageClampSeriesCapacitanceSlow.model_rebuild() -# VoltageClampSeriesResistanceCompBandwidth.model_rebuild() -# VoltageClampSeriesResistanceCompCorrection.model_rebuild() -# VoltageClampSeriesResistanceCompPrediction.model_rebuild() -# VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() -# VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() -# VoltageClampStimulusSeries.model_rebuild() -# VoltageClampStimulusSeriesData.model_rebuild() -# IntracellularElectrode.model_rebuild() -# SweepTable.model_rebuild() -# SweepTableSeriesIndex.model_rebuild() -# IntracellularElectrodesTable.model_rebuild() -# IntracellularStimuliTable.model_rebuild() -# IntracellularStimuliTableStimulus.model_rebuild() -# IntracellularResponsesTable.model_rebuild() -# IntracellularResponsesTableResponse.model_rebuild() -# IntracellularRecordingsTable.model_rebuild() -# SimultaneousRecordingsTable.model_rebuild() -# SimultaneousRecordingsTableRecordings.model_rebuild() -# SimultaneousRecordingsTableRecordingsIndex.model_rebuild() -# SequentialRecordingsTable.model_rebuild() -# SequentialRecordingsTableSimultaneousRecordings.model_rebuild() -# SequentialRecordingsTableSimultaneousRecordingsIndex.model_rebuild() -# RepetitionsTable.model_rebuild() -# RepetitionsTableSequentialRecordings.model_rebuild() -# RepetitionsTableSequentialRecordingsIndex.model_rebuild() -# ExperimentalConditionsTable.model_rebuild() -# ExperimentalConditionsTableRepetitions.model_rebuild() -# ExperimentalConditionsTableRepetitionsIndex.model_rebuild() -# \ No newline at end of file +PatchClampSeries.model_rebuild() +CurrentClampSeries.model_rebuild() +CurrentClampSeriesData.model_rebuild() +IZeroClampSeries.model_rebuild() +CurrentClampStimulusSeries.model_rebuild() +CurrentClampStimulusSeriesData.model_rebuild() +VoltageClampSeries.model_rebuild() +VoltageClampSeriesData.model_rebuild() +VoltageClampSeriesCapacitanceFast.model_rebuild() +VoltageClampSeriesCapacitanceSlow.model_rebuild() +VoltageClampSeriesResistanceCompBandwidth.model_rebuild() +VoltageClampSeriesResistanceCompCorrection.model_rebuild() +VoltageClampSeriesResistanceCompPrediction.model_rebuild() +VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() +VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() +VoltageClampStimulusSeries.model_rebuild() +VoltageClampStimulusSeriesData.model_rebuild() +IntracellularElectrode.model_rebuild() +SweepTable.model_rebuild() +SweepTableSeriesIndex.model_rebuild() +IntracellularElectrodesTable.model_rebuild() +IntracellularStimuliTable.model_rebuild() +IntracellularStimuliTableStimulus.model_rebuild() +IntracellularResponsesTable.model_rebuild() +IntracellularResponsesTableResponse.model_rebuild() +IntracellularRecordingsTable.model_rebuild() +SimultaneousRecordingsTable.model_rebuild() +SimultaneousRecordingsTableRecordings.model_rebuild() +SimultaneousRecordingsTableRecordingsIndex.model_rebuild() +SequentialRecordingsTable.model_rebuild() +SequentialRecordingsTableSimultaneousRecordings.model_rebuild() +SequentialRecordingsTableSimultaneousRecordingsIndex.model_rebuild() +RepetitionsTable.model_rebuild() +RepetitionsTableSequentialRecordings.model_rebuild() +RepetitionsTableSequentialRecordingsIndex.model_rebuild() +ExperimentalConditionsTable.model_rebuild() +ExperimentalConditionsTableRepetitions.model_rebuild() +ExperimentalConditionsTableRepetitionsIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py similarity index 96% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_image.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py index 9b97473..2898698 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_image.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_image.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -12,15 +13,15 @@ else: from .core_nwb_base import ( - TimeSeriesStartingTime, Image, - TimeSeries, - TimeSeriesSync + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries ) metamodel_version = "None" -version = "None" +version = "2.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -169,14 +170,14 @@ class IndexSeries(TimeSeries): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# GrayscaleImage.model_rebuild() -# RGBImage.model_rebuild() -# RGBAImage.model_rebuild() -# ImageSeries.model_rebuild() -# ImageSeriesData.model_rebuild() -# ImageMaskSeries.model_rebuild() -# OpticalSeries.model_rebuild() -# OpticalSeriesFieldOfView.model_rebuild() -# OpticalSeriesData.model_rebuild() -# IndexSeries.model_rebuild() +GrayscaleImage.model_rebuild() +RGBImage.model_rebuild() +RGBAImage.model_rebuild() +ImageSeries.model_rebuild() +ImageSeriesData.model_rebuild() +ImageMaskSeries.model_rebuild() +OpticalSeries.model_rebuild() +OpticalSeriesFieldOfView.model_rebuild() +OpticalSeriesData.model_rebuild() +IndexSeries.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py new file mode 100644 index 0000000..0fba9e6 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_misc.py @@ -0,0 +1,389 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + + +metamodel_version = "None" +version = "2.5.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class AbstractFeatureSeries(TimeSeries): + """ + Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial frequency and contrast). Null stimuli (eg, uniform gray) can be marked as being an independent feature (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, or through use of the TimeSeries::control fields. A set of features is considered to persist until the next set of features is defined. The final set of features stored should be the null set. This is useful when storing the raw stimulus is impractical. + """ + name:str= Field(...) + data:AbstractFeatureSeriesData= Field(..., description="""Values of each feature at each time.""") + feature_units:Optional[List[str]]= Field(default_factory=list, description="""Units of each feature.""") + features:List[str]= Field(default_factory=list, description="""Description of the features represented in TimeSeries::data.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class AbstractFeatureSeriesData(ConfiguredBaseModel): + """ + Values of each feature at each time. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Since there can be different units for different features, store the units in 'feature_units'. The default value for this attribute is \"see 'feature_units'\".""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_features"], Number] + ]]= Field(None) + + +class AnnotationSeries(TimeSeries): + """ + Stores user annotations made during an experiment. The data[] field stores a text array, and timestamps are stored for each annotation (ie, interval=1). This is largely an alias to a standard TimeSeries storing a text array but that is identifiable as storing annotations in a machine-readable way. + """ + name:str= Field(...) + data:List[str]= Field(default_factory=list, description="""Annotations made during an experiment.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class IntervalSeries(TimeSeries): + """ + Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the same series by using multiple key values (eg, 1 for feature A, 2 for feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely an alias of a standard TimeSeries but that is identifiable as representing time intervals in a machine-readable way. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Use values >0 if interval started, <0 if interval ended.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeries(TimeSeries): + """ + Spectral analysis of a time series, e.g. of an LFP or a speech signal. + """ + name:str= Field(...) + data:DecompositionSeriesData= Field(..., description="""Data decomposed into frequency bands.""") + metric:str= Field(..., description="""The metric used, e.g. phase, amplitude, power.""") + source_channels:Optional[DecompositionSeriesSourceChannels]= Field(None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""") + bands:DecompositionSeriesBands= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class DecompositionSeriesData(ConfiguredBaseModel): + """ + Data decomposed into frequency bands. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion'.""") + array:Optional[NDArray[Shape["* num_times, * num_channels, * num_bands"], Number]]= Field(None) + + +class DecompositionSeriesSourceChannels(DynamicTableRegion): + """ + DynamicTableRegion pointer to the channels that this decomposition series was generated from. + """ + name:Literal["source_channels"]= Field("source_channels") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class DecompositionSeriesBands(DynamicTable): + """ + Table for describing the bands that this series was generated from. There should be one row in this table for each band. + """ + name:Literal["bands"]= Field("bands") + band_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the band, e.g. theta.""") + band_limits:DecompositionSeriesBandsBandLimits= Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""") + band_mean:List[float]= Field(default_factory=list, description="""The mean Gaussian filters, in Hz.""") + band_stdev:List[float]= Field(default_factory=list, description="""The standard deviation of Gaussian filters, in Hz.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class DecompositionSeriesBandsBandLimits(VectorData): + """ + Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center. + """ + name:Literal["band_limits"]= Field("band_limits") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class Units(DynamicTable): + """ + Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. + """ + name:str= Field(...) + spike_times_index:Optional[UnitsSpikeTimesIndex]= Field(None, description="""Index into the spike_times dataset.""") + spike_times:Optional[UnitsSpikeTimes]= Field(None, description="""Spike times for each unit.""") + obs_intervals_index:Optional[UnitsObsIntervalsIndex]= Field(None, description="""Index into the obs_intervals dataset.""") + obs_intervals:Optional[UnitsObsIntervals]= Field(None, description="""Observation intervals for each unit.""") + electrodes_index:Optional[UnitsElectrodesIndex]= Field(None, description="""Index into electrodes.""") + electrodes:Optional[UnitsElectrodes]= Field(None, description="""Electrode that each spike unit came from, specified using a DynamicTableRegion.""") + electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Electrode group that each spike unit came from.""") + waveform_mean:Optional[UnitsWaveformMean]= Field(None, description="""Spike waveform mean for each spike unit.""") + waveform_sd:Optional[UnitsWaveformSd]= Field(None, description="""Spike waveform standard deviation for each spike unit.""") + waveforms:Optional[UnitsWaveforms]= Field(None, description="""Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same.""") + waveforms_index:Optional[UnitsWaveformsIndex]= Field(None, description="""Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail.""") + waveforms_index_index:Optional[UnitsWaveformsIndexIndex]= Field(None, description="""Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class UnitsSpikeTimesIndex(VectorIndex): + """ + Index into the spike_times dataset. + """ + name:Literal["spike_times_index"]= Field("spike_times_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsSpikeTimes(VectorData): + """ + Spike times for each unit. + """ + name:Literal["spike_times"]= Field("spike_times") + resolution:Optional[float]= Field(None, description="""The smallest possible difference between two spike times. Usually 1 divided by the acquisition sampling rate from which spike times were extracted, but could be larger if the acquisition time series was downsampled or smaller if the acquisition time series was smoothed/interpolated and it is possible for the spike time to be between samples.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsObsIntervalsIndex(VectorIndex): + """ + Index into the obs_intervals dataset. + """ + name:Literal["obs_intervals_index"]= Field("obs_intervals_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsObsIntervals(VectorData): + """ + Observation intervals for each unit. + """ + name:Literal["obs_intervals"]= Field("obs_intervals") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsElectrodesIndex(VectorIndex): + """ + Index into electrodes. + """ + name:Literal["electrodes_index"]= Field("electrodes_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsElectrodes(DynamicTableRegion): + """ + Electrode that each spike unit came from, specified using a DynamicTableRegion. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformMean(VectorData): + """ + Spike waveform mean for each spike unit. + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformSd(VectorData): + """ + Spike waveform standard deviation for each spike unit. + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveforms(VectorData): + """ + Individual waveforms for each spike on each electrode. This is a doubly indexed column. The 'waveforms_index' column indexes which waveforms in this column belong to the same spike event for a given unit, where each waveform was recorded from a different electrode. The 'waveforms_index_index' column indexes the 'waveforms_index' column to indicate which spike events belong to a given unit. For example, if the 'waveforms_index_index' column has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' column correspond to the 3 spike events of the second unit, and the next 1 element of the 'waveforms_index' column corresponds to the 1 spike event of the third unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' column contain the 3 spike waveforms that were recorded from 3 different electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays for a graphical representation of this example. When there is only one electrode for each unit (i.e., each spike time is associated with a single waveform), then the 'waveforms_index' column will have values 1, 2, ..., N, where N is the number of spike events. The number of electrodes for each spike event should be the same within a given unit. The 'electrodes' column should be used to indicate which electrodes are associated with each unit, and the order of the waveforms within a given unit x spike event should be in the same order as the electrodes referenced in the 'electrodes' column of this table. The number of samples for each waveform must be the same. + """ + name:Literal["waveforms"]= Field("waveforms") + sampling_rate:Optional[float]= Field(None, description="""Sampling rate, in hertz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement. This value is fixed to 'volts'.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformsIndex(VectorIndex): + """ + Index into the waveforms dataset. One value for every spike event. See 'waveforms' for more detail. + """ + name:Literal["waveforms_index"]= Field("waveforms_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class UnitsWaveformsIndexIndex(VectorIndex): + """ + Index into the waveforms_index dataset. One value for every unit (row in the table). See 'waveforms' for more detail. + """ + name:Literal["waveforms_index_index"]= Field("waveforms_index_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +AbstractFeatureSeries.model_rebuild() +AbstractFeatureSeriesData.model_rebuild() +AnnotationSeries.model_rebuild() +IntervalSeries.model_rebuild() +DecompositionSeries.model_rebuild() +DecompositionSeriesData.model_rebuild() +DecompositionSeriesSourceChannels.model_rebuild() +DecompositionSeriesBands.model_rebuild() +DecompositionSeriesBandsBandLimits.model_rebuild() +Units.model_rebuild() +UnitsSpikeTimesIndex.model_rebuild() +UnitsSpikeTimes.model_rebuild() +UnitsObsIntervalsIndex.model_rebuild() +UnitsObsIntervals.model_rebuild() +UnitsElectrodesIndex.model_rebuild() +UnitsElectrodes.model_rebuild() +UnitsWaveformMean.model_rebuild() +UnitsWaveformSd.model_rebuild() +UnitsWaveforms.model_rebuild() +UnitsWaveformsIndex.model_rebuild() +UnitsWaveformsIndexIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py new file mode 100644 index 0000000..ff573dd --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ogen.py @@ -0,0 +1,65 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeries, + NWBContainer, + TimeSeriesSync +) + + +metamodel_version = "None" +version = "2.5.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class OptogeneticSeries(TimeSeries): + """ + An optogenetic stimulus. + """ + name:str= Field(...) + data:List[float]= Field(default_factory=list, description="""Applied power for optogenetic stimulus, in watts.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OptogeneticStimulusSite(NWBContainer): + """ + A site of optogenetic stimulation. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of stimulation site.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + location:str= Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +OptogeneticSeries.model_rebuild() +OptogeneticStimulusSite.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py new file mode 100644 index 0000000..d847cf9 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_ophys.py @@ -0,0 +1,309 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from .core_nwb_image import ( + ImageSeriesData, + ImageSeries +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + + +metamodel_version = "None" +version = "2.5.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TwoPhotonSeries(ImageSeries): + """ + Image stack recorded over time from 2-photon microscope. + """ + name:str= Field(...) + pmt_gain:Optional[float]= Field(None, description="""Photomultiplier gain.""") + scan_line_rate:Optional[float]= Field(None, description="""Lines imaged per second. This is also stored in /general/optophysiology but is kept here as it is useful information for analysis, and so good to be stored w/ the actual data.""") + field_of_view:Optional[TwoPhotonSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:ImageSeriesData= Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TwoPhotonSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class RoiResponseSeries(TimeSeries): + """ + ROI responses over an imaging plane. The first dimension represents time. The second dimension, if present, represents ROIs. + """ + name:str= Field(...) + data:RoiResponseSeriesData= Field(..., description="""Signals from ROIs.""") + rois:RoiResponseSeriesRois= Field(..., description="""DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class RoiResponseSeriesData(ConfiguredBaseModel): + """ + Signals from ROIs. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_ROIs"], Number] + ]]= Field(None) + + +class RoiResponseSeriesRois(DynamicTableRegion): + """ + DynamicTableRegion referencing into an ROITable containing information on the ROIs stored in this timeseries. + """ + name:Literal["rois"]= Field("rois") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class DfOverF(NWBDataInterface): + """ + dF/F information about a region of interest (ROI). Storage hierarchy of dF/F should be the same as for segmentation (i.e., same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing dF/F for a ROI.""") + + +class Fluorescence(NWBDataInterface): + """ + Fluorescence information about a region of interest (ROI). Storage hierarchy of fluorescence should be the same as for segmentation (ie, same names for ROIs and for image planes). + """ + name:str= Field(...) + roi_response_series:List[RoiResponseSeries]= Field(default_factory=list, description="""RoiResponseSeries object(s) containing fluorescence data for a ROI.""") + + +class ImageSegmentation(NWBDataInterface): + """ + Stores pixels in an image that represent different regions of interest (ROIs) or masks. All segmentation for a given imaging plane is stored together, with storage for multiple imaging planes (masks) supported. Each ROI is stored in its own subgroup, with the ROI group containing both a 2D mask and a list of pixels that make up this mask. Segments can also be used for masking neuropil. If segmentation is allowed to change with time, a new imaging plane (or module) is required and ROI names should remain consistent between them. + """ + name:str= Field(...) + plane_segmentation:List[PlaneSegmentation]= Field(default_factory=list, description="""Results from image segmentation of a specific imaging plane.""") + + +class PlaneSegmentation(DynamicTable): + """ + Results from image segmentation of a specific imaging plane. + """ + name:str= Field(...) + image_mask:Optional[PlaneSegmentationImageMask]= Field(None, description="""ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero.""") + pixel_mask_index:Optional[PlaneSegmentationPixelMaskIndex]= Field(None, description="""Index into pixel_mask.""") + pixel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Pixel masks for each ROI: a list of indices and weights for the ROI. Pixel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + voxel_mask_index:Optional[PlaneSegmentationVoxelMaskIndex]= Field(None, description="""Index into voxel_mask.""") + voxel_mask:Optional[List[Any]]= Field(default_factory=list, description="""Voxel masks for each ROI: a list of indices and weights for the ROI. Voxel masks are concatenated and parsing of this dataset is maintained by the PlaneSegmentation""") + reference_images:Optional[List[ImageSeries]]= Field(default_factory=list, description="""Image stacks that the segmentation masks apply to.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class PlaneSegmentationImageMask(VectorData): + """ + ROI masks for each ROI. Each image mask is the size of the original imaging plane (or volume) and members of the ROI are finite non-zero. + """ + name:Literal["image_mask"]= Field("image_mask") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class PlaneSegmentationPixelMaskIndex(VectorIndex): + """ + Index into pixel_mask. + """ + name:Literal["pixel_mask_index"]= Field("pixel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class PlaneSegmentationVoxelMaskIndex(VectorIndex): + """ + Index into voxel_mask. + """ + name:Literal["voxel_mask_index"]= Field("voxel_mask_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class ImagingPlane(NWBContainer): + """ + An imaging plane and its metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the imaging plane.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + imaging_rate:Optional[float]= Field(None, description="""Rate that images are acquired, in Hz. If the corresponding TimeSeries is present, the rate should be stored there instead.""") + indicator:str= Field(..., description="""Calcium indicator.""") + location:str= Field(..., description="""Location of the imaging plane. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + manifold:Optional[ImagingPlaneManifold]= Field(None, description="""DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing.""") + origin_coords:Optional[ImagingPlaneOriginCoords]= Field(None, description="""Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma).""") + grid_spacing:Optional[ImagingPlaneGridSpacing]= Field(None, description="""Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid.""") + reference_frame:Optional[str]= Field(None, description="""Describes reference frame of origin_coords and grid_spacing. For example, this can be a text description of the anatomical location and orientation of the grid defined by origin_coords and grid_spacing or the vectors needed to transform or rotate the grid to a common anatomical axis (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and grid_spacing. If origin_coords and grid_spacing are not present, then this field is not required. For example, if the microscope takes 10 x 10 x 2 images, where the first value of the data matrix (index (0, 0, 0)) corresponds to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means more anterior, larger numbers in y means more rightward, and larger numbers in z means more ventral, then enter the following -- origin_coords = (-1.2, -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = \"Origin coordinates are relative to bregma. First dimension corresponds to anterior-posterior axis (larger index = more anterior). Second dimension corresponds to medial-lateral axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral axis (larger index = more ventral).\"""") + optical_channel:List[OpticalChannel]= Field(default_factory=list, description="""An optical channel used to record from an imaging plane.""") + + +class ImagingPlaneManifold(ConfiguredBaseModel): + """ + DEPRECATED Physical position of each pixel. 'xyz' represents the position of the pixel relative to the defined coordinate space. Deprecated in favor of origin_coords and grid_spacing. + """ + name:Literal["manifold"]= Field("manifold") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as pixels from x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then the 'conversion' multiplier to get from raw data acquisition pixel units to meters is 2/1000.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["* height, * width, 3 x_y_z"], Float32], + NDArray[Shape["* height, * width, 3 x_y_z, * depth"], Float32] + ]]= Field(None) + + +class ImagingPlaneOriginCoords(ConfiguredBaseModel): + """ + Physical location of the first element of the imaging plane (0, 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the physical location is relative to (e.g., bregma). + """ + name:Literal["origin_coords"]= Field("origin_coords") + unit:Optional[str]= Field(None, description="""Measurement units for origin_coords. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["2 x_y"], Float32], + NDArray[Shape["2 x_y, 3 x_y_z"], Float32] + ]]= Field(None) + + +class ImagingPlaneGridSpacing(ConfiguredBaseModel): + """ + Space between pixels in (x, y) or voxels in (x, y, z) directions, in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame to interpret the grid. + """ + name:Literal["grid_spacing"]= Field("grid_spacing") + unit:Optional[str]= Field(None, description="""Measurement units for grid_spacing. The default value is 'meters'.""") + array:Optional[Union[ + NDArray[Shape["2 x_y"], Float32], + NDArray[Shape["2 x_y, 3 x_y_z"], Float32] + ]]= Field(None) + + +class OpticalChannel(NWBContainer): + """ + An optical channel used to record from an imaging plane. + """ + name:str= Field(...) + description:str= Field(..., description="""Description or other notes about the channel.""") + emission_lambda:float= Field(..., description="""Emission wavelength for channel, in nm.""") + + +class MotionCorrection(NWBDataInterface): + """ + An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dimensions). + """ + name:str= Field(...) + corrected_image_stack:List[CorrectedImageStack]= Field(default_factory=list, description="""Reuslts from motion correction of an image stack.""") + + +class CorrectedImageStack(NWBDataInterface): + """ + Reuslts from motion correction of an image stack. + """ + name:str= Field(...) + corrected:ImageSeries= Field(..., description="""Image stack with frames shifted to the common coordinates.""") + xy_translation:TimeSeries= Field(..., description="""Stores the x,y delta necessary to align each frame to the common coordinates, for example, to align each frame to a reference image.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TwoPhotonSeries.model_rebuild() +TwoPhotonSeriesFieldOfView.model_rebuild() +RoiResponseSeries.model_rebuild() +RoiResponseSeriesData.model_rebuild() +RoiResponseSeriesRois.model_rebuild() +DfOverF.model_rebuild() +Fluorescence.model_rebuild() +ImageSegmentation.model_rebuild() +PlaneSegmentation.model_rebuild() +PlaneSegmentationImageMask.model_rebuild() +PlaneSegmentationPixelMaskIndex.model_rebuild() +PlaneSegmentationVoxelMaskIndex.model_rebuild() +ImagingPlane.model_rebuild() +ImagingPlaneManifold.model_rebuild() +ImagingPlaneOriginCoords.model_rebuild() +ImagingPlaneGridSpacing.model_rebuild() +OpticalChannel.model_rebuild() +MotionCorrection.model_rebuild() +CorrectedImageStack.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py new file mode 100644 index 0000000..fb5e736 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/core_nwb_retinotopy.py @@ -0,0 +1,137 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface +) + + +metamodel_version = "None" +version = "2.5.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ImagingRetinotopy(NWBDataInterface): + """ + Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). + """ + name:str= Field(...) + axis_1_phase_map:ImagingRetinotopyAxis1PhaseMap= Field(..., description="""Phase response to stimulus on the first measured axis.""") + axis_1_power_map:Optional[ImagingRetinotopyAxis1PowerMap]= Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_2_phase_map:ImagingRetinotopyAxis2PhaseMap= Field(..., description="""Phase response to stimulus on the second measured axis.""") + axis_2_power_map:Optional[ImagingRetinotopyAxis2PowerMap]= Field(None, description="""Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_descriptions:List[str]= Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""") + focal_depth_image:Optional[ImagingRetinotopyFocalDepthImage]= Field(None, description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""") + sign_map:Optional[ImagingRetinotopySignMap]= Field(None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""") + vasculature_image:ImagingRetinotopyVasculatureImage= Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""") + + +class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the first measured axis. + """ + name:Literal["axis_1_phase_map"]= Field("axis_1_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): + """ + Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_1_power_map"]= Field("axis_1_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the second measured axis. + """ + name:Literal["axis_2_phase_map"]= Field("axis_2_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): + """ + Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_2_power_map"]= Field("axis_2_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): + """ + Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. + """ + name:Literal["focal_depth_image"]= Field("focal_depth_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + focal_depth:Optional[float]= Field(None, description="""Focal depth offset, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + +class ImagingRetinotopySignMap(ConfiguredBaseModel): + """ + Sine of the angle between the direction of the gradient in axis_1 and axis_2. + """ + name:Literal["sign_map"]= Field("sign_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): + """ + Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] + """ + name:Literal["vasculature_image"]= Field("vasculature_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ImagingRetinotopy.model_rebuild() +ImagingRetinotopyAxis1PhaseMap.model_rebuild() +ImagingRetinotopyAxis1PowerMap.model_rebuild() +ImagingRetinotopyAxis2PhaseMap.model_rebuild() +ImagingRetinotopyAxis2PowerMap.model_rebuild() +ImagingRetinotopyFocalDepthImage.model_rebuild() +ImagingRetinotopySignMap.model_rebuild() +ImagingRetinotopyVasculatureImage.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/namespace.py new file mode 100644 index 0000000..f266cb4 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_5_0/namespace.py @@ -0,0 +1,168 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_experimental.v0_1_0.hdmf_experimental_resources import ( + ExternalResources +) + +from ...hdmf_common.v1_5_0.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_5_0.hdmf_common_base import ( + Data, + Container, + SimpleMultiContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + DynamicTable, + AlignedDynamicTable +) + +from ...hdmf_experimental.v0_1_0.hdmf_experimental_experimental import ( + EnumData +) + +from .core_nwb_retinotopy import ( + ImagingRetinotopy +) + +from .core_nwb_base import ( + NWBData, + TimeSeriesReferenceVectorData, + Image, + ImageReferences, + NWBContainer, + NWBDataInterface, + TimeSeries, + ProcessingModule, + Images +) + +from .core_nwb_ophys import ( + TwoPhotonSeries, + RoiResponseSeries, + DfOverF, + Fluorescence, + ImageSegmentation, + PlaneSegmentation, + ImagingPlane, + OpticalChannel, + MotionCorrection, + CorrectedImageStack +) + +from .core_nwb_device import ( + Device +) + +from .core_nwb_image import ( + GrayscaleImage, + RGBImage, + RGBAImage, + ImageSeries, + ImageMaskSeries, + OpticalSeries, + IndexSeries +) + +from .core_nwb_ogen import ( + OptogeneticSeries, + OptogeneticStimulusSite +) + +from .core_nwb_icephys import ( + PatchClampSeries, + CurrentClampSeries, + IZeroClampSeries, + CurrentClampStimulusSeries, + VoltageClampSeries, + VoltageClampStimulusSeries, + IntracellularElectrode, + SweepTable, + IntracellularElectrodesTable, + IntracellularStimuliTable, + IntracellularResponsesTable, + IntracellularRecordingsTable, + SimultaneousRecordingsTable, + SequentialRecordingsTable, + RepetitionsTable, + ExperimentalConditionsTable +) + +from .core_nwb_ecephys import ( + ElectricalSeries, + SpikeEventSeries, + FeatureExtraction, + EventDetection, + EventWaveform, + FilteredEphys, + LFP, + ElectrodeGroup, + ClusterWaveforms, + Clustering +) + +from .core_nwb_behavior import ( + SpatialSeries, + BehavioralEpochs, + BehavioralEvents, + BehavioralTimeSeries, + PupilTracking, + EyeTracking, + CompassDirection, + Position +) + +from .core_nwb_misc import ( + AbstractFeatureSeries, + AnnotationSeries, + IntervalSeries, + DecompositionSeries, + Units +) + +from .core_nwb_file import ( + ScratchData, + NWBFile, + LabMetaData, + Subject +) + +from .core_nwb_epoch import ( + TimeIntervals +) + + +metamodel_version = "None" +version = "2.5.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py new file mode 100644 index 0000000..eff67b1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_base.py @@ -0,0 +1,189 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_5_0.hdmf_common_base import ( + Container, + Data +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable, + VectorData +) + + +metamodel_version = "None" +version = "2.6.0-alpha" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class NWBData(Data): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class TimeSeriesReferenceVectorData(VectorData): + """ + Column storing references to a TimeSeries (rows). For each TimeSeries this VectorData column stores the start_index and count to indicate the range in time to be selected as well as an object reference to the TimeSeries. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class Image(NWBData): + """ + An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or (x, y, (r, g, b, a)). + """ + name:str= Field(...) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + array:Optional[Union[ + NDArray[Shape["* x, * y"], Number], + NDArray[Shape["* x, * y, 3 r_g_b"], Number], + NDArray[Shape["* x, * y, 3 r_g_b, 4 r_g_b_a"], Number] + ]]= Field(None) + + +class ImageReferences(NWBData): + """ + Ordered dataset of references to Image objects. + """ + name:str= Field(...) + array:Optional[List[Image] | Image]= Field(None) + + +class NWBContainer(Container): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class NWBDataInterface(NWBContainer): + """ + An abstract data type for a generic container storing collections of data, as opposed to metadata. + """ + name:str= Field(...) + + +class TimeSeries(NWBDataInterface): + """ + General purpose time series. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + data:TimeSeriesData= Field(..., description="""Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class TimeSeriesData(ConfiguredBaseModel): + """ + Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension should always represent time. This can also be used to store binary data (e.g., image frames). This can also be a link to data stored in an external file. + """ + name:Literal["data"]= Field("data") + conversion:Optional[float]= Field(None, description="""Scalar to multiply each element in data to convert it to the specified 'unit'. If the data are stored in acquisition system units or other units that require a conversion to be interpretable, multiply the data by 'conversion' to convert the data to the specified 'unit'. e.g. if the data acquisition system stores values in this object as signed 16-bit integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' multiplier to get from raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.""") + offset:Optional[float]= Field(None, description="""Scalar to add to the data after scaling by 'conversion' to finalize its coercion to the specified 'unit'. Two common examples of this include (a) data stored in an unsigned type that requires a shift after scaling to re-center the data, and (b) specialized recording devices that naturally cause a scalar offset with respect to the true units.""") + resolution:Optional[float]= Field(None, description="""Smallest meaningful difference between values in data, stored in the specified by unit, e.g., the change in value of the least significant bit, or a larger number if signal noise is known to be present. If unknown, use -1.0.""") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") + continuity:Optional[str]= Field(None, description="""Optionally describe the continuity of the data. Can be \"continuous\", \"instantaneous\", or \"step\". For example, a voltage trace would be \"continuous\", because samples are recorded from a continuous process. An array of lick times would be \"instantaneous\", because the data represents distinct moments in time. Times of image presentations would be \"step\" because the picture remains the same until the next timepoint. This field is optional, but is useful in providing information about the underlying data. It may inform the way this data is interpreted, the way it is visualized, and what analysis methods are applicable.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Any], + NDArray[Shape["* num_times, * num_DIM2"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3"], Any], + NDArray[Shape["* num_times, * num_DIM2, * num_DIM3, * num_DIM4"], Any] + ]]= Field(None) + + +class TimeSeriesStartingTime(ConfiguredBaseModel): + """ + Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute. + """ + name:Literal["starting_time"]= Field("starting_time") + rate:Optional[float]= Field(None, description="""Sampling rate, in Hz.""") + unit:Optional[str]= Field(None, description="""Unit of measurement for time, which is fixed to 'seconds'.""") + value:float= Field(...) + + +class TimeSeriesSync(ConfiguredBaseModel): + """ + Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes. + """ + name:Literal["sync"]= Field("sync") + + +class ProcessingModule(NWBContainer): + """ + A collection of processed data. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of processed data.""") + nwb_data_interface:Optional[List[NWBDataInterface]]= Field(default_factory=list, description="""Data objects stored in this collection.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""Tables stored in this collection.""") + + +class Images(NWBDataInterface): + """ + A collection of images with an optional way to specify the order of the images using the \"order_of_images\" dataset. An order must be specified if the images are referenced by index, e.g., from an IndexSeries. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this collection of images.""") + image:List[Image]= Field(default_factory=list, description="""Images stored in this collection.""") + order_of_images:Optional[ImagesOrderOfImages]= Field(None, description="""Ordered dataset of references to Image objects stored in the parent group. Each Image object in the Images group should be stored once and only once, so the dataset should have the same length as the number of images.""") + + +class ImagesOrderOfImages(ImageReferences): + """ + Ordered dataset of references to Image objects stored in the parent group. Each Image object in the Images group should be stored once and only once, so the dataset should have the same length as the number of images. + """ + name:Literal["order_of_images"]= Field("order_of_images") + array:Optional[List[Image] | Image]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +NWBData.model_rebuild() +TimeSeriesReferenceVectorData.model_rebuild() +Image.model_rebuild() +ImageReferences.model_rebuild() +NWBContainer.model_rebuild() +NWBDataInterface.model_rebuild() +TimeSeries.model_rebuild() +TimeSeriesData.model_rebuild() +TimeSeriesStartingTime.model_rebuild() +TimeSeriesSync.model_rebuild() +ProcessingModule.model_rebuild() +Images.model_rebuild() +ImagesOrderOfImages.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py new file mode 100644 index 0000000..a56dcdc --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_behavior.py @@ -0,0 +1,137 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + +from .core_nwb_misc import ( + IntervalSeries +) + + +metamodel_version = "None" +version = "2.6.0-alpha" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class SpatialSeries(TimeSeries): + """ + Direction, e.g., of gaze or travel, or position. The TimeSeries::data field is a 2D array storing position or direction relative to some reference frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries has a text dataset reference_frame that indicates the zero-position, or the zero-axes for direction. For example, if representing gaze direction, 'straight-ahead' might be a specific pixel on the monitor, or some other point in space. For position data, the 0,0 point might be the top-left corner of an enclosure, as viewed from the tracking camera. The unit of data will indicate how to interpret SpatialSeries values. + """ + name:str= Field(...) + data:SpatialSeriesData= Field(..., description="""1-D or 2-D array storing position or direction relative to some reference frame.""") + reference_frame:Optional[str]= Field(None, description="""Description defining what exactly 'straight-ahead' means.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpatialSeriesData(ConfiguredBaseModel): + """ + 1-D or 2-D array storing position or direction relative to some reference frame. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. The default value is 'meters'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, 1 x"], Number], + NDArray[Shape["* num_times, 1 x, 2 x_y"], Number], + NDArray[Shape["* num_times, 1 x, 2 x_y, 3 x_y_z"], Number] + ]]= Field(None) + + +class BehavioralEpochs(NWBDataInterface): + """ + TimeSeries for storing behavioral epochs. The objective of this and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) is to provide generic hooks for software tools/scripts. This allows a tool/script to take the output one specific interface (e.g., UnitTimes) and plot that data relative to another data modality (e.g., behavioral events) without having to define all possible modalities in advance. Declaring one of these interfaces means that one or more TimeSeries of the specified type is published. These TimeSeries should reside in a group having the same name as the interface. For example, if a BehavioralTimeSeries interface is declared, the module will have one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular events. BehavioralTimeSeries is for continuous data. + """ + name:str= Field(...) + interval_series:Optional[List[IntervalSeries]]= Field(default_factory=list, description="""IntervalSeries object containing start and stop times of epochs.""") + + +class BehavioralEvents(NWBDataInterface): + """ + TimeSeries for storing behavioral events. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing behavioral events.""") + + +class BehavioralTimeSeries(NWBDataInterface): + """ + TimeSeries for storing Behavoioral time series data. See description of BehavioralEpochs for more details. + """ + name:str= Field(...) + time_series:Optional[List[TimeSeries]]= Field(default_factory=list, description="""TimeSeries object containing continuous behavioral data.""") + + +class PupilTracking(NWBDataInterface): + """ + Eye-tracking data, representing pupil size. + """ + name:str= Field(...) + time_series:List[TimeSeries]= Field(default_factory=list, description="""TimeSeries object containing time series data on pupil size.""") + + +class EyeTracking(NWBDataInterface): + """ + Eye-tracking data, representing direction of gaze. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing data measuring direction of gaze.""") + + +class CompassDirection(NWBDataInterface): + """ + With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and which is the direction of rotation (this should be clockwise). The si_unit for the SpatialSeries should be radians or degrees. + """ + name:str= Field(...) + spatial_series:Optional[List[SpatialSeries]]= Field(default_factory=list, description="""SpatialSeries object containing direction of gaze travel.""") + + +class Position(NWBDataInterface): + """ + Position data, whether along the x, x/y or x/y/z axis. + """ + name:str= Field(...) + spatial_series:List[SpatialSeries]= Field(default_factory=list, description="""SpatialSeries object containing position data.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +SpatialSeries.model_rebuild() +SpatialSeriesData.model_rebuild() +BehavioralEpochs.model_rebuild() +BehavioralEvents.model_rebuild() +BehavioralTimeSeries.model_rebuild() +PupilTracking.model_rebuild() +EyeTracking.model_rebuild() +CompassDirection.model_rebuild() +Position.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_device.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_device.py new file mode 100644 index 0000000..a025799 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_device.py @@ -0,0 +1,45 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBContainer +) + + +metamodel_version = "None" +version = "2.6.0-alpha" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Device(NWBContainer): + """ + Metadata about a data acquisition device, e.g., recording system, electrode, microscope. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of the device (e.g., model, firmware version, processing software version, etc.) as free-form text.""") + manufacturer:Optional[str]= Field(None, description="""The name of the manufacturer of the device.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Device.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py new file mode 100644 index 0000000..a716013 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ecephys.py @@ -0,0 +1,252 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + DynamicTable +) + + +metamodel_version = "None" +version = "2.6.0-alpha" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ElectricalSeries(TimeSeries): + """ + A time series of acquired voltage data from extracellular recordings. The data field is an int or float array storing data in volts. The first dimension should always represent time. The second dimension, if present, should represent channels. + """ + name:str= Field(...) + filtering:Optional[str]= Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""") + data:ElectricalSeriesData= Field(..., description="""Recorded voltage data.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ElectricalSeriesData(ConfiguredBaseModel): + """ + Recorded voltage data. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. This value is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion', followed by 'channel_conversion' (if present), and then add 'offset'.""") + array:Optional[Union[ + NDArray[Shape["* num_times"], Number], + NDArray[Shape["* num_times, * num_channels"], Number], + NDArray[Shape["* num_times, * num_channels, * num_samples"], Number] + ]]= Field(None) + + +class ElectricalSeriesElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SpikeEventSeries(ElectricalSeries): + """ + Stores snapshots/snippets of recorded spike events (i.e., threshold crossings). This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describe how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode). + """ + name:str= Field(...) + data:SpikeEventSeriesData= Field(..., description="""Spike waveforms.""") + timestamps:List[float]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time. Timestamps are required for the events. Unlike for TimeSeries, timestamps are required for SpikeEventSeries and are thus re-specified here.""") + filtering:Optional[str]= Field(None, description="""Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be \"High-pass 4-pole Bessel filter at 500 Hz\". If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be \"Low-pass filter at 300 Hz\". If a non-standard filter type is used, provide as much detail about the filter properties as possible.""") + electrodes:ElectricalSeriesElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + channel_conversion:Optional[List[float]]= Field(default_factory=list, description="""Channel-specific conversion factor. Multiply the data in the 'data' dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the 'conversion' attribute of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class SpikeEventSeriesData(ConfiguredBaseModel): + """ + Spike waveforms. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Unit of measurement for waveforms, which is fixed to 'volts'.""") + array:Optional[Union[ + NDArray[Shape["* num_events, * num_samples"], Number], + NDArray[Shape["* num_events, * num_samples, * num_channels"], Number] + ]]= Field(None) + + +class FeatureExtraction(NWBDataInterface): + """ + Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEventSeries or other source. + """ + name:str= Field(...) + description:List[str]= Field(default_factory=list, description="""Description of features (eg, ''PC1'') for each of the extracted features.""") + features:FeatureExtractionFeatures= Field(..., description="""Multi-dimensional array of features extracted from each event.""") + times:List[float]= Field(default_factory=list, description="""Times of events that features correspond to (can be a link).""") + electrodes:FeatureExtractionElectrodes= Field(..., description="""DynamicTableRegion pointer to the electrodes that this time series was generated from.""") + + +class FeatureExtractionFeatures(ConfiguredBaseModel): + """ + Multi-dimensional array of features extracted from each event. + """ + name:Literal["features"]= Field("features") + array:Optional[NDArray[Shape["* num_events, * num_channels, * num_features"], Float32]]= Field(None) + + +class FeatureExtractionElectrodes(DynamicTableRegion): + """ + DynamicTableRegion pointer to the electrodes that this time series was generated from. + """ + name:Literal["electrodes"]= Field("electrodes") + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class EventDetection(NWBDataInterface): + """ + Detected spike events from voltage trace(s). + """ + name:str= Field(...) + detection_method:str= Field(..., description="""Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.""") + source_idx:List[int]= Field(default_factory=list, description="""Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. ''description'' should define what is meant by time of event (e.g., .25 ms before action potential peak, zero-crossing time, etc). The index points to each event from the raw data.""") + times:List[float]= Field(default_factory=list, description="""Timestamps of events, in seconds.""") + + +class EventWaveform(NWBDataInterface): + """ + Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. + """ + name:str= Field(...) + spike_event_series:Optional[List[SpikeEventSeries]]= Field(default_factory=list, description="""SpikeEventSeries object(s) containing detected spike event waveforms.""") + + +class FilteredEphys(NWBDataInterface): + """ + Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each's TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing filtered electrophysiology data.""") + + +class LFP(NWBDataInterface): + """ + LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries 'filtering' attribute. + """ + name:str= Field(...) + electrical_series:List[ElectricalSeries]= Field(default_factory=list, description="""ElectricalSeries object(s) containing LFP data for one or more channels.""") + + +class ElectrodeGroup(NWBContainer): + """ + A physical grouping of electrodes, e.g. a shank of an array. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of this electrode group.""") + location:Optional[str]= Field(None, description="""Location of electrode group. Specify the area, layer, comments on estimation of area/layer, etc. Use standard atlas names for anatomical regions when possible.""") + position:Optional[Any]= Field(None, description="""stereotaxic or common framework coordinates""") + + +class ClusterWaveforms(NWBDataInterface): + """ + DEPRECATED The mean waveform shape, including standard deviation, of the different clusters. Ideally, the waveform analysis should be performed on data that is only high-pass filtered. This is a separate module because it is expected to require updating. For example, IMEC probes may require different storage requirements to store/display mean waveforms, requiring a new interface or an extension of this one. + """ + name:str= Field(...) + waveform_filtering:str= Field(..., description="""Filtering applied to data before generating mean/sd""") + waveform_mean:ClusterWaveformsWaveformMean= Field(..., description="""The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled)""") + waveform_sd:ClusterWaveformsWaveformSd= Field(..., description="""Stdev of waveforms for each cluster, using the same indices as in mean""") + + +class ClusterWaveformsWaveformMean(ConfiguredBaseModel): + """ + The mean waveform for each cluster, using the same indices for each wave as cluster numbers in the associated Clustering module (i.e, cluster 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should be empty (e.g., zero- filled) + """ + name:Literal["waveform_mean"]= Field("waveform_mean") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class ClusterWaveformsWaveformSd(ConfiguredBaseModel): + """ + Stdev of waveforms for each cluster, using the same indices as in mean + """ + name:Literal["waveform_sd"]= Field("waveform_sd") + array:Optional[NDArray[Shape["* num_clusters, * num_samples"], Float32]]= Field(None) + + +class Clustering(NWBDataInterface): + """ + DEPRECATED Clustered spike data, whether from automatic clustering tools (e.g., klustakwik) or as a result of manual sorting. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc)""") + num:List[int]= Field(default_factory=list, description="""Cluster number of each event""") + peak_over_rms:List[float]= Field(default_factory=list, description="""Maximum ratio of waveform peak to RMS on any channel in the cluster (provides a basic clustering metric).""") + times:List[float]= Field(default_factory=list, description="""Times of clustered events, in seconds. This may be a link to times field in associated FeatureExtraction module.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ElectricalSeries.model_rebuild() +ElectricalSeriesData.model_rebuild() +ElectricalSeriesElectrodes.model_rebuild() +SpikeEventSeries.model_rebuild() +SpikeEventSeriesData.model_rebuild() +FeatureExtraction.model_rebuild() +FeatureExtractionFeatures.model_rebuild() +FeatureExtractionElectrodes.model_rebuild() +EventDetection.model_rebuild() +EventWaveform.model_rebuild() +FilteredEphys.model_rebuild() +LFP.model_rebuild() +ElectrodeGroup.model_rebuild() +ClusterWaveforms.model_rebuild() +ClusterWaveformsWaveformMean.model_rebuild() +ClusterWaveformsWaveformSd.model_rebuild() +Clustering.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py new file mode 100644 index 0000000..959bb6d --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_epoch.py @@ -0,0 +1,106 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTable, + VectorIndex, + VectorData +) + +from .core_nwb_base import ( + TimeSeriesReferenceVectorData +) + + +metamodel_version = "None" +version = "2.6.0-alpha" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class TimeIntervals(DynamicTable): + """ + A container for aggregating epoch data and the TimeSeries that each epoch applies to. + """ + name:str= Field(...) + start_time:Optional[List[float]]= Field(default_factory=list, description="""Start time of epoch, in seconds.""") + stop_time:Optional[List[float]]= Field(default_factory=list, description="""Stop time of epoch, in seconds.""") + tags:Optional[List[str]]= Field(default_factory=list, description="""User-defined tags that identify or categorize events.""") + tags_index:Optional[TimeIntervalsTagsIndex]= Field(None, description="""Index for tags.""") + timeseries:Optional[TimeIntervalsTimeseries]= Field(None, description="""An index into a TimeSeries object.""") + timeseries_index:Optional[TimeIntervalsTimeseriesIndex]= Field(None, description="""Index for timeseries.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class TimeIntervalsTagsIndex(VectorIndex): + """ + Index for tags. + """ + name:Literal["tags_index"]= Field("tags_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class TimeIntervalsTimeseries(TimeSeriesReferenceVectorData): + """ + An index into a TimeSeries object. + """ + name:Literal["timeseries"]= Field("timeseries") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class TimeIntervalsTimeseriesIndex(VectorIndex): + """ + Index for timeseries. + """ + name:Literal["timeseries_index"]= Field("timeseries_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +TimeIntervals.model_rebuild() +TimeIntervalsTagsIndex.model_rebuild() +TimeIntervalsTimeseries.model_rebuild() +TimeIntervalsTimeseriesIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_file.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py similarity index 85% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_file.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py index 3dd739e..f519ec6 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_file.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_file.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -11,56 +12,57 @@ else: from typing_extensions import Literal -from .core_nwb_base import ( - NWBContainer, - Images, - TimeSeries, - NWBDataInterface, - ProcessingModule, - NWBData +from .core_nwb_epoch import ( + TimeIntervals ) -from .core_nwb_ecephys import ( - ElectrodeGroup +from .core_nwb_base import ( + NWBData, + NWBDataInterface, + Images, + TimeSeries, + ProcessingModule, + NWBContainer +) + +from .core_nwb_icephys import ( + SweepTable, + IntracellularRecordingsTable, + IntracellularElectrode, + ExperimentalConditionsTable, + RepetitionsTable, + SimultaneousRecordingsTable, + SequentialRecordingsTable ) from .core_nwb_ogen import ( OptogeneticStimulusSite ) -from .core_nwb_device import ( - Device -) - from .core_nwb_ophys import ( ImagingPlane ) -from .core_nwb_epoch import ( - TimeIntervals -) - -from .core_nwb_icephys import ( - IntracellularElectrode, - IntracellularRecordingsTable, - RepetitionsTable, - SimultaneousRecordingsTable, - ExperimentalConditionsTable, - SweepTable, - SequentialRecordingsTable -) - -from .hdmf_common_table import ( - DynamicTable -) - from .core_nwb_misc import ( Units ) +from .core_nwb_device import ( + Device +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + VectorData, + DynamicTable +) + +from .core_nwb_ecephys import ( + ElectrodeGroup +) + metamodel_version = "None" -version = "None" +version = "2.6.0-alpha" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -154,7 +156,30 @@ class NWBFileGeneralExtracellularEphys(ConfiguredBaseModel): """ name:Literal["extracellular_ephys"]= Field("extracellular_ephys") electrode_group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Physical group of electrodes.""") - electrodes:Optional[DynamicTable]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + electrodes:Optional[NWBFileGeneralExtracellularEphysElectrodes]= Field(None, description="""A table of all electrodes (i.e. channels) used for recording.""") + + +class NWBFileGeneralExtracellularEphysElectrodes(DynamicTable): + """ + A table of all electrodes (i.e. channels) used for recording. + """ + name:Literal["electrodes"]= Field("electrodes") + x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate of the channel location in the brain (+x is posterior).""") + y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate of the channel location in the brain (+y is inferior).""") + z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate of the channel location in the brain (+z is right).""") + imp:Optional[List[float]]= Field(default_factory=list, description="""Impedance of the channel, in ohms.""") + location:Optional[List[str]]= Field(default_factory=list, description="""Location of the electrode (channel). Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + filtering:Optional[List[str]]= Field(default_factory=list, description="""Description of hardware filtering, including the filter name and frequency cutoffs.""") + group:Optional[List[ElectrodeGroup]]= Field(default_factory=list, description="""Reference to the ElectrodeGroup this electrode is a part of.""") + group_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the ElectrodeGroup this electrode is a part of.""") + rel_x:Optional[List[float]]= Field(default_factory=list, description="""x coordinate in electrode group""") + rel_y:Optional[List[float]]= Field(default_factory=list, description="""y coordinate in electrode group""") + rel_z:Optional[List[float]]= Field(default_factory=list, description="""z coordinate in electrode group""") + reference:Optional[List[str]]= Field(default_factory=list, description="""Description of the reference electrode and/or reference scheme used for this electrode, e.g., \"stainless steel skull screw\" or \"online common average referencing\".""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): @@ -164,7 +189,7 @@ class NWBFileGeneralIntracellularEphys(ConfiguredBaseModel): name:Literal["intracellular_ephys"]= Field("intracellular_ephys") filtering:Optional[str]= Field(None, description="""[DEPRECATED] Use IntracellularElectrode.filtering instead. Description of filtering used. Includes filtering type and parameters, frequency fall-off, etc. If this changes between TimeSeries, filter description should be stored as a text attribute for each TimeSeries.""") intracellular_electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""An intracellular electrode.""") - sweep_table:Optional[SweepTable]= Field(None, description="""[DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tables. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions tables provide enhanced support for experiment metadata.""") + sweep_table:Optional[SweepTable]= Field(None, description="""[DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tabels. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions tables provide enhanced support for experiment metadata.""") intracellular_recordings:Optional[IntracellularRecordingsTable]= Field(None, description="""A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response are recorded as as part of an experiment. In this case both, the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used.""") simultaneous_recordings:Optional[SimultaneousRecordingsTable]= Field(None, description="""A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes""") sequential_recordings:Optional[SequentialRecordingsTable]= Field(None, description="""A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where the a sequence of stimuli of the same type with varying parameters have been presented in a sequence.""") @@ -218,15 +243,16 @@ class SubjectAge(ConfiguredBaseModel): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# ScratchData.model_rebuild() -# NWBFile.model_rebuild() -# NWBFileStimulus.model_rebuild() -# NWBFileGeneral.model_rebuild() -# NWBFileGeneralSourceScript.model_rebuild() -# NWBFileGeneralExtracellularEphys.model_rebuild() -# NWBFileGeneralIntracellularEphys.model_rebuild() -# NWBFileIntervals.model_rebuild() -# LabMetaData.model_rebuild() -# Subject.model_rebuild() -# SubjectAge.model_rebuild() +ScratchData.model_rebuild() +NWBFile.model_rebuild() +NWBFileStimulus.model_rebuild() +NWBFileGeneral.model_rebuild() +NWBFileGeneralSourceScript.model_rebuild() +NWBFileGeneralExtracellularEphys.model_rebuild() +NWBFileGeneralExtracellularEphysElectrodes.model_rebuild() +NWBFileGeneralIntracellularEphys.model_rebuild() +NWBFileIntervals.model_rebuild() +LabMetaData.model_rebuild() +Subject.model_rebuild() +SubjectAge.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py new file mode 100644 index 0000000..de2751e --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_icephys.py @@ -0,0 +1,602 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeriesReferenceVectorData, + TimeSeries, + NWBContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable, + AlignedDynamicTable +) + + +metamodel_version = "None" +version = "2.6.0-alpha" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class PatchClampSeries(TimeSeries): + """ + An abstract base class for patch-clamp data - stimulus or response, current or voltage. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + data:List[float]= Field(default_factory=list, description="""Recorded voltage or current.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeries(PatchClampSeries): + """ + Voltage data from an intracellular current-clamp recording. A corresponding CurrentClampStimulusSeries (stored separately as a stimulus) is used to store the current injected. + """ + name:str= Field(...) + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + bias_current:Optional[float]= Field(None, description="""Bias current, in amps.""") + bridge_balance:Optional[float]= Field(None, description="""Bridge balance, in ohms.""") + capacitance_compensation:Optional[float]= Field(None, description="""Capacitance compensation, in farads.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampSeriesData(ConfiguredBaseModel): + """ + Recorded voltage. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") + value:Any= Field(...) + + +class IZeroClampSeries(CurrentClampSeries): + """ + Voltage data from an intracellular recording when all current and amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There is no CurrentClampStimulusSeries associated with an IZero series because the amplifier is disconnected and no stimulus can reach the cell. + """ + name:str= Field(...) + stimulus_description:Optional[str]= Field(None, description="""An IZeroClampSeries has no stimulus, so this attribute is automatically set to \"N/A\"""") + bias_current:float= Field(..., description="""Bias current, in amps, fixed to 0.0.""") + bridge_balance:float= Field(..., description="""Bridge balance, in ohms, fixed to 0.0.""") + capacitance_compensation:float= Field(..., description="""Capacitance compensation, in farads, fixed to 0.0.""") + data:CurrentClampSeriesData= Field(..., description="""Recorded voltage.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeries(PatchClampSeries): + """ + Stimulus current applied during current clamp recording. + """ + name:str= Field(...) + data:CurrentClampStimulusSeriesData= Field(..., description="""Stimulus current applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class CurrentClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus current applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") + value:Any= Field(...) + + +class VoltageClampSeries(PatchClampSeries): + """ + Current data from an intracellular voltage-clamp recording. A corresponding VoltageClampStimulusSeries (stored separately as a stimulus) is used to store the voltage injected. + """ + name:str= Field(...) + data:VoltageClampSeriesData= Field(..., description="""Recorded current.""") + capacitance_fast:Optional[VoltageClampSeriesCapacitanceFast]= Field(None, description="""Fast capacitance, in farads.""") + capacitance_slow:Optional[VoltageClampSeriesCapacitanceSlow]= Field(None, description="""Slow capacitance, in farads.""") + resistance_comp_bandwidth:Optional[VoltageClampSeriesResistanceCompBandwidth]= Field(None, description="""Resistance compensation bandwidth, in hertz.""") + resistance_comp_correction:Optional[VoltageClampSeriesResistanceCompCorrection]= Field(None, description="""Resistance compensation correction, in percent.""") + resistance_comp_prediction:Optional[VoltageClampSeriesResistanceCompPrediction]= Field(None, description="""Resistance compensation prediction, in percent.""") + whole_cell_capacitance_comp:Optional[VoltageClampSeriesWholeCellCapacitanceComp]= Field(None, description="""Whole cell capacitance compensation, in farads.""") + whole_cell_series_resistance_comp:Optional[VoltageClampSeriesWholeCellSeriesResistanceComp]= Field(None, description="""Whole cell series resistance compensation, in ohms.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampSeriesData(ConfiguredBaseModel): + """ + Recorded current. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'amperes'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") + value:Any= Field(...) + + +class VoltageClampSeriesCapacitanceFast(ConfiguredBaseModel): + """ + Fast capacitance, in farads. + """ + name:Literal["capacitance_fast"]= Field("capacitance_fast") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesCapacitanceSlow(ConfiguredBaseModel): + """ + Slow capacitance, in farads. + """ + name:Literal["capacitance_slow"]= Field("capacitance_slow") + unit:Optional[str]= Field(None, description="""Unit of measurement for capacitance_fast, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompBandwidth(ConfiguredBaseModel): + """ + Resistance compensation bandwidth, in hertz. + """ + name:Literal["resistance_comp_bandwidth"]= Field("resistance_comp_bandwidth") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_bandwidth, which is fixed to 'hertz'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompCorrection(ConfiguredBaseModel): + """ + Resistance compensation correction, in percent. + """ + name:Literal["resistance_comp_correction"]= Field("resistance_comp_correction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_correction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesResistanceCompPrediction(ConfiguredBaseModel): + """ + Resistance compensation prediction, in percent. + """ + name:Literal["resistance_comp_prediction"]= Field("resistance_comp_prediction") + unit:Optional[str]= Field(None, description="""Unit of measurement for resistance_comp_prediction, which is fixed to 'percent'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellCapacitanceComp(ConfiguredBaseModel): + """ + Whole cell capacitance compensation, in farads. + """ + name:Literal["whole_cell_capacitance_comp"]= Field("whole_cell_capacitance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_capacitance_comp, which is fixed to 'farads'.""") + value:float= Field(...) + + +class VoltageClampSeriesWholeCellSeriesResistanceComp(ConfiguredBaseModel): + """ + Whole cell series resistance compensation, in ohms. + """ + name:Literal["whole_cell_series_resistance_comp"]= Field("whole_cell_series_resistance_comp") + unit:Optional[str]= Field(None, description="""Unit of measurement for whole_cell_series_resistance_comp, which is fixed to 'ohms'.""") + value:float= Field(...) + + +class VoltageClampStimulusSeries(PatchClampSeries): + """ + Stimulus voltage applied during a voltage clamp recording. + """ + name:str= Field(...) + data:VoltageClampStimulusSeriesData= Field(..., description="""Stimulus voltage applied.""") + stimulus_description:Optional[str]= Field(None, description="""Protocol/stimulus name for this patch-clamp dataset.""") + sweep_number:Optional[int]= Field(None, description="""Sweep number, allows to group different PatchClampSeries together.""") + gain:Optional[float]= Field(None, description="""Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt (c-clamp).""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class VoltageClampStimulusSeriesData(ConfiguredBaseModel): + """ + Stimulus voltage applied. + """ + name:Literal["data"]= Field("data") + unit:Optional[str]= Field(None, description="""Base unit of measurement for working with the data. which is fixed to 'volts'. Actual stored values are not necessarily stored in these units. To access the data in these units, multiply 'data' by 'conversion' and add 'offset'.""") + value:Any= Field(...) + + +class IntracellularElectrode(NWBContainer): + """ + An intracellular electrode and its metadata. + """ + name:str= Field(...) + cell_id:Optional[str]= Field(None, description="""unique ID of the cell""") + description:str= Field(..., description="""Description of electrode (e.g., whole-cell, sharp, etc.).""") + filtering:Optional[str]= Field(None, description="""Electrode specific filtering.""") + initial_access_resistance:Optional[str]= Field(None, description="""Initial access resistance.""") + location:Optional[str]= Field(None, description="""Location of the electrode. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + resistance:Optional[str]= Field(None, description="""Electrode resistance, in ohms.""") + seal:Optional[str]= Field(None, description="""Information about seal used for recording.""") + slice:Optional[str]= Field(None, description="""Information about slice used for recording.""") + + +class SweepTable(DynamicTable): + """ + [DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tables. Additional SequentialRecordingsTable, RepetitionsTable, and ExperimentalConditions tables provide enhanced support for experiment metadata. + """ + name:str= Field(...) + sweep_number:Optional[List[int]]= Field(default_factory=list, description="""Sweep number of the PatchClampSeries in that row.""") + series:Optional[List[PatchClampSeries]]= Field(default_factory=list, description="""The PatchClampSeries with the sweep number in that row.""") + series_index:SweepTableSeriesIndex= Field(..., description="""Index for series.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class SweepTableSeriesIndex(VectorIndex): + """ + Index for series. + """ + name:Literal["series_index"]= Field("series_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class IntracellularElectrodesTable(DynamicTable): + """ + Table for storing intracellular electrode related metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + electrode:Optional[List[IntracellularElectrode]]= Field(default_factory=list, description="""Column for storing the reference to the intracellular electrode.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class IntracellularStimuliTable(DynamicTable): + """ + Table for storing intracellular stimulus related metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + stimulus:IntracellularStimuliTableStimulus= Field(..., description="""Column storing the reference to the recorded stimulus for the recording (rows).""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class IntracellularStimuliTableStimulus(TimeSeriesReferenceVectorData): + """ + Column storing the reference to the recorded stimulus for the recording (rows). + """ + name:Literal["stimulus"]= Field("stimulus") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class IntracellularResponsesTable(DynamicTable): + """ + Table for storing intracellular response related metadata. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + response:IntracellularResponsesTableResponse= Field(..., description="""Column storing the reference to the recorded response for the recording (rows)""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class IntracellularResponsesTableResponse(TimeSeriesReferenceVectorData): + """ + Column storing the reference to the recorded response for the recording (rows) + """ + name:Literal["response"]= Field("response") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class IntracellularRecordingsTable(AlignedDynamicTable): + """ + A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically of a stimulus and a corresponding response. In some cases, however, only a stimulus or a response is recorded as part of an experiment. In this case, both the stimulus and response will point to the same TimeSeries while the idx_start and count of the invalid column will be set to -1, thus, indicating that no values have been recorded for the stimulus or response, respectively. Note, a recording MUST contain at least a stimulus or a response. Typically the stimulus and response are PatchClampSeries. However, the use of AD/DA channels that are not associated to an electrode is also common in intracellular electrophysiology, in which case other TimeSeries may be used. + """ + name:Literal["intracellular_recordings"]= Field("intracellular_recordings") + description:Optional[str]= Field(None, description="""Description of the contents of this table. Inherited from AlignedDynamicTable and overwritten here to fix the value of the attribute.""") + electrodes:IntracellularElectrodesTable= Field(..., description="""Table for storing intracellular electrode related metadata.""") + stimuli:IntracellularStimuliTable= Field(..., description="""Table for storing intracellular stimulus related metadata.""") + responses:IntracellularResponsesTable= Field(..., description="""Table for storing intracellular response related metadata.""") + categories:Optional[str]= Field(None, description="""The names of the categories in this AlignedDynamicTable. Each category is represented by one DynamicTable stored in the parent group. This attribute should be used to specify an order of categories and the category names must match the names of the corresponding DynamicTable in the group.""") + dynamic_table:Optional[List[DynamicTable]]= Field(default_factory=list, description="""A DynamicTable representing a particular category for columns in the AlignedDynamicTable parent container. The table MUST be aligned with (i.e., have the same number of rows) as all other DynamicTables stored in the AlignedDynamicTable parent container. The name of the category is given by the name of the DynamicTable and its description by the description attribute of the DynamicTable.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class SimultaneousRecordingsTable(DynamicTable): + """ + A table for grouping different intracellular recordings from the IntracellularRecordingsTable table together that were recorded simultaneously from different electrodes. + """ + name:Literal["simultaneous_recordings"]= Field("simultaneous_recordings") + recordings:SimultaneousRecordingsTableRecordings= Field(..., description="""A reference to one or more rows in the IntracellularRecordingsTable table.""") + recordings_index:SimultaneousRecordingsTableRecordingsIndex= Field(..., description="""Index dataset for the recordings column.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class SimultaneousRecordingsTableRecordings(DynamicTableRegion): + """ + A reference to one or more rows in the IntracellularRecordingsTable table. + """ + name:Literal["recordings"]= Field("recordings") + table:Optional[IntracellularRecordingsTable]= Field(None, description="""Reference to the IntracellularRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SimultaneousRecordingsTableRecordingsIndex(VectorIndex): + """ + Index dataset for the recordings column. + """ + name:Literal["recordings_index"]= Field("recordings_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SequentialRecordingsTable(DynamicTable): + """ + A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where a sequence of stimuli of the same type with varying parameters have been presented in a sequence. + """ + name:Literal["sequential_recordings"]= Field("sequential_recordings") + simultaneous_recordings:SequentialRecordingsTableSimultaneousRecordings= Field(..., description="""A reference to one or more rows in the SimultaneousRecordingsTable table.""") + simultaneous_recordings_index:SequentialRecordingsTableSimultaneousRecordingsIndex= Field(..., description="""Index dataset for the simultaneous_recordings column.""") + stimulus_type:Optional[List[str]]= Field(default_factory=list, description="""The type of stimulus used for the sequential recording.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class SequentialRecordingsTableSimultaneousRecordings(DynamicTableRegion): + """ + A reference to one or more rows in the SimultaneousRecordingsTable table. + """ + name:Literal["simultaneous_recordings"]= Field("simultaneous_recordings") + table:Optional[SimultaneousRecordingsTable]= Field(None, description="""Reference to the SimultaneousRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class SequentialRecordingsTableSimultaneousRecordingsIndex(VectorIndex): + """ + Index dataset for the simultaneous_recordings column. + """ + name:Literal["simultaneous_recordings_index"]= Field("simultaneous_recordings_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class RepetitionsTable(DynamicTable): + """ + A table for grouping different sequential intracellular recordings together. With each SequentialRecording typically representing a particular type of stimulus, the RepetitionsTable table is typically used to group sets of stimuli applied in sequence. + """ + name:Literal["repetitions"]= Field("repetitions") + sequential_recordings:RepetitionsTableSequentialRecordings= Field(..., description="""A reference to one or more rows in the SequentialRecordingsTable table.""") + sequential_recordings_index:RepetitionsTableSequentialRecordingsIndex= Field(..., description="""Index dataset for the sequential_recordings column.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class RepetitionsTableSequentialRecordings(DynamicTableRegion): + """ + A reference to one or more rows in the SequentialRecordingsTable table. + """ + name:Literal["sequential_recordings"]= Field("sequential_recordings") + table:Optional[SequentialRecordingsTable]= Field(None, description="""Reference to the SequentialRecordingsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class RepetitionsTableSequentialRecordingsIndex(VectorIndex): + """ + Index dataset for the sequential_recordings column. + """ + name:Literal["sequential_recordings_index"]= Field("sequential_recordings_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class ExperimentalConditionsTable(DynamicTable): + """ + A table for grouping different intracellular recording repetitions together that belong to the same experimental condition. + """ + name:Literal["experimental_conditions"]= Field("experimental_conditions") + repetitions:ExperimentalConditionsTableRepetitions= Field(..., description="""A reference to one or more rows in the RepetitionsTable table.""") + repetitions_index:ExperimentalConditionsTableRepetitionsIndex= Field(..., description="""Index dataset for the repetitions column.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class ExperimentalConditionsTableRepetitions(DynamicTableRegion): + """ + A reference to one or more rows in the RepetitionsTable table. + """ + name:Literal["repetitions"]= Field("repetitions") + table:Optional[RepetitionsTable]= Field(None, description="""Reference to the RepetitionsTable table that this table region applies to. This specializes the attribute inherited from DynamicTableRegion to fix the type of table that can be referenced here.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class ExperimentalConditionsTableRepetitionsIndex(VectorIndex): + """ + Index dataset for the repetitions column. + """ + name:Literal["repetitions_index"]= Field("repetitions_index") + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +PatchClampSeries.model_rebuild() +CurrentClampSeries.model_rebuild() +CurrentClampSeriesData.model_rebuild() +IZeroClampSeries.model_rebuild() +CurrentClampStimulusSeries.model_rebuild() +CurrentClampStimulusSeriesData.model_rebuild() +VoltageClampSeries.model_rebuild() +VoltageClampSeriesData.model_rebuild() +VoltageClampSeriesCapacitanceFast.model_rebuild() +VoltageClampSeriesCapacitanceSlow.model_rebuild() +VoltageClampSeriesResistanceCompBandwidth.model_rebuild() +VoltageClampSeriesResistanceCompCorrection.model_rebuild() +VoltageClampSeriesResistanceCompPrediction.model_rebuild() +VoltageClampSeriesWholeCellCapacitanceComp.model_rebuild() +VoltageClampSeriesWholeCellSeriesResistanceComp.model_rebuild() +VoltageClampStimulusSeries.model_rebuild() +VoltageClampStimulusSeriesData.model_rebuild() +IntracellularElectrode.model_rebuild() +SweepTable.model_rebuild() +SweepTableSeriesIndex.model_rebuild() +IntracellularElectrodesTable.model_rebuild() +IntracellularStimuliTable.model_rebuild() +IntracellularStimuliTableStimulus.model_rebuild() +IntracellularResponsesTable.model_rebuild() +IntracellularResponsesTableResponse.model_rebuild() +IntracellularRecordingsTable.model_rebuild() +SimultaneousRecordingsTable.model_rebuild() +SimultaneousRecordingsTableRecordings.model_rebuild() +SimultaneousRecordingsTableRecordingsIndex.model_rebuild() +SequentialRecordingsTable.model_rebuild() +SequentialRecordingsTableSimultaneousRecordings.model_rebuild() +SequentialRecordingsTableSimultaneousRecordingsIndex.model_rebuild() +RepetitionsTable.model_rebuild() +RepetitionsTableSequentialRecordings.model_rebuild() +RepetitionsTableSequentialRecordingsIndex.model_rebuild() +ExperimentalConditionsTable.model_rebuild() +ExperimentalConditionsTableRepetitions.model_rebuild() +ExperimentalConditionsTableRepetitionsIndex.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py new file mode 100644 index 0000000..31f1cf1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_image.py @@ -0,0 +1,183 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + Image, + TimeSeriesSync, + TimeSeriesStartingTime, + TimeSeries +) + + +metamodel_version = "None" +version = "2.6.0-alpha" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class GrayscaleImage(Image): + """ + A grayscale image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBImage(Image): + """ + A color image. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 3 r_g_b"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class RGBAImage(Image): + """ + A color image with transparency. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* x, * y, 4 r_g_b_a"], Number]]= Field(None) + resolution:Optional[float]= Field(None, description="""Pixel resolution of the image, in pixels per centimeter.""") + description:Optional[str]= Field(None, description="""Description of the image.""") + + +class ImageSeries(TimeSeries): + """ + General image data that is common between acquisition and stimulus time series. Sometimes the image data is stored in the file in a raw format while other times it will be stored as a series of external image files in the host file system. The data field will either be binary data, if the data is stored in the NWB file, or empty, if the data is stored in an external image stack. [frame][x][y] or [frame][x][y][z]. + """ + name:str= Field(...) + data:ImageSeriesData= Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class ImageSeriesData(ConfiguredBaseModel): + """ + Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array. + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, * z"], Number] + ]]= Field(None) + + +class ImageMaskSeries(ImageSeries): + """ + An alpha mask that is applied to a presented visual stimulus. The 'data' array contains an array of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask can vary with time. The timestamps array indicates the starting time of a mask, and that mask pattern continues until it's explicitly changed. + """ + name:str= Field(...) + data:ImageSeriesData= Field(..., description="""Binary data representing images across frames. If data are stored in an external file, this should be an empty 3D array.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeries(ImageSeries): + """ + Image data that is presented or recorded. A stimulus template movie will be stored only as an image. When the image is presented as stimulus, additional data is required, such as field of view (e.g., how much of the visual field the image covers, or how what is the area of the target being imaged). If the OpticalSeries represents acquired imaging data, orientation is also important. + """ + name:str= Field(...) + distance:Optional[float]= Field(None, description="""Distance from camera/monitor to target/eye.""") + field_of_view:Optional[OpticalSeriesFieldOfView]= Field(None, description="""Width, height and depth of image, or imaged area, in meters.""") + data:OpticalSeriesData= Field(..., description="""Images presented to subject, either grayscale or RGB""") + orientation:Optional[str]= Field(None, description="""Description of image relative to some reference frame (e.g., which way is up). Must also specify frame of reference.""") + dimension:Optional[List[int]]= Field(default_factory=list, description="""Number of pixels on x, y, (and z) axes.""") + external_file:Optional[List[str]]= Field(default_factory=list, description="""Paths to one or more external file(s). The field is only present if format='external'. This is only relevant if the image series is stored in the file system as one or more image file(s). This field should NOT be used if the image is stored in another NWB file and that file is linked to this file.""") + format:Optional[str]= Field(None, description="""Format of image. If this is 'external', then the attribute 'external_file' contains the path information to the image files. If this is 'raw', then the raw (single-channel) binary data is stored in the 'data' dataset. If this attribute is not present, then the default format='raw' case is assumed.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OpticalSeriesFieldOfView(ConfiguredBaseModel): + """ + Width, height and depth of image, or imaged area, in meters. + """ + name:Literal["field_of_view"]= Field("field_of_view") + array:Optional[Union[ + NDArray[Shape["2 width_height"], Float32], + NDArray[Shape["2 width_height, 3 width_height_depth"], Float32] + ]]= Field(None) + + +class OpticalSeriesData(ConfiguredBaseModel): + """ + Images presented to subject, either grayscale or RGB + """ + name:Literal["data"]= Field("data") + array:Optional[Union[ + NDArray[Shape["* frame, * x, * y"], Number], + NDArray[Shape["* frame, * x, * y, 3 r_g_b"], Number] + ]]= Field(None) + + +class IndexSeries(TimeSeries): + """ + Stores indices to image frames stored in an ImageSeries. The purpose of the IndexSeries is to allow a static image stack to be stored in an Images object, and the images in the stack to be referenced out-of-order. This can be for the display of individual images, or of movie segments (as a movie is simply a series of images). The data field stores the index of the frame in the referenced Images object, and the timestamps array indicates when that image was displayed. + """ + name:str= Field(...) + data:List[int]= Field(default_factory=list, description="""Index of the image (using zero-indexing) in the linked Images object.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +GrayscaleImage.model_rebuild() +RGBImage.model_rebuild() +RGBAImage.model_rebuild() +ImageSeries.model_rebuild() +ImageSeriesData.model_rebuild() +ImageMaskSeries.model_rebuild() +OpticalSeries.model_rebuild() +OpticalSeriesFieldOfView.model_rebuild() +OpticalSeriesData.model_rebuild() +IndexSeries.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_misc.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py similarity index 89% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_misc.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py index 5add1aa..4f6a60b 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_misc.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_misc.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -12,25 +13,25 @@ else: from .core_nwb_base import ( - TimeSeriesStartingTime, TimeSeriesSync, + TimeSeriesStartingTime, TimeSeries ) +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, + VectorIndex, + VectorData, + DynamicTable +) + from .core_nwb_ecephys import ( ElectrodeGroup ) -from .hdmf_common_table import ( - VectorIndex, - DynamicTable, - VectorData, - DynamicTableRegion -) - metamodel_version = "None" -version = "None" +version = "2.6.0-alpha" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -108,7 +109,7 @@ class DecompositionSeries(TimeSeries): data:DecompositionSeriesData= Field(..., description="""Data decomposed into frequency bands.""") metric:str= Field(..., description="""The metric used, e.g. phase, amplitude, power.""") source_channels:Optional[DecompositionSeriesSourceChannels]= Field(None, description="""DynamicTableRegion pointer to the channels that this decomposition series was generated from.""") - bands:DynamicTable= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") + bands:DecompositionSeriesBands= Field(..., description="""Table for describing the bands that this series was generated from. There should be one row in this table for each band.""") description:Optional[str]= Field(None, description="""Description of the time series.""") comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") @@ -142,6 +143,35 @@ class DecompositionSeriesSourceChannels(DynamicTableRegion): ]]= Field(None) +class DecompositionSeriesBands(DynamicTable): + """ + Table for describing the bands that this series was generated from. There should be one row in this table for each band. + """ + name:Literal["bands"]= Field("bands") + band_name:Optional[List[str]]= Field(default_factory=list, description="""Name of the band, e.g. theta.""") + band_limits:DecompositionSeriesBandsBandLimits= Field(..., description="""Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center.""") + band_mean:List[float]= Field(default_factory=list, description="""The mean Gaussian filters, in Hz.""") + band_stdev:List[float]= Field(default_factory=list, description="""The standard deviation of Gaussian filters, in Hz.""") + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns, including index columns, of this dynamic table.""") + + +class DecompositionSeriesBandsBandLimits(VectorData): + """ + Low and high limit of each band in Hz. If it is a Gaussian filter, use 2 SD on either side of the center. + """ + name:Literal["band_limits"]= Field("band_limits") + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + class Units(DynamicTable): """ Data about spiking units. Event times of observed units (e.g. cell, synapse, etc.) should be concatenated and stored in spike_times. @@ -335,23 +365,25 @@ class UnitsWaveformsIndexIndex(VectorIndex): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# AbstractFeatureSeries.model_rebuild() -# AbstractFeatureSeriesData.model_rebuild() -# AnnotationSeries.model_rebuild() -# IntervalSeries.model_rebuild() -# DecompositionSeries.model_rebuild() -# DecompositionSeriesData.model_rebuild() -# DecompositionSeriesSourceChannels.model_rebuild() -# Units.model_rebuild() -# UnitsSpikeTimesIndex.model_rebuild() -# UnitsSpikeTimes.model_rebuild() -# UnitsObsIntervalsIndex.model_rebuild() -# UnitsObsIntervals.model_rebuild() -# UnitsElectrodesIndex.model_rebuild() -# UnitsElectrodes.model_rebuild() -# UnitsWaveformMean.model_rebuild() -# UnitsWaveformSd.model_rebuild() -# UnitsWaveforms.model_rebuild() -# UnitsWaveformsIndex.model_rebuild() -# UnitsWaveformsIndexIndex.model_rebuild() +AbstractFeatureSeries.model_rebuild() +AbstractFeatureSeriesData.model_rebuild() +AnnotationSeries.model_rebuild() +IntervalSeries.model_rebuild() +DecompositionSeries.model_rebuild() +DecompositionSeriesData.model_rebuild() +DecompositionSeriesSourceChannels.model_rebuild() +DecompositionSeriesBands.model_rebuild() +DecompositionSeriesBandsBandLimits.model_rebuild() +Units.model_rebuild() +UnitsSpikeTimesIndex.model_rebuild() +UnitsSpikeTimes.model_rebuild() +UnitsObsIntervalsIndex.model_rebuild() +UnitsObsIntervals.model_rebuild() +UnitsElectrodesIndex.model_rebuild() +UnitsElectrodes.model_rebuild() +UnitsWaveformMean.model_rebuild() +UnitsWaveformSd.model_rebuild() +UnitsWaveforms.model_rebuild() +UnitsWaveformsIndex.model_rebuild() +UnitsWaveformsIndexIndex.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py new file mode 100644 index 0000000..500779a --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ogen.py @@ -0,0 +1,65 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + TimeSeriesStartingTime, + TimeSeries, + NWBContainer, + TimeSeriesSync +) + + +metamodel_version = "None" +version = "2.6.0-alpha" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class OptogeneticSeries(TimeSeries): + """ + An optogenetic stimulus. + """ + name:str= Field(...) + data:List[float]= Field(default_factory=list, description="""Applied power for optogenetic stimulus, in watts.""") + description:Optional[str]= Field(None, description="""Description of the time series.""") + comments:Optional[str]= Field(None, description="""Human-readable comments about the TimeSeries. This second descriptive field can be used to store additional information, or descriptive information if the primary description field is populated with a computer-readable string.""") + starting_time:Optional[TimeSeriesStartingTime]= Field(None, description="""Timestamp of the first sample in seconds. When timestamps are uniformly spaced, the timestamp of the first sample can be specified and all subsequent ones calculated from the sampling rate attribute.""") + timestamps:Optional[List[float]]= Field(default_factory=list, description="""Timestamps for samples stored in data, in seconds, relative to the common experiment master-clock stored in NWBFile.timestamps_reference_time.""") + control:Optional[List[int]]= Field(default_factory=list, description="""Numerical labels that apply to each time point in data for the purpose of querying and slicing data by these values. If present, the length of this array should be the same size as the first dimension of data.""") + control_description:Optional[List[str]]= Field(default_factory=list, description="""Description of each control value. Must be present if control is present. If present, control_description[0] should describe time points where control == 0.""") + sync:Optional[TimeSeriesSync]= Field(None, description="""Lab-specific time and sync information as provided directly from hardware devices and that is necessary for aligning all acquired time information to a common timebase. The timestamp array stores time in the common timebase. This group will usually only be populated in TimeSeries that are stored external to the NWB file, in files storing raw data. Once timestamp data is calculated, the contents of 'sync' are mostly for archival purposes.""") + + +class OptogeneticStimulusSite(NWBContainer): + """ + A site of optogenetic stimulation. + """ + name:str= Field(...) + description:str= Field(..., description="""Description of stimulation site.""") + excitation_lambda:float= Field(..., description="""Excitation wavelength, in nm.""") + location:str= Field(..., description="""Location of the stimulation site. Specify the area, layer, comments on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use standard atlas names for anatomical regions when possible.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +OptogeneticSeries.model_rebuild() +OptogeneticStimulusSite.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core_nwb_ophys.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py similarity index 95% rename from nwb_linkml/src/nwb_linkml/models/core_nwb_ophys.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py index ea3bb04..0c415ac 100644 --- a/nwb_linkml/src/nwb_linkml/models/core_nwb_ophys.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_ophys.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -12,28 +13,28 @@ else: from .core_nwb_base import ( - TimeSeriesStartingTime, - NWBContainer, + NWBDataInterface, TimeSeriesSync, + TimeSeriesStartingTime, TimeSeries, - NWBDataInterface + NWBContainer ) from .core_nwb_image import ( - ImageSeries, - ImageSeriesData + ImageSeriesData, + ImageSeries ) -from .hdmf_common_table import ( +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + DynamicTableRegion, VectorIndex, - DynamicTable, VectorData, - DynamicTableRegion + DynamicTable ) metamodel_version = "None" -version = "None" +version = "2.6.0-alpha" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -310,24 +311,24 @@ class CorrectedImageStack(NWBDataInterface): # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -# OnePhotonSeries.model_rebuild() -# TwoPhotonSeries.model_rebuild() -# TwoPhotonSeriesFieldOfView.model_rebuild() -# RoiResponseSeries.model_rebuild() -# RoiResponseSeriesData.model_rebuild() -# RoiResponseSeriesRois.model_rebuild() -# DfOverF.model_rebuild() -# Fluorescence.model_rebuild() -# ImageSegmentation.model_rebuild() -# PlaneSegmentation.model_rebuild() -# PlaneSegmentationImageMask.model_rebuild() -# PlaneSegmentationPixelMaskIndex.model_rebuild() -# PlaneSegmentationVoxelMaskIndex.model_rebuild() -# ImagingPlane.model_rebuild() -# ImagingPlaneManifold.model_rebuild() -# ImagingPlaneOriginCoords.model_rebuild() -# ImagingPlaneGridSpacing.model_rebuild() -# OpticalChannel.model_rebuild() -# MotionCorrection.model_rebuild() -# CorrectedImageStack.model_rebuild() -# \ No newline at end of file +OnePhotonSeries.model_rebuild() +TwoPhotonSeries.model_rebuild() +TwoPhotonSeriesFieldOfView.model_rebuild() +RoiResponseSeries.model_rebuild() +RoiResponseSeriesData.model_rebuild() +RoiResponseSeriesRois.model_rebuild() +DfOverF.model_rebuild() +Fluorescence.model_rebuild() +ImageSegmentation.model_rebuild() +PlaneSegmentation.model_rebuild() +PlaneSegmentationImageMask.model_rebuild() +PlaneSegmentationPixelMaskIndex.model_rebuild() +PlaneSegmentationVoxelMaskIndex.model_rebuild() +ImagingPlane.model_rebuild() +ImagingPlaneManifold.model_rebuild() +ImagingPlaneOriginCoords.model_rebuild() +ImagingPlaneGridSpacing.model_rebuild() +OpticalChannel.model_rebuild() +MotionCorrection.model_rebuild() +CorrectedImageStack.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py new file mode 100644 index 0000000..2ffc683 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/core_nwb_retinotopy.py @@ -0,0 +1,137 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .core_nwb_base import ( + NWBDataInterface +) + + +metamodel_version = "None" +version = "2.6.0-alpha" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class ImagingRetinotopy(NWBDataInterface): + """ + Intrinsic signal optical imaging or widefield imaging for measuring retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of responses to specific stimuli and a combined polarity map from which to identify visual areas. This group does not store the raw responses imaged during retinotopic mapping or the stimuli presented, but rather the resulting phase and power maps after applying a Fourier transform on the averaged responses. Note: for data consistency, all images and arrays are stored in the format [row][column] and [row, col], which equates to [y][x]. Field of view and dimension arrays may appear backward (i.e., y before x). + """ + name:str= Field(...) + axis_1_phase_map:ImagingRetinotopyAxis1PhaseMap= Field(..., description="""Phase response to stimulus on the first measured axis.""") + axis_1_power_map:Optional[ImagingRetinotopyAxis1PowerMap]= Field(None, description="""Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_2_phase_map:ImagingRetinotopyAxis2PhaseMap= Field(..., description="""Phase response to stimulus on the second measured axis.""") + axis_2_power_map:Optional[ImagingRetinotopyAxis2PowerMap]= Field(None, description="""Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power.""") + axis_descriptions:List[str]= Field(default_factory=list, description="""Two-element array describing the contents of the two response axis fields. Description should be something like ['altitude', 'azimuth'] or '['radius', 'theta'].""") + focal_depth_image:Optional[ImagingRetinotopyFocalDepthImage]= Field(None, description="""Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns].""") + sign_map:Optional[ImagingRetinotopySignMap]= Field(None, description="""Sine of the angle between the direction of the gradient in axis_1 and axis_2.""") + vasculature_image:ImagingRetinotopyVasculatureImage= Field(..., description="""Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]""") + + +class ImagingRetinotopyAxis1PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the first measured axis. + """ + name:Literal["axis_1_phase_map"]= Field("axis_1_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis1PowerMap(ConfiguredBaseModel): + """ + Power response on the first measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_1_power_map"]= Field("axis_1_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PhaseMap(ConfiguredBaseModel): + """ + Phase response to stimulus on the second measured axis. + """ + name:Literal["axis_2_phase_map"]= Field("axis_2_phase_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyAxis2PowerMap(ConfiguredBaseModel): + """ + Power response on the second measured axis. Response is scaled so 0.0 is no power in the response and 1.0 is maximum relative power. + """ + name:Literal["axis_2_power_map"]= Field("axis_2_power_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + unit:Optional[str]= Field(None, description="""Unit that axis data is stored in (e.g., degrees).""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyFocalDepthImage(ConfiguredBaseModel): + """ + Gray-scale image taken with same settings/parameters (e.g., focal depth, wavelength) as data collection. Array format: [rows][columns]. + """ + name:Literal["focal_depth_image"]= Field("focal_depth_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value.""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + focal_depth:Optional[float]= Field(None, description="""Focal depth offset, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + +class ImagingRetinotopySignMap(ConfiguredBaseModel): + """ + Sine of the angle between the direction of the gradient in axis_1 and axis_2. + """ + name:Literal["sign_map"]= Field("sign_map") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], Float32]]= Field(None) + + +class ImagingRetinotopyVasculatureImage(ConfiguredBaseModel): + """ + Gray-scale anatomical image of cortical surface. Array structure: [rows][columns] + """ + name:Literal["vasculature_image"]= Field("vasculature_image") + bits_per_pixel:Optional[int]= Field(None, description="""Number of bits used to represent each value. This is necessary to determine maximum (white) pixel value""") + dimension:Optional[int]= Field(None, description="""Number of rows and columns in the image. NOTE: row, column representation is equivalent to height, width.""") + field_of_view:Optional[float]= Field(None, description="""Size of viewing area, in meters.""") + format:Optional[str]= Field(None, description="""Format of image. Right now only 'raw' is supported.""") + array:Optional[NDArray[Shape["* num_rows, * num_cols"], UInt16]]= Field(None) + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +ImagingRetinotopy.model_rebuild() +ImagingRetinotopyAxis1PhaseMap.model_rebuild() +ImagingRetinotopyAxis1PowerMap.model_rebuild() +ImagingRetinotopyAxis2PhaseMap.model_rebuild() +ImagingRetinotopyAxis2PowerMap.model_rebuild() +ImagingRetinotopyFocalDepthImage.model_rebuild() +ImagingRetinotopySignMap.model_rebuild() +ImagingRetinotopyVasculatureImage.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/core.py b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/namespace.py similarity index 82% rename from nwb_linkml/src/nwb_linkml/models/core.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/namespace.py index b802a40..b06ce2a 100644 --- a/nwb_linkml/src/nwb_linkml/models/core.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/core/v2_6_0_alpha/namespace.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -11,6 +12,33 @@ else: from typing_extensions import Literal +from ...hdmf_experimental.v0_1_0.hdmf_experimental_resources import ( + ExternalResources +) + +from ...hdmf_common.v1_5_0.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_5_0.hdmf_common_base import ( + Data, + Container, + SimpleMultiContainer +) + +from ...hdmf_common.v1_5_0.hdmf_common_table import ( + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + DynamicTable, + AlignedDynamicTable +) + +from ...hdmf_experimental.v0_1_0.hdmf_experimental_experimental import ( + EnumData +) + from .core_nwb_retinotopy import ( ImagingRetinotopy ) @@ -27,21 +55,6 @@ from .core_nwb_base import ( Images ) -from .hdmf_common_table import ( - VectorData, - VectorIndex, - ElementIdentifiers, - DynamicTableRegion, - DynamicTable, - AlignedDynamicTable -) - -from .hdmf_common_base import ( - Data, - Container, - SimpleMultiContainer -) - from .core_nwb_ophys import ( OnePhotonSeries, TwoPhotonSeries, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_sparse.py new file mode 100644 index 0000000..fe8457d --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_sparse.py @@ -0,0 +1,67 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "1.1.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class CSRMatrix(ConfiguredBaseModel): + """ + a compressed sparse row matrix + """ + name:str= Field(...) + shape:Optional[int]= Field(None, description="""the shape of this sparse matrix""") + indices:CSRMatrixIndices= Field(..., description="""column indices""") + indptr:CSRMatrixIndptr= Field(..., description="""index pointer""") + data:CSRMatrixData= Field(..., description="""values in the matrix""") + + +class CSRMatrixIndices(ConfiguredBaseModel): + """ + column indices + """ + name:Literal["indices"]= Field("indices") + + +class CSRMatrixIndptr(ConfiguredBaseModel): + """ + index pointer + """ + name:Literal["indptr"]= Field("indptr") + + +class CSRMatrixData(ConfiguredBaseModel): + """ + values in the matrix + """ + name:Literal["data"]= Field("data") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +CSRMatrix.model_rebuild() +CSRMatrixIndices.model_rebuild() +CSRMatrixIndptr.model_rebuild() +CSRMatrixData.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py new file mode 100644 index 0000000..b976bf4 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/hdmf_common_table.py @@ -0,0 +1,106 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "1.1.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Data(ConfiguredBaseModel): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class Index(Data): + """ + Pointers that index data values. + """ + name:str= Field(...) + target:Optional[Data]= Field(None, description="""Target dataset that this index applies to.""") + + +class VectorData(Data): + """ + An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex(0)+1]. The second vector is at VectorData[VectorIndex(0)+1:VectorIndex(1)+1], and so on. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class VectorIndex(Index): + """ + Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. + """ + name:str= Field(...) + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class ElementIdentifiers(Data): + """ + A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* num_elements"], Int]]= Field(None) + + +class DynamicTableRegion(VectorData): + """ + DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. + """ + name:str= Field(...) + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class Container(ConfiguredBaseModel): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class DynamicTable(Container): + """ + A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). Apart from a column that contains unique identifiers for each row there are no other required datasets. Users are free to add any number of VectorData objects here. Table functionality is already supported through compound types, which is analogous to storing an array-of-structs. DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. For example, DynamicTable was originally developed for storing trial data and spike unit metadata. Both of these use cases are expected to produce relatively small tables, so the spatial locality of multiple datasets present in a DynamicTable is not expected to have a significant performance impact. Additionally, requirements of trial and unit metadata tables are sufficiently diverse that performance implications can be overlooked in favor of usability. + """ + name:str= Field(...) + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Data.model_rebuild() +Index.model_rebuild() +VectorData.model_rebuild() +VectorIndex.model_rebuild() +ElementIdentifiers.model_rebuild() +DynamicTableRegion.model_rebuild() +Container.model_rebuild() +DynamicTable.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/namespace.py new file mode 100644 index 0000000..e9a6850 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_0/namespace.py @@ -0,0 +1,46 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .hdmf_common_sparse import ( + CSRMatrix +) + +from .hdmf_common_table import ( + Data, + Index, + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + Container, + DynamicTable +) + + +metamodel_version = "None" +version = "1.1.0" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_sparse.py new file mode 100644 index 0000000..a30c444 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_sparse.py @@ -0,0 +1,67 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "1.1.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class CSRMatrix(ConfiguredBaseModel): + """ + a compressed sparse row matrix + """ + name:str= Field(...) + shape:Optional[int]= Field(None, description="""the shape of this sparse matrix""") + indices:CSRMatrixIndices= Field(..., description="""column indices""") + indptr:CSRMatrixIndptr= Field(..., description="""index pointer""") + data:CSRMatrixData= Field(..., description="""values in the matrix""") + + +class CSRMatrixIndices(ConfiguredBaseModel): + """ + column indices + """ + name:Literal["indices"]= Field("indices") + + +class CSRMatrixIndptr(ConfiguredBaseModel): + """ + index pointer + """ + name:Literal["indptr"]= Field("indptr") + + +class CSRMatrixData(ConfiguredBaseModel): + """ + values in the matrix + """ + name:Literal["data"]= Field("data") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +CSRMatrix.model_rebuild() +CSRMatrixIndices.model_rebuild() +CSRMatrixIndptr.model_rebuild() +CSRMatrixData.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py new file mode 100644 index 0000000..a1dd466 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/hdmf_common_table.py @@ -0,0 +1,106 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "1.1.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Data(ConfiguredBaseModel): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class Index(Data): + """ + Pointers that index data values. + """ + name:str= Field(...) + target:Optional[Data]= Field(None, description="""Target dataset that this index applies to.""") + + +class VectorData(Data): + """ + An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex(0)+1]. The second vector is at VectorData[VectorIndex(0)+1:VectorIndex(1)+1], and so on. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + + +class VectorIndex(Index): + """ + Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. + """ + name:str= Field(...) + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + + +class ElementIdentifiers(Data): + """ + A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* num_elements"], Int]]= Field(None) + + +class DynamicTableRegion(VectorData): + """ + DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. + """ + name:str= Field(...) + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + + +class Container(ConfiguredBaseModel): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class DynamicTable(Container): + """ + A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). Apart from a column that contains unique identifiers for each row there are no other required datasets. Users are free to add any number of VectorData objects here. Table functionality is already supported through compound types, which is analogous to storing an array-of-structs. DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. For example, DynamicTable was originally developed for storing trial data and spike unit metadata. Both of these use cases are expected to produce relatively small tables, so the spatial locality of multiple datasets present in a DynamicTable is not expected to have a significant performance impact. Additionally, requirements of trial and unit metadata tables are sufficiently diverse that performance implications can be overlooked in favor of usability. + """ + name:str= Field(...) + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Data.model_rebuild() +Index.model_rebuild() +VectorData.model_rebuild() +VectorIndex.model_rebuild() +ElementIdentifiers.model_rebuild() +DynamicTableRegion.model_rebuild() +Container.model_rebuild() +DynamicTable.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/namespace.py new file mode 100644 index 0000000..e549025 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_2/namespace.py @@ -0,0 +1,46 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .hdmf_common_sparse import ( + CSRMatrix +) + +from .hdmf_common_table import ( + Data, + Index, + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + Container, + DynamicTable +) + + +metamodel_version = "None" +version = "1.1.2" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_sparse.py new file mode 100644 index 0000000..fbe9a01 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_sparse.py @@ -0,0 +1,67 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "1.1.3" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class CSRMatrix(ConfiguredBaseModel): + """ + a compressed sparse row matrix + """ + name:str= Field(...) + shape:Optional[int]= Field(None, description="""the shape of this sparse matrix""") + indices:CSRMatrixIndices= Field(..., description="""column indices""") + indptr:CSRMatrixIndptr= Field(..., description="""index pointer""") + data:CSRMatrixData= Field(..., description="""values in the matrix""") + + +class CSRMatrixIndices(ConfiguredBaseModel): + """ + column indices + """ + name:Literal["indices"]= Field("indices") + + +class CSRMatrixIndptr(ConfiguredBaseModel): + """ + index pointer + """ + name:Literal["indptr"]= Field("indptr") + + +class CSRMatrixData(ConfiguredBaseModel): + """ + values in the matrix + """ + name:Literal["data"]= Field("data") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +CSRMatrix.model_rebuild() +CSRMatrixIndices.model_rebuild() +CSRMatrixIndptr.model_rebuild() +CSRMatrixData.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py new file mode 100644 index 0000000..d738a13 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/hdmf_common_table.py @@ -0,0 +1,119 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "1.1.3" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Data(ConfiguredBaseModel): + """ + An abstract data type for a dataset. + """ + name:str= Field(...) + + +class Index(Data): + """ + Pointers that index data values. + """ + name:str= Field(...) + target:Optional[Data]= Field(None, description="""Target dataset that this index applies to.""") + + +class VectorData(Data): + """ + An n-dimensional dataset representing a column of a DynamicTable. If used without an accompanying VectorIndex, first dimension is along the rows of the DynamicTable and each step along the first dimension is a cell of the larger table. VectorData can also be used to represent a ragged array if paired with a VectorIndex. This allows for storing arrays of varying length in a single cell of the DynamicTable by indexing into this VectorData. The first vector is at VectorData[0:VectorIndex(0)+1]. The second vector is at VectorData[VectorIndex(0)+1:VectorIndex(1)+1], and so on. + """ + name:str= Field(...) + description:Optional[str]= Field(None, description="""Description of what these vectors represent.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class VectorIndex(Index): + """ + Used with VectorData to encode a ragged array. An array of indices into the first dimension of the target VectorData, and forming a map between the rows of a DynamicTable and the indices of the VectorData. + """ + name:str= Field(...) + target:Optional[VectorData]= Field(None, description="""Reference to the target dataset that this index applies to.""") + array:Optional[NDArray[Shape["* num_rows"], Any]]= Field(None) + + +class ElementIdentifiers(Data): + """ + A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable. + """ + name:str= Field(...) + array:Optional[NDArray[Shape["* num_elements"], Int]]= Field(None) + + +class DynamicTableRegion(VectorData): + """ + DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s. `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell of a `DynamicTable` can reference many rows of another `DynamicTable`. + """ + name:str= Field(...) + table:Optional[DynamicTable]= Field(None, description="""Reference to the DynamicTable object that this region applies to.""") + description:Optional[str]= Field(None, description="""Description of what this table region points to.""") + array:Optional[Union[ + NDArray[Shape["* dim0"], Any], + NDArray[Shape["* dim0, * dim1"], Any], + NDArray[Shape["* dim0, * dim1, * dim2"], Any], + NDArray[Shape["* dim0, * dim1, * dim2, * dim3"], Any] + ]]= Field(None) + + +class Container(ConfiguredBaseModel): + """ + An abstract data type for a generic container storing collections of data and metadata. Base type for all data and metadata containers. + """ + name:str= Field(...) + + +class DynamicTable(Container): + """ + A group containing multiple datasets that are aligned on the first dimension (Currently, this requirement if left up to APIs to check and enforce). Apart from a column that contains unique identifiers for each row there are no other required datasets. Users are free to add any number of VectorData objects here. Table functionality is already supported through compound types, which is analogous to storing an array-of-structs. DynamicTable can be thought of as a struct-of-arrays. This provides an alternative structure to choose from when optimizing storage for anticipated access patterns. Additionally, this type provides a way of creating a table without having to define a compound type up front. Although this convenience may be attractive, users should think carefully about how data will be accessed. DynamicTable is more appropriate for column-centric access, whereas a dataset with a compound type would be more appropriate for row-centric access. Finally, data size should also be taken into account. For small tables, performance loss may be an acceptable trade-off for the flexibility of a DynamicTable. For example, DynamicTable was originally developed for storing trial data and spike unit metadata. Both of these use cases are expected to produce relatively small tables, so the spatial locality of multiple datasets present in a DynamicTable is not expected to have a significant performance impact. Additionally, requirements of trial and unit metadata tables are sufficiently diverse that performance implications can be overlooked in favor of usability. + """ + name:str= Field(...) + colnames:Optional[str]= Field(None, description="""The names of the columns in this table. This should be used to specify an order to the columns.""") + description:Optional[str]= Field(None, description="""Description of what is in this dynamic table.""") + id:List[int]= Field(default_factory=list, description="""Array of unique identifiers for the rows of this dynamic table.""") + vector_data:Optional[List[VectorData]]= Field(default_factory=list, description="""Vector columns of this dynamic table.""") + vector_index:Optional[List[VectorIndex]]= Field(default_factory=list, description="""Indices for the vector columns of this dynamic table.""") + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Data.model_rebuild() +Index.model_rebuild() +VectorData.model_rebuild() +VectorIndex.model_rebuild() +ElementIdentifiers.model_rebuild() +DynamicTableRegion.model_rebuild() +Container.model_rebuild() +DynamicTable.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/namespace.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/namespace.py new file mode 100644 index 0000000..d55c817 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_1_3/namespace.py @@ -0,0 +1,46 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +from .hdmf_common_sparse import ( + CSRMatrix +) + +from .hdmf_common_table import ( + Data, + Index, + VectorData, + VectorIndex, + ElementIdentifiers, + DynamicTableRegion, + Container, + DynamicTable +) + + +metamodel_version = "None" +version = "1.1.3" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/hdmf_common_base.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_base.py similarity index 84% rename from nwb_linkml/src/nwb_linkml/models/hdmf_common_base.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_base.py index feb3cd7..2cab53f 100644 --- a/nwb_linkml/src/nwb_linkml/models/hdmf_common_base.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_base.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -13,7 +14,7 @@ else: metamodel_version = "None" -version = "None" +version = "1.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/hdmf_common_sparse.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py similarity index 84% rename from nwb_linkml/src/nwb_linkml/models/hdmf_common_sparse.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py index 64773f2..e0651f0 100644 --- a/nwb_linkml/src/nwb_linkml/models/hdmf_common_sparse.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_sparse.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -17,7 +18,7 @@ from .hdmf_common_base import ( metamodel_version = "None" -version = "None" +version = "1.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, diff --git a/nwb_linkml/src/nwb_linkml/models/hdmf_common_table.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py similarity index 96% rename from nwb_linkml/src/nwb_linkml/models/hdmf_common_table.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py index 23aa37f..f126a41 100644 --- a/nwb_linkml/src/nwb_linkml/models/hdmf_common_table.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/hdmf_common_table.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -18,7 +19,7 @@ from .hdmf_common_base import ( metamodel_version = "None" -version = "None" +version = "1.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, diff --git a/nwb_linkml/src/nwb_linkml/models/hdmf_common.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/namespace.py similarity index 78% rename from nwb_linkml/src/nwb_linkml/models/hdmf_common.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/namespace.py index 3be86ff..4450df6 100644 --- a/nwb_linkml/src/nwb_linkml/models/hdmf_common.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_common/v1_5_0/namespace.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -32,7 +33,7 @@ from .hdmf_common_table import ( metamodel_version = "None" -version = "1.8.0" +version = "1.5.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/__init__.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/hdmf_experimental_experimental.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py similarity index 81% rename from nwb_linkml/src/nwb_linkml/models/hdmf_experimental_experimental.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py index 67e5d03..2a9a08f 100644 --- a/nwb_linkml/src/nwb_linkml/models/hdmf_experimental_experimental.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_experimental.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -11,13 +12,13 @@ else: from typing_extensions import Literal -from .hdmf_common_table import ( +from ...hdmf_common.v1_5_0.hdmf_common_table import ( VectorData ) metamodel_version = "None" -version = "None" +version = "0.1.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, diff --git a/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_nwb_language.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_nwb_language.py new file mode 100644 index 0000000..e0472a8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_nwb_language.py @@ -0,0 +1,39 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, Field +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel, + validate_assignment = True, + validate_default = True, + extra = 'forbid', + arbitrary_types_allowed = True, + use_enum_values = True): + pass + + +class Arraylike(ConfiguredBaseModel): + """ + Container for arraylike information held in the dims, shape, and dtype properties.this is a special case to be interpreted by downstream i/o. this class has no slotsand is abstract by default.- Each slot within a subclass indicates a possible dimension.- Only dimensions that are present in all the dimension specifiers in the original schema are required.- Shape requirements are indicated using max/min cardinalities on the slot. + """ + None + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Arraylike.model_rebuild() + \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/hdmf_experimental_resources.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py similarity index 64% rename from nwb_linkml/src/nwb_linkml/models/hdmf_experimental_resources.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py index 24ebd40..9522d72 100644 --- a/nwb_linkml/src/nwb_linkml/models/hdmf_experimental_resources.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/hdmf_experimental_resources.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -11,13 +12,13 @@ else: from typing_extensions import Literal -from .hdmf_common_base import ( +from ...hdmf_common.v1_5_0.hdmf_common_base import ( Container ) metamodel_version = "None" -version = "None" +version = "0.1.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, @@ -28,21 +29,20 @@ class ConfiguredBaseModel(BaseModel, pass -class HERD(Container): +class ExternalResources(Container): """ - HDMF External Resources Data Structure. A set of six tables for tracking external resource references in a file or across multiple files. + A set of four tables for tracking external resource references in a file. NOTE: this data type is in beta testing and is subject to change in a later version. """ name:str= Field(...) keys:List[Any]= Field(default_factory=list, description="""A table for storing user terms that are used to refer to external resources.""") - files:List[Any]= Field(default_factory=list, description="""A table for storing object ids of files used in external resources.""") entities:List[Any]= Field(default_factory=list, description="""A table for mapping user terms (i.e., keys) to resource entities.""") + resources:List[Any]= Field(default_factory=list, description="""A table for mapping user terms (i.e., keys) to resource entities.""") objects:List[Any]= Field(default_factory=list, description="""A table for identifying which objects in a file contain references to external resources.""") object_keys:List[Any]= Field(default_factory=list, description="""A table for identifying which objects use which keys.""") - entity_keys:List[Any]= Field(default_factory=list, description="""A table for identifying which keys use which entity.""") # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -HERD.model_rebuild() +ExternalResources.model_rebuild() \ No newline at end of file diff --git a/nwb_linkml/src/nwb_linkml/models/hdmf_experimental.py b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py similarity index 67% rename from nwb_linkml/src/nwb_linkml/models/hdmf_experimental.py rename to nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py index 1d0c97e..4f6fb4d 100644 --- a/nwb_linkml/src/nwb_linkml/models/hdmf_experimental.py +++ b/nwb_linkml/src/nwb_linkml/models/pydantic/hdmf_experimental/v0_1_0/namespace.py @@ -3,7 +3,8 @@ from datetime import datetime, date from enum import Enum from typing import List, Dict, Optional, Any, Union from pydantic import BaseModel as BaseModel, Field -from nptyping import NDArray, Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nptyping import Shape, Float, Float32, Double, Float64, LongLong, Int64, Int, Int32, Int16, Short, Int8, UInt, UInt32, UInt16, UInt8, UInt64, Number, String, Unicode, Unicode, Unicode, String, Bool, Datetime64 +from nwb_linkml.types import NDArray import sys if sys.version_info >= (3, 8): from typing import Literal @@ -12,20 +13,20 @@ else: from .hdmf_experimental_resources import ( - HERD + ExternalResources ) -from .hdmf_common_base import ( +from ...hdmf_common.v1_5_0.hdmf_common_sparse import ( + CSRMatrix +) + +from ...hdmf_common.v1_5_0.hdmf_common_base import ( Data, Container, SimpleMultiContainer ) -from .hdmf_experimental_experimental import ( - EnumData -) - -from .hdmf_common_table import ( +from ...hdmf_common.v1_5_0.hdmf_common_table import ( VectorData, VectorIndex, ElementIdentifiers, @@ -34,9 +35,13 @@ from .hdmf_common_table import ( AlignedDynamicTable ) +from .hdmf_experimental_experimental import ( + EnumData +) + metamodel_version = "None" -version = "0.5.0" +version = "0.1.0" class ConfiguredBaseModel(BaseModel, validate_assignment = True, diff --git a/nwb_linkml/src/nwb_linkml/providers/git.py b/nwb_linkml/src/nwb_linkml/providers/git.py index 4bf0a3a..8130882 100644 --- a/nwb_linkml/src/nwb_linkml/providers/git.py +++ b/nwb_linkml/src/nwb_linkml/providers/git.py @@ -33,7 +33,7 @@ NWB_CORE_REPO = NamespaceRepo( name="core", repository="https://github.com/NeurodataWithoutBorders/nwb-schema", path=Path("core/nwb.namespace.yaml"), - versions=["2.0.1", "2.1.0", "2.2.0", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.5", "2.3.0", "2.4.0", "2.5.0", "2.6.0"] + versions=["2.2.0", "2.2.1", "2.2.2", "2.2.4", "2.2.5", "2.3.0", "2.4.0", "2.5.0", "2.6.0"] ) HDMF_COMMON_REPO = NamespaceRepo( diff --git a/nwb_linkml/src/nwb_linkml/providers/schema.py b/nwb_linkml/src/nwb_linkml/providers/schema.py index 70f9407..bb0c07b 100644 --- a/nwb_linkml/src/nwb_linkml/providers/schema.py +++ b/nwb_linkml/src/nwb_linkml/providers/schema.py @@ -516,10 +516,9 @@ class PydanticProvider(Provider): fn = path.parts[-1] version = version_module_case(version) - # this is extremely fragile, we should not be inferring version number from paths... if out_file is None: - fn = fn.strip('.yaml') + fn = fn.removesuffix('.yaml') fn = module_case(fn) + '.py' out_file = self.path / name / version / fn diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.base.yaml new file mode 100644 index 0000000..5fe93bb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.base.yaml @@ -0,0 +1,303 @@ +name: core.nwb.base +id: core.nwb.base +version: 2.2.0 +imports: +- ../../hdmf_common/v1_1_0/namespace +- core.nwb.language +default_prefix: core.nwb.base/ +classes: + NWBData: + name: NWBData + description: An abstract data type for a dataset. + is_a: Data + attributes: + name: + name: name + range: string + required: true + tree_root: true + Image: + name: Image + description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D + where the third dimension can have three or four elements, e.g. (x, y, (r, g, + b)) or (x, y, (r, g, b, a)). + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + resolution: + name: resolution + description: Pixel resolution of the image, in pixels per centimeter. + range: float32 + description: + name: description + description: Description of the image. + range: text + array: + name: array + range: Image__Array + tree_root: true + Image__Array: + name: Image__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + r, g, b, a: + name: r, g, b, a + range: numeric + required: false + minimum_cardinality: 4 + maximum_cardinality: 4 + NWBContainer: + name: NWBContainer + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + is_a: Container + attributes: + name: + name: name + range: string + required: true + tree_root: true + NWBDataInterface: + name: NWBDataInterface + description: An abstract data type for a generic container storing collections + of data, as opposed to metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeries: + name: TimeSeries + description: General purpose time series. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the time series. + range: text + comments: + name: comments + description: Human-readable comments about the TimeSeries. This second descriptive + field can be used to store additional information, or descriptive information + if the primary description field is populated with a computer-readable string. + range: text + data: + name: data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first + dimension should always represent time. This can also be used to store binary + data (e.g., image frames). This can also be a link to data stored in an + external file. + multivalued: false + range: TimeSeries__data + required: true + starting_time: + name: starting_time + description: Timestamp of the first sample in seconds. When timestamps are + uniformly spaced, the timestamp of the first sample can be specified and + all subsequent ones calculated from the sampling rate attribute. + multivalued: false + range: TimeSeries__starting_time + required: false + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + multivalued: true + range: float64 + required: false + control: + name: control + description: Numerical labels that apply to each time point in data for the + purpose of querying and slicing data by these values. If present, the length + of this array should be the same size as the first dimension of data. + multivalued: true + range: uint8 + required: false + control_description: + name: control_description + description: Description of each control value. Must be present if control + is present. If present, control_description[0] should describe time points + where control == 0. + multivalued: true + range: text + required: false + sync: + name: sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored + external to the NWB file, in files storing raw data. Once timestamp data + is calculated, the contents of 'sync' are mostly for archival purposes. + multivalued: false + range: TimeSeries__sync + required: false + tree_root: true + TimeSeries__data: + name: TimeSeries__data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension + should always represent time. This can also be used to store binary data (e.g., + image frames). This can also be a link to data stored in an external file. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as signed 16-bit + integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V + to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' + multiplier to get from raw data acquisition values to recorded volts is + 2.5/32768/8000 = 9.5367e-9. + range: float32 + resolution: + name: resolution + description: Smallest meaningful difference between values in data, stored + in the specified by unit, e.g., the change in value of the least significant + bit, or a larger number if signal noise is known to be present. If unknown, + use -1.0. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: TimeSeries__data__Array + TimeSeries__data__Array: + name: TimeSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: AnyType + required: true + num_DIM2: + name: num_DIM2 + range: AnyType + required: false + num_DIM3: + name: num_DIM3 + range: AnyType + required: false + num_DIM4: + name: num_DIM4 + range: AnyType + required: false + TimeSeries__starting_time: + name: TimeSeries__starting_time + description: Timestamp of the first sample in seconds. When timestamps are uniformly + spaced, the timestamp of the first sample can be specified and all subsequent + ones calculated from the sampling rate attribute. + attributes: + name: + name: name + ifabsent: string(starting_time) + range: string + required: true + equals_string: starting_time + rate: + name: rate + description: Sampling rate, in Hz. + range: float32 + unit: + name: unit + description: Unit of measurement for time, which is fixed to 'seconds'. + range: text + value: + name: value + range: float64 + required: true + TimeSeries__sync: + name: TimeSeries__sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored external + to the NWB file, in files storing raw data. Once timestamp data is calculated, + the contents of 'sync' are mostly for archival purposes. + attributes: + name: + name: name + ifabsent: string(sync) + range: string + required: true + equals_string: sync + ProcessingModule: + name: ProcessingModule + description: A collection of processed data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of processed data. + range: text + nwb_data_interface: + name: nwb_data_interface + description: Data objects stored in this collection. + multivalued: true + range: NWBDataInterface + required: false + dynamic_table: + name: dynamic_table + description: Tables stored in this collection. + multivalued: true + range: DynamicTable + required: false + tree_root: true + Images: + name: Images + description: A collection of images. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of images. + range: text + image: + name: image + description: Images stored in this collection. + multivalued: true + range: Image + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.behavior.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.behavior.yaml new file mode 100644 index 0000000..26620db --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.behavior.yaml @@ -0,0 +1,201 @@ +name: core.nwb.behavior +id: core.nwb.behavior +version: 2.2.0 +imports: +- core.nwb.base +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.behavior/ +classes: + SpatialSeries: + name: SpatialSeries + description: 'Direction, e.g., of gaze or travel, or position. The TimeSeries::data + field is a 2D array storing position or direction relative to some reference + frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries + has a text dataset reference_frame that indicates the zero-position, or the + zero-axes for direction. For example, if representing gaze direction, ''straight-ahead'' + might be a specific pixel on the monitor, or some other point in space. For + position data, the 0,0 point might be the top-left corner of an enclosure, as + viewed from the tracking camera. The unit of data will indicate how to interpret + SpatialSeries values.' + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: 1-D or 2-D array storing position or direction relative to some + reference frame. + multivalued: false + range: SpatialSeries__data + required: true + reference_frame: + name: reference_frame + description: Description defining what exactly 'straight-ahead' means. + multivalued: false + range: text + required: false + tree_root: true + SpatialSeries__data: + name: SpatialSeries__data + description: 1-D or 2-D array storing position or direction relative to some reference + frame. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: SpatialSeries__data__Array + SpatialSeries__data__Array: + name: SpatialSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + BehavioralEpochs: + name: BehavioralEpochs + description: TimeSeries for storing behavioral epochs. The objective of this + and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) + is to provide generic hooks for software tools/scripts. This allows a tool/script + to take the output one specific interface (e.g., UnitTimes) and plot that data + relative to another data modality (e.g., behavioral events) without having to + define all possible modalities in advance. Declaring one of these interfaces + means that one or more TimeSeries of the specified type is published. These + TimeSeries should reside in a group having the same name as the interface. For + example, if a BehavioralTimeSeries interface is declared, the module will have + one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. + BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular + events. BehavioralTimeSeries is for continuous data. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + interval_series: + name: interval_series + description: IntervalSeries object containing start and stop times of epochs. + multivalued: true + range: IntervalSeries + required: false + tree_root: true + BehavioralEvents: + name: BehavioralEvents + description: TimeSeries for storing behavioral events. See description of BehavioralEpochs + for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing behavioral events. + multivalued: true + range: TimeSeries + required: false + tree_root: true + BehavioralTimeSeries: + name: BehavioralTimeSeries + description: TimeSeries for storing Behavoioral time series data. See description + of BehavioralEpochs for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing continuous behavioral data. + multivalued: true + range: TimeSeries + required: false + tree_root: true + PupilTracking: + name: PupilTracking + description: Eye-tracking data, representing pupil size. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing time series data on pupil size. + multivalued: true + range: TimeSeries + required: true + tree_root: true + EyeTracking: + name: EyeTracking + description: Eye-tracking data, representing direction of gaze. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing data measuring direction of gaze. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + CompassDirection: + name: CompassDirection + description: With a CompassDirection interface, a module publishes a SpatialSeries + object representing a floating point value for theta. The SpatialSeries::reference_frame + field should indicate what direction corresponds to 0 and which is the direction + of rotation (this should be clockwise). The si_unit for the SpatialSeries should + be radians or degrees. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing direction of gaze travel. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + Position: + name: Position + description: Position data, whether along the x, x/y or x/y/z axis. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing position data. + multivalued: true + range: SpatialSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.device.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.device.yaml similarity index 95% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.device.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.device.yaml index 9a2af16..3c823ea 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.device.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.device.yaml @@ -1,8 +1,9 @@ name: core.nwb.device id: core.nwb.device +version: 2.2.0 imports: - core.nwb.base -- nwb.language +- core.nwb.language default_prefix: core.nwb.device/ classes: Device: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.ecephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.ecephys.yaml new file mode 100644 index 0000000..8286bd9 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.ecephys.yaml @@ -0,0 +1,492 @@ +name: core.nwb.ecephys +id: core.nwb.ecephys +version: 2.2.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_0/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ecephys/ +classes: + ElectricalSeries: + name: ElectricalSeries + description: A time series of acquired voltage data from extracellular recordings. + The data field is an int or float array storing data in volts. The first dimension + should always represent time. The second dimension, if present, should represent + channels. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage data. + multivalued: false + range: ElectricalSeries__data + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: ElectricalSeries__electrodes + required: true + channel_conversion: + name: channel_conversion + description: Channel-specific conversion factor. Multiply the data in the + 'data' dataset by these values along the channel axis (as indicated by axis + attribute) AND by the global conversion factor in the 'conversion' attribute + of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion + * channel_conversion. This approach allows for both global and per-channel + data conversion factors needed to support the storage of electrical recordings + as native values generated by data acquisition systems. If this dataset + is not present, then there is no channel-specific conversion factor, i.e. + it is 1 for all channels. + multivalued: true + range: float32 + required: false + tree_root: true + ElectricalSeries__data: + name: ElectricalSeries__data + description: Recorded voltage data. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. This value + is fixed to 'volts'. Actual stored values are not necessarily stored in + these units. To access the data in these units, multiply 'data' by 'conversion' + and 'channel_conversion' (if present). + range: text + array: + name: array + range: ElectricalSeries__data__Array + ElectricalSeries__data__Array: + name: ElectricalSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + num_samples: + name: num_samples + range: numeric + required: false + ElectricalSeries__electrodes: + name: ElectricalSeries__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + SpikeEventSeries: + name: SpikeEventSeries + description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold + crossings). This may also be raw data, as reported by ephys hardware. If so, + the TimeSeries::description field should describe how events were detected. + All SpikeEventSeries should reside in a module (under EventWaveform interface) + even if the spikes were reported and stored by hardware. All events span the + same recording channels and store snapshots of equal duration. TimeSeries::data + array structure: [num events] [num channels] [num samples] (or [num events] + [num samples] for single electrode).' + is_a: ElectricalSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Spike waveforms. + multivalued: false + range: SpikeEventSeries__data + required: true + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + Timestamps are required for the events. Unlike for TimeSeries, timestamps + are required for SpikeEventSeries and are thus re-specified here. + multivalued: true + range: float64 + required: true + tree_root: true + SpikeEventSeries__data: + name: SpikeEventSeries__data + description: Spike waveforms. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Unit of measurement for waveforms, which is fixed to 'volts'. + range: text + array: + name: array + range: SpikeEventSeries__data__Array + SpikeEventSeries__data__Array: + name: SpikeEventSeries__data__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: numeric + required: true + num_samples: + name: num_samples + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + FeatureExtraction: + name: FeatureExtraction + description: Features, such as PC1 and PC2, that are extracted from signals stored + in a SpikeEventSeries or other source. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of features (eg, ''PC1'') for each of the extracted + features. + multivalued: true + range: text + required: true + features: + name: features + description: Multi-dimensional array of features extracted from each event. + multivalued: false + range: FeatureExtraction__features + required: true + times: + name: times + description: Times of events that features correspond to (can be a link). + multivalued: true + range: float64 + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: FeatureExtraction__electrodes + required: true + tree_root: true + FeatureExtraction__features: + name: FeatureExtraction__features + description: Multi-dimensional array of features extracted from each event. + attributes: + name: + name: name + ifabsent: string(features) + range: string + required: true + equals_string: features + array: + name: array + range: FeatureExtraction__features__Array + FeatureExtraction__features__Array: + name: FeatureExtraction__features__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: float32 + required: true + num_channels: + name: num_channels + range: float32 + required: true + num_features: + name: num_features + range: float32 + required: true + FeatureExtraction__electrodes: + name: FeatureExtraction__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + EventDetection: + name: EventDetection + description: Detected spike events from voltage trace(s). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + detection_method: + name: detection_method + description: Description of how events were detected, such as voltage threshold, + or dV/dT threshold, as well as relevant values. + multivalued: false + range: text + required: true + source_idx: + name: source_idx + description: Indices (zero-based) into source ElectricalSeries::data array + corresponding to time of event. ''description'' should define what is meant + by time of event (e.g., .25 ms before action potential peak, zero-crossing + time, etc). The index points to each event from the raw data. + multivalued: true + range: int32 + required: true + times: + name: times + description: Timestamps of events, in seconds. + multivalued: true + range: float64 + required: true + tree_root: true + EventWaveform: + name: EventWaveform + description: Represents either the waveforms of detected events, as extracted + from a raw data trace in /acquisition, or the event waveforms that were stored + during experiment acquisition. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spike_event_series: + name: spike_event_series + description: SpikeEventSeries object(s) containing detected spike event waveforms. + multivalued: true + range: SpikeEventSeries + required: false + tree_root: true + FilteredEphys: + name: FilteredEphys + description: Electrophysiology data from one or more channels that has been subjected + to filtering. Examples of filtered data include Theta and Gamma (LFP has its + own interface). FilteredEphys modules publish an ElectricalSeries for each filtered + channel or set of channels. The name of each ElectricalSeries is arbitrary but + should be informative. The source of the filtered data, whether this is from + analysis of another time series or as acquired by hardware, should be noted + in each's TimeSeries::description field. There is no assumed 1::1 correspondence + between filtered ephys signals and electrodes, as a single signal can apply + to many nearby electrodes, and one electrode may have different filtered (e.g., + theta and/or gamma) signals represented. Filter properties should be noted in + the ElectricalSeries. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing filtered electrophysiology + data. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + LFP: + name: LFP + description: LFP data from one or more channels. The electrode map in each published + ElectricalSeries will identify which channels are providing LFP data. Filter + properties should be noted in the ElectricalSeries description or comments field. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing LFP data for one or more + channels. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + ElectrodeGroup: + name: ElectrodeGroup + description: A physical grouping of electrodes, e.g. a shank of an array. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this electrode group. + range: text + location: + name: location + description: Location of electrode group. Specify the area, layer, comments + on estimation of area/layer, etc. Use standard atlas names for anatomical + regions when possible. + range: text + position: + name: position + description: stereotaxic or common framework coordinates + multivalued: false + range: AnyType + required: false + tree_root: true + ClusterWaveforms: + name: ClusterWaveforms + description: DEPRECATED The mean waveform shape, including standard deviation, + of the different clusters. Ideally, the waveform analysis should be performed + on data that is only high-pass filtered. This is a separate module because it + is expected to require updating. For example, IMEC probes may require different + storage requirements to store/display mean waveforms, requiring a new interface + or an extension of this one. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + waveform_filtering: + name: waveform_filtering + description: Filtering applied to data before generating mean/sd + multivalued: false + range: text + required: true + waveform_mean: + name: waveform_mean + description: The mean waveform for each cluster, using the same indices for + each wave as cluster numbers in the associated Clustering module (i.e, cluster + 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence + should be empty (e.g., zero- filled) + multivalued: false + range: ClusterWaveforms__waveform_mean + required: true + waveform_sd: + name: waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as + in mean + multivalued: false + range: ClusterWaveforms__waveform_sd + required: true + tree_root: true + ClusterWaveforms__waveform_mean: + name: ClusterWaveforms__waveform_mean + description: The mean waveform for each cluster, using the same indices for each + wave as cluster numbers in the associated Clustering module (i.e, cluster 3 + is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should + be empty (e.g., zero- filled) + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + array: + name: array + range: ClusterWaveforms__waveform_mean__Array + ClusterWaveforms__waveform_mean__Array: + name: ClusterWaveforms__waveform_mean__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + ClusterWaveforms__waveform_sd: + name: ClusterWaveforms__waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as in + mean + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + array: + name: array + range: ClusterWaveforms__waveform_sd__Array + ClusterWaveforms__waveform_sd__Array: + name: ClusterWaveforms__waveform_sd__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + Clustering: + name: Clustering + description: DEPRECATED Clustered spike data, whether from automatic clustering + tools (e.g., klustakwik) or as a result of manual sorting. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of clusters or clustering, (e.g. cluster 0 is noise, + clusters curated using Klusters, etc) + multivalued: false + range: text + required: true + num: + name: num + description: Cluster number of each event + multivalued: true + range: int32 + required: true + peak_over_rms: + name: peak_over_rms + description: Maximum ratio of waveform peak to RMS on any channel in the cluster + (provides a basic clustering metric). + multivalued: true + range: float32 + required: true + times: + name: times + description: Times of clustered events, in seconds. This may be a link to + times field in associated FeatureExtraction module. + multivalued: true + range: float64 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.epoch.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.epoch.yaml new file mode 100644 index 0000000..582368a --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.epoch.yaml @@ -0,0 +1,74 @@ +name: core.nwb.epoch +id: core.nwb.epoch +version: 2.2.0 +imports: +- ../../hdmf_common/v1_1_0/namespace +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.epoch/ +classes: + TimeIntervals: + name: TimeIntervals + description: A container for aggregating epoch data and the TimeSeries that each + epoch applies to. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + start_time: + name: start_time + description: Start time of epoch, in seconds. + multivalued: true + range: float32 + stop_time: + name: stop_time + description: Stop time of epoch, in seconds. + multivalued: true + range: float32 + tags: + name: tags + description: User-defined tags that identify or categorize events. + multivalued: true + range: text + tags_index: + name: tags_index + description: Index for tags. + multivalued: false + range: TimeIntervals__tags_index + required: false + timeseries: + name: timeseries + description: An index into a TimeSeries object. + multivalued: true + range: AnyType + timeseries_index: + name: timeseries_index + description: Index for timeseries. + multivalued: false + range: TimeIntervals__timeseries_index + required: false + tree_root: true + TimeIntervals__tags_index: + name: TimeIntervals__tags_index + description: Index for tags. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(tags_index) + range: string + required: true + equals_string: tags_index + TimeIntervals__timeseries_index: + name: TimeIntervals__timeseries_index + description: Index for timeseries. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(timeseries_index) + range: string + required: true + equals_string: timeseries_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.file.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.file.yaml new file mode 100644 index 0000000..7374563 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.file.yaml @@ -0,0 +1,636 @@ +name: core.nwb.file +id: core.nwb.file +version: 2.2.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_0/namespace +- core.nwb.device +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.epoch +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.file/ +classes: + NWBFile: + name: NWBFile + description: An NWB:N file storing cellular-based neurophysiology data from a + single experimental session. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(root) + range: string + required: true + equals_string: root + nwb_version: + name: nwb_version + description: File version string. Use semantic versioning, e.g. 1.2.1. This + will be the name of the format with trailing major, minor and patch numbers. + range: text + file_create_date: + name: file_create_date + description: 'A record of the date the file was created and of subsequent + modifications. The date is stored in UTC with local timezone offset as ISO + 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored + in UTC end in "Z" with no timezone offset. Date accuracy is up to milliseconds. + The file can be created after the experiment was run, so this may differ + from the experiment start time. Each modification to the nwb file adds a + new entry to the array.' + multivalued: true + range: isodatetime + required: true + identifier: + name: identifier + description: A unique text identifier for the file. For example, concatenated + lab name, file creation date/time and experimentalist, or a hash of these + and/or other values. The goal is that the string should be unique to all + other files. + multivalued: false + range: text + required: true + session_description: + name: session_description + description: A description of the experimental session and data in the file. + multivalued: false + range: text + required: true + session_start_time: + name: session_start_time + description: 'Date and time of the experiment/session start. The date is stored + in UTC with local timezone offset as ISO 8601 extended formatted string: + 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in "Z" with no timezone + offset. Date accuracy is up to milliseconds.' + multivalued: false + range: isodatetime + required: true + timestamps_reference_time: + name: timestamps_reference_time + description: 'Date and time corresponding to time zero of all timestamps. + The date is stored in UTC with local timezone offset as ISO 8601 extended + formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end + in "Z" with no timezone offset. Date accuracy is up to milliseconds. All + times stored in the file use this time as reference (i.e., time zero).' + multivalued: false + range: isodatetime + required: true + acquisition: + name: acquisition + description: Data streams recorded from the system, including ephys, ophys, + tracking, etc. This group should be read-only after the experiment is completed + and timestamps are corrected to a common timebase. The data stored here + may be links to raw data stored in external NWB files. This will allow keeping + bulky raw data out of the file while preserving the option of keeping some/all + in the file. Acquired data includes tracking and experimental data streams + (i.e., everything measured from the system). If bulky data is stored in + the /acquisition group, the data can exist in a separate NWB file that is + linked to by the file being used for processing and analysis. + multivalued: true + any_of: + - range: NWBDataInterface + - range: DynamicTable + analysis: + name: analysis + description: Lab-specific and custom scientific analysis of data. There is + no defined format for the content of this group - the format is up to the + individual user/lab. To facilitate sharing analysis data between labs, the + contents here should be stored in standard types (e.g., neurodata_types) + and appropriately documented. The file can store lab-specific and custom + data analysis without restriction on its form or schema, reducing data formatting + restrictions on end users. Such data should be placed in the analysis group. + The analysis data should be documented so that it could be shared with other + labs. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + scratch: + name: scratch + description: A place to store one-off analysis results. Data placed here is + not intended for sharing. By placing data here, users acknowledge that there + is no guarantee that their data meets any standard. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + processing: + name: processing + description: The home for ProcessingModules. These modules perform intermediate + analysis of data that is necessary to perform before scientific analysis. + Examples include spike clustering, extracting position from tracking data, + stitching together image slices. ProcessingModules can be large and express + many data sets from relatively complex analysis (e.g., spike detection and + clustering) or small, representing extraction of position information from + tracking video, or even binary lick/no-lick decisions. Common software tools + (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' + refers to intermediate analysis of the acquired data to make it more amenable + to scientific analysis. + multivalued: true + any_of: + - range: ProcessingModule + stimulus: + name: stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment + complete and timestamps are corrected to common timebase. Stores both presented + stimuli and stimulus templates, the latter in case the same stimulus is + presented multiple times, or is pulled from an external stimulus library. + Stimuli are here defined as any signal that is pushed into the system as + part of the experiment (eg, sound, video, voltage, etc). Many different + experiments can use the same stimuli, and stimuli can be re-used during + an experiment. The stimulus group is organized so that one version of template + stimuli can be stored and these be used multiple times. These templates + can exist in the present file or can be linked to a remote library file. + multivalued: false + range: NWBFile__stimulus + required: true + general: + name: general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used + to describe the experiment. Metadata necessary for interpreting the data + is stored with the data. General experimental metadata, including animal + strain, experimental protocols, experimenter, devices, etc, are stored under + 'general'. Core metadata (e.g., that required to interpret data fields) + is stored with the data itself, and implicitly defined by the file specification + (e.g., time is in seconds). The strategy used here for storing non-core + metadata is to use free-form text fields, such as would appear in sentences + or paragraphs from a Methods section. Metadata fields are text to enable + them to be more general, for example to represent ranges instead of numerical + values. Machine-readable metadata is stored as attributes to these free-form + datasets. All entries in the below table are to be included when data is + present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) + should not be created unless there is data to store within them. + multivalued: false + range: NWBFile__general + required: true + intervals: + name: intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during + an experiment, or epochs (see epochs subgroup) deriving from analysis of + data. + multivalued: false + range: NWBFile__intervals + required: false + units: + name: units + description: Data about sorted spike units. + multivalued: false + range: Units + required: false + tree_root: true + NWBFile__stimulus: + name: NWBFile__stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment complete + and timestamps are corrected to common timebase. Stores both presented stimuli + and stimulus templates, the latter in case the same stimulus is presented multiple + times, or is pulled from an external stimulus library. Stimuli are here defined + as any signal that is pushed into the system as part of the experiment (eg, + sound, video, voltage, etc). Many different experiments can use the same stimuli, + and stimuli can be re-used during an experiment. The stimulus group is organized + so that one version of template stimuli can be stored and these be used multiple + times. These templates can exist in the present file or can be linked to a remote + library file. + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + presentation: + name: presentation + description: Stimuli presented during the experiment. + multivalued: true + any_of: + - range: TimeSeries + templates: + name: templates + description: Template stimuli. Timestamps in templates are based on stimulus + design and are relative to the beginning of the stimulus. When templates + are used, the stimulus instances must convert presentation times to the + experiment`s time reference frame. + multivalued: true + any_of: + - range: TimeSeries + NWBFile__general: + name: NWBFile__general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used to + describe the experiment. Metadata necessary for interpreting the data is stored + with the data. General experimental metadata, including animal strain, experimental + protocols, experimenter, devices, etc, are stored under 'general'. Core metadata + (e.g., that required to interpret data fields) is stored with the data itself, + and implicitly defined by the file specification (e.g., time is in seconds). + The strategy used here for storing non-core metadata is to use free-form text + fields, such as would appear in sentences or paragraphs from a Methods section. + Metadata fields are text to enable them to be more general, for example to represent + ranges instead of numerical values. Machine-readable metadata is stored as attributes + to these free-form datasets. All entries in the below table are to be included + when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology + experiment) should not be created unless there is data to store within them. + attributes: + name: + name: name + ifabsent: string(general) + range: string + required: true + equals_string: general + data_collection: + name: data_collection + description: Notes about data collection and analysis. + multivalued: false + range: text + required: false + experiment_description: + name: experiment_description + description: General description of the experiment. + multivalued: false + range: text + required: false + experimenter: + name: experimenter + description: Name of person(s) who performed the experiment. Can also specify + roles of different people involved. + multivalued: true + range: text + required: false + institution: + name: institution + description: Institution(s) where experiment was performed. + multivalued: false + range: text + required: false + keywords: + name: keywords + description: Terms to search over. + multivalued: true + range: text + required: false + lab: + name: lab + description: Laboratory where experiment was performed. + multivalued: false + range: text + required: false + notes: + name: notes + description: Notes about the experiment. + multivalued: false + range: text + required: false + pharmacology: + name: pharmacology + description: Description of drugs used, including how and when they were administered. + Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc. + multivalued: false + range: text + required: false + protocol: + name: protocol + description: Experimental protocol, if applicable. e.g., include IACUC protocol + number. + multivalued: false + range: text + required: false + related_publications: + name: related_publications + description: Publication information. PMID, DOI, URL, etc. + multivalued: true + range: text + required: false + session_id: + name: session_id + description: Lab-specific ID for the session. + multivalued: false + range: text + required: false + slices: + name: slices + description: Description of slices, including information about preparation + thickness, orientation, temperature, and bath solution. + multivalued: false + range: text + required: false + source_script: + name: source_script + description: Script file or link to public source code used to create this + NWB file. + multivalued: false + range: NWBFile__general__source_script + required: false + stimulus: + name: stimulus + description: Notes about stimuli, such as how and where they were presented. + multivalued: false + range: text + required: false + surgery: + name: surgery + description: Narrative description about surgery/surgeries, including date(s) + and who performed surgery. + multivalued: false + range: text + required: false + virus: + name: virus + description: Information about virus(es) used in experiments, including virus + ID, source, date made, injection location, volume, etc. + multivalued: false + range: text + required: false + nwb_container: + name: nwb_container + description: Place-holder than can be extended so that lab-specific meta-data + can be placed in /general. + multivalued: true + range: NWBContainer + required: false + devices: + name: devices + description: Description of hardware devices used during experiment, e.g., + monitors, ADC boards, microscopes, etc. + multivalued: true + any_of: + - range: Device + subject: + name: subject + description: Information about the animal or person from which the data was + measured. + multivalued: false + range: Subject + required: false + extracellular_ephys: + name: extracellular_ephys + description: Metadata related to extracellular electrophysiology. + multivalued: false + range: NWBFile__general__extracellular_ephys + required: false + intracellular_ephys: + name: intracellular_ephys + description: Metadata related to intracellular electrophysiology. + multivalued: false + range: NWBFile__general__intracellular_ephys + required: false + optogenetics: + name: optogenetics + description: Metadata describing optogenetic stimuluation. + multivalued: true + any_of: + - range: OptogeneticStimulusSite + optophysiology: + name: optophysiology + description: Metadata related to optophysiology. + multivalued: true + any_of: + - range: ImagingPlane + NWBFile__general__source_script: + name: NWBFile__general__source_script + description: Script file or link to public source code used to create this NWB + file. + attributes: + name: + name: name + ifabsent: string(source_script) + range: string + required: true + equals_string: source_script + file_name: + name: file_name + description: Name of script file. + range: text + value: + name: value + range: text + required: true + Subject: + name: Subject + description: Information about the animal or person from which the data was measured. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(subject) + range: string + required: true + equals_string: subject + age: + name: age + description: Age of subject. Can be supplied instead of 'date_of_birth'. + multivalued: false + range: text + required: false + date_of_birth: + name: date_of_birth + description: Date of birth of subject. Can be supplied instead of 'age'. + multivalued: false + range: isodatetime + required: false + description: + name: description + description: Description of subject and where subject came from (e.g., breeder, + if animal). + multivalued: false + range: text + required: false + genotype: + name: genotype + description: Genetic strain. If absent, assume Wild Type (WT). + multivalued: false + range: text + required: false + sex: + name: sex + description: Gender of subject. + multivalued: false + range: text + required: false + species: + name: species + description: Species of subject. + multivalued: false + range: text + required: false + subject_id: + name: subject_id + description: ID of animal/person used/participating in experiment (lab convention). + multivalued: false + range: text + required: false + weight: + name: weight + description: Weight at time of experiment, at time of surgery and at other + important times. + multivalued: false + range: text + required: false + NWBFile__general__extracellular_ephys: + name: NWBFile__general__extracellular_ephys + description: Metadata related to extracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(extracellular_ephys) + range: string + required: true + equals_string: extracellular_ephys + electrode_group: + name: electrode_group + description: Physical group of electrodes. + multivalued: true + range: ElectrodeGroup + required: false + electrodes: + name: electrodes + description: A table of all electrodes (i.e. channels) used for recording. + multivalued: false + range: NWBFile__general__extracellular_ephys__electrodes + required: false + NWBFile__general__extracellular_ephys__electrodes: + name: NWBFile__general__extracellular_ephys__electrodes + description: A table of all electrodes (i.e. channels) used for recording. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + x: + name: x + description: x coordinate of the channel location in the brain (+x is posterior). + multivalued: true + range: float32 + y: + name: y + description: y coordinate of the channel location in the brain (+y is inferior). + multivalued: true + range: float32 + z: + name: z + description: z coordinate of the channel location in the brain (+z is right). + multivalued: true + range: float32 + imp: + name: imp + description: Impedance of the channel. + multivalued: true + range: float32 + location: + name: location + description: Location of the electrode (channel). Specify the area, layer, + comments on estimation of area/layer, stereotaxic coordinates if in vivo, + etc. Use standard atlas names for anatomical regions when possible. + multivalued: true + range: text + filtering: + name: filtering + description: Description of hardware filtering. + multivalued: true + range: float32 + group: + name: group + description: Reference to the ElectrodeGroup this electrode is a part of. + multivalued: true + range: ElectrodeGroup + group_name: + name: group_name + description: Name of the ElectrodeGroup this electrode is a part of. + multivalued: true + range: text + rel_x: + name: rel_x + description: x coordinate in electrode group + multivalued: true + range: float32 + rel_y: + name: rel_y + description: y coordinate in electrode group + multivalued: true + range: float32 + rel_z: + name: rel_z + description: z coordinate in electrode group + multivalued: true + range: float32 + reference: + name: reference + description: Description of the reference used for this electrode. + multivalued: true + range: text + NWBFile__general__intracellular_ephys: + name: NWBFile__general__intracellular_ephys + description: Metadata related to intracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(intracellular_ephys) + range: string + required: true + equals_string: intracellular_ephys + filtering: + name: filtering + description: Description of filtering used. Includes filtering type and parameters, + frequency fall-off, etc. If this changes between TimeSeries, filter description + should be stored as a text attribute for each TimeSeries. + multivalued: false + range: text + required: false + intracellular_electrode: + name: intracellular_electrode + description: An intracellular electrode. + multivalued: true + range: IntracellularElectrode + required: false + sweep_table: + name: sweep_table + description: The table which groups different PatchClampSeries together. + multivalued: false + range: SweepTable + required: false + NWBFile__intervals: + name: NWBFile__intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during an + experiment, or epochs (see epochs subgroup) deriving from analysis of data. + attributes: + name: + name: name + ifabsent: string(intervals) + range: string + required: true + equals_string: intervals + epochs: + name: epochs + description: Divisions in time marking experimental stages or sub-divisions + of a single recording session. + multivalued: false + range: TimeIntervals + required: false + trials: + name: trials + description: Repeated experimental events that have a logical grouping. + multivalued: false + range: TimeIntervals + required: false + invalid_times: + name: invalid_times + description: Time intervals that should be removed from analysis. + multivalued: false + range: TimeIntervals + required: false + time_intervals: + name: time_intervals + description: Optional additional table(s) for describing other experimental + time intervals. + multivalued: true + range: TimeIntervals + required: false diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.icephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.icephys.yaml new file mode 100644 index 0000000..5c6c776 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.icephys.yaml @@ -0,0 +1,503 @@ +name: core.nwb.icephys +id: core.nwb.icephys +version: 2.2.0 +imports: +- core.nwb.base +- core.nwb.device +- ../../hdmf_common/v1_1_0/namespace +- core.nwb.language +default_prefix: core.nwb.icephys/ +classes: + PatchClampSeries: + name: PatchClampSeries + description: An abstract base class for patch-clamp data - stimulus or response, + current or voltage. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: Protocol/stimulus name for this patch-clamp dataset. + range: text + sweep_number: + name: sweep_number + description: Sweep number, allows to group different PatchClampSeries together. + range: uint32 + data: + name: data + description: Recorded voltage or current. + multivalued: true + range: numeric + required: true + gain: + name: gain + description: Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt + (c-clamp). + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries: + name: CurrentClampSeries + description: Voltage data from an intracellular current-clamp recording. A corresponding + CurrentClampStimulusSeries (stored separately as a stimulus) is used to store + the current injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage. + multivalued: false + range: CurrentClampSeries__data + required: true + bias_current: + name: bias_current + description: Bias current, in amps. + multivalued: false + range: float32 + required: false + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms. + multivalued: false + range: float32 + required: false + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads. + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries__data: + name: CurrentClampSeries__data + description: Recorded voltage. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IZeroClampSeries: + name: IZeroClampSeries + description: Voltage data from an intracellular recording when all current and + amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There + is no CurrentClampStimulusSeries associated with an IZero series because the + amplifier is disconnected and no stimulus can reach the cell. + is_a: CurrentClampSeries + attributes: + name: + name: name + range: string + required: true + bias_current: + name: bias_current + description: Bias current, in amps, fixed to 0.0. + multivalued: false + range: float32 + required: true + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms, fixed to 0.0. + multivalued: false + range: float32 + required: true + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads, fixed to 0.0. + multivalued: false + range: float32 + required: true + tree_root: true + CurrentClampStimulusSeries: + name: CurrentClampStimulusSeries + description: Stimulus current applied during current clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus current applied. + multivalued: false + range: CurrentClampStimulusSeries__data + required: true + tree_root: true + CurrentClampStimulusSeries__data: + name: CurrentClampStimulusSeries__data + description: Stimulus current applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries: + name: VoltageClampSeries + description: Current data from an intracellular voltage-clamp recording. A corresponding + VoltageClampStimulusSeries (stored separately as a stimulus) is used to store + the voltage injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded current. + multivalued: false + range: VoltageClampSeries__data + required: true + capacitance_fast: + name: capacitance_fast + description: Fast capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_fast + required: false + capacitance_slow: + name: capacitance_slow + description: Slow capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_slow + required: false + resistance_comp_bandwidth: + name: resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + multivalued: false + range: VoltageClampSeries__resistance_comp_bandwidth + required: false + resistance_comp_correction: + name: resistance_comp_correction + description: Resistance compensation correction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_correction + required: false + resistance_comp_prediction: + name: resistance_comp_prediction + description: Resistance compensation prediction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_prediction + required: false + whole_cell_capacitance_comp: + name: whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + multivalued: false + range: VoltageClampSeries__whole_cell_capacitance_comp + required: false + whole_cell_series_resistance_comp: + name: whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + multivalued: false + range: VoltageClampSeries__whole_cell_series_resistance_comp + required: false + tree_root: true + VoltageClampSeries__data: + name: VoltageClampSeries__data + description: Recorded current. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries__capacitance_fast: + name: VoltageClampSeries__capacitance_fast + description: Fast capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_fast) + range: string + required: true + equals_string: capacitance_fast + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__capacitance_slow: + name: VoltageClampSeries__capacitance_slow + description: Slow capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_slow) + range: string + required: true + equals_string: capacitance_slow + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_bandwidth: + name: VoltageClampSeries__resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + attributes: + name: + name: name + ifabsent: string(resistance_comp_bandwidth) + range: string + required: true + equals_string: resistance_comp_bandwidth + unit: + name: unit + description: Unit of measurement for resistance_comp_bandwidth, which is fixed + to 'hertz'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_correction: + name: VoltageClampSeries__resistance_comp_correction + description: Resistance compensation correction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_correction) + range: string + required: true + equals_string: resistance_comp_correction + unit: + name: unit + description: Unit of measurement for resistance_comp_correction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_prediction: + name: VoltageClampSeries__resistance_comp_prediction + description: Resistance compensation prediction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_prediction) + range: string + required: true + equals_string: resistance_comp_prediction + unit: + name: unit + description: Unit of measurement for resistance_comp_prediction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_capacitance_comp: + name: VoltageClampSeries__whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + attributes: + name: + name: name + ifabsent: string(whole_cell_capacitance_comp) + range: string + required: true + equals_string: whole_cell_capacitance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_capacitance_comp, which is + fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_series_resistance_comp: + name: VoltageClampSeries__whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + attributes: + name: + name: name + ifabsent: string(whole_cell_series_resistance_comp) + range: string + required: true + equals_string: whole_cell_series_resistance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_series_resistance_comp, which + is fixed to 'ohms'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampStimulusSeries: + name: VoltageClampStimulusSeries + description: Stimulus voltage applied during a voltage clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus voltage applied. + multivalued: false + range: VoltageClampStimulusSeries__data + required: true + tree_root: true + VoltageClampStimulusSeries__data: + name: VoltageClampStimulusSeries__data + description: Stimulus voltage applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IntracellularElectrode: + name: IntracellularElectrode + description: An intracellular electrode and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of electrode (e.g., whole-cell, sharp, etc.). + multivalued: false + range: text + required: true + filtering: + name: filtering + description: Electrode specific filtering. + multivalued: false + range: text + required: false + initial_access_resistance: + name: initial_access_resistance + description: Initial access resistance. + multivalued: false + range: text + required: false + location: + name: location + description: Location of the electrode. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: false + resistance: + name: resistance + description: Electrode resistance, in ohms. + multivalued: false + range: text + required: false + seal: + name: seal + description: Information about seal used for recording. + multivalued: false + range: text + required: false + slice: + name: slice + description: Information about slice used for recording. + multivalued: false + range: text + required: false + tree_root: true + SweepTable: + name: SweepTable + description: The table which groups different PatchClampSeries together. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + sweep_number: + name: sweep_number + description: Sweep number of the PatchClampSeries in that row. + multivalued: true + range: uint32 + series: + name: series + description: The PatchClampSeries with the sweep number in that row. + multivalued: true + range: PatchClampSeries + series_index: + name: series_index + description: Index for series. + multivalued: false + range: SweepTable__series_index + required: true + tree_root: true + SweepTable__series_index: + name: SweepTable__series_index + description: Index for series. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(series_index) + range: string + required: true + equals_string: series_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.image.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.image.yaml new file mode 100644 index 0000000..b914db0 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.image.yaml @@ -0,0 +1,271 @@ +name: core.nwb.image +id: core.nwb.image +version: 2.2.0 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.image/ +classes: + GrayscaleImage: + name: GrayscaleImage + description: A grayscale image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: GrayscaleImage__Array + tree_root: true + GrayscaleImage__Array: + name: GrayscaleImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + RGBImage: + name: RGBImage + description: A color image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBImage__Array + tree_root: true + RGBImage__Array: + name: RGBImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RGBAImage: + name: RGBAImage + description: A color image with transparency. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBAImage__Array + tree_root: true + RGBAImage__Array: + name: RGBAImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b, a: + name: r, g, b, a + range: numeric + required: true + minimum_cardinality: 4 + maximum_cardinality: 4 + ImageSeries: + name: ImageSeries + description: General image data that is common between acquisition and stimulus + time series. Sometimes the image data is stored in the file in a raw format + while other times it will be stored as a series of external image files in the + host file system. The data field will either be binary data, if the data is + stored in the NWB file, or empty, if the data is stored in an external image + stack. [frame][x][y] or [frame][x][y][z]. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Binary data representing images across frames. + multivalued: false + range: ImageSeries__data + required: false + dimension: + name: dimension + description: Number of pixels on x, y, (and z) axes. + multivalued: true + range: int32 + required: false + external_file: + name: external_file + description: Paths to one or more external file(s). The field is only present + if format='external'. This is only relevant if the image series is stored + in the file system as one or more image file(s). This field should NOT be + used if the image is stored in another NWB file and that file is linked + to this file. + multivalued: true + range: text + required: false + format: + name: format + description: Format of image. If this is 'external', then the attribute 'external_file' + contains the path information to the image files. If this is 'raw', then + the raw (single-channel) binary data is stored in the 'data' dataset. If + this attribute is not present, then the default format='raw' case is assumed. + multivalued: false + range: text + required: false + tree_root: true + ImageSeries__data: + name: ImageSeries__data + description: Binary data representing images across frames. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: ImageSeries__data__Array + ImageSeries__data__Array: + name: ImageSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + z: + name: z + range: numeric + required: false + ImageMaskSeries: + name: ImageMaskSeries + description: An alpha mask that is applied to a presented visual stimulus. The + 'data' array contains an array of mask values that are applied to the displayed + image. Mask values are stored as RGBA. Mask can vary with time. The timestamps + array indicates the starting time of a mask, and that mask pattern continues + until it's explicitly changed. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + tree_root: true + OpticalSeries: + name: OpticalSeries + description: Image data that is presented or recorded. A stimulus template movie + will be stored only as an image. When the image is presented as stimulus, additional + data is required, such as field of view (e.g., how much of the visual field + the image covers, or how what is the area of the target being imaged). If the + OpticalSeries represents acquired imaging data, orientation is also important. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + distance: + name: distance + description: Distance from camera/monitor to target/eye. + multivalued: false + range: float32 + required: false + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: OpticalSeries__field_of_view + required: false + orientation: + name: orientation + description: Description of image relative to some reference frame (e.g., + which way is up). Must also specify frame of reference. + multivalued: false + range: text + required: false + tree_root: true + OpticalSeries__field_of_view: + name: OpticalSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: OpticalSeries__field_of_view__Array + OpticalSeries__field_of_view__Array: + name: OpticalSeries__field_of_view__Array + is_a: Arraylike + attributes: + width, height: + name: width, height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width, height, depth: + name: width, height, depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + IndexSeries: + name: IndexSeries + description: Stores indices to image frames stored in an ImageSeries. The purpose + of the ImageIndexSeries is to allow a static image stack to be stored somewhere, + and the images in the stack to be referenced out-of-order. This can be for the + display of individual images, or of movie segments (as a movie is simply a series + of images). The data field stores the index of the frame in the referenced ImageSeries, + and the timestamps array indicates when that image was displayed. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Index of the frame in the referenced ImageSeries. + multivalued: true + range: int32 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.language.yaml similarity index 96% rename from nwb_linkml/src/nwb_linkml/schema/nwb.language.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.language.yaml index ae86525..c57e91f 100644 --- a/nwb_linkml/src/nwb_linkml/schema/nwb.language.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.language.yaml @@ -1,4 +1,4 @@ -name: nwb.language +name: core.nwb.language description: Adapter objects to mimic the behavior of elements in the nwb-schema-language id: nwb.language imports: @@ -9,15 +9,9 @@ prefixes: prefix_reference: https://w3id.org/linkml default_prefix: nwb.language/ types: - float: - name: float - typeof: float float32: name: float32 typeof: float - double: - name: double - typeof: double float64: name: float64 typeof: double diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.misc.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.misc.yaml new file mode 100644 index 0000000..9867765 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.misc.yaml @@ -0,0 +1,406 @@ +name: core.nwb.misc +id: core.nwb.misc +version: 2.2.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_0/namespace +- core.nwb.ecephys +- core.nwb.language +default_prefix: core.nwb.misc/ +classes: + AbstractFeatureSeries: + name: AbstractFeatureSeries + description: Abstract features, such as quantitative descriptions of sensory stimuli. + The TimeSeries::data field is a 2D array, storing those features (e.g., for + visual grating stimulus this might be orientation, spatial frequency and contrast). + Null stimuli (eg, uniform gray) can be marked as being an independent feature + (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, + or through use of the TimeSeries::control fields. A set of features is considered + to persist until the next set of features is defined. The final set of features + stored should be the null set. This is useful when storing the raw stimulus + is impractical. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Values of each feature at each time. + multivalued: false + range: AbstractFeatureSeries__data + required: true + feature_units: + name: feature_units + description: Units of each feature. + multivalued: true + range: text + required: false + features: + name: features + description: Description of the features represented in TimeSeries::data. + multivalued: true + range: text + required: true + tree_root: true + AbstractFeatureSeries__data: + name: AbstractFeatureSeries__data + description: Values of each feature at each time. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Since there can be different units for different features, store + the units in 'feature_units'. The default value for this attribute is "see + 'feature_units'". + range: text + array: + name: array + range: AbstractFeatureSeries__data__Array + AbstractFeatureSeries__data__Array: + name: AbstractFeatureSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + AnnotationSeries: + name: AnnotationSeries + description: Stores user annotations made during an experiment. The data[] field + stores a text array, and timestamps are stored for each annotation (ie, interval=1). + This is largely an alias to a standard TimeSeries storing a text array but that + is identifiable as storing annotations in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Annotations made during an experiment. + multivalued: true + range: text + required: true + tree_root: true + IntervalSeries: + name: IntervalSeries + description: Stores intervals of data. The timestamps field stores the beginning + and end of intervals. The data field stores whether the interval just started + (>0 value) or ended (<0 value). Different interval types can be represented + in the same series by using multiple key values (eg, 1 for feature A, 2 for + feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This + is largely an alias of a standard TimeSeries but that is identifiable as representing + time intervals in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Use values >0 if interval started, <0 if interval ended. + multivalued: true + range: int8 + required: true + tree_root: true + DecompositionSeries: + name: DecompositionSeries + description: Spectral analysis of a time series, e.g. of an LFP or a speech signal. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Data decomposed into frequency bands. + multivalued: false + range: DecompositionSeries__data + required: true + metric: + name: metric + description: The metric used, e.g. phase, amplitude, power. + multivalued: false + range: text + required: true + bands: + name: bands + description: Table for describing the bands that this series was generated + from. There should be one row in this table for each band. + multivalued: false + range: DecompositionSeries__bands + required: true + tree_root: true + DecompositionSeries__data: + name: DecompositionSeries__data + description: Data decomposed into frequency bands. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: DecompositionSeries__data__Array + DecompositionSeries__data__Array: + name: DecompositionSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: true + num_bands: + name: num_bands + range: numeric + required: true + DecompositionSeries__bands: + name: DecompositionSeries__bands + description: Table for describing the bands that this series was generated from. + There should be one row in this table for each band. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(bands) + range: string + required: true + equals_string: bands + band_name: + name: band_name + description: Name of the band, e.g. theta. + multivalued: true + range: text + band_limits: + name: band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + multivalued: false + range: DecompositionSeries__bands__band_limits + required: true + band_mean: + name: band_mean + description: The mean Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + band_stdev: + name: band_stdev + description: The standard deviation of Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + DecompositionSeries__bands__band_limits: + name: DecompositionSeries__bands__band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(band_limits) + range: string + required: true + equals_string: band_limits + Units: + name: Units + description: Data about spiking units. Event times of observed units (e.g. cell, + synapse, etc.) should be concatenated and stored in spike_times. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + spike_times_index: + name: spike_times_index + description: Index into the spike_times dataset. + multivalued: false + range: Units__spike_times_index + required: false + spike_times: + name: spike_times + description: Spike times for each unit. + multivalued: false + range: Units__spike_times + required: false + obs_intervals_index: + name: obs_intervals_index + description: Index into the obs_intervals dataset. + multivalued: false + range: Units__obs_intervals_index + required: false + obs_intervals: + name: obs_intervals + description: Observation intervals for each unit. + multivalued: false + range: Units__obs_intervals + required: false + electrodes_index: + name: electrodes_index + description: Index into electrodes. + multivalued: false + range: Units__electrodes_index + required: false + electrodes: + name: electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + multivalued: false + range: Units__electrodes + required: false + electrode_group: + name: electrode_group + description: Electrode group that each spike unit came from. + multivalued: true + range: ElectrodeGroup + waveform_mean: + name: waveform_mean + description: Spike waveform mean for each spike unit. + multivalued: false + range: Units__waveform_mean + required: false + waveform_sd: + name: waveform_sd + description: Spike waveform standard deviation for each spike unit. + multivalued: false + range: Units__waveform_sd + required: false + tree_root: true + Units__spike_times_index: + name: Units__spike_times_index + description: Index into the spike_times dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(spike_times_index) + range: string + required: true + equals_string: spike_times_index + Units__spike_times: + name: Units__spike_times + description: Spike times for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(spike_times) + range: string + required: true + equals_string: spike_times + resolution: + name: resolution + description: The smallest possible difference between two spike times. Usually + 1 divided by the acquisition sampling rate from which spike times were extracted, + but could be larger if the acquisition time series was downsampled or smaller + if the acquisition time series was smoothed/interpolated and it is possible + for the spike time to be between samples. + range: float64 + Units__obs_intervals_index: + name: Units__obs_intervals_index + description: Index into the obs_intervals dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(obs_intervals_index) + range: string + required: true + equals_string: obs_intervals_index + Units__obs_intervals: + name: Units__obs_intervals + description: Observation intervals for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(obs_intervals) + range: string + required: true + equals_string: obs_intervals + Units__electrodes_index: + name: Units__electrodes_index + description: Index into electrodes. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(electrodes_index) + range: string + required: true + equals_string: electrodes_index + Units__electrodes: + name: Units__electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + Units__waveform_mean: + name: Units__waveform_mean + description: Spike waveform mean for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveform_sd: + name: Units__waveform_sd + description: Spike waveform standard deviation for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.ogen.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.ogen.yaml similarity index 97% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.ogen.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.ogen.yaml index 116c91e..5bf7e3c 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.ogen.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.ogen.yaml @@ -1,9 +1,10 @@ name: core.nwb.ogen id: core.nwb.ogen +version: 2.2.0 imports: - core.nwb.base - core.nwb.device -- nwb.language +- core.nwb.language default_prefix: core.nwb.ogen/ classes: OptogeneticSeries: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.ophys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.ophys.yaml new file mode 100644 index 0000000..3003a66 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.ophys.yaml @@ -0,0 +1,546 @@ +name: core.nwb.ophys +id: core.nwb.ophys +version: 2.2.0 +imports: +- core.nwb.image +- core.nwb.base +- ../../hdmf_common/v1_1_0/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ophys/ +classes: + TwoPhotonSeries: + name: TwoPhotonSeries + description: Image stack recorded over time from 2-photon microscope. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + pmt_gain: + name: pmt_gain + description: Photomultiplier gain. + range: float32 + scan_line_rate: + name: scan_line_rate + description: Lines imaged per second. This is also stored in /general/optophysiology + but is kept here as it is useful information for analysis, and so good to + be stored w/ the actual data. + range: float32 + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: TwoPhotonSeries__field_of_view + required: false + tree_root: true + TwoPhotonSeries__field_of_view: + name: TwoPhotonSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: TwoPhotonSeries__field_of_view__Array + TwoPhotonSeries__field_of_view__Array: + name: TwoPhotonSeries__field_of_view__Array + is_a: Arraylike + attributes: + width|height: + name: width|height + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + width|height|depth: + name: width|height|depth + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RoiResponseSeries: + name: RoiResponseSeries + description: ROI responses over an imaging plane. The first dimension represents + time. The second dimension, if present, represents ROIs. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Signals from ROIs. + multivalued: false + range: RoiResponseSeries__data + required: true + rois: + name: rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + multivalued: false + range: RoiResponseSeries__rois + required: true + tree_root: true + RoiResponseSeries__data: + name: RoiResponseSeries__data + description: Signals from ROIs. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: RoiResponseSeries__data__Array + RoiResponseSeries__data__Array: + name: RoiResponseSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_ROIs: + name: num_ROIs + range: numeric + required: false + RoiResponseSeries__rois: + name: RoiResponseSeries__rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(rois) + range: string + required: true + equals_string: rois + DfOverF: + name: DfOverF + description: dF/F information about a region of interest (ROI). Storage hierarchy + of dF/F should be the same as for segmentation (i.e., same names for ROIs and + for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing dF/F for a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + Fluorescence: + name: Fluorescence + description: Fluorescence information about a region of interest (ROI). Storage + hierarchy of fluorescence should be the same as for segmentation (ie, same names + for ROIs and for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing fluorescence data for + a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + ImageSegmentation: + name: ImageSegmentation + description: Stores pixels in an image that represent different regions of interest + (ROIs) or masks. All segmentation for a given imaging plane is stored together, + with storage for multiple imaging planes (masks) supported. Each ROI is stored + in its own subgroup, with the ROI group containing both a 2D mask and a list + of pixels that make up this mask. Segments can also be used for masking neuropil. + If segmentation is allowed to change with time, a new imaging plane (or module) + is required and ROI names should remain consistent between them. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + plane_segmentation: + name: plane_segmentation + description: Results from image segmentation of a specific imaging plane. + multivalued: true + range: PlaneSegmentation + required: true + tree_root: true + PlaneSegmentation: + name: PlaneSegmentation + description: Results from image segmentation of a specific imaging plane. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + image_mask: + name: image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + multivalued: false + range: PlaneSegmentation__image_mask + required: false + pixel_mask_index: + name: pixel_mask_index + description: Index into pixel_mask. + multivalued: false + range: PlaneSegmentation__pixel_mask_index + required: false + pixel_mask: + name: pixel_mask + description: 'Pixel masks for each ROI: a list of indices and weights for + the ROI. Pixel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + voxel_mask_index: + name: voxel_mask_index + description: Index into voxel_mask. + multivalued: false + range: PlaneSegmentation__voxel_mask_index + required: false + voxel_mask: + name: voxel_mask + description: 'Voxel masks for each ROI: a list of indices and weights for + the ROI. Voxel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + reference_images: + name: reference_images + description: Image stacks that the segmentation masks apply to. + multivalued: true + any_of: + - range: ImageSeries + PlaneSegmentation__image_mask: + name: PlaneSegmentation__image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(image_mask) + range: string + required: true + equals_string: image_mask + PlaneSegmentation__pixel_mask_index: + name: PlaneSegmentation__pixel_mask_index + description: Index into pixel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(pixel_mask_index) + range: string + required: true + equals_string: pixel_mask_index + PlaneSegmentation__voxel_mask_index: + name: PlaneSegmentation__voxel_mask_index + description: Index into voxel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(voxel_mask_index) + range: string + required: true + equals_string: voxel_mask_index + ImagingPlane: + name: ImagingPlane + description: An imaging plane and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the imaging plane. + multivalued: false + range: text + required: false + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + imaging_rate: + name: imaging_rate + description: Rate that images are acquired, in Hz. + multivalued: false + range: float32 + required: true + indicator: + name: indicator + description: Calcium indicator. + multivalued: false + range: text + required: true + location: + name: location + description: Location of the imaging plane. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + manifold: + name: manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents + the position of the pixel relative to the defined coordinate space. Deprecated + in favor of origin_coords and grid_spacing. + multivalued: false + range: ImagingPlane__manifold + required: false + origin_coords: + name: origin_coords + description: Physical location of the first element of the imaging plane (0, + 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for + what the physical location is relative to (e.g., bregma). + multivalued: false + range: ImagingPlane__origin_coords + required: false + grid_spacing: + name: grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also + reference_frame to interpret the grid. + multivalued: false + range: ImagingPlane__grid_spacing + required: false + reference_frame: + name: reference_frame + description: Describes reference frame of origin_coords and grid_spacing. + For example, this can be a text description of the anatomical location and + orientation of the grid defined by origin_coords and grid_spacing or the + vectors needed to transform or rotate the grid to a common anatomical axis + (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and + grid_spacing. If origin_coords and grid_spacing are not present, then this + field is not required. For example, if the microscope takes 10 x 10 x 2 + images, where the first value of the data matrix (index (0, 0, 0)) corresponds + to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is + 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means + more anterior, larger numbers in y means more rightward, and larger numbers + in z means more ventral, then enter the following -- origin_coords = (-1.2, + -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = "Origin coordinates + are relative to bregma. First dimension corresponds to anterior-posterior + axis (larger index = more anterior). Second dimension corresponds to medial-lateral + axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral + axis (larger index = more ventral)." + multivalued: false + range: text + required: false + optical_channel: + name: optical_channel + description: An optical channel used to record from an imaging plane. + multivalued: false + range: OpticalChannel + required: true + tree_root: true + ImagingPlane__manifold: + name: ImagingPlane__manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents the + position of the pixel relative to the defined coordinate space. Deprecated in + favor of origin_coords and grid_spacing. + attributes: + name: + name: name + ifabsent: string(manifold) + range: string + required: true + equals_string: manifold + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as pixels from + x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then + the 'conversion' multiplier to get from raw data acquisition pixel units + to meters is 2/1000. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__manifold__Array + ImagingPlane__manifold__Array: + name: ImagingPlane__manifold__Array + is_a: Arraylike + attributes: + height: + name: height + range: float32 + required: true + width: + name: width + range: float32 + required: true + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + depth: + name: depth + range: float32 + required: false + ImagingPlane__origin_coords: + name: ImagingPlane__origin_coords + description: Physical location of the first element of the imaging plane (0, 0) + for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the + physical location is relative to (e.g., bregma). + attributes: + name: + name: name + ifabsent: string(origin_coords) + range: string + required: true + equals_string: origin_coords + unit: + name: unit + description: Measurement units for origin_coords. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__origin_coords__Array + ImagingPlane__origin_coords__Array: + name: ImagingPlane__origin_coords__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + ImagingPlane__grid_spacing: + name: ImagingPlane__grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame + to interpret the grid. + attributes: + name: + name: name + ifabsent: string(grid_spacing) + range: string + required: true + equals_string: grid_spacing + unit: + name: unit + description: Measurement units for grid_spacing. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__grid_spacing__Array + ImagingPlane__grid_spacing__Array: + name: ImagingPlane__grid_spacing__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalChannel: + name: OpticalChannel + description: An optical channel used to record from an imaging plane. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description or other notes about the channel. + multivalued: false + range: text + required: true + emission_lambda: + name: emission_lambda + description: Emission wavelength for channel, in nm. + multivalued: false + range: float32 + required: true + MotionCorrection: + name: MotionCorrection + description: 'An image stack where all frames are shifted (registered) to a common + coordinate system, to account for movement and drift between frames. Note: each + frame at each point in time is assumed to be 2-D (has only x & y dimensions).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected_image_stack: + name: corrected_image_stack + description: Reuslts from motion correction of an image stack. + multivalued: true + range: CorrectedImageStack + required: true + tree_root: true + CorrectedImageStack: + name: CorrectedImageStack + description: Reuslts from motion correction of an image stack. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected: + name: corrected + description: Image stack with frames shifted to the common coordinates. + multivalued: false + range: ImageSeries + required: true + xy_translation: + name: xy_translation + description: Stores the x,y delta necessary to align each frame to the common + coordinates, for example, to align each frame to a reference image. + multivalued: false + range: TimeSeries + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.retinotopy.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.retinotopy.yaml new file mode 100644 index 0000000..d82526b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/core.nwb.retinotopy.yaml @@ -0,0 +1,256 @@ +name: core.nwb.retinotopy +id: core.nwb.retinotopy +version: 2.2.0 +imports: +- core.nwb.base +- core.nwb.image +- core.nwb.language +default_prefix: core.nwb.retinotopy/ +classes: + RetinotopyMap: + name: RetinotopyMap + description: 'Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns]' + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + array: + name: array + range: RetinotopyMap__Array + tree_root: true + RetinotopyMap__Array: + name: RetinotopyMap__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + AxisMap: + name: AxisMap + description: Abstract two-dimensional map of responses to stimuli along a single + response axis (e.g. eccentricity) + is_a: RetinotopyMap + attributes: + name: + name: name + range: string + required: true + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: AxisMap__Array + tree_root: true + AxisMap__Array: + name: AxisMap__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + RetinotopyImage: + name: RetinotopyImage + description: 'Gray-scale image related to retinotopic mapping. Array structure: + [num_rows][num_columns]' + is_a: GrayscaleImage + attributes: + name: + name: name + range: string + required: true + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value. + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + tree_root: true + ImagingRetinotopy: + name: ImagingRetinotopy + description: 'Intrinsic signal optical imaging or widefield imaging for measuring + retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of + responses to specific stimuli and a combined polarity map from which to identify + visual areas. NOTE: for data consistency, all images and arrays are stored in + the format [row][column] and [row, col], which equates to [y][x]. Field of view + and dimension arrays may appear backward (i.e., y before x).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + axis_1_phase_map: + name: axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + multivalued: false + range: ImagingRetinotopy__axis_1_phase_map + required: true + axis_1_power_map: + name: axis_1_power_map + description: Power response on the first measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_1_power_map + required: false + axis_2_phase_map: + name: axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_phase_map + required: true + axis_2_power_map: + name: axis_2_power_map + description: Power response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_power_map + required: false + sign_map: + name: sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + multivalued: false + range: ImagingRetinotopy__sign_map + required: true + axis_descriptions: + name: axis_descriptions + description: Two-element array describing the contents of the two response + axis fields. Description should be something like ['altitude', 'azimuth'] + or '['radius', 'theta']. + multivalued: true + range: text + required: true + focal_depth_image: + name: focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., + focal depth, wavelength) as data collection. Array format: [rows][columns].' + multivalued: false + range: ImagingRetinotopy__focal_depth_image + required: true + vasculature_image: + name: vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + multivalued: false + range: ImagingRetinotopy__vasculature_image + required: true + tree_root: true + ImagingRetinotopy__axis_1_phase_map: + name: ImagingRetinotopy__axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + is_a: AxisMap + attributes: + name: + name: name + ifabsent: string(axis_1_phase_map) + range: string + required: true + equals_string: axis_1_phase_map + ImagingRetinotopy__axis_1_power_map: + name: ImagingRetinotopy__axis_1_power_map + description: Power response on the first measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + is_a: AxisMap + attributes: + name: + name: name + ifabsent: string(axis_1_power_map) + range: string + required: true + equals_string: axis_1_power_map + ImagingRetinotopy__axis_2_phase_map: + name: ImagingRetinotopy__axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + is_a: AxisMap + attributes: + name: + name: name + ifabsent: string(axis_2_phase_map) + range: string + required: true + equals_string: axis_2_phase_map + ImagingRetinotopy__axis_2_power_map: + name: ImagingRetinotopy__axis_2_power_map + description: Power response to stimulus on the second measured axis. + is_a: AxisMap + attributes: + name: + name: name + ifabsent: string(axis_2_power_map) + range: string + required: true + equals_string: axis_2_power_map + ImagingRetinotopy__sign_map: + name: ImagingRetinotopy__sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + is_a: RetinotopyMap + attributes: + name: + name: name + ifabsent: string(sign_map) + range: string + required: true + equals_string: sign_map + ImagingRetinotopy__focal_depth_image: + name: ImagingRetinotopy__focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., focal + depth, wavelength) as data collection. Array format: [rows][columns].' + is_a: RetinotopyImage + attributes: + name: + name: name + ifabsent: string(focal_depth_image) + range: string + required: true + equals_string: focal_depth_image + focal_depth: + name: focal_depth + description: Focal depth offset, in meters. + range: float32 + ImagingRetinotopy__vasculature_image: + name: ImagingRetinotopy__vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + is_a: RetinotopyImage + attributes: + name: + name: name + ifabsent: string(vasculature_image) + range: string + required: true + equals_string: vasculature_image diff --git a/nwb_linkml/src/nwb_linkml/schema/core.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/namespace.yaml similarity index 83% rename from nwb_linkml/src/nwb_linkml/schema/core.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/namespace.yaml index 72803e2..9d9e3e8 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_0/namespace.yaml @@ -5,7 +5,7 @@ annotations: value: 'True' description: NWB namespace id: core -version: 2.6.0-alpha +version: 2.2.0 imports: - core.nwb.base - core.nwb.device @@ -19,4 +19,6 @@ imports: - core.nwb.ogen - core.nwb.ophys - core.nwb.retinotopy +- core.nwb.language +- ../../hdmf_common/v1_1_0/namespace default_prefix: core/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.base.yaml new file mode 100644 index 0000000..c7efcc0 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.base.yaml @@ -0,0 +1,303 @@ +name: core.nwb.base +id: core.nwb.base +version: 2.2.1 +imports: +- ../../hdmf_common/v1_1_2/namespace +- core.nwb.language +default_prefix: core.nwb.base/ +classes: + NWBData: + name: NWBData + description: An abstract data type for a dataset. + is_a: Data + attributes: + name: + name: name + range: string + required: true + tree_root: true + Image: + name: Image + description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D + where the third dimension can have three or four elements, e.g. (x, y, (r, g, + b)) or (x, y, (r, g, b, a)). + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + resolution: + name: resolution + description: Pixel resolution of the image, in pixels per centimeter. + range: float32 + description: + name: description + description: Description of the image. + range: text + array: + name: array + range: Image__Array + tree_root: true + Image__Array: + name: Image__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + r, g, b, a: + name: r, g, b, a + range: numeric + required: false + minimum_cardinality: 4 + maximum_cardinality: 4 + NWBContainer: + name: NWBContainer + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + is_a: Container + attributes: + name: + name: name + range: string + required: true + tree_root: true + NWBDataInterface: + name: NWBDataInterface + description: An abstract data type for a generic container storing collections + of data, as opposed to metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeries: + name: TimeSeries + description: General purpose time series. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the time series. + range: text + comments: + name: comments + description: Human-readable comments about the TimeSeries. This second descriptive + field can be used to store additional information, or descriptive information + if the primary description field is populated with a computer-readable string. + range: text + data: + name: data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first + dimension should always represent time. This can also be used to store binary + data (e.g., image frames). This can also be a link to data stored in an + external file. + multivalued: false + range: TimeSeries__data + required: true + starting_time: + name: starting_time + description: Timestamp of the first sample in seconds. When timestamps are + uniformly spaced, the timestamp of the first sample can be specified and + all subsequent ones calculated from the sampling rate attribute. + multivalued: false + range: TimeSeries__starting_time + required: false + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + multivalued: true + range: float64 + required: false + control: + name: control + description: Numerical labels that apply to each time point in data for the + purpose of querying and slicing data by these values. If present, the length + of this array should be the same size as the first dimension of data. + multivalued: true + range: uint8 + required: false + control_description: + name: control_description + description: Description of each control value. Must be present if control + is present. If present, control_description[0] should describe time points + where control == 0. + multivalued: true + range: text + required: false + sync: + name: sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored + external to the NWB file, in files storing raw data. Once timestamp data + is calculated, the contents of 'sync' are mostly for archival purposes. + multivalued: false + range: TimeSeries__sync + required: false + tree_root: true + TimeSeries__data: + name: TimeSeries__data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension + should always represent time. This can also be used to store binary data (e.g., + image frames). This can also be a link to data stored in an external file. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as signed 16-bit + integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V + to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' + multiplier to get from raw data acquisition values to recorded volts is + 2.5/32768/8000 = 9.5367e-9. + range: float32 + resolution: + name: resolution + description: Smallest meaningful difference between values in data, stored + in the specified by unit, e.g., the change in value of the least significant + bit, or a larger number if signal noise is known to be present. If unknown, + use -1.0. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: TimeSeries__data__Array + TimeSeries__data__Array: + name: TimeSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: AnyType + required: true + num_DIM2: + name: num_DIM2 + range: AnyType + required: false + num_DIM3: + name: num_DIM3 + range: AnyType + required: false + num_DIM4: + name: num_DIM4 + range: AnyType + required: false + TimeSeries__starting_time: + name: TimeSeries__starting_time + description: Timestamp of the first sample in seconds. When timestamps are uniformly + spaced, the timestamp of the first sample can be specified and all subsequent + ones calculated from the sampling rate attribute. + attributes: + name: + name: name + ifabsent: string(starting_time) + range: string + required: true + equals_string: starting_time + rate: + name: rate + description: Sampling rate, in Hz. + range: float32 + unit: + name: unit + description: Unit of measurement for time, which is fixed to 'seconds'. + range: text + value: + name: value + range: float64 + required: true + TimeSeries__sync: + name: TimeSeries__sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored external + to the NWB file, in files storing raw data. Once timestamp data is calculated, + the contents of 'sync' are mostly for archival purposes. + attributes: + name: + name: name + ifabsent: string(sync) + range: string + required: true + equals_string: sync + ProcessingModule: + name: ProcessingModule + description: A collection of processed data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of processed data. + range: text + nwb_data_interface: + name: nwb_data_interface + description: Data objects stored in this collection. + multivalued: true + range: NWBDataInterface + required: false + dynamic_table: + name: dynamic_table + description: Tables stored in this collection. + multivalued: true + range: DynamicTable + required: false + tree_root: true + Images: + name: Images + description: A collection of images. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of images. + range: text + image: + name: image + description: Images stored in this collection. + multivalued: true + range: Image + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.behavior.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.behavior.yaml new file mode 100644 index 0000000..03caf75 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.behavior.yaml @@ -0,0 +1,201 @@ +name: core.nwb.behavior +id: core.nwb.behavior +version: 2.2.1 +imports: +- core.nwb.base +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.behavior/ +classes: + SpatialSeries: + name: SpatialSeries + description: 'Direction, e.g., of gaze or travel, or position. The TimeSeries::data + field is a 2D array storing position or direction relative to some reference + frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries + has a text dataset reference_frame that indicates the zero-position, or the + zero-axes for direction. For example, if representing gaze direction, ''straight-ahead'' + might be a specific pixel on the monitor, or some other point in space. For + position data, the 0,0 point might be the top-left corner of an enclosure, as + viewed from the tracking camera. The unit of data will indicate how to interpret + SpatialSeries values.' + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: 1-D or 2-D array storing position or direction relative to some + reference frame. + multivalued: false + range: SpatialSeries__data + required: true + reference_frame: + name: reference_frame + description: Description defining what exactly 'straight-ahead' means. + multivalued: false + range: text + required: false + tree_root: true + SpatialSeries__data: + name: SpatialSeries__data + description: 1-D or 2-D array storing position or direction relative to some reference + frame. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: SpatialSeries__data__Array + SpatialSeries__data__Array: + name: SpatialSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + BehavioralEpochs: + name: BehavioralEpochs + description: TimeSeries for storing behavioral epochs. The objective of this + and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) + is to provide generic hooks for software tools/scripts. This allows a tool/script + to take the output one specific interface (e.g., UnitTimes) and plot that data + relative to another data modality (e.g., behavioral events) without having to + define all possible modalities in advance. Declaring one of these interfaces + means that one or more TimeSeries of the specified type is published. These + TimeSeries should reside in a group having the same name as the interface. For + example, if a BehavioralTimeSeries interface is declared, the module will have + one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. + BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular + events. BehavioralTimeSeries is for continuous data. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + interval_series: + name: interval_series + description: IntervalSeries object containing start and stop times of epochs. + multivalued: true + range: IntervalSeries + required: false + tree_root: true + BehavioralEvents: + name: BehavioralEvents + description: TimeSeries for storing behavioral events. See description of BehavioralEpochs + for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing behavioral events. + multivalued: true + range: TimeSeries + required: false + tree_root: true + BehavioralTimeSeries: + name: BehavioralTimeSeries + description: TimeSeries for storing Behavoioral time series data. See description + of BehavioralEpochs for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing continuous behavioral data. + multivalued: true + range: TimeSeries + required: false + tree_root: true + PupilTracking: + name: PupilTracking + description: Eye-tracking data, representing pupil size. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing time series data on pupil size. + multivalued: true + range: TimeSeries + required: true + tree_root: true + EyeTracking: + name: EyeTracking + description: Eye-tracking data, representing direction of gaze. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing data measuring direction of gaze. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + CompassDirection: + name: CompassDirection + description: With a CompassDirection interface, a module publishes a SpatialSeries + object representing a floating point value for theta. The SpatialSeries::reference_frame + field should indicate what direction corresponds to 0 and which is the direction + of rotation (this should be clockwise). The si_unit for the SpatialSeries should + be radians or degrees. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing direction of gaze travel. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + Position: + name: Position + description: Position data, whether along the x, x/y or x/y/z axis. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing position data. + multivalued: true + range: SpatialSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.device.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.device.yaml new file mode 100644 index 0000000..fc2b8af --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.device.yaml @@ -0,0 +1,28 @@ +name: core.nwb.device +id: core.nwb.device +version: 2.2.1 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.device/ +classes: + Device: + name: Device + description: Metadata about a data acquisition device, e.g., recording system, + electrode, microscope. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the device (e.g., model, firmware version, processing + software version, etc.) as free-form text. + range: text + manufacturer: + name: manufacturer + description: The name of the manufacturer of the device. + range: text + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.ecephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.ecephys.yaml new file mode 100644 index 0000000..81c7343 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.ecephys.yaml @@ -0,0 +1,492 @@ +name: core.nwb.ecephys +id: core.nwb.ecephys +version: 2.2.1 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_2/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ecephys/ +classes: + ElectricalSeries: + name: ElectricalSeries + description: A time series of acquired voltage data from extracellular recordings. + The data field is an int or float array storing data in volts. The first dimension + should always represent time. The second dimension, if present, should represent + channels. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage data. + multivalued: false + range: ElectricalSeries__data + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: ElectricalSeries__electrodes + required: true + channel_conversion: + name: channel_conversion + description: Channel-specific conversion factor. Multiply the data in the + 'data' dataset by these values along the channel axis (as indicated by axis + attribute) AND by the global conversion factor in the 'conversion' attribute + of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion + * channel_conversion. This approach allows for both global and per-channel + data conversion factors needed to support the storage of electrical recordings + as native values generated by data acquisition systems. If this dataset + is not present, then there is no channel-specific conversion factor, i.e. + it is 1 for all channels. + multivalued: true + range: float32 + required: false + tree_root: true + ElectricalSeries__data: + name: ElectricalSeries__data + description: Recorded voltage data. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. This value + is fixed to 'volts'. Actual stored values are not necessarily stored in + these units. To access the data in these units, multiply 'data' by 'conversion' + and 'channel_conversion' (if present). + range: text + array: + name: array + range: ElectricalSeries__data__Array + ElectricalSeries__data__Array: + name: ElectricalSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + num_samples: + name: num_samples + range: numeric + required: false + ElectricalSeries__electrodes: + name: ElectricalSeries__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + SpikeEventSeries: + name: SpikeEventSeries + description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold + crossings). This may also be raw data, as reported by ephys hardware. If so, + the TimeSeries::description field should describe how events were detected. + All SpikeEventSeries should reside in a module (under EventWaveform interface) + even if the spikes were reported and stored by hardware. All events span the + same recording channels and store snapshots of equal duration. TimeSeries::data + array structure: [num events] [num channels] [num samples] (or [num events] + [num samples] for single electrode).' + is_a: ElectricalSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Spike waveforms. + multivalued: false + range: SpikeEventSeries__data + required: true + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + Timestamps are required for the events. Unlike for TimeSeries, timestamps + are required for SpikeEventSeries and are thus re-specified here. + multivalued: true + range: float64 + required: true + tree_root: true + SpikeEventSeries__data: + name: SpikeEventSeries__data + description: Spike waveforms. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Unit of measurement for waveforms, which is fixed to 'volts'. + range: text + array: + name: array + range: SpikeEventSeries__data__Array + SpikeEventSeries__data__Array: + name: SpikeEventSeries__data__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: numeric + required: true + num_samples: + name: num_samples + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + FeatureExtraction: + name: FeatureExtraction + description: Features, such as PC1 and PC2, that are extracted from signals stored + in a SpikeEventSeries or other source. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of features (eg, ''PC1'') for each of the extracted + features. + multivalued: true + range: text + required: true + features: + name: features + description: Multi-dimensional array of features extracted from each event. + multivalued: false + range: FeatureExtraction__features + required: true + times: + name: times + description: Times of events that features correspond to (can be a link). + multivalued: true + range: float64 + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: FeatureExtraction__electrodes + required: true + tree_root: true + FeatureExtraction__features: + name: FeatureExtraction__features + description: Multi-dimensional array of features extracted from each event. + attributes: + name: + name: name + ifabsent: string(features) + range: string + required: true + equals_string: features + array: + name: array + range: FeatureExtraction__features__Array + FeatureExtraction__features__Array: + name: FeatureExtraction__features__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: float32 + required: true + num_channels: + name: num_channels + range: float32 + required: true + num_features: + name: num_features + range: float32 + required: true + FeatureExtraction__electrodes: + name: FeatureExtraction__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + EventDetection: + name: EventDetection + description: Detected spike events from voltage trace(s). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + detection_method: + name: detection_method + description: Description of how events were detected, such as voltage threshold, + or dV/dT threshold, as well as relevant values. + multivalued: false + range: text + required: true + source_idx: + name: source_idx + description: Indices (zero-based) into source ElectricalSeries::data array + corresponding to time of event. ''description'' should define what is meant + by time of event (e.g., .25 ms before action potential peak, zero-crossing + time, etc). The index points to each event from the raw data. + multivalued: true + range: int32 + required: true + times: + name: times + description: Timestamps of events, in seconds. + multivalued: true + range: float64 + required: true + tree_root: true + EventWaveform: + name: EventWaveform + description: Represents either the waveforms of detected events, as extracted + from a raw data trace in /acquisition, or the event waveforms that were stored + during experiment acquisition. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spike_event_series: + name: spike_event_series + description: SpikeEventSeries object(s) containing detected spike event waveforms. + multivalued: true + range: SpikeEventSeries + required: false + tree_root: true + FilteredEphys: + name: FilteredEphys + description: Electrophysiology data from one or more channels that has been subjected + to filtering. Examples of filtered data include Theta and Gamma (LFP has its + own interface). FilteredEphys modules publish an ElectricalSeries for each filtered + channel or set of channels. The name of each ElectricalSeries is arbitrary but + should be informative. The source of the filtered data, whether this is from + analysis of another time series or as acquired by hardware, should be noted + in each's TimeSeries::description field. There is no assumed 1::1 correspondence + between filtered ephys signals and electrodes, as a single signal can apply + to many nearby electrodes, and one electrode may have different filtered (e.g., + theta and/or gamma) signals represented. Filter properties should be noted in + the ElectricalSeries. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing filtered electrophysiology + data. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + LFP: + name: LFP + description: LFP data from one or more channels. The electrode map in each published + ElectricalSeries will identify which channels are providing LFP data. Filter + properties should be noted in the ElectricalSeries description or comments field. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing LFP data for one or more + channels. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + ElectrodeGroup: + name: ElectrodeGroup + description: A physical grouping of electrodes, e.g. a shank of an array. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this electrode group. + range: text + location: + name: location + description: Location of electrode group. Specify the area, layer, comments + on estimation of area/layer, etc. Use standard atlas names for anatomical + regions when possible. + range: text + position: + name: position + description: stereotaxic or common framework coordinates + multivalued: false + range: AnyType + required: false + tree_root: true + ClusterWaveforms: + name: ClusterWaveforms + description: DEPRECATED The mean waveform shape, including standard deviation, + of the different clusters. Ideally, the waveform analysis should be performed + on data that is only high-pass filtered. This is a separate module because it + is expected to require updating. For example, IMEC probes may require different + storage requirements to store/display mean waveforms, requiring a new interface + or an extension of this one. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + waveform_filtering: + name: waveform_filtering + description: Filtering applied to data before generating mean/sd + multivalued: false + range: text + required: true + waveform_mean: + name: waveform_mean + description: The mean waveform for each cluster, using the same indices for + each wave as cluster numbers in the associated Clustering module (i.e, cluster + 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence + should be empty (e.g., zero- filled) + multivalued: false + range: ClusterWaveforms__waveform_mean + required: true + waveform_sd: + name: waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as + in mean + multivalued: false + range: ClusterWaveforms__waveform_sd + required: true + tree_root: true + ClusterWaveforms__waveform_mean: + name: ClusterWaveforms__waveform_mean + description: The mean waveform for each cluster, using the same indices for each + wave as cluster numbers in the associated Clustering module (i.e, cluster 3 + is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should + be empty (e.g., zero- filled) + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + array: + name: array + range: ClusterWaveforms__waveform_mean__Array + ClusterWaveforms__waveform_mean__Array: + name: ClusterWaveforms__waveform_mean__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + ClusterWaveforms__waveform_sd: + name: ClusterWaveforms__waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as in + mean + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + array: + name: array + range: ClusterWaveforms__waveform_sd__Array + ClusterWaveforms__waveform_sd__Array: + name: ClusterWaveforms__waveform_sd__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + Clustering: + name: Clustering + description: DEPRECATED Clustered spike data, whether from automatic clustering + tools (e.g., klustakwik) or as a result of manual sorting. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of clusters or clustering, (e.g. cluster 0 is noise, + clusters curated using Klusters, etc) + multivalued: false + range: text + required: true + num: + name: num + description: Cluster number of each event + multivalued: true + range: int32 + required: true + peak_over_rms: + name: peak_over_rms + description: Maximum ratio of waveform peak to RMS on any channel in the cluster + (provides a basic clustering metric). + multivalued: true + range: float32 + required: true + times: + name: times + description: Times of clustered events, in seconds. This may be a link to + times field in associated FeatureExtraction module. + multivalued: true + range: float64 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.epoch.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.epoch.yaml new file mode 100644 index 0000000..54ca85d --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.epoch.yaml @@ -0,0 +1,74 @@ +name: core.nwb.epoch +id: core.nwb.epoch +version: 2.2.1 +imports: +- ../../hdmf_common/v1_1_2/namespace +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.epoch/ +classes: + TimeIntervals: + name: TimeIntervals + description: A container for aggregating epoch data and the TimeSeries that each + epoch applies to. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + start_time: + name: start_time + description: Start time of epoch, in seconds. + multivalued: true + range: float32 + stop_time: + name: stop_time + description: Stop time of epoch, in seconds. + multivalued: true + range: float32 + tags: + name: tags + description: User-defined tags that identify or categorize events. + multivalued: true + range: text + tags_index: + name: tags_index + description: Index for tags. + multivalued: false + range: TimeIntervals__tags_index + required: false + timeseries: + name: timeseries + description: An index into a TimeSeries object. + multivalued: true + range: AnyType + timeseries_index: + name: timeseries_index + description: Index for timeseries. + multivalued: false + range: TimeIntervals__timeseries_index + required: false + tree_root: true + TimeIntervals__tags_index: + name: TimeIntervals__tags_index + description: Index for tags. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(tags_index) + range: string + required: true + equals_string: tags_index + TimeIntervals__timeseries_index: + name: TimeIntervals__timeseries_index + description: Index for timeseries. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(timeseries_index) + range: string + required: true + equals_string: timeseries_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.file.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.file.yaml new file mode 100644 index 0000000..8a6bd5d --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.file.yaml @@ -0,0 +1,636 @@ +name: core.nwb.file +id: core.nwb.file +version: 2.2.1 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_2/namespace +- core.nwb.device +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.epoch +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.file/ +classes: + NWBFile: + name: NWBFile + description: An NWB:N file storing cellular-based neurophysiology data from a + single experimental session. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(root) + range: string + required: true + equals_string: root + nwb_version: + name: nwb_version + description: File version string. Use semantic versioning, e.g. 1.2.1. This + will be the name of the format with trailing major, minor and patch numbers. + range: text + file_create_date: + name: file_create_date + description: 'A record of the date the file was created and of subsequent + modifications. The date is stored in UTC with local timezone offset as ISO + 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored + in UTC end in "Z" with no timezone offset. Date accuracy is up to milliseconds. + The file can be created after the experiment was run, so this may differ + from the experiment start time. Each modification to the nwb file adds a + new entry to the array.' + multivalued: true + range: isodatetime + required: true + identifier: + name: identifier + description: A unique text identifier for the file. For example, concatenated + lab name, file creation date/time and experimentalist, or a hash of these + and/or other values. The goal is that the string should be unique to all + other files. + multivalued: false + range: text + required: true + session_description: + name: session_description + description: A description of the experimental session and data in the file. + multivalued: false + range: text + required: true + session_start_time: + name: session_start_time + description: 'Date and time of the experiment/session start. The date is stored + in UTC with local timezone offset as ISO 8601 extended formatted string: + 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in "Z" with no timezone + offset. Date accuracy is up to milliseconds.' + multivalued: false + range: isodatetime + required: true + timestamps_reference_time: + name: timestamps_reference_time + description: 'Date and time corresponding to time zero of all timestamps. + The date is stored in UTC with local timezone offset as ISO 8601 extended + formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end + in "Z" with no timezone offset. Date accuracy is up to milliseconds. All + times stored in the file use this time as reference (i.e., time zero).' + multivalued: false + range: isodatetime + required: true + acquisition: + name: acquisition + description: Data streams recorded from the system, including ephys, ophys, + tracking, etc. This group should be read-only after the experiment is completed + and timestamps are corrected to a common timebase. The data stored here + may be links to raw data stored in external NWB files. This will allow keeping + bulky raw data out of the file while preserving the option of keeping some/all + in the file. Acquired data includes tracking and experimental data streams + (i.e., everything measured from the system). If bulky data is stored in + the /acquisition group, the data can exist in a separate NWB file that is + linked to by the file being used for processing and analysis. + multivalued: true + any_of: + - range: NWBDataInterface + - range: DynamicTable + analysis: + name: analysis + description: Lab-specific and custom scientific analysis of data. There is + no defined format for the content of this group - the format is up to the + individual user/lab. To facilitate sharing analysis data between labs, the + contents here should be stored in standard types (e.g., neurodata_types) + and appropriately documented. The file can store lab-specific and custom + data analysis without restriction on its form or schema, reducing data formatting + restrictions on end users. Such data should be placed in the analysis group. + The analysis data should be documented so that it could be shared with other + labs. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + scratch: + name: scratch + description: A place to store one-off analysis results. Data placed here is + not intended for sharing. By placing data here, users acknowledge that there + is no guarantee that their data meets any standard. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + processing: + name: processing + description: The home for ProcessingModules. These modules perform intermediate + analysis of data that is necessary to perform before scientific analysis. + Examples include spike clustering, extracting position from tracking data, + stitching together image slices. ProcessingModules can be large and express + many data sets from relatively complex analysis (e.g., spike detection and + clustering) or small, representing extraction of position information from + tracking video, or even binary lick/no-lick decisions. Common software tools + (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' + refers to intermediate analysis of the acquired data to make it more amenable + to scientific analysis. + multivalued: true + any_of: + - range: ProcessingModule + stimulus: + name: stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment + complete and timestamps are corrected to common timebase. Stores both presented + stimuli and stimulus templates, the latter in case the same stimulus is + presented multiple times, or is pulled from an external stimulus library. + Stimuli are here defined as any signal that is pushed into the system as + part of the experiment (eg, sound, video, voltage, etc). Many different + experiments can use the same stimuli, and stimuli can be re-used during + an experiment. The stimulus group is organized so that one version of template + stimuli can be stored and these be used multiple times. These templates + can exist in the present file or can be linked to a remote library file. + multivalued: false + range: NWBFile__stimulus + required: true + general: + name: general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used + to describe the experiment. Metadata necessary for interpreting the data + is stored with the data. General experimental metadata, including animal + strain, experimental protocols, experimenter, devices, etc, are stored under + 'general'. Core metadata (e.g., that required to interpret data fields) + is stored with the data itself, and implicitly defined by the file specification + (e.g., time is in seconds). The strategy used here for storing non-core + metadata is to use free-form text fields, such as would appear in sentences + or paragraphs from a Methods section. Metadata fields are text to enable + them to be more general, for example to represent ranges instead of numerical + values. Machine-readable metadata is stored as attributes to these free-form + datasets. All entries in the below table are to be included when data is + present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) + should not be created unless there is data to store within them. + multivalued: false + range: NWBFile__general + required: true + intervals: + name: intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during + an experiment, or epochs (see epochs subgroup) deriving from analysis of + data. + multivalued: false + range: NWBFile__intervals + required: false + units: + name: units + description: Data about sorted spike units. + multivalued: false + range: Units + required: false + tree_root: true + NWBFile__stimulus: + name: NWBFile__stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment complete + and timestamps are corrected to common timebase. Stores both presented stimuli + and stimulus templates, the latter in case the same stimulus is presented multiple + times, or is pulled from an external stimulus library. Stimuli are here defined + as any signal that is pushed into the system as part of the experiment (eg, + sound, video, voltage, etc). Many different experiments can use the same stimuli, + and stimuli can be re-used during an experiment. The stimulus group is organized + so that one version of template stimuli can be stored and these be used multiple + times. These templates can exist in the present file or can be linked to a remote + library file. + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + presentation: + name: presentation + description: Stimuli presented during the experiment. + multivalued: true + any_of: + - range: TimeSeries + templates: + name: templates + description: Template stimuli. Timestamps in templates are based on stimulus + design and are relative to the beginning of the stimulus. When templates + are used, the stimulus instances must convert presentation times to the + experiment`s time reference frame. + multivalued: true + any_of: + - range: TimeSeries + NWBFile__general: + name: NWBFile__general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used to + describe the experiment. Metadata necessary for interpreting the data is stored + with the data. General experimental metadata, including animal strain, experimental + protocols, experimenter, devices, etc, are stored under 'general'. Core metadata + (e.g., that required to interpret data fields) is stored with the data itself, + and implicitly defined by the file specification (e.g., time is in seconds). + The strategy used here for storing non-core metadata is to use free-form text + fields, such as would appear in sentences or paragraphs from a Methods section. + Metadata fields are text to enable them to be more general, for example to represent + ranges instead of numerical values. Machine-readable metadata is stored as attributes + to these free-form datasets. All entries in the below table are to be included + when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology + experiment) should not be created unless there is data to store within them. + attributes: + name: + name: name + ifabsent: string(general) + range: string + required: true + equals_string: general + data_collection: + name: data_collection + description: Notes about data collection and analysis. + multivalued: false + range: text + required: false + experiment_description: + name: experiment_description + description: General description of the experiment. + multivalued: false + range: text + required: false + experimenter: + name: experimenter + description: Name of person(s) who performed the experiment. Can also specify + roles of different people involved. + multivalued: true + range: text + required: false + institution: + name: institution + description: Institution(s) where experiment was performed. + multivalued: false + range: text + required: false + keywords: + name: keywords + description: Terms to search over. + multivalued: true + range: text + required: false + lab: + name: lab + description: Laboratory where experiment was performed. + multivalued: false + range: text + required: false + notes: + name: notes + description: Notes about the experiment. + multivalued: false + range: text + required: false + pharmacology: + name: pharmacology + description: Description of drugs used, including how and when they were administered. + Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc. + multivalued: false + range: text + required: false + protocol: + name: protocol + description: Experimental protocol, if applicable. e.g., include IACUC protocol + number. + multivalued: false + range: text + required: false + related_publications: + name: related_publications + description: Publication information. PMID, DOI, URL, etc. + multivalued: true + range: text + required: false + session_id: + name: session_id + description: Lab-specific ID for the session. + multivalued: false + range: text + required: false + slices: + name: slices + description: Description of slices, including information about preparation + thickness, orientation, temperature, and bath solution. + multivalued: false + range: text + required: false + source_script: + name: source_script + description: Script file or link to public source code used to create this + NWB file. + multivalued: false + range: NWBFile__general__source_script + required: false + stimulus: + name: stimulus + description: Notes about stimuli, such as how and where they were presented. + multivalued: false + range: text + required: false + surgery: + name: surgery + description: Narrative description about surgery/surgeries, including date(s) + and who performed surgery. + multivalued: false + range: text + required: false + virus: + name: virus + description: Information about virus(es) used in experiments, including virus + ID, source, date made, injection location, volume, etc. + multivalued: false + range: text + required: false + nwb_container: + name: nwb_container + description: Place-holder than can be extended so that lab-specific meta-data + can be placed in /general. + multivalued: true + range: NWBContainer + required: false + devices: + name: devices + description: Description of hardware devices used during experiment, e.g., + monitors, ADC boards, microscopes, etc. + multivalued: true + any_of: + - range: Device + subject: + name: subject + description: Information about the animal or person from which the data was + measured. + multivalued: false + range: Subject + required: false + extracellular_ephys: + name: extracellular_ephys + description: Metadata related to extracellular electrophysiology. + multivalued: false + range: NWBFile__general__extracellular_ephys + required: false + intracellular_ephys: + name: intracellular_ephys + description: Metadata related to intracellular electrophysiology. + multivalued: false + range: NWBFile__general__intracellular_ephys + required: false + optogenetics: + name: optogenetics + description: Metadata describing optogenetic stimuluation. + multivalued: true + any_of: + - range: OptogeneticStimulusSite + optophysiology: + name: optophysiology + description: Metadata related to optophysiology. + multivalued: true + any_of: + - range: ImagingPlane + NWBFile__general__source_script: + name: NWBFile__general__source_script + description: Script file or link to public source code used to create this NWB + file. + attributes: + name: + name: name + ifabsent: string(source_script) + range: string + required: true + equals_string: source_script + file_name: + name: file_name + description: Name of script file. + range: text + value: + name: value + range: text + required: true + Subject: + name: Subject + description: Information about the animal or person from which the data was measured. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(subject) + range: string + required: true + equals_string: subject + age: + name: age + description: Age of subject. Can be supplied instead of 'date_of_birth'. + multivalued: false + range: text + required: false + date_of_birth: + name: date_of_birth + description: Date of birth of subject. Can be supplied instead of 'age'. + multivalued: false + range: isodatetime + required: false + description: + name: description + description: Description of subject and where subject came from (e.g., breeder, + if animal). + multivalued: false + range: text + required: false + genotype: + name: genotype + description: Genetic strain. If absent, assume Wild Type (WT). + multivalued: false + range: text + required: false + sex: + name: sex + description: Gender of subject. + multivalued: false + range: text + required: false + species: + name: species + description: Species of subject. + multivalued: false + range: text + required: false + subject_id: + name: subject_id + description: ID of animal/person used/participating in experiment (lab convention). + multivalued: false + range: text + required: false + weight: + name: weight + description: Weight at time of experiment, at time of surgery and at other + important times. + multivalued: false + range: text + required: false + NWBFile__general__extracellular_ephys: + name: NWBFile__general__extracellular_ephys + description: Metadata related to extracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(extracellular_ephys) + range: string + required: true + equals_string: extracellular_ephys + electrode_group: + name: electrode_group + description: Physical group of electrodes. + multivalued: true + range: ElectrodeGroup + required: false + electrodes: + name: electrodes + description: A table of all electrodes (i.e. channels) used for recording. + multivalued: false + range: NWBFile__general__extracellular_ephys__electrodes + required: false + NWBFile__general__extracellular_ephys__electrodes: + name: NWBFile__general__extracellular_ephys__electrodes + description: A table of all electrodes (i.e. channels) used for recording. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + x: + name: x + description: x coordinate of the channel location in the brain (+x is posterior). + multivalued: true + range: float32 + y: + name: y + description: y coordinate of the channel location in the brain (+y is inferior). + multivalued: true + range: float32 + z: + name: z + description: z coordinate of the channel location in the brain (+z is right). + multivalued: true + range: float32 + imp: + name: imp + description: Impedance of the channel. + multivalued: true + range: float32 + location: + name: location + description: Location of the electrode (channel). Specify the area, layer, + comments on estimation of area/layer, stereotaxic coordinates if in vivo, + etc. Use standard atlas names for anatomical regions when possible. + multivalued: true + range: text + filtering: + name: filtering + description: Description of hardware filtering. + multivalued: true + range: float32 + group: + name: group + description: Reference to the ElectrodeGroup this electrode is a part of. + multivalued: true + range: ElectrodeGroup + group_name: + name: group_name + description: Name of the ElectrodeGroup this electrode is a part of. + multivalued: true + range: text + rel_x: + name: rel_x + description: x coordinate in electrode group + multivalued: true + range: float32 + rel_y: + name: rel_y + description: y coordinate in electrode group + multivalued: true + range: float32 + rel_z: + name: rel_z + description: z coordinate in electrode group + multivalued: true + range: float32 + reference: + name: reference + description: Description of the reference used for this electrode. + multivalued: true + range: text + NWBFile__general__intracellular_ephys: + name: NWBFile__general__intracellular_ephys + description: Metadata related to intracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(intracellular_ephys) + range: string + required: true + equals_string: intracellular_ephys + filtering: + name: filtering + description: Description of filtering used. Includes filtering type and parameters, + frequency fall-off, etc. If this changes between TimeSeries, filter description + should be stored as a text attribute for each TimeSeries. + multivalued: false + range: text + required: false + intracellular_electrode: + name: intracellular_electrode + description: An intracellular electrode. + multivalued: true + range: IntracellularElectrode + required: false + sweep_table: + name: sweep_table + description: The table which groups different PatchClampSeries together. + multivalued: false + range: SweepTable + required: false + NWBFile__intervals: + name: NWBFile__intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during an + experiment, or epochs (see epochs subgroup) deriving from analysis of data. + attributes: + name: + name: name + ifabsent: string(intervals) + range: string + required: true + equals_string: intervals + epochs: + name: epochs + description: Divisions in time marking experimental stages or sub-divisions + of a single recording session. + multivalued: false + range: TimeIntervals + required: false + trials: + name: trials + description: Repeated experimental events that have a logical grouping. + multivalued: false + range: TimeIntervals + required: false + invalid_times: + name: invalid_times + description: Time intervals that should be removed from analysis. + multivalued: false + range: TimeIntervals + required: false + time_intervals: + name: time_intervals + description: Optional additional table(s) for describing other experimental + time intervals. + multivalued: true + range: TimeIntervals + required: false diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.icephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.icephys.yaml new file mode 100644 index 0000000..6e6bc25 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.icephys.yaml @@ -0,0 +1,503 @@ +name: core.nwb.icephys +id: core.nwb.icephys +version: 2.2.1 +imports: +- core.nwb.base +- core.nwb.device +- ../../hdmf_common/v1_1_2/namespace +- core.nwb.language +default_prefix: core.nwb.icephys/ +classes: + PatchClampSeries: + name: PatchClampSeries + description: An abstract base class for patch-clamp data - stimulus or response, + current or voltage. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: Protocol/stimulus name for this patch-clamp dataset. + range: text + sweep_number: + name: sweep_number + description: Sweep number, allows to group different PatchClampSeries together. + range: uint32 + data: + name: data + description: Recorded voltage or current. + multivalued: true + range: numeric + required: true + gain: + name: gain + description: Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt + (c-clamp). + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries: + name: CurrentClampSeries + description: Voltage data from an intracellular current-clamp recording. A corresponding + CurrentClampStimulusSeries (stored separately as a stimulus) is used to store + the current injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage. + multivalued: false + range: CurrentClampSeries__data + required: true + bias_current: + name: bias_current + description: Bias current, in amps. + multivalued: false + range: float32 + required: false + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms. + multivalued: false + range: float32 + required: false + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads. + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries__data: + name: CurrentClampSeries__data + description: Recorded voltage. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IZeroClampSeries: + name: IZeroClampSeries + description: Voltage data from an intracellular recording when all current and + amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There + is no CurrentClampStimulusSeries associated with an IZero series because the + amplifier is disconnected and no stimulus can reach the cell. + is_a: CurrentClampSeries + attributes: + name: + name: name + range: string + required: true + bias_current: + name: bias_current + description: Bias current, in amps, fixed to 0.0. + multivalued: false + range: float32 + required: true + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms, fixed to 0.0. + multivalued: false + range: float32 + required: true + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads, fixed to 0.0. + multivalued: false + range: float32 + required: true + tree_root: true + CurrentClampStimulusSeries: + name: CurrentClampStimulusSeries + description: Stimulus current applied during current clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus current applied. + multivalued: false + range: CurrentClampStimulusSeries__data + required: true + tree_root: true + CurrentClampStimulusSeries__data: + name: CurrentClampStimulusSeries__data + description: Stimulus current applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries: + name: VoltageClampSeries + description: Current data from an intracellular voltage-clamp recording. A corresponding + VoltageClampStimulusSeries (stored separately as a stimulus) is used to store + the voltage injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded current. + multivalued: false + range: VoltageClampSeries__data + required: true + capacitance_fast: + name: capacitance_fast + description: Fast capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_fast + required: false + capacitance_slow: + name: capacitance_slow + description: Slow capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_slow + required: false + resistance_comp_bandwidth: + name: resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + multivalued: false + range: VoltageClampSeries__resistance_comp_bandwidth + required: false + resistance_comp_correction: + name: resistance_comp_correction + description: Resistance compensation correction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_correction + required: false + resistance_comp_prediction: + name: resistance_comp_prediction + description: Resistance compensation prediction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_prediction + required: false + whole_cell_capacitance_comp: + name: whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + multivalued: false + range: VoltageClampSeries__whole_cell_capacitance_comp + required: false + whole_cell_series_resistance_comp: + name: whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + multivalued: false + range: VoltageClampSeries__whole_cell_series_resistance_comp + required: false + tree_root: true + VoltageClampSeries__data: + name: VoltageClampSeries__data + description: Recorded current. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries__capacitance_fast: + name: VoltageClampSeries__capacitance_fast + description: Fast capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_fast) + range: string + required: true + equals_string: capacitance_fast + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__capacitance_slow: + name: VoltageClampSeries__capacitance_slow + description: Slow capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_slow) + range: string + required: true + equals_string: capacitance_slow + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_bandwidth: + name: VoltageClampSeries__resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + attributes: + name: + name: name + ifabsent: string(resistance_comp_bandwidth) + range: string + required: true + equals_string: resistance_comp_bandwidth + unit: + name: unit + description: Unit of measurement for resistance_comp_bandwidth, which is fixed + to 'hertz'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_correction: + name: VoltageClampSeries__resistance_comp_correction + description: Resistance compensation correction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_correction) + range: string + required: true + equals_string: resistance_comp_correction + unit: + name: unit + description: Unit of measurement for resistance_comp_correction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_prediction: + name: VoltageClampSeries__resistance_comp_prediction + description: Resistance compensation prediction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_prediction) + range: string + required: true + equals_string: resistance_comp_prediction + unit: + name: unit + description: Unit of measurement for resistance_comp_prediction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_capacitance_comp: + name: VoltageClampSeries__whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + attributes: + name: + name: name + ifabsent: string(whole_cell_capacitance_comp) + range: string + required: true + equals_string: whole_cell_capacitance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_capacitance_comp, which is + fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_series_resistance_comp: + name: VoltageClampSeries__whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + attributes: + name: + name: name + ifabsent: string(whole_cell_series_resistance_comp) + range: string + required: true + equals_string: whole_cell_series_resistance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_series_resistance_comp, which + is fixed to 'ohms'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampStimulusSeries: + name: VoltageClampStimulusSeries + description: Stimulus voltage applied during a voltage clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus voltage applied. + multivalued: false + range: VoltageClampStimulusSeries__data + required: true + tree_root: true + VoltageClampStimulusSeries__data: + name: VoltageClampStimulusSeries__data + description: Stimulus voltage applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IntracellularElectrode: + name: IntracellularElectrode + description: An intracellular electrode and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of electrode (e.g., whole-cell, sharp, etc.). + multivalued: false + range: text + required: true + filtering: + name: filtering + description: Electrode specific filtering. + multivalued: false + range: text + required: false + initial_access_resistance: + name: initial_access_resistance + description: Initial access resistance. + multivalued: false + range: text + required: false + location: + name: location + description: Location of the electrode. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: false + resistance: + name: resistance + description: Electrode resistance, in ohms. + multivalued: false + range: text + required: false + seal: + name: seal + description: Information about seal used for recording. + multivalued: false + range: text + required: false + slice: + name: slice + description: Information about slice used for recording. + multivalued: false + range: text + required: false + tree_root: true + SweepTable: + name: SweepTable + description: The table which groups different PatchClampSeries together. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + sweep_number: + name: sweep_number + description: Sweep number of the PatchClampSeries in that row. + multivalued: true + range: uint32 + series: + name: series + description: The PatchClampSeries with the sweep number in that row. + multivalued: true + range: PatchClampSeries + series_index: + name: series_index + description: Index for series. + multivalued: false + range: SweepTable__series_index + required: true + tree_root: true + SweepTable__series_index: + name: SweepTable__series_index + description: Index for series. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(series_index) + range: string + required: true + equals_string: series_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.image.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.image.yaml new file mode 100644 index 0000000..1f2083f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.image.yaml @@ -0,0 +1,271 @@ +name: core.nwb.image +id: core.nwb.image +version: 2.2.1 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.image/ +classes: + GrayscaleImage: + name: GrayscaleImage + description: A grayscale image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: GrayscaleImage__Array + tree_root: true + GrayscaleImage__Array: + name: GrayscaleImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + RGBImage: + name: RGBImage + description: A color image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBImage__Array + tree_root: true + RGBImage__Array: + name: RGBImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RGBAImage: + name: RGBAImage + description: A color image with transparency. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBAImage__Array + tree_root: true + RGBAImage__Array: + name: RGBAImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b, a: + name: r, g, b, a + range: numeric + required: true + minimum_cardinality: 4 + maximum_cardinality: 4 + ImageSeries: + name: ImageSeries + description: General image data that is common between acquisition and stimulus + time series. Sometimes the image data is stored in the file in a raw format + while other times it will be stored as a series of external image files in the + host file system. The data field will either be binary data, if the data is + stored in the NWB file, or empty, if the data is stored in an external image + stack. [frame][x][y] or [frame][x][y][z]. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Binary data representing images across frames. + multivalued: false + range: ImageSeries__data + required: false + dimension: + name: dimension + description: Number of pixels on x, y, (and z) axes. + multivalued: true + range: int32 + required: false + external_file: + name: external_file + description: Paths to one or more external file(s). The field is only present + if format='external'. This is only relevant if the image series is stored + in the file system as one or more image file(s). This field should NOT be + used if the image is stored in another NWB file and that file is linked + to this file. + multivalued: true + range: text + required: false + format: + name: format + description: Format of image. If this is 'external', then the attribute 'external_file' + contains the path information to the image files. If this is 'raw', then + the raw (single-channel) binary data is stored in the 'data' dataset. If + this attribute is not present, then the default format='raw' case is assumed. + multivalued: false + range: text + required: false + tree_root: true + ImageSeries__data: + name: ImageSeries__data + description: Binary data representing images across frames. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: ImageSeries__data__Array + ImageSeries__data__Array: + name: ImageSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + z: + name: z + range: numeric + required: false + ImageMaskSeries: + name: ImageMaskSeries + description: An alpha mask that is applied to a presented visual stimulus. The + 'data' array contains an array of mask values that are applied to the displayed + image. Mask values are stored as RGBA. Mask can vary with time. The timestamps + array indicates the starting time of a mask, and that mask pattern continues + until it's explicitly changed. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + tree_root: true + OpticalSeries: + name: OpticalSeries + description: Image data that is presented or recorded. A stimulus template movie + will be stored only as an image. When the image is presented as stimulus, additional + data is required, such as field of view (e.g., how much of the visual field + the image covers, or how what is the area of the target being imaged). If the + OpticalSeries represents acquired imaging data, orientation is also important. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + distance: + name: distance + description: Distance from camera/monitor to target/eye. + multivalued: false + range: float32 + required: false + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: OpticalSeries__field_of_view + required: false + orientation: + name: orientation + description: Description of image relative to some reference frame (e.g., + which way is up). Must also specify frame of reference. + multivalued: false + range: text + required: false + tree_root: true + OpticalSeries__field_of_view: + name: OpticalSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: OpticalSeries__field_of_view__Array + OpticalSeries__field_of_view__Array: + name: OpticalSeries__field_of_view__Array + is_a: Arraylike + attributes: + width, height: + name: width, height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width, height, depth: + name: width, height, depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + IndexSeries: + name: IndexSeries + description: Stores indices to image frames stored in an ImageSeries. The purpose + of the ImageIndexSeries is to allow a static image stack to be stored somewhere, + and the images in the stack to be referenced out-of-order. This can be for the + display of individual images, or of movie segments (as a movie is simply a series + of images). The data field stores the index of the frame in the referenced ImageSeries, + and the timestamps array indicates when that image was displayed. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Index of the frame in the referenced ImageSeries. + multivalued: true + range: int32 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.language.yaml new file mode 100644 index 0000000..c57e91f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.language.yaml @@ -0,0 +1,148 @@ +name: core.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.misc.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.misc.yaml new file mode 100644 index 0000000..1581e23 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.misc.yaml @@ -0,0 +1,406 @@ +name: core.nwb.misc +id: core.nwb.misc +version: 2.2.1 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_2/namespace +- core.nwb.ecephys +- core.nwb.language +default_prefix: core.nwb.misc/ +classes: + AbstractFeatureSeries: + name: AbstractFeatureSeries + description: Abstract features, such as quantitative descriptions of sensory stimuli. + The TimeSeries::data field is a 2D array, storing those features (e.g., for + visual grating stimulus this might be orientation, spatial frequency and contrast). + Null stimuli (eg, uniform gray) can be marked as being an independent feature + (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, + or through use of the TimeSeries::control fields. A set of features is considered + to persist until the next set of features is defined. The final set of features + stored should be the null set. This is useful when storing the raw stimulus + is impractical. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Values of each feature at each time. + multivalued: false + range: AbstractFeatureSeries__data + required: true + feature_units: + name: feature_units + description: Units of each feature. + multivalued: true + range: text + required: false + features: + name: features + description: Description of the features represented in TimeSeries::data. + multivalued: true + range: text + required: true + tree_root: true + AbstractFeatureSeries__data: + name: AbstractFeatureSeries__data + description: Values of each feature at each time. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Since there can be different units for different features, store + the units in 'feature_units'. The default value for this attribute is "see + 'feature_units'". + range: text + array: + name: array + range: AbstractFeatureSeries__data__Array + AbstractFeatureSeries__data__Array: + name: AbstractFeatureSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + AnnotationSeries: + name: AnnotationSeries + description: Stores user annotations made during an experiment. The data[] field + stores a text array, and timestamps are stored for each annotation (ie, interval=1). + This is largely an alias to a standard TimeSeries storing a text array but that + is identifiable as storing annotations in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Annotations made during an experiment. + multivalued: true + range: text + required: true + tree_root: true + IntervalSeries: + name: IntervalSeries + description: Stores intervals of data. The timestamps field stores the beginning + and end of intervals. The data field stores whether the interval just started + (>0 value) or ended (<0 value). Different interval types can be represented + in the same series by using multiple key values (eg, 1 for feature A, 2 for + feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This + is largely an alias of a standard TimeSeries but that is identifiable as representing + time intervals in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Use values >0 if interval started, <0 if interval ended. + multivalued: true + range: int8 + required: true + tree_root: true + DecompositionSeries: + name: DecompositionSeries + description: Spectral analysis of a time series, e.g. of an LFP or a speech signal. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Data decomposed into frequency bands. + multivalued: false + range: DecompositionSeries__data + required: true + metric: + name: metric + description: The metric used, e.g. phase, amplitude, power. + multivalued: false + range: text + required: true + bands: + name: bands + description: Table for describing the bands that this series was generated + from. There should be one row in this table for each band. + multivalued: false + range: DecompositionSeries__bands + required: true + tree_root: true + DecompositionSeries__data: + name: DecompositionSeries__data + description: Data decomposed into frequency bands. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: DecompositionSeries__data__Array + DecompositionSeries__data__Array: + name: DecompositionSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: true + num_bands: + name: num_bands + range: numeric + required: true + DecompositionSeries__bands: + name: DecompositionSeries__bands + description: Table for describing the bands that this series was generated from. + There should be one row in this table for each band. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(bands) + range: string + required: true + equals_string: bands + band_name: + name: band_name + description: Name of the band, e.g. theta. + multivalued: true + range: text + band_limits: + name: band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + multivalued: false + range: DecompositionSeries__bands__band_limits + required: true + band_mean: + name: band_mean + description: The mean Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + band_stdev: + name: band_stdev + description: The standard deviation of Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + DecompositionSeries__bands__band_limits: + name: DecompositionSeries__bands__band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(band_limits) + range: string + required: true + equals_string: band_limits + Units: + name: Units + description: Data about spiking units. Event times of observed units (e.g. cell, + synapse, etc.) should be concatenated and stored in spike_times. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + spike_times_index: + name: spike_times_index + description: Index into the spike_times dataset. + multivalued: false + range: Units__spike_times_index + required: false + spike_times: + name: spike_times + description: Spike times for each unit. + multivalued: false + range: Units__spike_times + required: false + obs_intervals_index: + name: obs_intervals_index + description: Index into the obs_intervals dataset. + multivalued: false + range: Units__obs_intervals_index + required: false + obs_intervals: + name: obs_intervals + description: Observation intervals for each unit. + multivalued: false + range: Units__obs_intervals + required: false + electrodes_index: + name: electrodes_index + description: Index into electrodes. + multivalued: false + range: Units__electrodes_index + required: false + electrodes: + name: electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + multivalued: false + range: Units__electrodes + required: false + electrode_group: + name: electrode_group + description: Electrode group that each spike unit came from. + multivalued: true + range: ElectrodeGroup + waveform_mean: + name: waveform_mean + description: Spike waveform mean for each spike unit. + multivalued: false + range: Units__waveform_mean + required: false + waveform_sd: + name: waveform_sd + description: Spike waveform standard deviation for each spike unit. + multivalued: false + range: Units__waveform_sd + required: false + tree_root: true + Units__spike_times_index: + name: Units__spike_times_index + description: Index into the spike_times dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(spike_times_index) + range: string + required: true + equals_string: spike_times_index + Units__spike_times: + name: Units__spike_times + description: Spike times for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(spike_times) + range: string + required: true + equals_string: spike_times + resolution: + name: resolution + description: The smallest possible difference between two spike times. Usually + 1 divided by the acquisition sampling rate from which spike times were extracted, + but could be larger if the acquisition time series was downsampled or smaller + if the acquisition time series was smoothed/interpolated and it is possible + for the spike time to be between samples. + range: float64 + Units__obs_intervals_index: + name: Units__obs_intervals_index + description: Index into the obs_intervals dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(obs_intervals_index) + range: string + required: true + equals_string: obs_intervals_index + Units__obs_intervals: + name: Units__obs_intervals + description: Observation intervals for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(obs_intervals) + range: string + required: true + equals_string: obs_intervals + Units__electrodes_index: + name: Units__electrodes_index + description: Index into electrodes. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(electrodes_index) + range: string + required: true + equals_string: electrodes_index + Units__electrodes: + name: Units__electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + Units__waveform_mean: + name: Units__waveform_mean + description: Spike waveform mean for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveform_sd: + name: Units__waveform_sd + description: Spike waveform standard deviation for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.ogen.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.ogen.yaml new file mode 100644 index 0000000..5279509 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.ogen.yaml @@ -0,0 +1,55 @@ +name: core.nwb.ogen +id: core.nwb.ogen +version: 2.2.1 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ogen/ +classes: + OptogeneticSeries: + name: OptogeneticSeries + description: An optogenetic stimulus. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Applied power for optogenetic stimulus, in watts. + multivalued: true + range: numeric + required: true + tree_root: true + OptogeneticStimulusSite: + name: OptogeneticStimulusSite + description: A site of optogenetic stimulation. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of stimulation site. + multivalued: false + range: text + required: true + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + location: + name: location + description: Location of the stimulation site. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.ophys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.ophys.yaml new file mode 100644 index 0000000..111bc1e --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.ophys.yaml @@ -0,0 +1,546 @@ +name: core.nwb.ophys +id: core.nwb.ophys +version: 2.2.1 +imports: +- core.nwb.image +- core.nwb.base +- ../../hdmf_common/v1_1_2/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ophys/ +classes: + TwoPhotonSeries: + name: TwoPhotonSeries + description: Image stack recorded over time from 2-photon microscope. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + pmt_gain: + name: pmt_gain + description: Photomultiplier gain. + range: float32 + scan_line_rate: + name: scan_line_rate + description: Lines imaged per second. This is also stored in /general/optophysiology + but is kept here as it is useful information for analysis, and so good to + be stored w/ the actual data. + range: float32 + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: TwoPhotonSeries__field_of_view + required: false + tree_root: true + TwoPhotonSeries__field_of_view: + name: TwoPhotonSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: TwoPhotonSeries__field_of_view__Array + TwoPhotonSeries__field_of_view__Array: + name: TwoPhotonSeries__field_of_view__Array + is_a: Arraylike + attributes: + width|height: + name: width|height + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + width|height|depth: + name: width|height|depth + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RoiResponseSeries: + name: RoiResponseSeries + description: ROI responses over an imaging plane. The first dimension represents + time. The second dimension, if present, represents ROIs. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Signals from ROIs. + multivalued: false + range: RoiResponseSeries__data + required: true + rois: + name: rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + multivalued: false + range: RoiResponseSeries__rois + required: true + tree_root: true + RoiResponseSeries__data: + name: RoiResponseSeries__data + description: Signals from ROIs. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: RoiResponseSeries__data__Array + RoiResponseSeries__data__Array: + name: RoiResponseSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_ROIs: + name: num_ROIs + range: numeric + required: false + RoiResponseSeries__rois: + name: RoiResponseSeries__rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(rois) + range: string + required: true + equals_string: rois + DfOverF: + name: DfOverF + description: dF/F information about a region of interest (ROI). Storage hierarchy + of dF/F should be the same as for segmentation (i.e., same names for ROIs and + for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing dF/F for a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + Fluorescence: + name: Fluorescence + description: Fluorescence information about a region of interest (ROI). Storage + hierarchy of fluorescence should be the same as for segmentation (ie, same names + for ROIs and for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing fluorescence data for + a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + ImageSegmentation: + name: ImageSegmentation + description: Stores pixels in an image that represent different regions of interest + (ROIs) or masks. All segmentation for a given imaging plane is stored together, + with storage for multiple imaging planes (masks) supported. Each ROI is stored + in its own subgroup, with the ROI group containing both a 2D mask and a list + of pixels that make up this mask. Segments can also be used for masking neuropil. + If segmentation is allowed to change with time, a new imaging plane (or module) + is required and ROI names should remain consistent between them. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + plane_segmentation: + name: plane_segmentation + description: Results from image segmentation of a specific imaging plane. + multivalued: true + range: PlaneSegmentation + required: true + tree_root: true + PlaneSegmentation: + name: PlaneSegmentation + description: Results from image segmentation of a specific imaging plane. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + image_mask: + name: image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + multivalued: false + range: PlaneSegmentation__image_mask + required: false + pixel_mask_index: + name: pixel_mask_index + description: Index into pixel_mask. + multivalued: false + range: PlaneSegmentation__pixel_mask_index + required: false + pixel_mask: + name: pixel_mask + description: 'Pixel masks for each ROI: a list of indices and weights for + the ROI. Pixel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + voxel_mask_index: + name: voxel_mask_index + description: Index into voxel_mask. + multivalued: false + range: PlaneSegmentation__voxel_mask_index + required: false + voxel_mask: + name: voxel_mask + description: 'Voxel masks for each ROI: a list of indices and weights for + the ROI. Voxel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + reference_images: + name: reference_images + description: Image stacks that the segmentation masks apply to. + multivalued: true + any_of: + - range: ImageSeries + PlaneSegmentation__image_mask: + name: PlaneSegmentation__image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(image_mask) + range: string + required: true + equals_string: image_mask + PlaneSegmentation__pixel_mask_index: + name: PlaneSegmentation__pixel_mask_index + description: Index into pixel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(pixel_mask_index) + range: string + required: true + equals_string: pixel_mask_index + PlaneSegmentation__voxel_mask_index: + name: PlaneSegmentation__voxel_mask_index + description: Index into voxel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(voxel_mask_index) + range: string + required: true + equals_string: voxel_mask_index + ImagingPlane: + name: ImagingPlane + description: An imaging plane and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the imaging plane. + multivalued: false + range: text + required: false + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + imaging_rate: + name: imaging_rate + description: Rate that images are acquired, in Hz. + multivalued: false + range: float32 + required: true + indicator: + name: indicator + description: Calcium indicator. + multivalued: false + range: text + required: true + location: + name: location + description: Location of the imaging plane. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + manifold: + name: manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents + the position of the pixel relative to the defined coordinate space. Deprecated + in favor of origin_coords and grid_spacing. + multivalued: false + range: ImagingPlane__manifold + required: false + origin_coords: + name: origin_coords + description: Physical location of the first element of the imaging plane (0, + 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for + what the physical location is relative to (e.g., bregma). + multivalued: false + range: ImagingPlane__origin_coords + required: false + grid_spacing: + name: grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also + reference_frame to interpret the grid. + multivalued: false + range: ImagingPlane__grid_spacing + required: false + reference_frame: + name: reference_frame + description: Describes reference frame of origin_coords and grid_spacing. + For example, this can be a text description of the anatomical location and + orientation of the grid defined by origin_coords and grid_spacing or the + vectors needed to transform or rotate the grid to a common anatomical axis + (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and + grid_spacing. If origin_coords and grid_spacing are not present, then this + field is not required. For example, if the microscope takes 10 x 10 x 2 + images, where the first value of the data matrix (index (0, 0, 0)) corresponds + to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is + 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means + more anterior, larger numbers in y means more rightward, and larger numbers + in z means more ventral, then enter the following -- origin_coords = (-1.2, + -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = "Origin coordinates + are relative to bregma. First dimension corresponds to anterior-posterior + axis (larger index = more anterior). Second dimension corresponds to medial-lateral + axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral + axis (larger index = more ventral)." + multivalued: false + range: text + required: false + optical_channel: + name: optical_channel + description: An optical channel used to record from an imaging plane. + multivalued: false + range: OpticalChannel + required: true + tree_root: true + ImagingPlane__manifold: + name: ImagingPlane__manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents the + position of the pixel relative to the defined coordinate space. Deprecated in + favor of origin_coords and grid_spacing. + attributes: + name: + name: name + ifabsent: string(manifold) + range: string + required: true + equals_string: manifold + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as pixels from + x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then + the 'conversion' multiplier to get from raw data acquisition pixel units + to meters is 2/1000. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__manifold__Array + ImagingPlane__manifold__Array: + name: ImagingPlane__manifold__Array + is_a: Arraylike + attributes: + height: + name: height + range: float32 + required: true + width: + name: width + range: float32 + required: true + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + depth: + name: depth + range: float32 + required: false + ImagingPlane__origin_coords: + name: ImagingPlane__origin_coords + description: Physical location of the first element of the imaging plane (0, 0) + for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the + physical location is relative to (e.g., bregma). + attributes: + name: + name: name + ifabsent: string(origin_coords) + range: string + required: true + equals_string: origin_coords + unit: + name: unit + description: Measurement units for origin_coords. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__origin_coords__Array + ImagingPlane__origin_coords__Array: + name: ImagingPlane__origin_coords__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + ImagingPlane__grid_spacing: + name: ImagingPlane__grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame + to interpret the grid. + attributes: + name: + name: name + ifabsent: string(grid_spacing) + range: string + required: true + equals_string: grid_spacing + unit: + name: unit + description: Measurement units for grid_spacing. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__grid_spacing__Array + ImagingPlane__grid_spacing__Array: + name: ImagingPlane__grid_spacing__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalChannel: + name: OpticalChannel + description: An optical channel used to record from an imaging plane. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description or other notes about the channel. + multivalued: false + range: text + required: true + emission_lambda: + name: emission_lambda + description: Emission wavelength for channel, in nm. + multivalued: false + range: float32 + required: true + MotionCorrection: + name: MotionCorrection + description: 'An image stack where all frames are shifted (registered) to a common + coordinate system, to account for movement and drift between frames. Note: each + frame at each point in time is assumed to be 2-D (has only x & y dimensions).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected_image_stack: + name: corrected_image_stack + description: Reuslts from motion correction of an image stack. + multivalued: true + range: CorrectedImageStack + required: true + tree_root: true + CorrectedImageStack: + name: CorrectedImageStack + description: Reuslts from motion correction of an image stack. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected: + name: corrected + description: Image stack with frames shifted to the common coordinates. + multivalued: false + range: ImageSeries + required: true + xy_translation: + name: xy_translation + description: Stores the x,y delta necessary to align each frame to the common + coordinates, for example, to align each frame to a reference image. + multivalued: false + range: TimeSeries + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.retinotopy.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.retinotopy.yaml new file mode 100644 index 0000000..4158eef --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/core.nwb.retinotopy.yaml @@ -0,0 +1,256 @@ +name: core.nwb.retinotopy +id: core.nwb.retinotopy +version: 2.2.1 +imports: +- core.nwb.base +- core.nwb.image +- core.nwb.language +default_prefix: core.nwb.retinotopy/ +classes: + RetinotopyMap: + name: RetinotopyMap + description: 'Abstract two-dimensional map of responses. Array structure: [num_rows][num_columns]' + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + array: + name: array + range: RetinotopyMap__Array + tree_root: true + RetinotopyMap__Array: + name: RetinotopyMap__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + AxisMap: + name: AxisMap + description: Abstract two-dimensional map of responses to stimuli along a single + response axis (e.g. eccentricity) + is_a: RetinotopyMap + attributes: + name: + name: name + range: string + required: true + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: AxisMap__Array + tree_root: true + AxisMap__Array: + name: AxisMap__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + RetinotopyImage: + name: RetinotopyImage + description: 'Gray-scale image related to retinotopic mapping. Array structure: + [num_rows][num_columns]' + is_a: GrayscaleImage + attributes: + name: + name: name + range: string + required: true + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value. + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + tree_root: true + ImagingRetinotopy: + name: ImagingRetinotopy + description: 'Intrinsic signal optical imaging or widefield imaging for measuring + retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of + responses to specific stimuli and a combined polarity map from which to identify + visual areas. NOTE: for data consistency, all images and arrays are stored in + the format [row][column] and [row, col], which equates to [y][x]. Field of view + and dimension arrays may appear backward (i.e., y before x).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + axis_1_phase_map: + name: axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + multivalued: false + range: ImagingRetinotopy__axis_1_phase_map + required: true + axis_1_power_map: + name: axis_1_power_map + description: Power response on the first measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_1_power_map + required: false + axis_2_phase_map: + name: axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_phase_map + required: true + axis_2_power_map: + name: axis_2_power_map + description: Power response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_power_map + required: false + sign_map: + name: sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + multivalued: false + range: ImagingRetinotopy__sign_map + required: true + axis_descriptions: + name: axis_descriptions + description: Two-element array describing the contents of the two response + axis fields. Description should be something like ['altitude', 'azimuth'] + or '['radius', 'theta']. + multivalued: true + range: text + required: true + focal_depth_image: + name: focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., + focal depth, wavelength) as data collection. Array format: [rows][columns].' + multivalued: false + range: ImagingRetinotopy__focal_depth_image + required: true + vasculature_image: + name: vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + multivalued: false + range: ImagingRetinotopy__vasculature_image + required: true + tree_root: true + ImagingRetinotopy__axis_1_phase_map: + name: ImagingRetinotopy__axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + is_a: AxisMap + attributes: + name: + name: name + ifabsent: string(axis_1_phase_map) + range: string + required: true + equals_string: axis_1_phase_map + ImagingRetinotopy__axis_1_power_map: + name: ImagingRetinotopy__axis_1_power_map + description: Power response on the first measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + is_a: AxisMap + attributes: + name: + name: name + ifabsent: string(axis_1_power_map) + range: string + required: true + equals_string: axis_1_power_map + ImagingRetinotopy__axis_2_phase_map: + name: ImagingRetinotopy__axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + is_a: AxisMap + attributes: + name: + name: name + ifabsent: string(axis_2_phase_map) + range: string + required: true + equals_string: axis_2_phase_map + ImagingRetinotopy__axis_2_power_map: + name: ImagingRetinotopy__axis_2_power_map + description: Power response to stimulus on the second measured axis. + is_a: AxisMap + attributes: + name: + name: name + ifabsent: string(axis_2_power_map) + range: string + required: true + equals_string: axis_2_power_map + ImagingRetinotopy__sign_map: + name: ImagingRetinotopy__sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + is_a: RetinotopyMap + attributes: + name: + name: name + ifabsent: string(sign_map) + range: string + required: true + equals_string: sign_map + ImagingRetinotopy__focal_depth_image: + name: ImagingRetinotopy__focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., focal + depth, wavelength) as data collection. Array format: [rows][columns].' + is_a: RetinotopyImage + attributes: + name: + name: name + ifabsent: string(focal_depth_image) + range: string + required: true + equals_string: focal_depth_image + focal_depth: + name: focal_depth + description: Focal depth offset, in meters. + range: float32 + ImagingRetinotopy__vasculature_image: + name: ImagingRetinotopy__vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + is_a: RetinotopyImage + attributes: + name: + name: name + ifabsent: string(vasculature_image) + range: string + required: true + equals_string: vasculature_image diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/namespace.yaml new file mode 100644 index 0000000..2a81855 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_1/namespace.yaml @@ -0,0 +1,24 @@ +name: core +annotations: + namespace: + tag: namespace + value: 'True' +description: NWB namespace +id: core +version: 2.2.1 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.epoch +- core.nwb.image +- core.nwb.file +- core.nwb.misc +- core.nwb.behavior +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.retinotopy +- core.nwb.language +- ../../hdmf_common/v1_1_2/namespace +default_prefix: core/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.base.yaml new file mode 100644 index 0000000..d36b1b0 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.base.yaml @@ -0,0 +1,303 @@ +name: core.nwb.base +id: core.nwb.base +version: 2.2.2 +imports: +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.language +default_prefix: core.nwb.base/ +classes: + NWBData: + name: NWBData + description: An abstract data type for a dataset. + is_a: Data + attributes: + name: + name: name + range: string + required: true + tree_root: true + Image: + name: Image + description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D + where the third dimension can have three or four elements, e.g. (x, y, (r, g, + b)) or (x, y, (r, g, b, a)). + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + resolution: + name: resolution + description: Pixel resolution of the image, in pixels per centimeter. + range: float32 + description: + name: description + description: Description of the image. + range: text + array: + name: array + range: Image__Array + tree_root: true + Image__Array: + name: Image__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + r, g, b, a: + name: r, g, b, a + range: numeric + required: false + minimum_cardinality: 4 + maximum_cardinality: 4 + NWBContainer: + name: NWBContainer + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + is_a: Container + attributes: + name: + name: name + range: string + required: true + tree_root: true + NWBDataInterface: + name: NWBDataInterface + description: An abstract data type for a generic container storing collections + of data, as opposed to metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeries: + name: TimeSeries + description: General purpose time series. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the time series. + range: text + comments: + name: comments + description: Human-readable comments about the TimeSeries. This second descriptive + field can be used to store additional information, or descriptive information + if the primary description field is populated with a computer-readable string. + range: text + data: + name: data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first + dimension should always represent time. This can also be used to store binary + data (e.g., image frames). This can also be a link to data stored in an + external file. + multivalued: false + range: TimeSeries__data + required: true + starting_time: + name: starting_time + description: Timestamp of the first sample in seconds. When timestamps are + uniformly spaced, the timestamp of the first sample can be specified and + all subsequent ones calculated from the sampling rate attribute. + multivalued: false + range: TimeSeries__starting_time + required: false + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + multivalued: true + range: float64 + required: false + control: + name: control + description: Numerical labels that apply to each time point in data for the + purpose of querying and slicing data by these values. If present, the length + of this array should be the same size as the first dimension of data. + multivalued: true + range: uint8 + required: false + control_description: + name: control_description + description: Description of each control value. Must be present if control + is present. If present, control_description[0] should describe time points + where control == 0. + multivalued: true + range: text + required: false + sync: + name: sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored + external to the NWB file, in files storing raw data. Once timestamp data + is calculated, the contents of 'sync' are mostly for archival purposes. + multivalued: false + range: TimeSeries__sync + required: false + tree_root: true + TimeSeries__data: + name: TimeSeries__data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension + should always represent time. This can also be used to store binary data (e.g., + image frames). This can also be a link to data stored in an external file. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as signed 16-bit + integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V + to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' + multiplier to get from raw data acquisition values to recorded volts is + 2.5/32768/8000 = 9.5367e-9. + range: float32 + resolution: + name: resolution + description: Smallest meaningful difference between values in data, stored + in the specified by unit, e.g., the change in value of the least significant + bit, or a larger number if signal noise is known to be present. If unknown, + use -1.0. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: TimeSeries__data__Array + TimeSeries__data__Array: + name: TimeSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: AnyType + required: true + num_DIM2: + name: num_DIM2 + range: AnyType + required: false + num_DIM3: + name: num_DIM3 + range: AnyType + required: false + num_DIM4: + name: num_DIM4 + range: AnyType + required: false + TimeSeries__starting_time: + name: TimeSeries__starting_time + description: Timestamp of the first sample in seconds. When timestamps are uniformly + spaced, the timestamp of the first sample can be specified and all subsequent + ones calculated from the sampling rate attribute. + attributes: + name: + name: name + ifabsent: string(starting_time) + range: string + required: true + equals_string: starting_time + rate: + name: rate + description: Sampling rate, in Hz. + range: float32 + unit: + name: unit + description: Unit of measurement for time, which is fixed to 'seconds'. + range: text + value: + name: value + range: float64 + required: true + TimeSeries__sync: + name: TimeSeries__sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored external + to the NWB file, in files storing raw data. Once timestamp data is calculated, + the contents of 'sync' are mostly for archival purposes. + attributes: + name: + name: name + ifabsent: string(sync) + range: string + required: true + equals_string: sync + ProcessingModule: + name: ProcessingModule + description: A collection of processed data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of processed data. + range: text + nwb_data_interface: + name: nwb_data_interface + description: Data objects stored in this collection. + multivalued: true + range: NWBDataInterface + required: false + dynamic_table: + name: dynamic_table + description: Tables stored in this collection. + multivalued: true + range: DynamicTable + required: false + tree_root: true + Images: + name: Images + description: A collection of images. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of images. + range: text + image: + name: image + description: Images stored in this collection. + multivalued: true + range: Image + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.behavior.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.behavior.yaml new file mode 100644 index 0000000..10a5822 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.behavior.yaml @@ -0,0 +1,201 @@ +name: core.nwb.behavior +id: core.nwb.behavior +version: 2.2.2 +imports: +- core.nwb.base +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.behavior/ +classes: + SpatialSeries: + name: SpatialSeries + description: 'Direction, e.g., of gaze or travel, or position. The TimeSeries::data + field is a 2D array storing position or direction relative to some reference + frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries + has a text dataset reference_frame that indicates the zero-position, or the + zero-axes for direction. For example, if representing gaze direction, ''straight-ahead'' + might be a specific pixel on the monitor, or some other point in space. For + position data, the 0,0 point might be the top-left corner of an enclosure, as + viewed from the tracking camera. The unit of data will indicate how to interpret + SpatialSeries values.' + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: 1-D or 2-D array storing position or direction relative to some + reference frame. + multivalued: false + range: SpatialSeries__data + required: true + reference_frame: + name: reference_frame + description: Description defining what exactly 'straight-ahead' means. + multivalued: false + range: text + required: false + tree_root: true + SpatialSeries__data: + name: SpatialSeries__data + description: 1-D or 2-D array storing position or direction relative to some reference + frame. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: SpatialSeries__data__Array + SpatialSeries__data__Array: + name: SpatialSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + BehavioralEpochs: + name: BehavioralEpochs + description: TimeSeries for storing behavioral epochs. The objective of this + and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) + is to provide generic hooks for software tools/scripts. This allows a tool/script + to take the output one specific interface (e.g., UnitTimes) and plot that data + relative to another data modality (e.g., behavioral events) without having to + define all possible modalities in advance. Declaring one of these interfaces + means that one or more TimeSeries of the specified type is published. These + TimeSeries should reside in a group having the same name as the interface. For + example, if a BehavioralTimeSeries interface is declared, the module will have + one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. + BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular + events. BehavioralTimeSeries is for continuous data. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + interval_series: + name: interval_series + description: IntervalSeries object containing start and stop times of epochs. + multivalued: true + range: IntervalSeries + required: false + tree_root: true + BehavioralEvents: + name: BehavioralEvents + description: TimeSeries for storing behavioral events. See description of BehavioralEpochs + for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing behavioral events. + multivalued: true + range: TimeSeries + required: false + tree_root: true + BehavioralTimeSeries: + name: BehavioralTimeSeries + description: TimeSeries for storing Behavoioral time series data. See description + of BehavioralEpochs for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing continuous behavioral data. + multivalued: true + range: TimeSeries + required: false + tree_root: true + PupilTracking: + name: PupilTracking + description: Eye-tracking data, representing pupil size. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing time series data on pupil size. + multivalued: true + range: TimeSeries + required: true + tree_root: true + EyeTracking: + name: EyeTracking + description: Eye-tracking data, representing direction of gaze. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing data measuring direction of gaze. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + CompassDirection: + name: CompassDirection + description: With a CompassDirection interface, a module publishes a SpatialSeries + object representing a floating point value for theta. The SpatialSeries::reference_frame + field should indicate what direction corresponds to 0 and which is the direction + of rotation (this should be clockwise). The si_unit for the SpatialSeries should + be radians or degrees. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing direction of gaze travel. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + Position: + name: Position + description: Position data, whether along the x, x/y or x/y/z axis. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing position data. + multivalued: true + range: SpatialSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.device.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.device.yaml new file mode 100644 index 0000000..78f92b1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.device.yaml @@ -0,0 +1,28 @@ +name: core.nwb.device +id: core.nwb.device +version: 2.2.2 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.device/ +classes: + Device: + name: Device + description: Metadata about a data acquisition device, e.g., recording system, + electrode, microscope. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the device (e.g., model, firmware version, processing + software version, etc.) as free-form text. + range: text + manufacturer: + name: manufacturer + description: The name of the manufacturer of the device. + range: text + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.ecephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.ecephys.yaml new file mode 100644 index 0000000..3a8e44a --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.ecephys.yaml @@ -0,0 +1,492 @@ +name: core.nwb.ecephys +id: core.nwb.ecephys +version: 2.2.2 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ecephys/ +classes: + ElectricalSeries: + name: ElectricalSeries + description: A time series of acquired voltage data from extracellular recordings. + The data field is an int or float array storing data in volts. The first dimension + should always represent time. The second dimension, if present, should represent + channels. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage data. + multivalued: false + range: ElectricalSeries__data + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: ElectricalSeries__electrodes + required: true + channel_conversion: + name: channel_conversion + description: Channel-specific conversion factor. Multiply the data in the + 'data' dataset by these values along the channel axis (as indicated by axis + attribute) AND by the global conversion factor in the 'conversion' attribute + of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion + * channel_conversion. This approach allows for both global and per-channel + data conversion factors needed to support the storage of electrical recordings + as native values generated by data acquisition systems. If this dataset + is not present, then there is no channel-specific conversion factor, i.e. + it is 1 for all channels. + multivalued: true + range: float32 + required: false + tree_root: true + ElectricalSeries__data: + name: ElectricalSeries__data + description: Recorded voltage data. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. This value + is fixed to 'volts'. Actual stored values are not necessarily stored in + these units. To access the data in these units, multiply 'data' by 'conversion' + and 'channel_conversion' (if present). + range: text + array: + name: array + range: ElectricalSeries__data__Array + ElectricalSeries__data__Array: + name: ElectricalSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + num_samples: + name: num_samples + range: numeric + required: false + ElectricalSeries__electrodes: + name: ElectricalSeries__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + SpikeEventSeries: + name: SpikeEventSeries + description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold + crossings). This may also be raw data, as reported by ephys hardware. If so, + the TimeSeries::description field should describe how events were detected. + All SpikeEventSeries should reside in a module (under EventWaveform interface) + even if the spikes were reported and stored by hardware. All events span the + same recording channels and store snapshots of equal duration. TimeSeries::data + array structure: [num events] [num channels] [num samples] (or [num events] + [num samples] for single electrode).' + is_a: ElectricalSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Spike waveforms. + multivalued: false + range: SpikeEventSeries__data + required: true + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + Timestamps are required for the events. Unlike for TimeSeries, timestamps + are required for SpikeEventSeries and are thus re-specified here. + multivalued: true + range: float64 + required: true + tree_root: true + SpikeEventSeries__data: + name: SpikeEventSeries__data + description: Spike waveforms. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Unit of measurement for waveforms, which is fixed to 'volts'. + range: text + array: + name: array + range: SpikeEventSeries__data__Array + SpikeEventSeries__data__Array: + name: SpikeEventSeries__data__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: numeric + required: true + num_samples: + name: num_samples + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + FeatureExtraction: + name: FeatureExtraction + description: Features, such as PC1 and PC2, that are extracted from signals stored + in a SpikeEventSeries or other source. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of features (eg, ''PC1'') for each of the extracted + features. + multivalued: true + range: text + required: true + features: + name: features + description: Multi-dimensional array of features extracted from each event. + multivalued: false + range: FeatureExtraction__features + required: true + times: + name: times + description: Times of events that features correspond to (can be a link). + multivalued: true + range: float64 + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: FeatureExtraction__electrodes + required: true + tree_root: true + FeatureExtraction__features: + name: FeatureExtraction__features + description: Multi-dimensional array of features extracted from each event. + attributes: + name: + name: name + ifabsent: string(features) + range: string + required: true + equals_string: features + array: + name: array + range: FeatureExtraction__features__Array + FeatureExtraction__features__Array: + name: FeatureExtraction__features__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: float32 + required: true + num_channels: + name: num_channels + range: float32 + required: true + num_features: + name: num_features + range: float32 + required: true + FeatureExtraction__electrodes: + name: FeatureExtraction__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + EventDetection: + name: EventDetection + description: Detected spike events from voltage trace(s). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + detection_method: + name: detection_method + description: Description of how events were detected, such as voltage threshold, + or dV/dT threshold, as well as relevant values. + multivalued: false + range: text + required: true + source_idx: + name: source_idx + description: Indices (zero-based) into source ElectricalSeries::data array + corresponding to time of event. ''description'' should define what is meant + by time of event (e.g., .25 ms before action potential peak, zero-crossing + time, etc). The index points to each event from the raw data. + multivalued: true + range: int32 + required: true + times: + name: times + description: Timestamps of events, in seconds. + multivalued: true + range: float64 + required: true + tree_root: true + EventWaveform: + name: EventWaveform + description: Represents either the waveforms of detected events, as extracted + from a raw data trace in /acquisition, or the event waveforms that were stored + during experiment acquisition. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spike_event_series: + name: spike_event_series + description: SpikeEventSeries object(s) containing detected spike event waveforms. + multivalued: true + range: SpikeEventSeries + required: false + tree_root: true + FilteredEphys: + name: FilteredEphys + description: Electrophysiology data from one or more channels that has been subjected + to filtering. Examples of filtered data include Theta and Gamma (LFP has its + own interface). FilteredEphys modules publish an ElectricalSeries for each filtered + channel or set of channels. The name of each ElectricalSeries is arbitrary but + should be informative. The source of the filtered data, whether this is from + analysis of another time series or as acquired by hardware, should be noted + in each's TimeSeries::description field. There is no assumed 1::1 correspondence + between filtered ephys signals and electrodes, as a single signal can apply + to many nearby electrodes, and one electrode may have different filtered (e.g., + theta and/or gamma) signals represented. Filter properties should be noted in + the ElectricalSeries. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing filtered electrophysiology + data. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + LFP: + name: LFP + description: LFP data from one or more channels. The electrode map in each published + ElectricalSeries will identify which channels are providing LFP data. Filter + properties should be noted in the ElectricalSeries description or comments field. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing LFP data for one or more + channels. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + ElectrodeGroup: + name: ElectrodeGroup + description: A physical grouping of electrodes, e.g. a shank of an array. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this electrode group. + range: text + location: + name: location + description: Location of electrode group. Specify the area, layer, comments + on estimation of area/layer, etc. Use standard atlas names for anatomical + regions when possible. + range: text + position: + name: position + description: stereotaxic or common framework coordinates + multivalued: false + range: AnyType + required: false + tree_root: true + ClusterWaveforms: + name: ClusterWaveforms + description: DEPRECATED The mean waveform shape, including standard deviation, + of the different clusters. Ideally, the waveform analysis should be performed + on data that is only high-pass filtered. This is a separate module because it + is expected to require updating. For example, IMEC probes may require different + storage requirements to store/display mean waveforms, requiring a new interface + or an extension of this one. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + waveform_filtering: + name: waveform_filtering + description: Filtering applied to data before generating mean/sd + multivalued: false + range: text + required: true + waveform_mean: + name: waveform_mean + description: The mean waveform for each cluster, using the same indices for + each wave as cluster numbers in the associated Clustering module (i.e, cluster + 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence + should be empty (e.g., zero- filled) + multivalued: false + range: ClusterWaveforms__waveform_mean + required: true + waveform_sd: + name: waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as + in mean + multivalued: false + range: ClusterWaveforms__waveform_sd + required: true + tree_root: true + ClusterWaveforms__waveform_mean: + name: ClusterWaveforms__waveform_mean + description: The mean waveform for each cluster, using the same indices for each + wave as cluster numbers in the associated Clustering module (i.e, cluster 3 + is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should + be empty (e.g., zero- filled) + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + array: + name: array + range: ClusterWaveforms__waveform_mean__Array + ClusterWaveforms__waveform_mean__Array: + name: ClusterWaveforms__waveform_mean__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + ClusterWaveforms__waveform_sd: + name: ClusterWaveforms__waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as in + mean + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + array: + name: array + range: ClusterWaveforms__waveform_sd__Array + ClusterWaveforms__waveform_sd__Array: + name: ClusterWaveforms__waveform_sd__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + Clustering: + name: Clustering + description: DEPRECATED Clustered spike data, whether from automatic clustering + tools (e.g., klustakwik) or as a result of manual sorting. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of clusters or clustering, (e.g. cluster 0 is noise, + clusters curated using Klusters, etc) + multivalued: false + range: text + required: true + num: + name: num + description: Cluster number of each event + multivalued: true + range: int32 + required: true + peak_over_rms: + name: peak_over_rms + description: Maximum ratio of waveform peak to RMS on any channel in the cluster + (provides a basic clustering metric). + multivalued: true + range: float32 + required: true + times: + name: times + description: Times of clustered events, in seconds. This may be a link to + times field in associated FeatureExtraction module. + multivalued: true + range: float64 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.epoch.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.epoch.yaml new file mode 100644 index 0000000..1613ae1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.epoch.yaml @@ -0,0 +1,74 @@ +name: core.nwb.epoch +id: core.nwb.epoch +version: 2.2.2 +imports: +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.epoch/ +classes: + TimeIntervals: + name: TimeIntervals + description: A container for aggregating epoch data and the TimeSeries that each + epoch applies to. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + start_time: + name: start_time + description: Start time of epoch, in seconds. + multivalued: true + range: float32 + stop_time: + name: stop_time + description: Stop time of epoch, in seconds. + multivalued: true + range: float32 + tags: + name: tags + description: User-defined tags that identify or categorize events. + multivalued: true + range: text + tags_index: + name: tags_index + description: Index for tags. + multivalued: false + range: TimeIntervals__tags_index + required: false + timeseries: + name: timeseries + description: An index into a TimeSeries object. + multivalued: true + range: AnyType + timeseries_index: + name: timeseries_index + description: Index for timeseries. + multivalued: false + range: TimeIntervals__timeseries_index + required: false + tree_root: true + TimeIntervals__tags_index: + name: TimeIntervals__tags_index + description: Index for tags. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(tags_index) + range: string + required: true + equals_string: tags_index + TimeIntervals__timeseries_index: + name: TimeIntervals__timeseries_index + description: Index for timeseries. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(timeseries_index) + range: string + required: true + equals_string: timeseries_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.file.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.file.yaml new file mode 100644 index 0000000..d697433 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.file.yaml @@ -0,0 +1,636 @@ +name: core.nwb.file +id: core.nwb.file +version: 2.2.2 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.device +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.epoch +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.file/ +classes: + NWBFile: + name: NWBFile + description: An NWB:N file storing cellular-based neurophysiology data from a + single experimental session. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(root) + range: string + required: true + equals_string: root + nwb_version: + name: nwb_version + description: File version string. Use semantic versioning, e.g. 1.2.1. This + will be the name of the format with trailing major, minor and patch numbers. + range: text + file_create_date: + name: file_create_date + description: 'A record of the date the file was created and of subsequent + modifications. The date is stored in UTC with local timezone offset as ISO + 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored + in UTC end in "Z" with no timezone offset. Date accuracy is up to milliseconds. + The file can be created after the experiment was run, so this may differ + from the experiment start time. Each modification to the nwb file adds a + new entry to the array.' + multivalued: true + range: isodatetime + required: true + identifier: + name: identifier + description: A unique text identifier for the file. For example, concatenated + lab name, file creation date/time and experimentalist, or a hash of these + and/or other values. The goal is that the string should be unique to all + other files. + multivalued: false + range: text + required: true + session_description: + name: session_description + description: A description of the experimental session and data in the file. + multivalued: false + range: text + required: true + session_start_time: + name: session_start_time + description: 'Date and time of the experiment/session start. The date is stored + in UTC with local timezone offset as ISO 8601 extended formatted string: + 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in "Z" with no timezone + offset. Date accuracy is up to milliseconds.' + multivalued: false + range: isodatetime + required: true + timestamps_reference_time: + name: timestamps_reference_time + description: 'Date and time corresponding to time zero of all timestamps. + The date is stored in UTC with local timezone offset as ISO 8601 extended + formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end + in "Z" with no timezone offset. Date accuracy is up to milliseconds. All + times stored in the file use this time as reference (i.e., time zero).' + multivalued: false + range: isodatetime + required: true + acquisition: + name: acquisition + description: Data streams recorded from the system, including ephys, ophys, + tracking, etc. This group should be read-only after the experiment is completed + and timestamps are corrected to a common timebase. The data stored here + may be links to raw data stored in external NWB files. This will allow keeping + bulky raw data out of the file while preserving the option of keeping some/all + in the file. Acquired data includes tracking and experimental data streams + (i.e., everything measured from the system). If bulky data is stored in + the /acquisition group, the data can exist in a separate NWB file that is + linked to by the file being used for processing and analysis. + multivalued: true + any_of: + - range: NWBDataInterface + - range: DynamicTable + analysis: + name: analysis + description: Lab-specific and custom scientific analysis of data. There is + no defined format for the content of this group - the format is up to the + individual user/lab. To facilitate sharing analysis data between labs, the + contents here should be stored in standard types (e.g., neurodata_types) + and appropriately documented. The file can store lab-specific and custom + data analysis without restriction on its form or schema, reducing data formatting + restrictions on end users. Such data should be placed in the analysis group. + The analysis data should be documented so that it could be shared with other + labs. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + scratch: + name: scratch + description: A place to store one-off analysis results. Data placed here is + not intended for sharing. By placing data here, users acknowledge that there + is no guarantee that their data meets any standard. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + processing: + name: processing + description: The home for ProcessingModules. These modules perform intermediate + analysis of data that is necessary to perform before scientific analysis. + Examples include spike clustering, extracting position from tracking data, + stitching together image slices. ProcessingModules can be large and express + many data sets from relatively complex analysis (e.g., spike detection and + clustering) or small, representing extraction of position information from + tracking video, or even binary lick/no-lick decisions. Common software tools + (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' + refers to intermediate analysis of the acquired data to make it more amenable + to scientific analysis. + multivalued: true + any_of: + - range: ProcessingModule + stimulus: + name: stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment + complete and timestamps are corrected to common timebase. Stores both presented + stimuli and stimulus templates, the latter in case the same stimulus is + presented multiple times, or is pulled from an external stimulus library. + Stimuli are here defined as any signal that is pushed into the system as + part of the experiment (eg, sound, video, voltage, etc). Many different + experiments can use the same stimuli, and stimuli can be re-used during + an experiment. The stimulus group is organized so that one version of template + stimuli can be stored and these be used multiple times. These templates + can exist in the present file or can be linked to a remote library file. + multivalued: false + range: NWBFile__stimulus + required: true + general: + name: general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used + to describe the experiment. Metadata necessary for interpreting the data + is stored with the data. General experimental metadata, including animal + strain, experimental protocols, experimenter, devices, etc, are stored under + 'general'. Core metadata (e.g., that required to interpret data fields) + is stored with the data itself, and implicitly defined by the file specification + (e.g., time is in seconds). The strategy used here for storing non-core + metadata is to use free-form text fields, such as would appear in sentences + or paragraphs from a Methods section. Metadata fields are text to enable + them to be more general, for example to represent ranges instead of numerical + values. Machine-readable metadata is stored as attributes to these free-form + datasets. All entries in the below table are to be included when data is + present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) + should not be created unless there is data to store within them. + multivalued: false + range: NWBFile__general + required: true + intervals: + name: intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during + an experiment, or epochs (see epochs subgroup) deriving from analysis of + data. + multivalued: false + range: NWBFile__intervals + required: false + units: + name: units + description: Data about sorted spike units. + multivalued: false + range: Units + required: false + tree_root: true + NWBFile__stimulus: + name: NWBFile__stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment complete + and timestamps are corrected to common timebase. Stores both presented stimuli + and stimulus templates, the latter in case the same stimulus is presented multiple + times, or is pulled from an external stimulus library. Stimuli are here defined + as any signal that is pushed into the system as part of the experiment (eg, + sound, video, voltage, etc). Many different experiments can use the same stimuli, + and stimuli can be re-used during an experiment. The stimulus group is organized + so that one version of template stimuli can be stored and these be used multiple + times. These templates can exist in the present file or can be linked to a remote + library file. + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + presentation: + name: presentation + description: Stimuli presented during the experiment. + multivalued: true + any_of: + - range: TimeSeries + templates: + name: templates + description: Template stimuli. Timestamps in templates are based on stimulus + design and are relative to the beginning of the stimulus. When templates + are used, the stimulus instances must convert presentation times to the + experiment`s time reference frame. + multivalued: true + any_of: + - range: TimeSeries + NWBFile__general: + name: NWBFile__general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used to + describe the experiment. Metadata necessary for interpreting the data is stored + with the data. General experimental metadata, including animal strain, experimental + protocols, experimenter, devices, etc, are stored under 'general'. Core metadata + (e.g., that required to interpret data fields) is stored with the data itself, + and implicitly defined by the file specification (e.g., time is in seconds). + The strategy used here for storing non-core metadata is to use free-form text + fields, such as would appear in sentences or paragraphs from a Methods section. + Metadata fields are text to enable them to be more general, for example to represent + ranges instead of numerical values. Machine-readable metadata is stored as attributes + to these free-form datasets. All entries in the below table are to be included + when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology + experiment) should not be created unless there is data to store within them. + attributes: + name: + name: name + ifabsent: string(general) + range: string + required: true + equals_string: general + data_collection: + name: data_collection + description: Notes about data collection and analysis. + multivalued: false + range: text + required: false + experiment_description: + name: experiment_description + description: General description of the experiment. + multivalued: false + range: text + required: false + experimenter: + name: experimenter + description: Name of person(s) who performed the experiment. Can also specify + roles of different people involved. + multivalued: true + range: text + required: false + institution: + name: institution + description: Institution(s) where experiment was performed. + multivalued: false + range: text + required: false + keywords: + name: keywords + description: Terms to search over. + multivalued: true + range: text + required: false + lab: + name: lab + description: Laboratory where experiment was performed. + multivalued: false + range: text + required: false + notes: + name: notes + description: Notes about the experiment. + multivalued: false + range: text + required: false + pharmacology: + name: pharmacology + description: Description of drugs used, including how and when they were administered. + Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc. + multivalued: false + range: text + required: false + protocol: + name: protocol + description: Experimental protocol, if applicable. e.g., include IACUC protocol + number. + multivalued: false + range: text + required: false + related_publications: + name: related_publications + description: Publication information. PMID, DOI, URL, etc. + multivalued: true + range: text + required: false + session_id: + name: session_id + description: Lab-specific ID for the session. + multivalued: false + range: text + required: false + slices: + name: slices + description: Description of slices, including information about preparation + thickness, orientation, temperature, and bath solution. + multivalued: false + range: text + required: false + source_script: + name: source_script + description: Script file or link to public source code used to create this + NWB file. + multivalued: false + range: NWBFile__general__source_script + required: false + stimulus: + name: stimulus + description: Notes about stimuli, such as how and where they were presented. + multivalued: false + range: text + required: false + surgery: + name: surgery + description: Narrative description about surgery/surgeries, including date(s) + and who performed surgery. + multivalued: false + range: text + required: false + virus: + name: virus + description: Information about virus(es) used in experiments, including virus + ID, source, date made, injection location, volume, etc. + multivalued: false + range: text + required: false + nwb_container: + name: nwb_container + description: Place-holder than can be extended so that lab-specific meta-data + can be placed in /general. + multivalued: true + range: NWBContainer + required: false + devices: + name: devices + description: Description of hardware devices used during experiment, e.g., + monitors, ADC boards, microscopes, etc. + multivalued: true + any_of: + - range: Device + subject: + name: subject + description: Information about the animal or person from which the data was + measured. + multivalued: false + range: Subject + required: false + extracellular_ephys: + name: extracellular_ephys + description: Metadata related to extracellular electrophysiology. + multivalued: false + range: NWBFile__general__extracellular_ephys + required: false + intracellular_ephys: + name: intracellular_ephys + description: Metadata related to intracellular electrophysiology. + multivalued: false + range: NWBFile__general__intracellular_ephys + required: false + optogenetics: + name: optogenetics + description: Metadata describing optogenetic stimuluation. + multivalued: true + any_of: + - range: OptogeneticStimulusSite + optophysiology: + name: optophysiology + description: Metadata related to optophysiology. + multivalued: true + any_of: + - range: ImagingPlane + NWBFile__general__source_script: + name: NWBFile__general__source_script + description: Script file or link to public source code used to create this NWB + file. + attributes: + name: + name: name + ifabsent: string(source_script) + range: string + required: true + equals_string: source_script + file_name: + name: file_name + description: Name of script file. + range: text + value: + name: value + range: text + required: true + Subject: + name: Subject + description: Information about the animal or person from which the data was measured. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(subject) + range: string + required: true + equals_string: subject + age: + name: age + description: Age of subject. Can be supplied instead of 'date_of_birth'. + multivalued: false + range: text + required: false + date_of_birth: + name: date_of_birth + description: Date of birth of subject. Can be supplied instead of 'age'. + multivalued: false + range: isodatetime + required: false + description: + name: description + description: Description of subject and where subject came from (e.g., breeder, + if animal). + multivalued: false + range: text + required: false + genotype: + name: genotype + description: Genetic strain. If absent, assume Wild Type (WT). + multivalued: false + range: text + required: false + sex: + name: sex + description: Gender of subject. + multivalued: false + range: text + required: false + species: + name: species + description: Species of subject. + multivalued: false + range: text + required: false + subject_id: + name: subject_id + description: ID of animal/person used/participating in experiment (lab convention). + multivalued: false + range: text + required: false + weight: + name: weight + description: Weight at time of experiment, at time of surgery and at other + important times. + multivalued: false + range: text + required: false + NWBFile__general__extracellular_ephys: + name: NWBFile__general__extracellular_ephys + description: Metadata related to extracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(extracellular_ephys) + range: string + required: true + equals_string: extracellular_ephys + electrode_group: + name: electrode_group + description: Physical group of electrodes. + multivalued: true + range: ElectrodeGroup + required: false + electrodes: + name: electrodes + description: A table of all electrodes (i.e. channels) used for recording. + multivalued: false + range: NWBFile__general__extracellular_ephys__electrodes + required: false + NWBFile__general__extracellular_ephys__electrodes: + name: NWBFile__general__extracellular_ephys__electrodes + description: A table of all electrodes (i.e. channels) used for recording. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + x: + name: x + description: x coordinate of the channel location in the brain (+x is posterior). + multivalued: true + range: float32 + y: + name: y + description: y coordinate of the channel location in the brain (+y is inferior). + multivalued: true + range: float32 + z: + name: z + description: z coordinate of the channel location in the brain (+z is right). + multivalued: true + range: float32 + imp: + name: imp + description: Impedance of the channel. + multivalued: true + range: float32 + location: + name: location + description: Location of the electrode (channel). Specify the area, layer, + comments on estimation of area/layer, stereotaxic coordinates if in vivo, + etc. Use standard atlas names for anatomical regions when possible. + multivalued: true + range: text + filtering: + name: filtering + description: Description of hardware filtering. + multivalued: true + range: float32 + group: + name: group + description: Reference to the ElectrodeGroup this electrode is a part of. + multivalued: true + range: ElectrodeGroup + group_name: + name: group_name + description: Name of the ElectrodeGroup this electrode is a part of. + multivalued: true + range: text + rel_x: + name: rel_x + description: x coordinate in electrode group + multivalued: true + range: float32 + rel_y: + name: rel_y + description: y coordinate in electrode group + multivalued: true + range: float32 + rel_z: + name: rel_z + description: z coordinate in electrode group + multivalued: true + range: float32 + reference: + name: reference + description: Description of the reference used for this electrode. + multivalued: true + range: text + NWBFile__general__intracellular_ephys: + name: NWBFile__general__intracellular_ephys + description: Metadata related to intracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(intracellular_ephys) + range: string + required: true + equals_string: intracellular_ephys + filtering: + name: filtering + description: Description of filtering used. Includes filtering type and parameters, + frequency fall-off, etc. If this changes between TimeSeries, filter description + should be stored as a text attribute for each TimeSeries. + multivalued: false + range: text + required: false + intracellular_electrode: + name: intracellular_electrode + description: An intracellular electrode. + multivalued: true + range: IntracellularElectrode + required: false + sweep_table: + name: sweep_table + description: The table which groups different PatchClampSeries together. + multivalued: false + range: SweepTable + required: false + NWBFile__intervals: + name: NWBFile__intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during an + experiment, or epochs (see epochs subgroup) deriving from analysis of data. + attributes: + name: + name: name + ifabsent: string(intervals) + range: string + required: true + equals_string: intervals + epochs: + name: epochs + description: Divisions in time marking experimental stages or sub-divisions + of a single recording session. + multivalued: false + range: TimeIntervals + required: false + trials: + name: trials + description: Repeated experimental events that have a logical grouping. + multivalued: false + range: TimeIntervals + required: false + invalid_times: + name: invalid_times + description: Time intervals that should be removed from analysis. + multivalued: false + range: TimeIntervals + required: false + time_intervals: + name: time_intervals + description: Optional additional table(s) for describing other experimental + time intervals. + multivalued: true + range: TimeIntervals + required: false diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.icephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.icephys.yaml new file mode 100644 index 0000000..4156b5b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.icephys.yaml @@ -0,0 +1,503 @@ +name: core.nwb.icephys +id: core.nwb.icephys +version: 2.2.2 +imports: +- core.nwb.base +- core.nwb.device +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.language +default_prefix: core.nwb.icephys/ +classes: + PatchClampSeries: + name: PatchClampSeries + description: An abstract base class for patch-clamp data - stimulus or response, + current or voltage. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: Protocol/stimulus name for this patch-clamp dataset. + range: text + sweep_number: + name: sweep_number + description: Sweep number, allows to group different PatchClampSeries together. + range: uint32 + data: + name: data + description: Recorded voltage or current. + multivalued: true + range: numeric + required: true + gain: + name: gain + description: Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt + (c-clamp). + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries: + name: CurrentClampSeries + description: Voltage data from an intracellular current-clamp recording. A corresponding + CurrentClampStimulusSeries (stored separately as a stimulus) is used to store + the current injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage. + multivalued: false + range: CurrentClampSeries__data + required: true + bias_current: + name: bias_current + description: Bias current, in amps. + multivalued: false + range: float32 + required: false + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms. + multivalued: false + range: float32 + required: false + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads. + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries__data: + name: CurrentClampSeries__data + description: Recorded voltage. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IZeroClampSeries: + name: IZeroClampSeries + description: Voltage data from an intracellular recording when all current and + amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There + is no CurrentClampStimulusSeries associated with an IZero series because the + amplifier is disconnected and no stimulus can reach the cell. + is_a: CurrentClampSeries + attributes: + name: + name: name + range: string + required: true + bias_current: + name: bias_current + description: Bias current, in amps, fixed to 0.0. + multivalued: false + range: float32 + required: true + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms, fixed to 0.0. + multivalued: false + range: float32 + required: true + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads, fixed to 0.0. + multivalued: false + range: float32 + required: true + tree_root: true + CurrentClampStimulusSeries: + name: CurrentClampStimulusSeries + description: Stimulus current applied during current clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus current applied. + multivalued: false + range: CurrentClampStimulusSeries__data + required: true + tree_root: true + CurrentClampStimulusSeries__data: + name: CurrentClampStimulusSeries__data + description: Stimulus current applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries: + name: VoltageClampSeries + description: Current data from an intracellular voltage-clamp recording. A corresponding + VoltageClampStimulusSeries (stored separately as a stimulus) is used to store + the voltage injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded current. + multivalued: false + range: VoltageClampSeries__data + required: true + capacitance_fast: + name: capacitance_fast + description: Fast capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_fast + required: false + capacitance_slow: + name: capacitance_slow + description: Slow capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_slow + required: false + resistance_comp_bandwidth: + name: resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + multivalued: false + range: VoltageClampSeries__resistance_comp_bandwidth + required: false + resistance_comp_correction: + name: resistance_comp_correction + description: Resistance compensation correction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_correction + required: false + resistance_comp_prediction: + name: resistance_comp_prediction + description: Resistance compensation prediction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_prediction + required: false + whole_cell_capacitance_comp: + name: whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + multivalued: false + range: VoltageClampSeries__whole_cell_capacitance_comp + required: false + whole_cell_series_resistance_comp: + name: whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + multivalued: false + range: VoltageClampSeries__whole_cell_series_resistance_comp + required: false + tree_root: true + VoltageClampSeries__data: + name: VoltageClampSeries__data + description: Recorded current. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries__capacitance_fast: + name: VoltageClampSeries__capacitance_fast + description: Fast capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_fast) + range: string + required: true + equals_string: capacitance_fast + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__capacitance_slow: + name: VoltageClampSeries__capacitance_slow + description: Slow capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_slow) + range: string + required: true + equals_string: capacitance_slow + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_bandwidth: + name: VoltageClampSeries__resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + attributes: + name: + name: name + ifabsent: string(resistance_comp_bandwidth) + range: string + required: true + equals_string: resistance_comp_bandwidth + unit: + name: unit + description: Unit of measurement for resistance_comp_bandwidth, which is fixed + to 'hertz'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_correction: + name: VoltageClampSeries__resistance_comp_correction + description: Resistance compensation correction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_correction) + range: string + required: true + equals_string: resistance_comp_correction + unit: + name: unit + description: Unit of measurement for resistance_comp_correction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_prediction: + name: VoltageClampSeries__resistance_comp_prediction + description: Resistance compensation prediction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_prediction) + range: string + required: true + equals_string: resistance_comp_prediction + unit: + name: unit + description: Unit of measurement for resistance_comp_prediction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_capacitance_comp: + name: VoltageClampSeries__whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + attributes: + name: + name: name + ifabsent: string(whole_cell_capacitance_comp) + range: string + required: true + equals_string: whole_cell_capacitance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_capacitance_comp, which is + fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_series_resistance_comp: + name: VoltageClampSeries__whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + attributes: + name: + name: name + ifabsent: string(whole_cell_series_resistance_comp) + range: string + required: true + equals_string: whole_cell_series_resistance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_series_resistance_comp, which + is fixed to 'ohms'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampStimulusSeries: + name: VoltageClampStimulusSeries + description: Stimulus voltage applied during a voltage clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus voltage applied. + multivalued: false + range: VoltageClampStimulusSeries__data + required: true + tree_root: true + VoltageClampStimulusSeries__data: + name: VoltageClampStimulusSeries__data + description: Stimulus voltage applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IntracellularElectrode: + name: IntracellularElectrode + description: An intracellular electrode and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of electrode (e.g., whole-cell, sharp, etc.). + multivalued: false + range: text + required: true + filtering: + name: filtering + description: Electrode specific filtering. + multivalued: false + range: text + required: false + initial_access_resistance: + name: initial_access_resistance + description: Initial access resistance. + multivalued: false + range: text + required: false + location: + name: location + description: Location of the electrode. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: false + resistance: + name: resistance + description: Electrode resistance, in ohms. + multivalued: false + range: text + required: false + seal: + name: seal + description: Information about seal used for recording. + multivalued: false + range: text + required: false + slice: + name: slice + description: Information about slice used for recording. + multivalued: false + range: text + required: false + tree_root: true + SweepTable: + name: SweepTable + description: The table which groups different PatchClampSeries together. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + sweep_number: + name: sweep_number + description: Sweep number of the PatchClampSeries in that row. + multivalued: true + range: uint32 + series: + name: series + description: The PatchClampSeries with the sweep number in that row. + multivalued: true + range: PatchClampSeries + series_index: + name: series_index + description: Index for series. + multivalued: false + range: SweepTable__series_index + required: true + tree_root: true + SweepTable__series_index: + name: SweepTable__series_index + description: Index for series. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(series_index) + range: string + required: true + equals_string: series_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.image.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.image.yaml new file mode 100644 index 0000000..83153dc --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.image.yaml @@ -0,0 +1,312 @@ +name: core.nwb.image +id: core.nwb.image +version: 2.2.2 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.image/ +classes: + GrayscaleImage: + name: GrayscaleImage + description: A grayscale image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: GrayscaleImage__Array + tree_root: true + GrayscaleImage__Array: + name: GrayscaleImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + RGBImage: + name: RGBImage + description: A color image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBImage__Array + tree_root: true + RGBImage__Array: + name: RGBImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RGBAImage: + name: RGBAImage + description: A color image with transparency. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBAImage__Array + tree_root: true + RGBAImage__Array: + name: RGBAImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b, a: + name: r, g, b, a + range: numeric + required: true + minimum_cardinality: 4 + maximum_cardinality: 4 + ImageSeries: + name: ImageSeries + description: General image data that is common between acquisition and stimulus + time series. Sometimes the image data is stored in the file in a raw format + while other times it will be stored as a series of external image files in the + host file system. The data field will either be binary data, if the data is + stored in the NWB file, or empty, if the data is stored in an external image + stack. [frame][x][y] or [frame][x][y][z]. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Binary data representing images across frames. + multivalued: false + range: ImageSeries__data + required: false + dimension: + name: dimension + description: Number of pixels on x, y, (and z) axes. + multivalued: true + range: int32 + required: false + external_file: + name: external_file + description: Paths to one or more external file(s). The field is only present + if format='external'. This is only relevant if the image series is stored + in the file system as one or more image file(s). This field should NOT be + used if the image is stored in another NWB file and that file is linked + to this file. + multivalued: true + range: text + required: false + format: + name: format + description: Format of image. If this is 'external', then the attribute 'external_file' + contains the path information to the image files. If this is 'raw', then + the raw (single-channel) binary data is stored in the 'data' dataset. If + this attribute is not present, then the default format='raw' case is assumed. + multivalued: false + range: text + required: false + tree_root: true + ImageSeries__data: + name: ImageSeries__data + description: Binary data representing images across frames. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: ImageSeries__data__Array + ImageSeries__data__Array: + name: ImageSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + z: + name: z + range: numeric + required: false + ImageMaskSeries: + name: ImageMaskSeries + description: An alpha mask that is applied to a presented visual stimulus. The + 'data' array contains an array of mask values that are applied to the displayed + image. Mask values are stored as RGBA. Mask can vary with time. The timestamps + array indicates the starting time of a mask, and that mask pattern continues + until it's explicitly changed. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + tree_root: true + OpticalSeries: + name: OpticalSeries + description: Image data that is presented or recorded. A stimulus template movie + will be stored only as an image. When the image is presented as stimulus, additional + data is required, such as field of view (e.g., how much of the visual field + the image covers, or how what is the area of the target being imaged). If the + OpticalSeries represents acquired imaging data, orientation is also important. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + distance: + name: distance + description: Distance from camera/monitor to target/eye. + multivalued: false + range: float32 + required: false + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: OpticalSeries__field_of_view + required: false + data: + name: data + description: Images presented to subject, either grayscale or RGB + multivalued: false + range: OpticalSeries__data + required: true + orientation: + name: orientation + description: Description of image relative to some reference frame (e.g., + which way is up). Must also specify frame of reference. + multivalued: false + range: text + required: false + tree_root: true + OpticalSeries__field_of_view: + name: OpticalSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: OpticalSeries__field_of_view__Array + OpticalSeries__field_of_view__Array: + name: OpticalSeries__field_of_view__Array + is_a: Arraylike + attributes: + width, height: + name: width, height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width, height, depth: + name: width, height, depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalSeries__data: + name: OpticalSeries__data + description: Images presented to subject, either grayscale or RGB + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: OpticalSeries__data__Array + OpticalSeries__data__Array: + name: OpticalSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + IndexSeries: + name: IndexSeries + description: Stores indices to image frames stored in an ImageSeries. The purpose + of the ImageIndexSeries is to allow a static image stack to be stored somewhere, + and the images in the stack to be referenced out-of-order. This can be for the + display of individual images, or of movie segments (as a movie is simply a series + of images). The data field stores the index of the frame in the referenced ImageSeries, + and the timestamps array indicates when that image was displayed. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Index of the frame in the referenced ImageSeries. + multivalued: true + range: int32 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.language.yaml new file mode 100644 index 0000000..c57e91f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.language.yaml @@ -0,0 +1,148 @@ +name: core.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.misc.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.misc.yaml new file mode 100644 index 0000000..b20b58f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.misc.yaml @@ -0,0 +1,406 @@ +name: core.nwb.misc +id: core.nwb.misc +version: 2.2.2 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.ecephys +- core.nwb.language +default_prefix: core.nwb.misc/ +classes: + AbstractFeatureSeries: + name: AbstractFeatureSeries + description: Abstract features, such as quantitative descriptions of sensory stimuli. + The TimeSeries::data field is a 2D array, storing those features (e.g., for + visual grating stimulus this might be orientation, spatial frequency and contrast). + Null stimuli (eg, uniform gray) can be marked as being an independent feature + (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, + or through use of the TimeSeries::control fields. A set of features is considered + to persist until the next set of features is defined. The final set of features + stored should be the null set. This is useful when storing the raw stimulus + is impractical. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Values of each feature at each time. + multivalued: false + range: AbstractFeatureSeries__data + required: true + feature_units: + name: feature_units + description: Units of each feature. + multivalued: true + range: text + required: false + features: + name: features + description: Description of the features represented in TimeSeries::data. + multivalued: true + range: text + required: true + tree_root: true + AbstractFeatureSeries__data: + name: AbstractFeatureSeries__data + description: Values of each feature at each time. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Since there can be different units for different features, store + the units in 'feature_units'. The default value for this attribute is "see + 'feature_units'". + range: text + array: + name: array + range: AbstractFeatureSeries__data__Array + AbstractFeatureSeries__data__Array: + name: AbstractFeatureSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + AnnotationSeries: + name: AnnotationSeries + description: Stores user annotations made during an experiment. The data[] field + stores a text array, and timestamps are stored for each annotation (ie, interval=1). + This is largely an alias to a standard TimeSeries storing a text array but that + is identifiable as storing annotations in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Annotations made during an experiment. + multivalued: true + range: text + required: true + tree_root: true + IntervalSeries: + name: IntervalSeries + description: Stores intervals of data. The timestamps field stores the beginning + and end of intervals. The data field stores whether the interval just started + (>0 value) or ended (<0 value). Different interval types can be represented + in the same series by using multiple key values (eg, 1 for feature A, 2 for + feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This + is largely an alias of a standard TimeSeries but that is identifiable as representing + time intervals in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Use values >0 if interval started, <0 if interval ended. + multivalued: true + range: int8 + required: true + tree_root: true + DecompositionSeries: + name: DecompositionSeries + description: Spectral analysis of a time series, e.g. of an LFP or a speech signal. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Data decomposed into frequency bands. + multivalued: false + range: DecompositionSeries__data + required: true + metric: + name: metric + description: The metric used, e.g. phase, amplitude, power. + multivalued: false + range: text + required: true + bands: + name: bands + description: Table for describing the bands that this series was generated + from. There should be one row in this table for each band. + multivalued: false + range: DecompositionSeries__bands + required: true + tree_root: true + DecompositionSeries__data: + name: DecompositionSeries__data + description: Data decomposed into frequency bands. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: DecompositionSeries__data__Array + DecompositionSeries__data__Array: + name: DecompositionSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: true + num_bands: + name: num_bands + range: numeric + required: true + DecompositionSeries__bands: + name: DecompositionSeries__bands + description: Table for describing the bands that this series was generated from. + There should be one row in this table for each band. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(bands) + range: string + required: true + equals_string: bands + band_name: + name: band_name + description: Name of the band, e.g. theta. + multivalued: true + range: text + band_limits: + name: band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + multivalued: false + range: DecompositionSeries__bands__band_limits + required: true + band_mean: + name: band_mean + description: The mean Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + band_stdev: + name: band_stdev + description: The standard deviation of Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + DecompositionSeries__bands__band_limits: + name: DecompositionSeries__bands__band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(band_limits) + range: string + required: true + equals_string: band_limits + Units: + name: Units + description: Data about spiking units. Event times of observed units (e.g. cell, + synapse, etc.) should be concatenated and stored in spike_times. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + spike_times_index: + name: spike_times_index + description: Index into the spike_times dataset. + multivalued: false + range: Units__spike_times_index + required: false + spike_times: + name: spike_times + description: Spike times for each unit. + multivalued: false + range: Units__spike_times + required: false + obs_intervals_index: + name: obs_intervals_index + description: Index into the obs_intervals dataset. + multivalued: false + range: Units__obs_intervals_index + required: false + obs_intervals: + name: obs_intervals + description: Observation intervals for each unit. + multivalued: false + range: Units__obs_intervals + required: false + electrodes_index: + name: electrodes_index + description: Index into electrodes. + multivalued: false + range: Units__electrodes_index + required: false + electrodes: + name: electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + multivalued: false + range: Units__electrodes + required: false + electrode_group: + name: electrode_group + description: Electrode group that each spike unit came from. + multivalued: true + range: ElectrodeGroup + waveform_mean: + name: waveform_mean + description: Spike waveform mean for each spike unit. + multivalued: false + range: Units__waveform_mean + required: false + waveform_sd: + name: waveform_sd + description: Spike waveform standard deviation for each spike unit. + multivalued: false + range: Units__waveform_sd + required: false + tree_root: true + Units__spike_times_index: + name: Units__spike_times_index + description: Index into the spike_times dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(spike_times_index) + range: string + required: true + equals_string: spike_times_index + Units__spike_times: + name: Units__spike_times + description: Spike times for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(spike_times) + range: string + required: true + equals_string: spike_times + resolution: + name: resolution + description: The smallest possible difference between two spike times. Usually + 1 divided by the acquisition sampling rate from which spike times were extracted, + but could be larger if the acquisition time series was downsampled or smaller + if the acquisition time series was smoothed/interpolated and it is possible + for the spike time to be between samples. + range: float64 + Units__obs_intervals_index: + name: Units__obs_intervals_index + description: Index into the obs_intervals dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(obs_intervals_index) + range: string + required: true + equals_string: obs_intervals_index + Units__obs_intervals: + name: Units__obs_intervals + description: Observation intervals for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(obs_intervals) + range: string + required: true + equals_string: obs_intervals + Units__electrodes_index: + name: Units__electrodes_index + description: Index into electrodes. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(electrodes_index) + range: string + required: true + equals_string: electrodes_index + Units__electrodes: + name: Units__electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + Units__waveform_mean: + name: Units__waveform_mean + description: Spike waveform mean for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveform_sd: + name: Units__waveform_sd + description: Spike waveform standard deviation for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.ogen.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.ogen.yaml new file mode 100644 index 0000000..d4a9196 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.ogen.yaml @@ -0,0 +1,55 @@ +name: core.nwb.ogen +id: core.nwb.ogen +version: 2.2.2 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ogen/ +classes: + OptogeneticSeries: + name: OptogeneticSeries + description: An optogenetic stimulus. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Applied power for optogenetic stimulus, in watts. + multivalued: true + range: numeric + required: true + tree_root: true + OptogeneticStimulusSite: + name: OptogeneticStimulusSite + description: A site of optogenetic stimulation. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of stimulation site. + multivalued: false + range: text + required: true + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + location: + name: location + description: Location of the stimulation site. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.ophys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.ophys.yaml new file mode 100644 index 0000000..d78cf07 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.ophys.yaml @@ -0,0 +1,546 @@ +name: core.nwb.ophys +id: core.nwb.ophys +version: 2.2.2 +imports: +- core.nwb.image +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ophys/ +classes: + TwoPhotonSeries: + name: TwoPhotonSeries + description: Image stack recorded over time from 2-photon microscope. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + pmt_gain: + name: pmt_gain + description: Photomultiplier gain. + range: float32 + scan_line_rate: + name: scan_line_rate + description: Lines imaged per second. This is also stored in /general/optophysiology + but is kept here as it is useful information for analysis, and so good to + be stored w/ the actual data. + range: float32 + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: TwoPhotonSeries__field_of_view + required: false + tree_root: true + TwoPhotonSeries__field_of_view: + name: TwoPhotonSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: TwoPhotonSeries__field_of_view__Array + TwoPhotonSeries__field_of_view__Array: + name: TwoPhotonSeries__field_of_view__Array + is_a: Arraylike + attributes: + width|height: + name: width|height + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + width|height|depth: + name: width|height|depth + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RoiResponseSeries: + name: RoiResponseSeries + description: ROI responses over an imaging plane. The first dimension represents + time. The second dimension, if present, represents ROIs. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Signals from ROIs. + multivalued: false + range: RoiResponseSeries__data + required: true + rois: + name: rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + multivalued: false + range: RoiResponseSeries__rois + required: true + tree_root: true + RoiResponseSeries__data: + name: RoiResponseSeries__data + description: Signals from ROIs. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: RoiResponseSeries__data__Array + RoiResponseSeries__data__Array: + name: RoiResponseSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_ROIs: + name: num_ROIs + range: numeric + required: false + RoiResponseSeries__rois: + name: RoiResponseSeries__rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(rois) + range: string + required: true + equals_string: rois + DfOverF: + name: DfOverF + description: dF/F information about a region of interest (ROI). Storage hierarchy + of dF/F should be the same as for segmentation (i.e., same names for ROIs and + for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing dF/F for a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + Fluorescence: + name: Fluorescence + description: Fluorescence information about a region of interest (ROI). Storage + hierarchy of fluorescence should be the same as for segmentation (ie, same names + for ROIs and for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing fluorescence data for + a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + ImageSegmentation: + name: ImageSegmentation + description: Stores pixels in an image that represent different regions of interest + (ROIs) or masks. All segmentation for a given imaging plane is stored together, + with storage for multiple imaging planes (masks) supported. Each ROI is stored + in its own subgroup, with the ROI group containing both a 2D mask and a list + of pixels that make up this mask. Segments can also be used for masking neuropil. + If segmentation is allowed to change with time, a new imaging plane (or module) + is required and ROI names should remain consistent between them. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + plane_segmentation: + name: plane_segmentation + description: Results from image segmentation of a specific imaging plane. + multivalued: true + range: PlaneSegmentation + required: true + tree_root: true + PlaneSegmentation: + name: PlaneSegmentation + description: Results from image segmentation of a specific imaging plane. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + image_mask: + name: image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + multivalued: false + range: PlaneSegmentation__image_mask + required: false + pixel_mask_index: + name: pixel_mask_index + description: Index into pixel_mask. + multivalued: false + range: PlaneSegmentation__pixel_mask_index + required: false + pixel_mask: + name: pixel_mask + description: 'Pixel masks for each ROI: a list of indices and weights for + the ROI. Pixel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + voxel_mask_index: + name: voxel_mask_index + description: Index into voxel_mask. + multivalued: false + range: PlaneSegmentation__voxel_mask_index + required: false + voxel_mask: + name: voxel_mask + description: 'Voxel masks for each ROI: a list of indices and weights for + the ROI. Voxel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + reference_images: + name: reference_images + description: Image stacks that the segmentation masks apply to. + multivalued: true + any_of: + - range: ImageSeries + PlaneSegmentation__image_mask: + name: PlaneSegmentation__image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(image_mask) + range: string + required: true + equals_string: image_mask + PlaneSegmentation__pixel_mask_index: + name: PlaneSegmentation__pixel_mask_index + description: Index into pixel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(pixel_mask_index) + range: string + required: true + equals_string: pixel_mask_index + PlaneSegmentation__voxel_mask_index: + name: PlaneSegmentation__voxel_mask_index + description: Index into voxel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(voxel_mask_index) + range: string + required: true + equals_string: voxel_mask_index + ImagingPlane: + name: ImagingPlane + description: An imaging plane and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the imaging plane. + multivalued: false + range: text + required: false + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + imaging_rate: + name: imaging_rate + description: Rate that images are acquired, in Hz. + multivalued: false + range: float32 + required: true + indicator: + name: indicator + description: Calcium indicator. + multivalued: false + range: text + required: true + location: + name: location + description: Location of the imaging plane. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + manifold: + name: manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents + the position of the pixel relative to the defined coordinate space. Deprecated + in favor of origin_coords and grid_spacing. + multivalued: false + range: ImagingPlane__manifold + required: false + origin_coords: + name: origin_coords + description: Physical location of the first element of the imaging plane (0, + 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for + what the physical location is relative to (e.g., bregma). + multivalued: false + range: ImagingPlane__origin_coords + required: false + grid_spacing: + name: grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also + reference_frame to interpret the grid. + multivalued: false + range: ImagingPlane__grid_spacing + required: false + reference_frame: + name: reference_frame + description: Describes reference frame of origin_coords and grid_spacing. + For example, this can be a text description of the anatomical location and + orientation of the grid defined by origin_coords and grid_spacing or the + vectors needed to transform or rotate the grid to a common anatomical axis + (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and + grid_spacing. If origin_coords and grid_spacing are not present, then this + field is not required. For example, if the microscope takes 10 x 10 x 2 + images, where the first value of the data matrix (index (0, 0, 0)) corresponds + to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is + 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means + more anterior, larger numbers in y means more rightward, and larger numbers + in z means more ventral, then enter the following -- origin_coords = (-1.2, + -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = "Origin coordinates + are relative to bregma. First dimension corresponds to anterior-posterior + axis (larger index = more anterior). Second dimension corresponds to medial-lateral + axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral + axis (larger index = more ventral)." + multivalued: false + range: text + required: false + optical_channel: + name: optical_channel + description: An optical channel used to record from an imaging plane. + multivalued: true + range: OpticalChannel + required: true + tree_root: true + ImagingPlane__manifold: + name: ImagingPlane__manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents the + position of the pixel relative to the defined coordinate space. Deprecated in + favor of origin_coords and grid_spacing. + attributes: + name: + name: name + ifabsent: string(manifold) + range: string + required: true + equals_string: manifold + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as pixels from + x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then + the 'conversion' multiplier to get from raw data acquisition pixel units + to meters is 2/1000. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__manifold__Array + ImagingPlane__manifold__Array: + name: ImagingPlane__manifold__Array + is_a: Arraylike + attributes: + height: + name: height + range: float32 + required: true + width: + name: width + range: float32 + required: true + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + depth: + name: depth + range: float32 + required: false + ImagingPlane__origin_coords: + name: ImagingPlane__origin_coords + description: Physical location of the first element of the imaging plane (0, 0) + for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the + physical location is relative to (e.g., bregma). + attributes: + name: + name: name + ifabsent: string(origin_coords) + range: string + required: true + equals_string: origin_coords + unit: + name: unit + description: Measurement units for origin_coords. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__origin_coords__Array + ImagingPlane__origin_coords__Array: + name: ImagingPlane__origin_coords__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + ImagingPlane__grid_spacing: + name: ImagingPlane__grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame + to interpret the grid. + attributes: + name: + name: name + ifabsent: string(grid_spacing) + range: string + required: true + equals_string: grid_spacing + unit: + name: unit + description: Measurement units for grid_spacing. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__grid_spacing__Array + ImagingPlane__grid_spacing__Array: + name: ImagingPlane__grid_spacing__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalChannel: + name: OpticalChannel + description: An optical channel used to record from an imaging plane. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description or other notes about the channel. + multivalued: false + range: text + required: true + emission_lambda: + name: emission_lambda + description: Emission wavelength for channel, in nm. + multivalued: false + range: float32 + required: true + MotionCorrection: + name: MotionCorrection + description: 'An image stack where all frames are shifted (registered) to a common + coordinate system, to account for movement and drift between frames. Note: each + frame at each point in time is assumed to be 2-D (has only x & y dimensions).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected_image_stack: + name: corrected_image_stack + description: Reuslts from motion correction of an image stack. + multivalued: true + range: CorrectedImageStack + required: true + tree_root: true + CorrectedImageStack: + name: CorrectedImageStack + description: Reuslts from motion correction of an image stack. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected: + name: corrected + description: Image stack with frames shifted to the common coordinates. + multivalued: false + range: ImageSeries + required: true + xy_translation: + name: xy_translation + description: Stores the x,y delta necessary to align each frame to the common + coordinates, for example, to align each frame to a reference image. + multivalued: false + range: TimeSeries + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.retinotopy.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.retinotopy.yaml similarity index 99% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.retinotopy.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.retinotopy.yaml index c6334c4..f39ff96 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.retinotopy.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/core.nwb.retinotopy.yaml @@ -1,8 +1,9 @@ name: core.nwb.retinotopy id: core.nwb.retinotopy +version: 2.2.2 imports: - core.nwb.base -- nwb.language +- core.nwb.language default_prefix: core.nwb.retinotopy/ classes: ImagingRetinotopy: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/namespace.yaml new file mode 100644 index 0000000..daa5754 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_2/namespace.yaml @@ -0,0 +1,24 @@ +name: core +annotations: + namespace: + tag: namespace + value: 'True' +description: NWB namespace +id: core +version: 2.2.2 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.epoch +- core.nwb.image +- core.nwb.file +- core.nwb.misc +- core.nwb.behavior +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.retinotopy +- core.nwb.language +- ../../hdmf_common/v1_1_3/namespace +default_prefix: core/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.base.yaml new file mode 100644 index 0000000..941cc80 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.base.yaml @@ -0,0 +1,303 @@ +name: core.nwb.base +id: core.nwb.base +version: 2.2.4 +imports: +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.language +default_prefix: core.nwb.base/ +classes: + NWBData: + name: NWBData + description: An abstract data type for a dataset. + is_a: Data + attributes: + name: + name: name + range: string + required: true + tree_root: true + Image: + name: Image + description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D + where the third dimension can have three or four elements, e.g. (x, y, (r, g, + b)) or (x, y, (r, g, b, a)). + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + resolution: + name: resolution + description: Pixel resolution of the image, in pixels per centimeter. + range: float32 + description: + name: description + description: Description of the image. + range: text + array: + name: array + range: Image__Array + tree_root: true + Image__Array: + name: Image__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + r, g, b, a: + name: r, g, b, a + range: numeric + required: false + minimum_cardinality: 4 + maximum_cardinality: 4 + NWBContainer: + name: NWBContainer + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + is_a: Container + attributes: + name: + name: name + range: string + required: true + tree_root: true + NWBDataInterface: + name: NWBDataInterface + description: An abstract data type for a generic container storing collections + of data, as opposed to metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeries: + name: TimeSeries + description: General purpose time series. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the time series. + range: text + comments: + name: comments + description: Human-readable comments about the TimeSeries. This second descriptive + field can be used to store additional information, or descriptive information + if the primary description field is populated with a computer-readable string. + range: text + data: + name: data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first + dimension should always represent time. This can also be used to store binary + data (e.g., image frames). This can also be a link to data stored in an + external file. + multivalued: false + range: TimeSeries__data + required: true + starting_time: + name: starting_time + description: Timestamp of the first sample in seconds. When timestamps are + uniformly spaced, the timestamp of the first sample can be specified and + all subsequent ones calculated from the sampling rate attribute. + multivalued: false + range: TimeSeries__starting_time + required: false + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + multivalued: true + range: float64 + required: false + control: + name: control + description: Numerical labels that apply to each time point in data for the + purpose of querying and slicing data by these values. If present, the length + of this array should be the same size as the first dimension of data. + multivalued: true + range: uint8 + required: false + control_description: + name: control_description + description: Description of each control value. Must be present if control + is present. If present, control_description[0] should describe time points + where control == 0. + multivalued: true + range: text + required: false + sync: + name: sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored + external to the NWB file, in files storing raw data. Once timestamp data + is calculated, the contents of 'sync' are mostly for archival purposes. + multivalued: false + range: TimeSeries__sync + required: false + tree_root: true + TimeSeries__data: + name: TimeSeries__data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension + should always represent time. This can also be used to store binary data (e.g., + image frames). This can also be a link to data stored in an external file. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as signed 16-bit + integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V + to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' + multiplier to get from raw data acquisition values to recorded volts is + 2.5/32768/8000 = 9.5367e-9. + range: float32 + resolution: + name: resolution + description: Smallest meaningful difference between values in data, stored + in the specified by unit, e.g., the change in value of the least significant + bit, or a larger number if signal noise is known to be present. If unknown, + use -1.0. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: TimeSeries__data__Array + TimeSeries__data__Array: + name: TimeSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: AnyType + required: true + num_DIM2: + name: num_DIM2 + range: AnyType + required: false + num_DIM3: + name: num_DIM3 + range: AnyType + required: false + num_DIM4: + name: num_DIM4 + range: AnyType + required: false + TimeSeries__starting_time: + name: TimeSeries__starting_time + description: Timestamp of the first sample in seconds. When timestamps are uniformly + spaced, the timestamp of the first sample can be specified and all subsequent + ones calculated from the sampling rate attribute. + attributes: + name: + name: name + ifabsent: string(starting_time) + range: string + required: true + equals_string: starting_time + rate: + name: rate + description: Sampling rate, in Hz. + range: float32 + unit: + name: unit + description: Unit of measurement for time, which is fixed to 'seconds'. + range: text + value: + name: value + range: float64 + required: true + TimeSeries__sync: + name: TimeSeries__sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored external + to the NWB file, in files storing raw data. Once timestamp data is calculated, + the contents of 'sync' are mostly for archival purposes. + attributes: + name: + name: name + ifabsent: string(sync) + range: string + required: true + equals_string: sync + ProcessingModule: + name: ProcessingModule + description: A collection of processed data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of processed data. + range: text + nwb_data_interface: + name: nwb_data_interface + description: Data objects stored in this collection. + multivalued: true + range: NWBDataInterface + required: false + dynamic_table: + name: dynamic_table + description: Tables stored in this collection. + multivalued: true + range: DynamicTable + required: false + tree_root: true + Images: + name: Images + description: A collection of images. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of images. + range: text + image: + name: image + description: Images stored in this collection. + multivalued: true + range: Image + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.behavior.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.behavior.yaml new file mode 100644 index 0000000..acebe41 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.behavior.yaml @@ -0,0 +1,201 @@ +name: core.nwb.behavior +id: core.nwb.behavior +version: 2.2.4 +imports: +- core.nwb.base +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.behavior/ +classes: + SpatialSeries: + name: SpatialSeries + description: 'Direction, e.g., of gaze or travel, or position. The TimeSeries::data + field is a 2D array storing position or direction relative to some reference + frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries + has a text dataset reference_frame that indicates the zero-position, or the + zero-axes for direction. For example, if representing gaze direction, ''straight-ahead'' + might be a specific pixel on the monitor, or some other point in space. For + position data, the 0,0 point might be the top-left corner of an enclosure, as + viewed from the tracking camera. The unit of data will indicate how to interpret + SpatialSeries values.' + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: 1-D or 2-D array storing position or direction relative to some + reference frame. + multivalued: false + range: SpatialSeries__data + required: true + reference_frame: + name: reference_frame + description: Description defining what exactly 'straight-ahead' means. + multivalued: false + range: text + required: false + tree_root: true + SpatialSeries__data: + name: SpatialSeries__data + description: 1-D or 2-D array storing position or direction relative to some reference + frame. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: SpatialSeries__data__Array + SpatialSeries__data__Array: + name: SpatialSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + BehavioralEpochs: + name: BehavioralEpochs + description: TimeSeries for storing behavioral epochs. The objective of this + and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) + is to provide generic hooks for software tools/scripts. This allows a tool/script + to take the output one specific interface (e.g., UnitTimes) and plot that data + relative to another data modality (e.g., behavioral events) without having to + define all possible modalities in advance. Declaring one of these interfaces + means that one or more TimeSeries of the specified type is published. These + TimeSeries should reside in a group having the same name as the interface. For + example, if a BehavioralTimeSeries interface is declared, the module will have + one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. + BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular + events. BehavioralTimeSeries is for continuous data. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + interval_series: + name: interval_series + description: IntervalSeries object containing start and stop times of epochs. + multivalued: true + range: IntervalSeries + required: false + tree_root: true + BehavioralEvents: + name: BehavioralEvents + description: TimeSeries for storing behavioral events. See description of BehavioralEpochs + for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing behavioral events. + multivalued: true + range: TimeSeries + required: false + tree_root: true + BehavioralTimeSeries: + name: BehavioralTimeSeries + description: TimeSeries for storing Behavoioral time series data. See description + of BehavioralEpochs for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing continuous behavioral data. + multivalued: true + range: TimeSeries + required: false + tree_root: true + PupilTracking: + name: PupilTracking + description: Eye-tracking data, representing pupil size. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing time series data on pupil size. + multivalued: true + range: TimeSeries + required: true + tree_root: true + EyeTracking: + name: EyeTracking + description: Eye-tracking data, representing direction of gaze. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing data measuring direction of gaze. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + CompassDirection: + name: CompassDirection + description: With a CompassDirection interface, a module publishes a SpatialSeries + object representing a floating point value for theta. The SpatialSeries::reference_frame + field should indicate what direction corresponds to 0 and which is the direction + of rotation (this should be clockwise). The si_unit for the SpatialSeries should + be radians or degrees. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing direction of gaze travel. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + Position: + name: Position + description: Position data, whether along the x, x/y or x/y/z axis. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing position data. + multivalued: true + range: SpatialSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.device.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.device.yaml new file mode 100644 index 0000000..233e587 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.device.yaml @@ -0,0 +1,28 @@ +name: core.nwb.device +id: core.nwb.device +version: 2.2.4 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.device/ +classes: + Device: + name: Device + description: Metadata about a data acquisition device, e.g., recording system, + electrode, microscope. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the device (e.g., model, firmware version, processing + software version, etc.) as free-form text. + range: text + manufacturer: + name: manufacturer + description: The name of the manufacturer of the device. + range: text + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.ecephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.ecephys.yaml new file mode 100644 index 0000000..aef2f64 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.ecephys.yaml @@ -0,0 +1,492 @@ +name: core.nwb.ecephys +id: core.nwb.ecephys +version: 2.2.4 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ecephys/ +classes: + ElectricalSeries: + name: ElectricalSeries + description: A time series of acquired voltage data from extracellular recordings. + The data field is an int or float array storing data in volts. The first dimension + should always represent time. The second dimension, if present, should represent + channels. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage data. + multivalued: false + range: ElectricalSeries__data + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: ElectricalSeries__electrodes + required: true + channel_conversion: + name: channel_conversion + description: Channel-specific conversion factor. Multiply the data in the + 'data' dataset by these values along the channel axis (as indicated by axis + attribute) AND by the global conversion factor in the 'conversion' attribute + of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion + * channel_conversion. This approach allows for both global and per-channel + data conversion factors needed to support the storage of electrical recordings + as native values generated by data acquisition systems. If this dataset + is not present, then there is no channel-specific conversion factor, i.e. + it is 1 for all channels. + multivalued: true + range: float32 + required: false + tree_root: true + ElectricalSeries__data: + name: ElectricalSeries__data + description: Recorded voltage data. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. This value + is fixed to 'volts'. Actual stored values are not necessarily stored in + these units. To access the data in these units, multiply 'data' by 'conversion' + and 'channel_conversion' (if present). + range: text + array: + name: array + range: ElectricalSeries__data__Array + ElectricalSeries__data__Array: + name: ElectricalSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + num_samples: + name: num_samples + range: numeric + required: false + ElectricalSeries__electrodes: + name: ElectricalSeries__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + SpikeEventSeries: + name: SpikeEventSeries + description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold + crossings). This may also be raw data, as reported by ephys hardware. If so, + the TimeSeries::description field should describe how events were detected. + All SpikeEventSeries should reside in a module (under EventWaveform interface) + even if the spikes were reported and stored by hardware. All events span the + same recording channels and store snapshots of equal duration. TimeSeries::data + array structure: [num events] [num channels] [num samples] (or [num events] + [num samples] for single electrode).' + is_a: ElectricalSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Spike waveforms. + multivalued: false + range: SpikeEventSeries__data + required: true + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + Timestamps are required for the events. Unlike for TimeSeries, timestamps + are required for SpikeEventSeries and are thus re-specified here. + multivalued: true + range: float64 + required: true + tree_root: true + SpikeEventSeries__data: + name: SpikeEventSeries__data + description: Spike waveforms. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Unit of measurement for waveforms, which is fixed to 'volts'. + range: text + array: + name: array + range: SpikeEventSeries__data__Array + SpikeEventSeries__data__Array: + name: SpikeEventSeries__data__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: numeric + required: true + num_samples: + name: num_samples + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + FeatureExtraction: + name: FeatureExtraction + description: Features, such as PC1 and PC2, that are extracted from signals stored + in a SpikeEventSeries or other source. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of features (eg, ''PC1'') for each of the extracted + features. + multivalued: true + range: text + required: true + features: + name: features + description: Multi-dimensional array of features extracted from each event. + multivalued: false + range: FeatureExtraction__features + required: true + times: + name: times + description: Times of events that features correspond to (can be a link). + multivalued: true + range: float64 + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: FeatureExtraction__electrodes + required: true + tree_root: true + FeatureExtraction__features: + name: FeatureExtraction__features + description: Multi-dimensional array of features extracted from each event. + attributes: + name: + name: name + ifabsent: string(features) + range: string + required: true + equals_string: features + array: + name: array + range: FeatureExtraction__features__Array + FeatureExtraction__features__Array: + name: FeatureExtraction__features__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: float32 + required: true + num_channels: + name: num_channels + range: float32 + required: true + num_features: + name: num_features + range: float32 + required: true + FeatureExtraction__electrodes: + name: FeatureExtraction__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + EventDetection: + name: EventDetection + description: Detected spike events from voltage trace(s). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + detection_method: + name: detection_method + description: Description of how events were detected, such as voltage threshold, + or dV/dT threshold, as well as relevant values. + multivalued: false + range: text + required: true + source_idx: + name: source_idx + description: Indices (zero-based) into source ElectricalSeries::data array + corresponding to time of event. ''description'' should define what is meant + by time of event (e.g., .25 ms before action potential peak, zero-crossing + time, etc). The index points to each event from the raw data. + multivalued: true + range: int32 + required: true + times: + name: times + description: Timestamps of events, in seconds. + multivalued: true + range: float64 + required: true + tree_root: true + EventWaveform: + name: EventWaveform + description: Represents either the waveforms of detected events, as extracted + from a raw data trace in /acquisition, or the event waveforms that were stored + during experiment acquisition. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spike_event_series: + name: spike_event_series + description: SpikeEventSeries object(s) containing detected spike event waveforms. + multivalued: true + range: SpikeEventSeries + required: false + tree_root: true + FilteredEphys: + name: FilteredEphys + description: Electrophysiology data from one or more channels that has been subjected + to filtering. Examples of filtered data include Theta and Gamma (LFP has its + own interface). FilteredEphys modules publish an ElectricalSeries for each filtered + channel or set of channels. The name of each ElectricalSeries is arbitrary but + should be informative. The source of the filtered data, whether this is from + analysis of another time series or as acquired by hardware, should be noted + in each's TimeSeries::description field. There is no assumed 1::1 correspondence + between filtered ephys signals and electrodes, as a single signal can apply + to many nearby electrodes, and one electrode may have different filtered (e.g., + theta and/or gamma) signals represented. Filter properties should be noted in + the ElectricalSeries. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing filtered electrophysiology + data. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + LFP: + name: LFP + description: LFP data from one or more channels. The electrode map in each published + ElectricalSeries will identify which channels are providing LFP data. Filter + properties should be noted in the ElectricalSeries description or comments field. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing LFP data for one or more + channels. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + ElectrodeGroup: + name: ElectrodeGroup + description: A physical grouping of electrodes, e.g. a shank of an array. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this electrode group. + range: text + location: + name: location + description: Location of electrode group. Specify the area, layer, comments + on estimation of area/layer, etc. Use standard atlas names for anatomical + regions when possible. + range: text + position: + name: position + description: stereotaxic or common framework coordinates + multivalued: false + range: AnyType + required: false + tree_root: true + ClusterWaveforms: + name: ClusterWaveforms + description: DEPRECATED The mean waveform shape, including standard deviation, + of the different clusters. Ideally, the waveform analysis should be performed + on data that is only high-pass filtered. This is a separate module because it + is expected to require updating. For example, IMEC probes may require different + storage requirements to store/display mean waveforms, requiring a new interface + or an extension of this one. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + waveform_filtering: + name: waveform_filtering + description: Filtering applied to data before generating mean/sd + multivalued: false + range: text + required: true + waveform_mean: + name: waveform_mean + description: The mean waveform for each cluster, using the same indices for + each wave as cluster numbers in the associated Clustering module (i.e, cluster + 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence + should be empty (e.g., zero- filled) + multivalued: false + range: ClusterWaveforms__waveform_mean + required: true + waveform_sd: + name: waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as + in mean + multivalued: false + range: ClusterWaveforms__waveform_sd + required: true + tree_root: true + ClusterWaveforms__waveform_mean: + name: ClusterWaveforms__waveform_mean + description: The mean waveform for each cluster, using the same indices for each + wave as cluster numbers in the associated Clustering module (i.e, cluster 3 + is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should + be empty (e.g., zero- filled) + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + array: + name: array + range: ClusterWaveforms__waveform_mean__Array + ClusterWaveforms__waveform_mean__Array: + name: ClusterWaveforms__waveform_mean__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + ClusterWaveforms__waveform_sd: + name: ClusterWaveforms__waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as in + mean + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + array: + name: array + range: ClusterWaveforms__waveform_sd__Array + ClusterWaveforms__waveform_sd__Array: + name: ClusterWaveforms__waveform_sd__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + Clustering: + name: Clustering + description: DEPRECATED Clustered spike data, whether from automatic clustering + tools (e.g., klustakwik) or as a result of manual sorting. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of clusters or clustering, (e.g. cluster 0 is noise, + clusters curated using Klusters, etc) + multivalued: false + range: text + required: true + num: + name: num + description: Cluster number of each event + multivalued: true + range: int32 + required: true + peak_over_rms: + name: peak_over_rms + description: Maximum ratio of waveform peak to RMS on any channel in the cluster + (provides a basic clustering metric). + multivalued: true + range: float32 + required: true + times: + name: times + description: Times of clustered events, in seconds. This may be a link to + times field in associated FeatureExtraction module. + multivalued: true + range: float64 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.epoch.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.epoch.yaml new file mode 100644 index 0000000..55d23ca --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.epoch.yaml @@ -0,0 +1,74 @@ +name: core.nwb.epoch +id: core.nwb.epoch +version: 2.2.4 +imports: +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.epoch/ +classes: + TimeIntervals: + name: TimeIntervals + description: A container for aggregating epoch data and the TimeSeries that each + epoch applies to. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + start_time: + name: start_time + description: Start time of epoch, in seconds. + multivalued: true + range: float32 + stop_time: + name: stop_time + description: Stop time of epoch, in seconds. + multivalued: true + range: float32 + tags: + name: tags + description: User-defined tags that identify or categorize events. + multivalued: true + range: text + tags_index: + name: tags_index + description: Index for tags. + multivalued: false + range: TimeIntervals__tags_index + required: false + timeseries: + name: timeseries + description: An index into a TimeSeries object. + multivalued: true + range: AnyType + timeseries_index: + name: timeseries_index + description: Index for timeseries. + multivalued: false + range: TimeIntervals__timeseries_index + required: false + tree_root: true + TimeIntervals__tags_index: + name: TimeIntervals__tags_index + description: Index for tags. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(tags_index) + range: string + required: true + equals_string: tags_index + TimeIntervals__timeseries_index: + name: TimeIntervals__timeseries_index + description: Index for timeseries. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(timeseries_index) + range: string + required: true + equals_string: timeseries_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.file.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.file.yaml new file mode 100644 index 0000000..d7fe203 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.file.yaml @@ -0,0 +1,659 @@ +name: core.nwb.file +id: core.nwb.file +version: 2.2.4 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.device +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.epoch +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.file/ +classes: + ScratchData: + name: ScratchData + description: Any one-off datasets + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + notes: + name: notes + description: Any notes the user has about the dataset being stored + range: text + tree_root: true + NWBFile: + name: NWBFile + description: An NWB:N file storing cellular-based neurophysiology data from a + single experimental session. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(root) + range: string + required: true + equals_string: root + nwb_version: + name: nwb_version + description: File version string. Use semantic versioning, e.g. 1.2.1. This + will be the name of the format with trailing major, minor and patch numbers. + range: text + file_create_date: + name: file_create_date + description: 'A record of the date the file was created and of subsequent + modifications. The date is stored in UTC with local timezone offset as ISO + 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored + in UTC end in "Z" with no timezone offset. Date accuracy is up to milliseconds. + The file can be created after the experiment was run, so this may differ + from the experiment start time. Each modification to the nwb file adds a + new entry to the array.' + multivalued: true + range: isodatetime + required: true + identifier: + name: identifier + description: A unique text identifier for the file. For example, concatenated + lab name, file creation date/time and experimentalist, or a hash of these + and/or other values. The goal is that the string should be unique to all + other files. + multivalued: false + range: text + required: true + session_description: + name: session_description + description: A description of the experimental session and data in the file. + multivalued: false + range: text + required: true + session_start_time: + name: session_start_time + description: 'Date and time of the experiment/session start. The date is stored + in UTC with local timezone offset as ISO 8601 extended formatted string: + 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in "Z" with no timezone + offset. Date accuracy is up to milliseconds.' + multivalued: false + range: isodatetime + required: true + timestamps_reference_time: + name: timestamps_reference_time + description: 'Date and time corresponding to time zero of all timestamps. + The date is stored in UTC with local timezone offset as ISO 8601 extended + formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end + in "Z" with no timezone offset. Date accuracy is up to milliseconds. All + times stored in the file use this time as reference (i.e., time zero).' + multivalued: false + range: isodatetime + required: true + acquisition: + name: acquisition + description: Data streams recorded from the system, including ephys, ophys, + tracking, etc. This group should be read-only after the experiment is completed + and timestamps are corrected to a common timebase. The data stored here + may be links to raw data stored in external NWB files. This will allow keeping + bulky raw data out of the file while preserving the option of keeping some/all + in the file. Acquired data includes tracking and experimental data streams + (i.e., everything measured from the system). If bulky data is stored in + the /acquisition group, the data can exist in a separate NWB file that is + linked to by the file being used for processing and analysis. + multivalued: true + any_of: + - range: NWBDataInterface + - range: DynamicTable + analysis: + name: analysis + description: Lab-specific and custom scientific analysis of data. There is + no defined format for the content of this group - the format is up to the + individual user/lab. To facilitate sharing analysis data between labs, the + contents here should be stored in standard types (e.g., neurodata_types) + and appropriately documented. The file can store lab-specific and custom + data analysis without restriction on its form or schema, reducing data formatting + restrictions on end users. Such data should be placed in the analysis group. + The analysis data should be documented so that it could be shared with other + labs. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + scratch: + name: scratch + description: A place to store one-off analysis results. Data placed here is + not intended for sharing. By placing data here, users acknowledge that there + is no guarantee that their data meets any standard. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + processing: + name: processing + description: The home for ProcessingModules. These modules perform intermediate + analysis of data that is necessary to perform before scientific analysis. + Examples include spike clustering, extracting position from tracking data, + stitching together image slices. ProcessingModules can be large and express + many data sets from relatively complex analysis (e.g., spike detection and + clustering) or small, representing extraction of position information from + tracking video, or even binary lick/no-lick decisions. Common software tools + (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' + refers to intermediate analysis of the acquired data to make it more amenable + to scientific analysis. + multivalued: true + any_of: + - range: ProcessingModule + stimulus: + name: stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment + complete and timestamps are corrected to common timebase. Stores both presented + stimuli and stimulus templates, the latter in case the same stimulus is + presented multiple times, or is pulled from an external stimulus library. + Stimuli are here defined as any signal that is pushed into the system as + part of the experiment (eg, sound, video, voltage, etc). Many different + experiments can use the same stimuli, and stimuli can be re-used during + an experiment. The stimulus group is organized so that one version of template + stimuli can be stored and these be used multiple times. These templates + can exist in the present file or can be linked to a remote library file. + multivalued: false + range: NWBFile__stimulus + required: true + general: + name: general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used + to describe the experiment. Metadata necessary for interpreting the data + is stored with the data. General experimental metadata, including animal + strain, experimental protocols, experimenter, devices, etc, are stored under + 'general'. Core metadata (e.g., that required to interpret data fields) + is stored with the data itself, and implicitly defined by the file specification + (e.g., time is in seconds). The strategy used here for storing non-core + metadata is to use free-form text fields, such as would appear in sentences + or paragraphs from a Methods section. Metadata fields are text to enable + them to be more general, for example to represent ranges instead of numerical + values. Machine-readable metadata is stored as attributes to these free-form + datasets. All entries in the below table are to be included when data is + present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) + should not be created unless there is data to store within them. + multivalued: false + range: NWBFile__general + required: true + intervals: + name: intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during + an experiment, or epochs (see epochs subgroup) deriving from analysis of + data. + multivalued: false + range: NWBFile__intervals + required: false + units: + name: units + description: Data about sorted spike units. + multivalued: false + range: Units + required: false + tree_root: true + NWBFile__stimulus: + name: NWBFile__stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment complete + and timestamps are corrected to common timebase. Stores both presented stimuli + and stimulus templates, the latter in case the same stimulus is presented multiple + times, or is pulled from an external stimulus library. Stimuli are here defined + as any signal that is pushed into the system as part of the experiment (eg, + sound, video, voltage, etc). Many different experiments can use the same stimuli, + and stimuli can be re-used during an experiment. The stimulus group is organized + so that one version of template stimuli can be stored and these be used multiple + times. These templates can exist in the present file or can be linked to a remote + library file. + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + presentation: + name: presentation + description: Stimuli presented during the experiment. + multivalued: true + any_of: + - range: TimeSeries + templates: + name: templates + description: Template stimuli. Timestamps in templates are based on stimulus + design and are relative to the beginning of the stimulus. When templates + are used, the stimulus instances must convert presentation times to the + experiment`s time reference frame. + multivalued: true + any_of: + - range: TimeSeries + NWBFile__general: + name: NWBFile__general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used to + describe the experiment. Metadata necessary for interpreting the data is stored + with the data. General experimental metadata, including animal strain, experimental + protocols, experimenter, devices, etc, are stored under 'general'. Core metadata + (e.g., that required to interpret data fields) is stored with the data itself, + and implicitly defined by the file specification (e.g., time is in seconds). + The strategy used here for storing non-core metadata is to use free-form text + fields, such as would appear in sentences or paragraphs from a Methods section. + Metadata fields are text to enable them to be more general, for example to represent + ranges instead of numerical values. Machine-readable metadata is stored as attributes + to these free-form datasets. All entries in the below table are to be included + when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology + experiment) should not be created unless there is data to store within them. + attributes: + name: + name: name + ifabsent: string(general) + range: string + required: true + equals_string: general + data_collection: + name: data_collection + description: Notes about data collection and analysis. + multivalued: false + range: text + required: false + experiment_description: + name: experiment_description + description: General description of the experiment. + multivalued: false + range: text + required: false + experimenter: + name: experimenter + description: Name of person(s) who performed the experiment. Can also specify + roles of different people involved. + multivalued: true + range: text + required: false + institution: + name: institution + description: Institution(s) where experiment was performed. + multivalued: false + range: text + required: false + keywords: + name: keywords + description: Terms to search over. + multivalued: true + range: text + required: false + lab: + name: lab + description: Laboratory where experiment was performed. + multivalued: false + range: text + required: false + notes: + name: notes + description: Notes about the experiment. + multivalued: false + range: text + required: false + pharmacology: + name: pharmacology + description: Description of drugs used, including how and when they were administered. + Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc. + multivalued: false + range: text + required: false + protocol: + name: protocol + description: Experimental protocol, if applicable. e.g., include IACUC protocol + number. + multivalued: false + range: text + required: false + related_publications: + name: related_publications + description: Publication information. PMID, DOI, URL, etc. + multivalued: true + range: text + required: false + session_id: + name: session_id + description: Lab-specific ID for the session. + multivalued: false + range: text + required: false + slices: + name: slices + description: Description of slices, including information about preparation + thickness, orientation, temperature, and bath solution. + multivalued: false + range: text + required: false + source_script: + name: source_script + description: Script file or link to public source code used to create this + NWB file. + multivalued: false + range: NWBFile__general__source_script + required: false + stimulus: + name: stimulus + description: Notes about stimuli, such as how and where they were presented. + multivalued: false + range: text + required: false + surgery: + name: surgery + description: Narrative description about surgery/surgeries, including date(s) + and who performed surgery. + multivalued: false + range: text + required: false + virus: + name: virus + description: Information about virus(es) used in experiments, including virus + ID, source, date made, injection location, volume, etc. + multivalued: false + range: text + required: false + lab_meta_data: + name: lab_meta_data + description: Place-holder than can be extended so that lab-specific meta-data + can be placed in /general. + multivalued: true + range: LabMetaData + required: false + devices: + name: devices + description: Description of hardware devices used during experiment, e.g., + monitors, ADC boards, microscopes, etc. + multivalued: true + any_of: + - range: Device + subject: + name: subject + description: Information about the animal or person from which the data was + measured. + multivalued: false + range: Subject + required: false + extracellular_ephys: + name: extracellular_ephys + description: Metadata related to extracellular electrophysiology. + multivalued: false + range: NWBFile__general__extracellular_ephys + required: false + intracellular_ephys: + name: intracellular_ephys + description: Metadata related to intracellular electrophysiology. + multivalued: false + range: NWBFile__general__intracellular_ephys + required: false + optogenetics: + name: optogenetics + description: Metadata describing optogenetic stimuluation. + multivalued: true + any_of: + - range: OptogeneticStimulusSite + optophysiology: + name: optophysiology + description: Metadata related to optophysiology. + multivalued: true + any_of: + - range: ImagingPlane + NWBFile__general__source_script: + name: NWBFile__general__source_script + description: Script file or link to public source code used to create this NWB + file. + attributes: + name: + name: name + ifabsent: string(source_script) + range: string + required: true + equals_string: source_script + file_name: + name: file_name + description: Name of script file. + range: text + value: + name: value + range: text + required: true + NWBFile__general__extracellular_ephys: + name: NWBFile__general__extracellular_ephys + description: Metadata related to extracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(extracellular_ephys) + range: string + required: true + equals_string: extracellular_ephys + electrode_group: + name: electrode_group + description: Physical group of electrodes. + multivalued: true + range: ElectrodeGroup + required: false + electrodes: + name: electrodes + description: A table of all electrodes (i.e. channels) used for recording. + multivalued: false + range: NWBFile__general__extracellular_ephys__electrodes + required: false + NWBFile__general__extracellular_ephys__electrodes: + name: NWBFile__general__extracellular_ephys__electrodes + description: A table of all electrodes (i.e. channels) used for recording. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + x: + name: x + description: x coordinate of the channel location in the brain (+x is posterior). + multivalued: true + range: float32 + y: + name: y + description: y coordinate of the channel location in the brain (+y is inferior). + multivalued: true + range: float32 + z: + name: z + description: z coordinate of the channel location in the brain (+z is right). + multivalued: true + range: float32 + imp: + name: imp + description: Impedance of the channel. + multivalued: true + range: float32 + location: + name: location + description: Location of the electrode (channel). Specify the area, layer, + comments on estimation of area/layer, stereotaxic coordinates if in vivo, + etc. Use standard atlas names for anatomical regions when possible. + multivalued: true + range: text + filtering: + name: filtering + description: Description of hardware filtering. + multivalued: true + range: float32 + group: + name: group + description: Reference to the ElectrodeGroup this electrode is a part of. + multivalued: true + range: ElectrodeGroup + group_name: + name: group_name + description: Name of the ElectrodeGroup this electrode is a part of. + multivalued: true + range: text + rel_x: + name: rel_x + description: x coordinate in electrode group + multivalued: true + range: float32 + rel_y: + name: rel_y + description: y coordinate in electrode group + multivalued: true + range: float32 + rel_z: + name: rel_z + description: z coordinate in electrode group + multivalued: true + range: float32 + reference: + name: reference + description: Description of the reference used for this electrode. + multivalued: true + range: text + NWBFile__general__intracellular_ephys: + name: NWBFile__general__intracellular_ephys + description: Metadata related to intracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(intracellular_ephys) + range: string + required: true + equals_string: intracellular_ephys + filtering: + name: filtering + description: Description of filtering used. Includes filtering type and parameters, + frequency fall-off, etc. If this changes between TimeSeries, filter description + should be stored as a text attribute for each TimeSeries. + multivalued: false + range: text + required: false + intracellular_electrode: + name: intracellular_electrode + description: An intracellular electrode. + multivalued: true + range: IntracellularElectrode + required: false + sweep_table: + name: sweep_table + description: The table which groups different PatchClampSeries together. + multivalued: false + range: SweepTable + required: false + NWBFile__intervals: + name: NWBFile__intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during an + experiment, or epochs (see epochs subgroup) deriving from analysis of data. + attributes: + name: + name: name + ifabsent: string(intervals) + range: string + required: true + equals_string: intervals + epochs: + name: epochs + description: Divisions in time marking experimental stages or sub-divisions + of a single recording session. + multivalued: false + range: TimeIntervals + required: false + trials: + name: trials + description: Repeated experimental events that have a logical grouping. + multivalued: false + range: TimeIntervals + required: false + invalid_times: + name: invalid_times + description: Time intervals that should be removed from analysis. + multivalued: false + range: TimeIntervals + required: false + time_intervals: + name: time_intervals + description: Optional additional table(s) for describing other experimental + time intervals. + multivalued: true + range: TimeIntervals + required: false + LabMetaData: + name: LabMetaData + description: Lab-specific meta-data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + Subject: + name: Subject + description: Information about the animal or person from which the data was measured. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + age: + name: age + description: Age of subject. Can be supplied instead of 'date_of_birth'. + multivalued: false + range: text + required: false + date_of_birth: + name: date_of_birth + description: Date of birth of subject. Can be supplied instead of 'age'. + multivalued: false + range: isodatetime + required: false + description: + name: description + description: Description of subject and where subject came from (e.g., breeder, + if animal). + multivalued: false + range: text + required: false + genotype: + name: genotype + description: Genetic strain. If absent, assume Wild Type (WT). + multivalued: false + range: text + required: false + sex: + name: sex + description: Gender of subject. + multivalued: false + range: text + required: false + species: + name: species + description: Species of subject. + multivalued: false + range: text + required: false + subject_id: + name: subject_id + description: ID of animal/person used/participating in experiment (lab convention). + multivalued: false + range: text + required: false + weight: + name: weight + description: Weight at time of experiment, at time of surgery and at other + important times. + multivalued: false + range: text + required: false + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.icephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.icephys.yaml new file mode 100644 index 0000000..348ef4a --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.icephys.yaml @@ -0,0 +1,503 @@ +name: core.nwb.icephys +id: core.nwb.icephys +version: 2.2.4 +imports: +- core.nwb.base +- core.nwb.device +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.language +default_prefix: core.nwb.icephys/ +classes: + PatchClampSeries: + name: PatchClampSeries + description: An abstract base class for patch-clamp data - stimulus or response, + current or voltage. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: Protocol/stimulus name for this patch-clamp dataset. + range: text + sweep_number: + name: sweep_number + description: Sweep number, allows to group different PatchClampSeries together. + range: uint32 + data: + name: data + description: Recorded voltage or current. + multivalued: true + range: numeric + required: true + gain: + name: gain + description: Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt + (c-clamp). + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries: + name: CurrentClampSeries + description: Voltage data from an intracellular current-clamp recording. A corresponding + CurrentClampStimulusSeries (stored separately as a stimulus) is used to store + the current injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage. + multivalued: false + range: CurrentClampSeries__data + required: true + bias_current: + name: bias_current + description: Bias current, in amps. + multivalued: false + range: float32 + required: false + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms. + multivalued: false + range: float32 + required: false + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads. + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries__data: + name: CurrentClampSeries__data + description: Recorded voltage. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IZeroClampSeries: + name: IZeroClampSeries + description: Voltage data from an intracellular recording when all current and + amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There + is no CurrentClampStimulusSeries associated with an IZero series because the + amplifier is disconnected and no stimulus can reach the cell. + is_a: CurrentClampSeries + attributes: + name: + name: name + range: string + required: true + bias_current: + name: bias_current + description: Bias current, in amps, fixed to 0.0. + multivalued: false + range: float32 + required: true + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms, fixed to 0.0. + multivalued: false + range: float32 + required: true + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads, fixed to 0.0. + multivalued: false + range: float32 + required: true + tree_root: true + CurrentClampStimulusSeries: + name: CurrentClampStimulusSeries + description: Stimulus current applied during current clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus current applied. + multivalued: false + range: CurrentClampStimulusSeries__data + required: true + tree_root: true + CurrentClampStimulusSeries__data: + name: CurrentClampStimulusSeries__data + description: Stimulus current applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries: + name: VoltageClampSeries + description: Current data from an intracellular voltage-clamp recording. A corresponding + VoltageClampStimulusSeries (stored separately as a stimulus) is used to store + the voltage injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded current. + multivalued: false + range: VoltageClampSeries__data + required: true + capacitance_fast: + name: capacitance_fast + description: Fast capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_fast + required: false + capacitance_slow: + name: capacitance_slow + description: Slow capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_slow + required: false + resistance_comp_bandwidth: + name: resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + multivalued: false + range: VoltageClampSeries__resistance_comp_bandwidth + required: false + resistance_comp_correction: + name: resistance_comp_correction + description: Resistance compensation correction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_correction + required: false + resistance_comp_prediction: + name: resistance_comp_prediction + description: Resistance compensation prediction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_prediction + required: false + whole_cell_capacitance_comp: + name: whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + multivalued: false + range: VoltageClampSeries__whole_cell_capacitance_comp + required: false + whole_cell_series_resistance_comp: + name: whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + multivalued: false + range: VoltageClampSeries__whole_cell_series_resistance_comp + required: false + tree_root: true + VoltageClampSeries__data: + name: VoltageClampSeries__data + description: Recorded current. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries__capacitance_fast: + name: VoltageClampSeries__capacitance_fast + description: Fast capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_fast) + range: string + required: true + equals_string: capacitance_fast + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__capacitance_slow: + name: VoltageClampSeries__capacitance_slow + description: Slow capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_slow) + range: string + required: true + equals_string: capacitance_slow + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_bandwidth: + name: VoltageClampSeries__resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + attributes: + name: + name: name + ifabsent: string(resistance_comp_bandwidth) + range: string + required: true + equals_string: resistance_comp_bandwidth + unit: + name: unit + description: Unit of measurement for resistance_comp_bandwidth, which is fixed + to 'hertz'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_correction: + name: VoltageClampSeries__resistance_comp_correction + description: Resistance compensation correction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_correction) + range: string + required: true + equals_string: resistance_comp_correction + unit: + name: unit + description: Unit of measurement for resistance_comp_correction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_prediction: + name: VoltageClampSeries__resistance_comp_prediction + description: Resistance compensation prediction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_prediction) + range: string + required: true + equals_string: resistance_comp_prediction + unit: + name: unit + description: Unit of measurement for resistance_comp_prediction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_capacitance_comp: + name: VoltageClampSeries__whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + attributes: + name: + name: name + ifabsent: string(whole_cell_capacitance_comp) + range: string + required: true + equals_string: whole_cell_capacitance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_capacitance_comp, which is + fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_series_resistance_comp: + name: VoltageClampSeries__whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + attributes: + name: + name: name + ifabsent: string(whole_cell_series_resistance_comp) + range: string + required: true + equals_string: whole_cell_series_resistance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_series_resistance_comp, which + is fixed to 'ohms'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampStimulusSeries: + name: VoltageClampStimulusSeries + description: Stimulus voltage applied during a voltage clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus voltage applied. + multivalued: false + range: VoltageClampStimulusSeries__data + required: true + tree_root: true + VoltageClampStimulusSeries__data: + name: VoltageClampStimulusSeries__data + description: Stimulus voltage applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IntracellularElectrode: + name: IntracellularElectrode + description: An intracellular electrode and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of electrode (e.g., whole-cell, sharp, etc.). + multivalued: false + range: text + required: true + filtering: + name: filtering + description: Electrode specific filtering. + multivalued: false + range: text + required: false + initial_access_resistance: + name: initial_access_resistance + description: Initial access resistance. + multivalued: false + range: text + required: false + location: + name: location + description: Location of the electrode. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: false + resistance: + name: resistance + description: Electrode resistance, in ohms. + multivalued: false + range: text + required: false + seal: + name: seal + description: Information about seal used for recording. + multivalued: false + range: text + required: false + slice: + name: slice + description: Information about slice used for recording. + multivalued: false + range: text + required: false + tree_root: true + SweepTable: + name: SweepTable + description: The table which groups different PatchClampSeries together. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + sweep_number: + name: sweep_number + description: Sweep number of the PatchClampSeries in that row. + multivalued: true + range: uint32 + series: + name: series + description: The PatchClampSeries with the sweep number in that row. + multivalued: true + range: PatchClampSeries + series_index: + name: series_index + description: Index for series. + multivalued: false + range: SweepTable__series_index + required: true + tree_root: true + SweepTable__series_index: + name: SweepTable__series_index + description: Index for series. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(series_index) + range: string + required: true + equals_string: series_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.image.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.image.yaml new file mode 100644 index 0000000..32480da --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.image.yaml @@ -0,0 +1,312 @@ +name: core.nwb.image +id: core.nwb.image +version: 2.2.4 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.image/ +classes: + GrayscaleImage: + name: GrayscaleImage + description: A grayscale image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: GrayscaleImage__Array + tree_root: true + GrayscaleImage__Array: + name: GrayscaleImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + RGBImage: + name: RGBImage + description: A color image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBImage__Array + tree_root: true + RGBImage__Array: + name: RGBImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RGBAImage: + name: RGBAImage + description: A color image with transparency. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBAImage__Array + tree_root: true + RGBAImage__Array: + name: RGBAImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b, a: + name: r, g, b, a + range: numeric + required: true + minimum_cardinality: 4 + maximum_cardinality: 4 + ImageSeries: + name: ImageSeries + description: General image data that is common between acquisition and stimulus + time series. Sometimes the image data is stored in the file in a raw format + while other times it will be stored as a series of external image files in the + host file system. The data field will either be binary data, if the data is + stored in the NWB file, or empty, if the data is stored in an external image + stack. [frame][x][y] or [frame][x][y][z]. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Binary data representing images across frames. + multivalued: false + range: ImageSeries__data + required: false + dimension: + name: dimension + description: Number of pixels on x, y, (and z) axes. + multivalued: true + range: int32 + required: false + external_file: + name: external_file + description: Paths to one or more external file(s). The field is only present + if format='external'. This is only relevant if the image series is stored + in the file system as one or more image file(s). This field should NOT be + used if the image is stored in another NWB file and that file is linked + to this file. + multivalued: true + range: text + required: false + format: + name: format + description: Format of image. If this is 'external', then the attribute 'external_file' + contains the path information to the image files. If this is 'raw', then + the raw (single-channel) binary data is stored in the 'data' dataset. If + this attribute is not present, then the default format='raw' case is assumed. + multivalued: false + range: text + required: false + tree_root: true + ImageSeries__data: + name: ImageSeries__data + description: Binary data representing images across frames. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: ImageSeries__data__Array + ImageSeries__data__Array: + name: ImageSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + z: + name: z + range: numeric + required: false + ImageMaskSeries: + name: ImageMaskSeries + description: An alpha mask that is applied to a presented visual stimulus. The + 'data' array contains an array of mask values that are applied to the displayed + image. Mask values are stored as RGBA. Mask can vary with time. The timestamps + array indicates the starting time of a mask, and that mask pattern continues + until it's explicitly changed. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + tree_root: true + OpticalSeries: + name: OpticalSeries + description: Image data that is presented or recorded. A stimulus template movie + will be stored only as an image. When the image is presented as stimulus, additional + data is required, such as field of view (e.g., how much of the visual field + the image covers, or how what is the area of the target being imaged). If the + OpticalSeries represents acquired imaging data, orientation is also important. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + distance: + name: distance + description: Distance from camera/monitor to target/eye. + multivalued: false + range: float32 + required: false + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: OpticalSeries__field_of_view + required: false + data: + name: data + description: Images presented to subject, either grayscale or RGB + multivalued: false + range: OpticalSeries__data + required: true + orientation: + name: orientation + description: Description of image relative to some reference frame (e.g., + which way is up). Must also specify frame of reference. + multivalued: false + range: text + required: false + tree_root: true + OpticalSeries__field_of_view: + name: OpticalSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: OpticalSeries__field_of_view__Array + OpticalSeries__field_of_view__Array: + name: OpticalSeries__field_of_view__Array + is_a: Arraylike + attributes: + width, height: + name: width, height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width, height, depth: + name: width, height, depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalSeries__data: + name: OpticalSeries__data + description: Images presented to subject, either grayscale or RGB + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: OpticalSeries__data__Array + OpticalSeries__data__Array: + name: OpticalSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + IndexSeries: + name: IndexSeries + description: Stores indices to image frames stored in an ImageSeries. The purpose + of the ImageIndexSeries is to allow a static image stack to be stored somewhere, + and the images in the stack to be referenced out-of-order. This can be for the + display of individual images, or of movie segments (as a movie is simply a series + of images). The data field stores the index of the frame in the referenced ImageSeries, + and the timestamps array indicates when that image was displayed. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Index of the frame in the referenced ImageSeries. + multivalued: true + range: int32 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.language.yaml new file mode 100644 index 0000000..c57e91f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.language.yaml @@ -0,0 +1,148 @@ +name: core.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.misc.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.misc.yaml new file mode 100644 index 0000000..fb013b5 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.misc.yaml @@ -0,0 +1,406 @@ +name: core.nwb.misc +id: core.nwb.misc +version: 2.2.4 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.ecephys +- core.nwb.language +default_prefix: core.nwb.misc/ +classes: + AbstractFeatureSeries: + name: AbstractFeatureSeries + description: Abstract features, such as quantitative descriptions of sensory stimuli. + The TimeSeries::data field is a 2D array, storing those features (e.g., for + visual grating stimulus this might be orientation, spatial frequency and contrast). + Null stimuli (eg, uniform gray) can be marked as being an independent feature + (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, + or through use of the TimeSeries::control fields. A set of features is considered + to persist until the next set of features is defined. The final set of features + stored should be the null set. This is useful when storing the raw stimulus + is impractical. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Values of each feature at each time. + multivalued: false + range: AbstractFeatureSeries__data + required: true + feature_units: + name: feature_units + description: Units of each feature. + multivalued: true + range: text + required: false + features: + name: features + description: Description of the features represented in TimeSeries::data. + multivalued: true + range: text + required: true + tree_root: true + AbstractFeatureSeries__data: + name: AbstractFeatureSeries__data + description: Values of each feature at each time. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Since there can be different units for different features, store + the units in 'feature_units'. The default value for this attribute is "see + 'feature_units'". + range: text + array: + name: array + range: AbstractFeatureSeries__data__Array + AbstractFeatureSeries__data__Array: + name: AbstractFeatureSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + AnnotationSeries: + name: AnnotationSeries + description: Stores user annotations made during an experiment. The data[] field + stores a text array, and timestamps are stored for each annotation (ie, interval=1). + This is largely an alias to a standard TimeSeries storing a text array but that + is identifiable as storing annotations in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Annotations made during an experiment. + multivalued: true + range: text + required: true + tree_root: true + IntervalSeries: + name: IntervalSeries + description: Stores intervals of data. The timestamps field stores the beginning + and end of intervals. The data field stores whether the interval just started + (>0 value) or ended (<0 value). Different interval types can be represented + in the same series by using multiple key values (eg, 1 for feature A, 2 for + feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This + is largely an alias of a standard TimeSeries but that is identifiable as representing + time intervals in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Use values >0 if interval started, <0 if interval ended. + multivalued: true + range: int8 + required: true + tree_root: true + DecompositionSeries: + name: DecompositionSeries + description: Spectral analysis of a time series, e.g. of an LFP or a speech signal. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Data decomposed into frequency bands. + multivalued: false + range: DecompositionSeries__data + required: true + metric: + name: metric + description: The metric used, e.g. phase, amplitude, power. + multivalued: false + range: text + required: true + bands: + name: bands + description: Table for describing the bands that this series was generated + from. There should be one row in this table for each band. + multivalued: false + range: DecompositionSeries__bands + required: true + tree_root: true + DecompositionSeries__data: + name: DecompositionSeries__data + description: Data decomposed into frequency bands. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: DecompositionSeries__data__Array + DecompositionSeries__data__Array: + name: DecompositionSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: true + num_bands: + name: num_bands + range: numeric + required: true + DecompositionSeries__bands: + name: DecompositionSeries__bands + description: Table for describing the bands that this series was generated from. + There should be one row in this table for each band. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(bands) + range: string + required: true + equals_string: bands + band_name: + name: band_name + description: Name of the band, e.g. theta. + multivalued: true + range: text + band_limits: + name: band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + multivalued: false + range: DecompositionSeries__bands__band_limits + required: true + band_mean: + name: band_mean + description: The mean Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + band_stdev: + name: band_stdev + description: The standard deviation of Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + DecompositionSeries__bands__band_limits: + name: DecompositionSeries__bands__band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(band_limits) + range: string + required: true + equals_string: band_limits + Units: + name: Units + description: Data about spiking units. Event times of observed units (e.g. cell, + synapse, etc.) should be concatenated and stored in spike_times. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + spike_times_index: + name: spike_times_index + description: Index into the spike_times dataset. + multivalued: false + range: Units__spike_times_index + required: false + spike_times: + name: spike_times + description: Spike times for each unit. + multivalued: false + range: Units__spike_times + required: false + obs_intervals_index: + name: obs_intervals_index + description: Index into the obs_intervals dataset. + multivalued: false + range: Units__obs_intervals_index + required: false + obs_intervals: + name: obs_intervals + description: Observation intervals for each unit. + multivalued: false + range: Units__obs_intervals + required: false + electrodes_index: + name: electrodes_index + description: Index into electrodes. + multivalued: false + range: Units__electrodes_index + required: false + electrodes: + name: electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + multivalued: false + range: Units__electrodes + required: false + electrode_group: + name: electrode_group + description: Electrode group that each spike unit came from. + multivalued: true + range: ElectrodeGroup + waveform_mean: + name: waveform_mean + description: Spike waveform mean for each spike unit. + multivalued: false + range: Units__waveform_mean + required: false + waveform_sd: + name: waveform_sd + description: Spike waveform standard deviation for each spike unit. + multivalued: false + range: Units__waveform_sd + required: false + tree_root: true + Units__spike_times_index: + name: Units__spike_times_index + description: Index into the spike_times dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(spike_times_index) + range: string + required: true + equals_string: spike_times_index + Units__spike_times: + name: Units__spike_times + description: Spike times for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(spike_times) + range: string + required: true + equals_string: spike_times + resolution: + name: resolution + description: The smallest possible difference between two spike times. Usually + 1 divided by the acquisition sampling rate from which spike times were extracted, + but could be larger if the acquisition time series was downsampled or smaller + if the acquisition time series was smoothed/interpolated and it is possible + for the spike time to be between samples. + range: float64 + Units__obs_intervals_index: + name: Units__obs_intervals_index + description: Index into the obs_intervals dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(obs_intervals_index) + range: string + required: true + equals_string: obs_intervals_index + Units__obs_intervals: + name: Units__obs_intervals + description: Observation intervals for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(obs_intervals) + range: string + required: true + equals_string: obs_intervals + Units__electrodes_index: + name: Units__electrodes_index + description: Index into electrodes. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(electrodes_index) + range: string + required: true + equals_string: electrodes_index + Units__electrodes: + name: Units__electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + Units__waveform_mean: + name: Units__waveform_mean + description: Spike waveform mean for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveform_sd: + name: Units__waveform_sd + description: Spike waveform standard deviation for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.ogen.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.ogen.yaml new file mode 100644 index 0000000..f62a92a --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.ogen.yaml @@ -0,0 +1,55 @@ +name: core.nwb.ogen +id: core.nwb.ogen +version: 2.2.4 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ogen/ +classes: + OptogeneticSeries: + name: OptogeneticSeries + description: An optogenetic stimulus. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Applied power for optogenetic stimulus, in watts. + multivalued: true + range: numeric + required: true + tree_root: true + OptogeneticStimulusSite: + name: OptogeneticStimulusSite + description: A site of optogenetic stimulation. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of stimulation site. + multivalued: false + range: text + required: true + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + location: + name: location + description: Location of the stimulation site. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.ophys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.ophys.yaml new file mode 100644 index 0000000..8c4d3d1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.ophys.yaml @@ -0,0 +1,550 @@ +name: core.nwb.ophys +id: core.nwb.ophys +version: 2.2.4 +imports: +- core.nwb.image +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ophys/ +classes: + TwoPhotonSeries: + name: TwoPhotonSeries + description: Image stack recorded over time from 2-photon microscope. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + pmt_gain: + name: pmt_gain + description: Photomultiplier gain. + range: float32 + scan_line_rate: + name: scan_line_rate + description: Lines imaged per second. This is also stored in /general/optophysiology + but is kept here as it is useful information for analysis, and so good to + be stored w/ the actual data. + range: float32 + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: TwoPhotonSeries__field_of_view + required: false + tree_root: true + TwoPhotonSeries__field_of_view: + name: TwoPhotonSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: TwoPhotonSeries__field_of_view__Array + TwoPhotonSeries__field_of_view__Array: + name: TwoPhotonSeries__field_of_view__Array + is_a: Arraylike + attributes: + width|height: + name: width|height + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + width|height|depth: + name: width|height|depth + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RoiResponseSeries: + name: RoiResponseSeries + description: ROI responses over an imaging plane. The first dimension represents + time. The second dimension, if present, represents ROIs. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Signals from ROIs. + multivalued: false + range: RoiResponseSeries__data + required: true + rois: + name: rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + multivalued: false + range: RoiResponseSeries__rois + required: true + tree_root: true + RoiResponseSeries__data: + name: RoiResponseSeries__data + description: Signals from ROIs. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: RoiResponseSeries__data__Array + RoiResponseSeries__data__Array: + name: RoiResponseSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_ROIs: + name: num_ROIs + range: numeric + required: false + RoiResponseSeries__rois: + name: RoiResponseSeries__rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(rois) + range: string + required: true + equals_string: rois + DfOverF: + name: DfOverF + description: dF/F information about a region of interest (ROI). Storage hierarchy + of dF/F should be the same as for segmentation (i.e., same names for ROIs and + for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing dF/F for a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + Fluorescence: + name: Fluorescence + description: Fluorescence information about a region of interest (ROI). Storage + hierarchy of fluorescence should be the same as for segmentation (ie, same names + for ROIs and for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing fluorescence data for + a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + ImageSegmentation: + name: ImageSegmentation + description: Stores pixels in an image that represent different regions of interest + (ROIs) or masks. All segmentation for a given imaging plane is stored together, + with storage for multiple imaging planes (masks) supported. Each ROI is stored + in its own subgroup, with the ROI group containing both a 2D mask and a list + of pixels that make up this mask. Segments can also be used for masking neuropil. + If segmentation is allowed to change with time, a new imaging plane (or module) + is required and ROI names should remain consistent between them. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + plane_segmentation: + name: plane_segmentation + description: Results from image segmentation of a specific imaging plane. + multivalued: true + range: PlaneSegmentation + required: true + tree_root: true + PlaneSegmentation: + name: PlaneSegmentation + description: Results from image segmentation of a specific imaging plane. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + image_mask: + name: image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + multivalued: false + range: PlaneSegmentation__image_mask + required: false + pixel_mask_index: + name: pixel_mask_index + description: Index into pixel_mask. + multivalued: false + range: PlaneSegmentation__pixel_mask_index + required: false + pixel_mask: + name: pixel_mask + description: 'Pixel masks for each ROI: a list of indices and weights for + the ROI. Pixel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + voxel_mask_index: + name: voxel_mask_index + description: Index into voxel_mask. + multivalued: false + range: PlaneSegmentation__voxel_mask_index + required: false + voxel_mask: + name: voxel_mask + description: 'Voxel masks for each ROI: a list of indices and weights for + the ROI. Voxel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + reference_images: + name: reference_images + description: Image stacks that the segmentation masks apply to. + multivalued: true + any_of: + - range: ImageSeries + tree_root: true + PlaneSegmentation__image_mask: + name: PlaneSegmentation__image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(image_mask) + range: string + required: true + equals_string: image_mask + PlaneSegmentation__pixel_mask_index: + name: PlaneSegmentation__pixel_mask_index + description: Index into pixel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(pixel_mask_index) + range: string + required: true + equals_string: pixel_mask_index + PlaneSegmentation__voxel_mask_index: + name: PlaneSegmentation__voxel_mask_index + description: Index into voxel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(voxel_mask_index) + range: string + required: true + equals_string: voxel_mask_index + ImagingPlane: + name: ImagingPlane + description: An imaging plane and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the imaging plane. + multivalued: false + range: text + required: false + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + imaging_rate: + name: imaging_rate + description: Rate that images are acquired, in Hz. If the corresponding TimeSeries + is present, the rate should be stored there instead. + multivalued: false + range: float32 + required: false + indicator: + name: indicator + description: Calcium indicator. + multivalued: false + range: text + required: true + location: + name: location + description: Location of the imaging plane. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + manifold: + name: manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents + the position of the pixel relative to the defined coordinate space. Deprecated + in favor of origin_coords and grid_spacing. + multivalued: false + range: ImagingPlane__manifold + required: false + origin_coords: + name: origin_coords + description: Physical location of the first element of the imaging plane (0, + 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for + what the physical location is relative to (e.g., bregma). + multivalued: false + range: ImagingPlane__origin_coords + required: false + grid_spacing: + name: grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also + reference_frame to interpret the grid. + multivalued: false + range: ImagingPlane__grid_spacing + required: false + reference_frame: + name: reference_frame + description: Describes reference frame of origin_coords and grid_spacing. + For example, this can be a text description of the anatomical location and + orientation of the grid defined by origin_coords and grid_spacing or the + vectors needed to transform or rotate the grid to a common anatomical axis + (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and + grid_spacing. If origin_coords and grid_spacing are not present, then this + field is not required. For example, if the microscope takes 10 x 10 x 2 + images, where the first value of the data matrix (index (0, 0, 0)) corresponds + to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is + 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means + more anterior, larger numbers in y means more rightward, and larger numbers + in z means more ventral, then enter the following -- origin_coords = (-1.2, + -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = "Origin coordinates + are relative to bregma. First dimension corresponds to anterior-posterior + axis (larger index = more anterior). Second dimension corresponds to medial-lateral + axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral + axis (larger index = more ventral)." + multivalued: false + range: text + required: false + optical_channel: + name: optical_channel + description: An optical channel used to record from an imaging plane. + multivalued: true + range: OpticalChannel + required: true + tree_root: true + ImagingPlane__manifold: + name: ImagingPlane__manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents the + position of the pixel relative to the defined coordinate space. Deprecated in + favor of origin_coords and grid_spacing. + attributes: + name: + name: name + ifabsent: string(manifold) + range: string + required: true + equals_string: manifold + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as pixels from + x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then + the 'conversion' multiplier to get from raw data acquisition pixel units + to meters is 2/1000. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__manifold__Array + ImagingPlane__manifold__Array: + name: ImagingPlane__manifold__Array + is_a: Arraylike + attributes: + height: + name: height + range: float32 + required: true + width: + name: width + range: float32 + required: true + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + depth: + name: depth + range: float32 + required: false + ImagingPlane__origin_coords: + name: ImagingPlane__origin_coords + description: Physical location of the first element of the imaging plane (0, 0) + for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the + physical location is relative to (e.g., bregma). + attributes: + name: + name: name + ifabsent: string(origin_coords) + range: string + required: true + equals_string: origin_coords + unit: + name: unit + description: Measurement units for origin_coords. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__origin_coords__Array + ImagingPlane__origin_coords__Array: + name: ImagingPlane__origin_coords__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + ImagingPlane__grid_spacing: + name: ImagingPlane__grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame + to interpret the grid. + attributes: + name: + name: name + ifabsent: string(grid_spacing) + range: string + required: true + equals_string: grid_spacing + unit: + name: unit + description: Measurement units for grid_spacing. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__grid_spacing__Array + ImagingPlane__grid_spacing__Array: + name: ImagingPlane__grid_spacing__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: true + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalChannel: + name: OpticalChannel + description: An optical channel used to record from an imaging plane. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description or other notes about the channel. + multivalued: false + range: text + required: true + emission_lambda: + name: emission_lambda + description: Emission wavelength for channel, in nm. + multivalued: false + range: float32 + required: true + tree_root: true + MotionCorrection: + name: MotionCorrection + description: 'An image stack where all frames are shifted (registered) to a common + coordinate system, to account for movement and drift between frames. Note: each + frame at each point in time is assumed to be 2-D (has only x & y dimensions).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected_image_stack: + name: corrected_image_stack + description: Reuslts from motion correction of an image stack. + multivalued: true + range: CorrectedImageStack + required: true + tree_root: true + CorrectedImageStack: + name: CorrectedImageStack + description: Reuslts from motion correction of an image stack. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected: + name: corrected + description: Image stack with frames shifted to the common coordinates. + multivalued: false + range: ImageSeries + required: true + xy_translation: + name: xy_translation + description: Stores the x,y delta necessary to align each frame to the common + coordinates, for example, to align each frame to a reference image. + multivalued: false + range: TimeSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.retinotopy.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.retinotopy.yaml new file mode 100644 index 0000000..bc3ce48 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/core.nwb.retinotopy.yaml @@ -0,0 +1,362 @@ +name: core.nwb.retinotopy +id: core.nwb.retinotopy +version: 2.2.4 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.retinotopy/ +classes: + ImagingRetinotopy: + name: ImagingRetinotopy + description: 'Intrinsic signal optical imaging or widefield imaging for measuring + retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of + responses to specific stimuli and a combined polarity map from which to identify + visual areas. This group does not store the raw responses imaged during retinotopic + mapping or the stimuli presented, but rather the resulting phase and power maps + after applying a Fourier transform on the averaged responses. Note: for data + consistency, all images and arrays are stored in the format [row][column] and + [row, col], which equates to [y][x]. Field of view and dimension arrays may + appear backward (i.e., y before x).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + axis_1_phase_map: + name: axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + multivalued: false + range: ImagingRetinotopy__axis_1_phase_map + required: true + axis_1_power_map: + name: axis_1_power_map + description: Power response on the first measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_1_power_map + required: false + axis_2_phase_map: + name: axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_phase_map + required: true + axis_2_power_map: + name: axis_2_power_map + description: Power response on the second measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_2_power_map + required: false + axis_descriptions: + name: axis_descriptions + description: Two-element array describing the contents of the two response + axis fields. Description should be something like ['altitude', 'azimuth'] + or '['radius', 'theta']. + multivalued: true + range: text + required: true + focal_depth_image: + name: focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., + focal depth, wavelength) as data collection. Array format: [rows][columns].' + multivalued: false + range: ImagingRetinotopy__focal_depth_image + required: false + sign_map: + name: sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + multivalued: false + range: ImagingRetinotopy__sign_map + required: false + vasculature_image: + name: vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + multivalued: false + range: ImagingRetinotopy__vasculature_image + required: true + tree_root: true + ImagingRetinotopy__axis_1_phase_map: + name: ImagingRetinotopy__axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + attributes: + name: + name: name + ifabsent: string(axis_1_phase_map) + range: string + required: true + equals_string: axis_1_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_phase_map__Array + ImagingRetinotopy__axis_1_phase_map__Array: + name: ImagingRetinotopy__axis_1_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_1_power_map: + name: ImagingRetinotopy__axis_1_power_map + description: Power response on the first measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_1_power_map) + range: string + required: true + equals_string: axis_1_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_power_map__Array + ImagingRetinotopy__axis_1_power_map__Array: + name: ImagingRetinotopy__axis_1_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_phase_map: + name: ImagingRetinotopy__axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + attributes: + name: + name: name + ifabsent: string(axis_2_phase_map) + range: string + required: true + equals_string: axis_2_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_phase_map__Array + ImagingRetinotopy__axis_2_phase_map__Array: + name: ImagingRetinotopy__axis_2_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_power_map: + name: ImagingRetinotopy__axis_2_power_map + description: Power response on the second measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_2_power_map) + range: string + required: true + equals_string: axis_2_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_power_map__Array + ImagingRetinotopy__axis_2_power_map__Array: + name: ImagingRetinotopy__axis_2_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__focal_depth_image: + name: ImagingRetinotopy__focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., focal + depth, wavelength) as data collection. Array format: [rows][columns].' + attributes: + name: + name: name + ifabsent: string(focal_depth_image) + range: string + required: true + equals_string: focal_depth_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value. + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + focal_depth: + name: focal_depth + description: Focal depth offset, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__focal_depth_image__Array + ImagingRetinotopy__focal_depth_image__Array: + name: ImagingRetinotopy__focal_depth_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true + ImagingRetinotopy__sign_map: + name: ImagingRetinotopy__sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + attributes: + name: + name: name + ifabsent: string(sign_map) + range: string + required: true + equals_string: sign_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + array: + name: array + range: ImagingRetinotopy__sign_map__Array + ImagingRetinotopy__sign_map__Array: + name: ImagingRetinotopy__sign_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__vasculature_image: + name: ImagingRetinotopy__vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + attributes: + name: + name: name + ifabsent: string(vasculature_image) + range: string + required: true + equals_string: vasculature_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__vasculature_image__Array + ImagingRetinotopy__vasculature_image__Array: + name: ImagingRetinotopy__vasculature_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/namespace.yaml new file mode 100644 index 0000000..9e1371b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_4/namespace.yaml @@ -0,0 +1,24 @@ +name: core +annotations: + namespace: + tag: namespace + value: 'True' +description: NWB namespace +id: core +version: 2.2.4 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.epoch +- core.nwb.image +- core.nwb.file +- core.nwb.misc +- core.nwb.behavior +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.retinotopy +- core.nwb.language +- ../../hdmf_common/v1_1_3/namespace +default_prefix: core/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.base.yaml new file mode 100644 index 0000000..5832905 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.base.yaml @@ -0,0 +1,303 @@ +name: core.nwb.base +id: core.nwb.base +version: 2.2.5 +imports: +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.language +default_prefix: core.nwb.base/ +classes: + NWBData: + name: NWBData + description: An abstract data type for a dataset. + is_a: Data + attributes: + name: + name: name + range: string + required: true + tree_root: true + Image: + name: Image + description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D + where the third dimension can have three or four elements, e.g. (x, y, (r, g, + b)) or (x, y, (r, g, b, a)). + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + resolution: + name: resolution + description: Pixel resolution of the image, in pixels per centimeter. + range: float32 + description: + name: description + description: Description of the image. + range: text + array: + name: array + range: Image__Array + tree_root: true + Image__Array: + name: Image__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + r, g, b, a: + name: r, g, b, a + range: numeric + required: false + minimum_cardinality: 4 + maximum_cardinality: 4 + NWBContainer: + name: NWBContainer + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + is_a: Container + attributes: + name: + name: name + range: string + required: true + tree_root: true + NWBDataInterface: + name: NWBDataInterface + description: An abstract data type for a generic container storing collections + of data, as opposed to metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeries: + name: TimeSeries + description: General purpose time series. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the time series. + range: text + comments: + name: comments + description: Human-readable comments about the TimeSeries. This second descriptive + field can be used to store additional information, or descriptive information + if the primary description field is populated with a computer-readable string. + range: text + data: + name: data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first + dimension should always represent time. This can also be used to store binary + data (e.g., image frames). This can also be a link to data stored in an + external file. + multivalued: false + range: TimeSeries__data + required: true + starting_time: + name: starting_time + description: Timestamp of the first sample in seconds. When timestamps are + uniformly spaced, the timestamp of the first sample can be specified and + all subsequent ones calculated from the sampling rate attribute. + multivalued: false + range: TimeSeries__starting_time + required: false + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + multivalued: true + range: float64 + required: false + control: + name: control + description: Numerical labels that apply to each time point in data for the + purpose of querying and slicing data by these values. If present, the length + of this array should be the same size as the first dimension of data. + multivalued: true + range: uint8 + required: false + control_description: + name: control_description + description: Description of each control value. Must be present if control + is present. If present, control_description[0] should describe time points + where control == 0. + multivalued: true + range: text + required: false + sync: + name: sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored + external to the NWB file, in files storing raw data. Once timestamp data + is calculated, the contents of 'sync' are mostly for archival purposes. + multivalued: false + range: TimeSeries__sync + required: false + tree_root: true + TimeSeries__data: + name: TimeSeries__data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension + should always represent time. This can also be used to store binary data (e.g., + image frames). This can also be a link to data stored in an external file. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as signed 16-bit + integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V + to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' + multiplier to get from raw data acquisition values to recorded volts is + 2.5/32768/8000 = 9.5367e-9. + range: float32 + resolution: + name: resolution + description: Smallest meaningful difference between values in data, stored + in the specified by unit, e.g., the change in value of the least significant + bit, or a larger number if signal noise is known to be present. If unknown, + use -1.0. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: TimeSeries__data__Array + TimeSeries__data__Array: + name: TimeSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: AnyType + required: true + num_DIM2: + name: num_DIM2 + range: AnyType + required: false + num_DIM3: + name: num_DIM3 + range: AnyType + required: false + num_DIM4: + name: num_DIM4 + range: AnyType + required: false + TimeSeries__starting_time: + name: TimeSeries__starting_time + description: Timestamp of the first sample in seconds. When timestamps are uniformly + spaced, the timestamp of the first sample can be specified and all subsequent + ones calculated from the sampling rate attribute. + attributes: + name: + name: name + ifabsent: string(starting_time) + range: string + required: true + equals_string: starting_time + rate: + name: rate + description: Sampling rate, in Hz. + range: float32 + unit: + name: unit + description: Unit of measurement for time, which is fixed to 'seconds'. + range: text + value: + name: value + range: float64 + required: true + TimeSeries__sync: + name: TimeSeries__sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored external + to the NWB file, in files storing raw data. Once timestamp data is calculated, + the contents of 'sync' are mostly for archival purposes. + attributes: + name: + name: name + ifabsent: string(sync) + range: string + required: true + equals_string: sync + ProcessingModule: + name: ProcessingModule + description: A collection of processed data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of processed data. + range: text + nwb_data_interface: + name: nwb_data_interface + description: Data objects stored in this collection. + multivalued: true + range: NWBDataInterface + required: false + dynamic_table: + name: dynamic_table + description: Tables stored in this collection. + multivalued: true + range: DynamicTable + required: false + tree_root: true + Images: + name: Images + description: A collection of images. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of images. + range: text + image: + name: image + description: Images stored in this collection. + multivalued: true + range: Image + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.behavior.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.behavior.yaml new file mode 100644 index 0000000..9821ae9 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.behavior.yaml @@ -0,0 +1,201 @@ +name: core.nwb.behavior +id: core.nwb.behavior +version: 2.2.5 +imports: +- core.nwb.base +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.behavior/ +classes: + SpatialSeries: + name: SpatialSeries + description: 'Direction, e.g., of gaze or travel, or position. The TimeSeries::data + field is a 2D array storing position or direction relative to some reference + frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries + has a text dataset reference_frame that indicates the zero-position, or the + zero-axes for direction. For example, if representing gaze direction, ''straight-ahead'' + might be a specific pixel on the monitor, or some other point in space. For + position data, the 0,0 point might be the top-left corner of an enclosure, as + viewed from the tracking camera. The unit of data will indicate how to interpret + SpatialSeries values.' + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: 1-D or 2-D array storing position or direction relative to some + reference frame. + multivalued: false + range: SpatialSeries__data + required: true + reference_frame: + name: reference_frame + description: Description defining what exactly 'straight-ahead' means. + multivalued: false + range: text + required: false + tree_root: true + SpatialSeries__data: + name: SpatialSeries__data + description: 1-D or 2-D array storing position or direction relative to some reference + frame. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: SpatialSeries__data__Array + SpatialSeries__data__Array: + name: SpatialSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + BehavioralEpochs: + name: BehavioralEpochs + description: TimeSeries for storing behavioral epochs. The objective of this + and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) + is to provide generic hooks for software tools/scripts. This allows a tool/script + to take the output one specific interface (e.g., UnitTimes) and plot that data + relative to another data modality (e.g., behavioral events) without having to + define all possible modalities in advance. Declaring one of these interfaces + means that one or more TimeSeries of the specified type is published. These + TimeSeries should reside in a group having the same name as the interface. For + example, if a BehavioralTimeSeries interface is declared, the module will have + one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. + BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular + events. BehavioralTimeSeries is for continuous data. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + interval_series: + name: interval_series + description: IntervalSeries object containing start and stop times of epochs. + multivalued: true + range: IntervalSeries + required: false + tree_root: true + BehavioralEvents: + name: BehavioralEvents + description: TimeSeries for storing behavioral events. See description of BehavioralEpochs + for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing behavioral events. + multivalued: true + range: TimeSeries + required: false + tree_root: true + BehavioralTimeSeries: + name: BehavioralTimeSeries + description: TimeSeries for storing Behavoioral time series data. See description + of BehavioralEpochs for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing continuous behavioral data. + multivalued: true + range: TimeSeries + required: false + tree_root: true + PupilTracking: + name: PupilTracking + description: Eye-tracking data, representing pupil size. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing time series data on pupil size. + multivalued: true + range: TimeSeries + required: true + tree_root: true + EyeTracking: + name: EyeTracking + description: Eye-tracking data, representing direction of gaze. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing data measuring direction of gaze. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + CompassDirection: + name: CompassDirection + description: With a CompassDirection interface, a module publishes a SpatialSeries + object representing a floating point value for theta. The SpatialSeries::reference_frame + field should indicate what direction corresponds to 0 and which is the direction + of rotation (this should be clockwise). The si_unit for the SpatialSeries should + be radians or degrees. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing direction of gaze travel. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + Position: + name: Position + description: Position data, whether along the x, x/y or x/y/z axis. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing position data. + multivalued: true + range: SpatialSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.device.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.device.yaml new file mode 100644 index 0000000..efa1d17 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.device.yaml @@ -0,0 +1,28 @@ +name: core.nwb.device +id: core.nwb.device +version: 2.2.5 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.device/ +classes: + Device: + name: Device + description: Metadata about a data acquisition device, e.g., recording system, + electrode, microscope. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the device (e.g., model, firmware version, processing + software version, etc.) as free-form text. + range: text + manufacturer: + name: manufacturer + description: The name of the manufacturer of the device. + range: text + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.ecephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.ecephys.yaml new file mode 100644 index 0000000..d753b1b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.ecephys.yaml @@ -0,0 +1,492 @@ +name: core.nwb.ecephys +id: core.nwb.ecephys +version: 2.2.5 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ecephys/ +classes: + ElectricalSeries: + name: ElectricalSeries + description: A time series of acquired voltage data from extracellular recordings. + The data field is an int or float array storing data in volts. The first dimension + should always represent time. The second dimension, if present, should represent + channels. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage data. + multivalued: false + range: ElectricalSeries__data + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: ElectricalSeries__electrodes + required: true + channel_conversion: + name: channel_conversion + description: Channel-specific conversion factor. Multiply the data in the + 'data' dataset by these values along the channel axis (as indicated by axis + attribute) AND by the global conversion factor in the 'conversion' attribute + of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion + * channel_conversion. This approach allows for both global and per-channel + data conversion factors needed to support the storage of electrical recordings + as native values generated by data acquisition systems. If this dataset + is not present, then there is no channel-specific conversion factor, i.e. + it is 1 for all channels. + multivalued: true + range: float32 + required: false + tree_root: true + ElectricalSeries__data: + name: ElectricalSeries__data + description: Recorded voltage data. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. This value + is fixed to 'volts'. Actual stored values are not necessarily stored in + these units. To access the data in these units, multiply 'data' by 'conversion' + and 'channel_conversion' (if present). + range: text + array: + name: array + range: ElectricalSeries__data__Array + ElectricalSeries__data__Array: + name: ElectricalSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + num_samples: + name: num_samples + range: numeric + required: false + ElectricalSeries__electrodes: + name: ElectricalSeries__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + SpikeEventSeries: + name: SpikeEventSeries + description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold + crossings). This may also be raw data, as reported by ephys hardware. If so, + the TimeSeries::description field should describe how events were detected. + All SpikeEventSeries should reside in a module (under EventWaveform interface) + even if the spikes were reported and stored by hardware. All events span the + same recording channels and store snapshots of equal duration. TimeSeries::data + array structure: [num events] [num channels] [num samples] (or [num events] + [num samples] for single electrode).' + is_a: ElectricalSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Spike waveforms. + multivalued: false + range: SpikeEventSeries__data + required: true + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + Timestamps are required for the events. Unlike for TimeSeries, timestamps + are required for SpikeEventSeries and are thus re-specified here. + multivalued: true + range: float64 + required: true + tree_root: true + SpikeEventSeries__data: + name: SpikeEventSeries__data + description: Spike waveforms. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Unit of measurement for waveforms, which is fixed to 'volts'. + range: text + array: + name: array + range: SpikeEventSeries__data__Array + SpikeEventSeries__data__Array: + name: SpikeEventSeries__data__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: numeric + required: true + num_samples: + name: num_samples + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + FeatureExtraction: + name: FeatureExtraction + description: Features, such as PC1 and PC2, that are extracted from signals stored + in a SpikeEventSeries or other source. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of features (eg, ''PC1'') for each of the extracted + features. + multivalued: true + range: text + required: true + features: + name: features + description: Multi-dimensional array of features extracted from each event. + multivalued: false + range: FeatureExtraction__features + required: true + times: + name: times + description: Times of events that features correspond to (can be a link). + multivalued: true + range: float64 + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: FeatureExtraction__electrodes + required: true + tree_root: true + FeatureExtraction__features: + name: FeatureExtraction__features + description: Multi-dimensional array of features extracted from each event. + attributes: + name: + name: name + ifabsent: string(features) + range: string + required: true + equals_string: features + array: + name: array + range: FeatureExtraction__features__Array + FeatureExtraction__features__Array: + name: FeatureExtraction__features__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: float32 + required: true + num_channels: + name: num_channels + range: float32 + required: true + num_features: + name: num_features + range: float32 + required: true + FeatureExtraction__electrodes: + name: FeatureExtraction__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + EventDetection: + name: EventDetection + description: Detected spike events from voltage trace(s). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + detection_method: + name: detection_method + description: Description of how events were detected, such as voltage threshold, + or dV/dT threshold, as well as relevant values. + multivalued: false + range: text + required: true + source_idx: + name: source_idx + description: Indices (zero-based) into source ElectricalSeries::data array + corresponding to time of event. ''description'' should define what is meant + by time of event (e.g., .25 ms before action potential peak, zero-crossing + time, etc). The index points to each event from the raw data. + multivalued: true + range: int32 + required: true + times: + name: times + description: Timestamps of events, in seconds. + multivalued: true + range: float64 + required: true + tree_root: true + EventWaveform: + name: EventWaveform + description: Represents either the waveforms of detected events, as extracted + from a raw data trace in /acquisition, or the event waveforms that were stored + during experiment acquisition. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spike_event_series: + name: spike_event_series + description: SpikeEventSeries object(s) containing detected spike event waveforms. + multivalued: true + range: SpikeEventSeries + required: false + tree_root: true + FilteredEphys: + name: FilteredEphys + description: Electrophysiology data from one or more channels that has been subjected + to filtering. Examples of filtered data include Theta and Gamma (LFP has its + own interface). FilteredEphys modules publish an ElectricalSeries for each filtered + channel or set of channels. The name of each ElectricalSeries is arbitrary but + should be informative. The source of the filtered data, whether this is from + analysis of another time series or as acquired by hardware, should be noted + in each's TimeSeries::description field. There is no assumed 1::1 correspondence + between filtered ephys signals and electrodes, as a single signal can apply + to many nearby electrodes, and one electrode may have different filtered (e.g., + theta and/or gamma) signals represented. Filter properties should be noted in + the ElectricalSeries. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing filtered electrophysiology + data. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + LFP: + name: LFP + description: LFP data from one or more channels. The electrode map in each published + ElectricalSeries will identify which channels are providing LFP data. Filter + properties should be noted in the ElectricalSeries description or comments field. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing LFP data for one or more + channels. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + ElectrodeGroup: + name: ElectrodeGroup + description: A physical grouping of electrodes, e.g. a shank of an array. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this electrode group. + range: text + location: + name: location + description: Location of electrode group. Specify the area, layer, comments + on estimation of area/layer, etc. Use standard atlas names for anatomical + regions when possible. + range: text + position: + name: position + description: stereotaxic or common framework coordinates + multivalued: false + range: AnyType + required: false + tree_root: true + ClusterWaveforms: + name: ClusterWaveforms + description: DEPRECATED The mean waveform shape, including standard deviation, + of the different clusters. Ideally, the waveform analysis should be performed + on data that is only high-pass filtered. This is a separate module because it + is expected to require updating. For example, IMEC probes may require different + storage requirements to store/display mean waveforms, requiring a new interface + or an extension of this one. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + waveform_filtering: + name: waveform_filtering + description: Filtering applied to data before generating mean/sd + multivalued: false + range: text + required: true + waveform_mean: + name: waveform_mean + description: The mean waveform for each cluster, using the same indices for + each wave as cluster numbers in the associated Clustering module (i.e, cluster + 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence + should be empty (e.g., zero- filled) + multivalued: false + range: ClusterWaveforms__waveform_mean + required: true + waveform_sd: + name: waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as + in mean + multivalued: false + range: ClusterWaveforms__waveform_sd + required: true + tree_root: true + ClusterWaveforms__waveform_mean: + name: ClusterWaveforms__waveform_mean + description: The mean waveform for each cluster, using the same indices for each + wave as cluster numbers in the associated Clustering module (i.e, cluster 3 + is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should + be empty (e.g., zero- filled) + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + array: + name: array + range: ClusterWaveforms__waveform_mean__Array + ClusterWaveforms__waveform_mean__Array: + name: ClusterWaveforms__waveform_mean__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + ClusterWaveforms__waveform_sd: + name: ClusterWaveforms__waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as in + mean + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + array: + name: array + range: ClusterWaveforms__waveform_sd__Array + ClusterWaveforms__waveform_sd__Array: + name: ClusterWaveforms__waveform_sd__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + Clustering: + name: Clustering + description: DEPRECATED Clustered spike data, whether from automatic clustering + tools (e.g., klustakwik) or as a result of manual sorting. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of clusters or clustering, (e.g. cluster 0 is noise, + clusters curated using Klusters, etc) + multivalued: false + range: text + required: true + num: + name: num + description: Cluster number of each event + multivalued: true + range: int32 + required: true + peak_over_rms: + name: peak_over_rms + description: Maximum ratio of waveform peak to RMS on any channel in the cluster + (provides a basic clustering metric). + multivalued: true + range: float32 + required: true + times: + name: times + description: Times of clustered events, in seconds. This may be a link to + times field in associated FeatureExtraction module. + multivalued: true + range: float64 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.epoch.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.epoch.yaml new file mode 100644 index 0000000..fc79ada --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.epoch.yaml @@ -0,0 +1,74 @@ +name: core.nwb.epoch +id: core.nwb.epoch +version: 2.2.5 +imports: +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.epoch/ +classes: + TimeIntervals: + name: TimeIntervals + description: A container for aggregating epoch data and the TimeSeries that each + epoch applies to. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + start_time: + name: start_time + description: Start time of epoch, in seconds. + multivalued: true + range: float32 + stop_time: + name: stop_time + description: Stop time of epoch, in seconds. + multivalued: true + range: float32 + tags: + name: tags + description: User-defined tags that identify or categorize events. + multivalued: true + range: text + tags_index: + name: tags_index + description: Index for tags. + multivalued: false + range: TimeIntervals__tags_index + required: false + timeseries: + name: timeseries + description: An index into a TimeSeries object. + multivalued: true + range: AnyType + timeseries_index: + name: timeseries_index + description: Index for timeseries. + multivalued: false + range: TimeIntervals__timeseries_index + required: false + tree_root: true + TimeIntervals__tags_index: + name: TimeIntervals__tags_index + description: Index for tags. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(tags_index) + range: string + required: true + equals_string: tags_index + TimeIntervals__timeseries_index: + name: TimeIntervals__timeseries_index + description: Index for timeseries. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(timeseries_index) + range: string + required: true + equals_string: timeseries_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.file.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.file.yaml new file mode 100644 index 0000000..ad24073 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.file.yaml @@ -0,0 +1,659 @@ +name: core.nwb.file +id: core.nwb.file +version: 2.2.5 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.device +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.epoch +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.file/ +classes: + ScratchData: + name: ScratchData + description: Any one-off datasets + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + notes: + name: notes + description: Any notes the user has about the dataset being stored + range: text + tree_root: true + NWBFile: + name: NWBFile + description: An NWB:N file storing cellular-based neurophysiology data from a + single experimental session. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(root) + range: string + required: true + equals_string: root + nwb_version: + name: nwb_version + description: File version string. Use semantic versioning, e.g. 1.2.1. This + will be the name of the format with trailing major, minor and patch numbers. + range: text + file_create_date: + name: file_create_date + description: 'A record of the date the file was created and of subsequent + modifications. The date is stored in UTC with local timezone offset as ISO + 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored + in UTC end in "Z" with no timezone offset. Date accuracy is up to milliseconds. + The file can be created after the experiment was run, so this may differ + from the experiment start time. Each modification to the nwb file adds a + new entry to the array.' + multivalued: true + range: isodatetime + required: true + identifier: + name: identifier + description: A unique text identifier for the file. For example, concatenated + lab name, file creation date/time and experimentalist, or a hash of these + and/or other values. The goal is that the string should be unique to all + other files. + multivalued: false + range: text + required: true + session_description: + name: session_description + description: A description of the experimental session and data in the file. + multivalued: false + range: text + required: true + session_start_time: + name: session_start_time + description: 'Date and time of the experiment/session start. The date is stored + in UTC with local timezone offset as ISO 8601 extended formatted string: + 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in "Z" with no timezone + offset. Date accuracy is up to milliseconds.' + multivalued: false + range: isodatetime + required: true + timestamps_reference_time: + name: timestamps_reference_time + description: 'Date and time corresponding to time zero of all timestamps. + The date is stored in UTC with local timezone offset as ISO 8601 extended + formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end + in "Z" with no timezone offset. Date accuracy is up to milliseconds. All + times stored in the file use this time as reference (i.e., time zero).' + multivalued: false + range: isodatetime + required: true + acquisition: + name: acquisition + description: Data streams recorded from the system, including ephys, ophys, + tracking, etc. This group should be read-only after the experiment is completed + and timestamps are corrected to a common timebase. The data stored here + may be links to raw data stored in external NWB files. This will allow keeping + bulky raw data out of the file while preserving the option of keeping some/all + in the file. Acquired data includes tracking and experimental data streams + (i.e., everything measured from the system). If bulky data is stored in + the /acquisition group, the data can exist in a separate NWB file that is + linked to by the file being used for processing and analysis. + multivalued: true + any_of: + - range: NWBDataInterface + - range: DynamicTable + analysis: + name: analysis + description: Lab-specific and custom scientific analysis of data. There is + no defined format for the content of this group - the format is up to the + individual user/lab. To facilitate sharing analysis data between labs, the + contents here should be stored in standard types (e.g., neurodata_types) + and appropriately documented. The file can store lab-specific and custom + data analysis without restriction on its form or schema, reducing data formatting + restrictions on end users. Such data should be placed in the analysis group. + The analysis data should be documented so that it could be shared with other + labs. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + scratch: + name: scratch + description: A place to store one-off analysis results. Data placed here is + not intended for sharing. By placing data here, users acknowledge that there + is no guarantee that their data meets any standard. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + processing: + name: processing + description: The home for ProcessingModules. These modules perform intermediate + analysis of data that is necessary to perform before scientific analysis. + Examples include spike clustering, extracting position from tracking data, + stitching together image slices. ProcessingModules can be large and express + many data sets from relatively complex analysis (e.g., spike detection and + clustering) or small, representing extraction of position information from + tracking video, or even binary lick/no-lick decisions. Common software tools + (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' + refers to intermediate analysis of the acquired data to make it more amenable + to scientific analysis. + multivalued: true + any_of: + - range: ProcessingModule + stimulus: + name: stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment + complete and timestamps are corrected to common timebase. Stores both presented + stimuli and stimulus templates, the latter in case the same stimulus is + presented multiple times, or is pulled from an external stimulus library. + Stimuli are here defined as any signal that is pushed into the system as + part of the experiment (eg, sound, video, voltage, etc). Many different + experiments can use the same stimuli, and stimuli can be re-used during + an experiment. The stimulus group is organized so that one version of template + stimuli can be stored and these be used multiple times. These templates + can exist in the present file or can be linked to a remote library file. + multivalued: false + range: NWBFile__stimulus + required: true + general: + name: general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used + to describe the experiment. Metadata necessary for interpreting the data + is stored with the data. General experimental metadata, including animal + strain, experimental protocols, experimenter, devices, etc, are stored under + 'general'. Core metadata (e.g., that required to interpret data fields) + is stored with the data itself, and implicitly defined by the file specification + (e.g., time is in seconds). The strategy used here for storing non-core + metadata is to use free-form text fields, such as would appear in sentences + or paragraphs from a Methods section. Metadata fields are text to enable + them to be more general, for example to represent ranges instead of numerical + values. Machine-readable metadata is stored as attributes to these free-form + datasets. All entries in the below table are to be included when data is + present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) + should not be created unless there is data to store within them. + multivalued: false + range: NWBFile__general + required: true + intervals: + name: intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during + an experiment, or epochs (see epochs subgroup) deriving from analysis of + data. + multivalued: false + range: NWBFile__intervals + required: false + units: + name: units + description: Data about sorted spike units. + multivalued: false + range: Units + required: false + tree_root: true + NWBFile__stimulus: + name: NWBFile__stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment complete + and timestamps are corrected to common timebase. Stores both presented stimuli + and stimulus templates, the latter in case the same stimulus is presented multiple + times, or is pulled from an external stimulus library. Stimuli are here defined + as any signal that is pushed into the system as part of the experiment (eg, + sound, video, voltage, etc). Many different experiments can use the same stimuli, + and stimuli can be re-used during an experiment. The stimulus group is organized + so that one version of template stimuli can be stored and these be used multiple + times. These templates can exist in the present file or can be linked to a remote + library file. + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + presentation: + name: presentation + description: Stimuli presented during the experiment. + multivalued: true + any_of: + - range: TimeSeries + templates: + name: templates + description: Template stimuli. Timestamps in templates are based on stimulus + design and are relative to the beginning of the stimulus. When templates + are used, the stimulus instances must convert presentation times to the + experiment`s time reference frame. + multivalued: true + any_of: + - range: TimeSeries + NWBFile__general: + name: NWBFile__general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used to + describe the experiment. Metadata necessary for interpreting the data is stored + with the data. General experimental metadata, including animal strain, experimental + protocols, experimenter, devices, etc, are stored under 'general'. Core metadata + (e.g., that required to interpret data fields) is stored with the data itself, + and implicitly defined by the file specification (e.g., time is in seconds). + The strategy used here for storing non-core metadata is to use free-form text + fields, such as would appear in sentences or paragraphs from a Methods section. + Metadata fields are text to enable them to be more general, for example to represent + ranges instead of numerical values. Machine-readable metadata is stored as attributes + to these free-form datasets. All entries in the below table are to be included + when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology + experiment) should not be created unless there is data to store within them. + attributes: + name: + name: name + ifabsent: string(general) + range: string + required: true + equals_string: general + data_collection: + name: data_collection + description: Notes about data collection and analysis. + multivalued: false + range: text + required: false + experiment_description: + name: experiment_description + description: General description of the experiment. + multivalued: false + range: text + required: false + experimenter: + name: experimenter + description: Name of person(s) who performed the experiment. Can also specify + roles of different people involved. + multivalued: true + range: text + required: false + institution: + name: institution + description: Institution(s) where experiment was performed. + multivalued: false + range: text + required: false + keywords: + name: keywords + description: Terms to search over. + multivalued: true + range: text + required: false + lab: + name: lab + description: Laboratory where experiment was performed. + multivalued: false + range: text + required: false + notes: + name: notes + description: Notes about the experiment. + multivalued: false + range: text + required: false + pharmacology: + name: pharmacology + description: Description of drugs used, including how and when they were administered. + Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc. + multivalued: false + range: text + required: false + protocol: + name: protocol + description: Experimental protocol, if applicable. e.g., include IACUC protocol + number. + multivalued: false + range: text + required: false + related_publications: + name: related_publications + description: Publication information. PMID, DOI, URL, etc. + multivalued: true + range: text + required: false + session_id: + name: session_id + description: Lab-specific ID for the session. + multivalued: false + range: text + required: false + slices: + name: slices + description: Description of slices, including information about preparation + thickness, orientation, temperature, and bath solution. + multivalued: false + range: text + required: false + source_script: + name: source_script + description: Script file or link to public source code used to create this + NWB file. + multivalued: false + range: NWBFile__general__source_script + required: false + stimulus: + name: stimulus + description: Notes about stimuli, such as how and where they were presented. + multivalued: false + range: text + required: false + surgery: + name: surgery + description: Narrative description about surgery/surgeries, including date(s) + and who performed surgery. + multivalued: false + range: text + required: false + virus: + name: virus + description: Information about virus(es) used in experiments, including virus + ID, source, date made, injection location, volume, etc. + multivalued: false + range: text + required: false + lab_meta_data: + name: lab_meta_data + description: Place-holder than can be extended so that lab-specific meta-data + can be placed in /general. + multivalued: true + range: LabMetaData + required: false + devices: + name: devices + description: Description of hardware devices used during experiment, e.g., + monitors, ADC boards, microscopes, etc. + multivalued: true + any_of: + - range: Device + subject: + name: subject + description: Information about the animal or person from which the data was + measured. + multivalued: false + range: Subject + required: false + extracellular_ephys: + name: extracellular_ephys + description: Metadata related to extracellular electrophysiology. + multivalued: false + range: NWBFile__general__extracellular_ephys + required: false + intracellular_ephys: + name: intracellular_ephys + description: Metadata related to intracellular electrophysiology. + multivalued: false + range: NWBFile__general__intracellular_ephys + required: false + optogenetics: + name: optogenetics + description: Metadata describing optogenetic stimuluation. + multivalued: true + any_of: + - range: OptogeneticStimulusSite + optophysiology: + name: optophysiology + description: Metadata related to optophysiology. + multivalued: true + any_of: + - range: ImagingPlane + NWBFile__general__source_script: + name: NWBFile__general__source_script + description: Script file or link to public source code used to create this NWB + file. + attributes: + name: + name: name + ifabsent: string(source_script) + range: string + required: true + equals_string: source_script + file_name: + name: file_name + description: Name of script file. + range: text + value: + name: value + range: text + required: true + NWBFile__general__extracellular_ephys: + name: NWBFile__general__extracellular_ephys + description: Metadata related to extracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(extracellular_ephys) + range: string + required: true + equals_string: extracellular_ephys + electrode_group: + name: electrode_group + description: Physical group of electrodes. + multivalued: true + range: ElectrodeGroup + required: false + electrodes: + name: electrodes + description: A table of all electrodes (i.e. channels) used for recording. + multivalued: false + range: NWBFile__general__extracellular_ephys__electrodes + required: false + NWBFile__general__extracellular_ephys__electrodes: + name: NWBFile__general__extracellular_ephys__electrodes + description: A table of all electrodes (i.e. channels) used for recording. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + x: + name: x + description: x coordinate of the channel location in the brain (+x is posterior). + multivalued: true + range: float32 + y: + name: y + description: y coordinate of the channel location in the brain (+y is inferior). + multivalued: true + range: float32 + z: + name: z + description: z coordinate of the channel location in the brain (+z is right). + multivalued: true + range: float32 + imp: + name: imp + description: Impedance of the channel. + multivalued: true + range: float32 + location: + name: location + description: Location of the electrode (channel). Specify the area, layer, + comments on estimation of area/layer, stereotaxic coordinates if in vivo, + etc. Use standard atlas names for anatomical regions when possible. + multivalued: true + range: text + filtering: + name: filtering + description: Description of hardware filtering. + multivalued: true + range: float32 + group: + name: group + description: Reference to the ElectrodeGroup this electrode is a part of. + multivalued: true + range: ElectrodeGroup + group_name: + name: group_name + description: Name of the ElectrodeGroup this electrode is a part of. + multivalued: true + range: text + rel_x: + name: rel_x + description: x coordinate in electrode group + multivalued: true + range: float32 + rel_y: + name: rel_y + description: y coordinate in electrode group + multivalued: true + range: float32 + rel_z: + name: rel_z + description: z coordinate in electrode group + multivalued: true + range: float32 + reference: + name: reference + description: Description of the reference used for this electrode. + multivalued: true + range: text + NWBFile__general__intracellular_ephys: + name: NWBFile__general__intracellular_ephys + description: Metadata related to intracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(intracellular_ephys) + range: string + required: true + equals_string: intracellular_ephys + filtering: + name: filtering + description: Description of filtering used. Includes filtering type and parameters, + frequency fall-off, etc. If this changes between TimeSeries, filter description + should be stored as a text attribute for each TimeSeries. + multivalued: false + range: text + required: false + intracellular_electrode: + name: intracellular_electrode + description: An intracellular electrode. + multivalued: true + range: IntracellularElectrode + required: false + sweep_table: + name: sweep_table + description: The table which groups different PatchClampSeries together. + multivalued: false + range: SweepTable + required: false + NWBFile__intervals: + name: NWBFile__intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during an + experiment, or epochs (see epochs subgroup) deriving from analysis of data. + attributes: + name: + name: name + ifabsent: string(intervals) + range: string + required: true + equals_string: intervals + epochs: + name: epochs + description: Divisions in time marking experimental stages or sub-divisions + of a single recording session. + multivalued: false + range: TimeIntervals + required: false + trials: + name: trials + description: Repeated experimental events that have a logical grouping. + multivalued: false + range: TimeIntervals + required: false + invalid_times: + name: invalid_times + description: Time intervals that should be removed from analysis. + multivalued: false + range: TimeIntervals + required: false + time_intervals: + name: time_intervals + description: Optional additional table(s) for describing other experimental + time intervals. + multivalued: true + range: TimeIntervals + required: false + LabMetaData: + name: LabMetaData + description: Lab-specific meta-data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + Subject: + name: Subject + description: Information about the animal or person from which the data was measured. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + age: + name: age + description: Age of subject. Can be supplied instead of 'date_of_birth'. + multivalued: false + range: text + required: false + date_of_birth: + name: date_of_birth + description: Date of birth of subject. Can be supplied instead of 'age'. + multivalued: false + range: isodatetime + required: false + description: + name: description + description: Description of subject and where subject came from (e.g., breeder, + if animal). + multivalued: false + range: text + required: false + genotype: + name: genotype + description: Genetic strain. If absent, assume Wild Type (WT). + multivalued: false + range: text + required: false + sex: + name: sex + description: Gender of subject. + multivalued: false + range: text + required: false + species: + name: species + description: Species of subject. + multivalued: false + range: text + required: false + subject_id: + name: subject_id + description: ID of animal/person used/participating in experiment (lab convention). + multivalued: false + range: text + required: false + weight: + name: weight + description: Weight at time of experiment, at time of surgery and at other + important times. + multivalued: false + range: text + required: false + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.icephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.icephys.yaml new file mode 100644 index 0000000..5562c72 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.icephys.yaml @@ -0,0 +1,503 @@ +name: core.nwb.icephys +id: core.nwb.icephys +version: 2.2.5 +imports: +- core.nwb.base +- core.nwb.device +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.language +default_prefix: core.nwb.icephys/ +classes: + PatchClampSeries: + name: PatchClampSeries + description: An abstract base class for patch-clamp data - stimulus or response, + current or voltage. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: Protocol/stimulus name for this patch-clamp dataset. + range: text + sweep_number: + name: sweep_number + description: Sweep number, allows to group different PatchClampSeries together. + range: uint32 + data: + name: data + description: Recorded voltage or current. + multivalued: true + range: numeric + required: true + gain: + name: gain + description: Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt + (c-clamp). + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries: + name: CurrentClampSeries + description: Voltage data from an intracellular current-clamp recording. A corresponding + CurrentClampStimulusSeries (stored separately as a stimulus) is used to store + the current injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage. + multivalued: false + range: CurrentClampSeries__data + required: true + bias_current: + name: bias_current + description: Bias current, in amps. + multivalued: false + range: float32 + required: false + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms. + multivalued: false + range: float32 + required: false + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads. + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries__data: + name: CurrentClampSeries__data + description: Recorded voltage. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IZeroClampSeries: + name: IZeroClampSeries + description: Voltage data from an intracellular recording when all current and + amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There + is no CurrentClampStimulusSeries associated with an IZero series because the + amplifier is disconnected and no stimulus can reach the cell. + is_a: CurrentClampSeries + attributes: + name: + name: name + range: string + required: true + bias_current: + name: bias_current + description: Bias current, in amps, fixed to 0.0. + multivalued: false + range: float32 + required: true + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms, fixed to 0.0. + multivalued: false + range: float32 + required: true + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads, fixed to 0.0. + multivalued: false + range: float32 + required: true + tree_root: true + CurrentClampStimulusSeries: + name: CurrentClampStimulusSeries + description: Stimulus current applied during current clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus current applied. + multivalued: false + range: CurrentClampStimulusSeries__data + required: true + tree_root: true + CurrentClampStimulusSeries__data: + name: CurrentClampStimulusSeries__data + description: Stimulus current applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries: + name: VoltageClampSeries + description: Current data from an intracellular voltage-clamp recording. A corresponding + VoltageClampStimulusSeries (stored separately as a stimulus) is used to store + the voltage injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded current. + multivalued: false + range: VoltageClampSeries__data + required: true + capacitance_fast: + name: capacitance_fast + description: Fast capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_fast + required: false + capacitance_slow: + name: capacitance_slow + description: Slow capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_slow + required: false + resistance_comp_bandwidth: + name: resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + multivalued: false + range: VoltageClampSeries__resistance_comp_bandwidth + required: false + resistance_comp_correction: + name: resistance_comp_correction + description: Resistance compensation correction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_correction + required: false + resistance_comp_prediction: + name: resistance_comp_prediction + description: Resistance compensation prediction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_prediction + required: false + whole_cell_capacitance_comp: + name: whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + multivalued: false + range: VoltageClampSeries__whole_cell_capacitance_comp + required: false + whole_cell_series_resistance_comp: + name: whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + multivalued: false + range: VoltageClampSeries__whole_cell_series_resistance_comp + required: false + tree_root: true + VoltageClampSeries__data: + name: VoltageClampSeries__data + description: Recorded current. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries__capacitance_fast: + name: VoltageClampSeries__capacitance_fast + description: Fast capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_fast) + range: string + required: true + equals_string: capacitance_fast + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__capacitance_slow: + name: VoltageClampSeries__capacitance_slow + description: Slow capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_slow) + range: string + required: true + equals_string: capacitance_slow + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_bandwidth: + name: VoltageClampSeries__resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + attributes: + name: + name: name + ifabsent: string(resistance_comp_bandwidth) + range: string + required: true + equals_string: resistance_comp_bandwidth + unit: + name: unit + description: Unit of measurement for resistance_comp_bandwidth, which is fixed + to 'hertz'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_correction: + name: VoltageClampSeries__resistance_comp_correction + description: Resistance compensation correction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_correction) + range: string + required: true + equals_string: resistance_comp_correction + unit: + name: unit + description: Unit of measurement for resistance_comp_correction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_prediction: + name: VoltageClampSeries__resistance_comp_prediction + description: Resistance compensation prediction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_prediction) + range: string + required: true + equals_string: resistance_comp_prediction + unit: + name: unit + description: Unit of measurement for resistance_comp_prediction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_capacitance_comp: + name: VoltageClampSeries__whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + attributes: + name: + name: name + ifabsent: string(whole_cell_capacitance_comp) + range: string + required: true + equals_string: whole_cell_capacitance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_capacitance_comp, which is + fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_series_resistance_comp: + name: VoltageClampSeries__whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + attributes: + name: + name: name + ifabsent: string(whole_cell_series_resistance_comp) + range: string + required: true + equals_string: whole_cell_series_resistance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_series_resistance_comp, which + is fixed to 'ohms'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampStimulusSeries: + name: VoltageClampStimulusSeries + description: Stimulus voltage applied during a voltage clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus voltage applied. + multivalued: false + range: VoltageClampStimulusSeries__data + required: true + tree_root: true + VoltageClampStimulusSeries__data: + name: VoltageClampStimulusSeries__data + description: Stimulus voltage applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IntracellularElectrode: + name: IntracellularElectrode + description: An intracellular electrode and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of electrode (e.g., whole-cell, sharp, etc.). + multivalued: false + range: text + required: true + filtering: + name: filtering + description: Electrode specific filtering. + multivalued: false + range: text + required: false + initial_access_resistance: + name: initial_access_resistance + description: Initial access resistance. + multivalued: false + range: text + required: false + location: + name: location + description: Location of the electrode. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: false + resistance: + name: resistance + description: Electrode resistance, in ohms. + multivalued: false + range: text + required: false + seal: + name: seal + description: Information about seal used for recording. + multivalued: false + range: text + required: false + slice: + name: slice + description: Information about slice used for recording. + multivalued: false + range: text + required: false + tree_root: true + SweepTable: + name: SweepTable + description: The table which groups different PatchClampSeries together. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + sweep_number: + name: sweep_number + description: Sweep number of the PatchClampSeries in that row. + multivalued: true + range: uint32 + series: + name: series + description: The PatchClampSeries with the sweep number in that row. + multivalued: true + range: PatchClampSeries + series_index: + name: series_index + description: Index for series. + multivalued: false + range: SweepTable__series_index + required: true + tree_root: true + SweepTable__series_index: + name: SweepTable__series_index + description: Index for series. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(series_index) + range: string + required: true + equals_string: series_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.image.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.image.yaml new file mode 100644 index 0000000..f3a354c --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.image.yaml @@ -0,0 +1,312 @@ +name: core.nwb.image +id: core.nwb.image +version: 2.2.5 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.image/ +classes: + GrayscaleImage: + name: GrayscaleImage + description: A grayscale image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: GrayscaleImage__Array + tree_root: true + GrayscaleImage__Array: + name: GrayscaleImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + RGBImage: + name: RGBImage + description: A color image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBImage__Array + tree_root: true + RGBImage__Array: + name: RGBImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RGBAImage: + name: RGBAImage + description: A color image with transparency. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBAImage__Array + tree_root: true + RGBAImage__Array: + name: RGBAImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b, a: + name: r, g, b, a + range: numeric + required: true + minimum_cardinality: 4 + maximum_cardinality: 4 + ImageSeries: + name: ImageSeries + description: General image data that is common between acquisition and stimulus + time series. Sometimes the image data is stored in the file in a raw format + while other times it will be stored as a series of external image files in the + host file system. The data field will either be binary data, if the data is + stored in the NWB file, or empty, if the data is stored in an external image + stack. [frame][x][y] or [frame][x][y][z]. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Binary data representing images across frames. + multivalued: false + range: ImageSeries__data + required: false + dimension: + name: dimension + description: Number of pixels on x, y, (and z) axes. + multivalued: true + range: int32 + required: false + external_file: + name: external_file + description: Paths to one or more external file(s). The field is only present + if format='external'. This is only relevant if the image series is stored + in the file system as one or more image file(s). This field should NOT be + used if the image is stored in another NWB file and that file is linked + to this file. + multivalued: true + range: text + required: false + format: + name: format + description: Format of image. If this is 'external', then the attribute 'external_file' + contains the path information to the image files. If this is 'raw', then + the raw (single-channel) binary data is stored in the 'data' dataset. If + this attribute is not present, then the default format='raw' case is assumed. + multivalued: false + range: text + required: false + tree_root: true + ImageSeries__data: + name: ImageSeries__data + description: Binary data representing images across frames. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: ImageSeries__data__Array + ImageSeries__data__Array: + name: ImageSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + z: + name: z + range: numeric + required: false + ImageMaskSeries: + name: ImageMaskSeries + description: An alpha mask that is applied to a presented visual stimulus. The + 'data' array contains an array of mask values that are applied to the displayed + image. Mask values are stored as RGBA. Mask can vary with time. The timestamps + array indicates the starting time of a mask, and that mask pattern continues + until it's explicitly changed. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + tree_root: true + OpticalSeries: + name: OpticalSeries + description: Image data that is presented or recorded. A stimulus template movie + will be stored only as an image. When the image is presented as stimulus, additional + data is required, such as field of view (e.g., how much of the visual field + the image covers, or how what is the area of the target being imaged). If the + OpticalSeries represents acquired imaging data, orientation is also important. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + distance: + name: distance + description: Distance from camera/monitor to target/eye. + multivalued: false + range: float32 + required: false + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: OpticalSeries__field_of_view + required: false + data: + name: data + description: Images presented to subject, either grayscale or RGB + multivalued: false + range: OpticalSeries__data + required: true + orientation: + name: orientation + description: Description of image relative to some reference frame (e.g., + which way is up). Must also specify frame of reference. + multivalued: false + range: text + required: false + tree_root: true + OpticalSeries__field_of_view: + name: OpticalSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: OpticalSeries__field_of_view__Array + OpticalSeries__field_of_view__Array: + name: OpticalSeries__field_of_view__Array + is_a: Arraylike + attributes: + width, height: + name: width, height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width, height, depth: + name: width, height, depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalSeries__data: + name: OpticalSeries__data + description: Images presented to subject, either grayscale or RGB + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: OpticalSeries__data__Array + OpticalSeries__data__Array: + name: OpticalSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + IndexSeries: + name: IndexSeries + description: Stores indices to image frames stored in an ImageSeries. The purpose + of the ImageIndexSeries is to allow a static image stack to be stored somewhere, + and the images in the stack to be referenced out-of-order. This can be for the + display of individual images, or of movie segments (as a movie is simply a series + of images). The data field stores the index of the frame in the referenced ImageSeries, + and the timestamps array indicates when that image was displayed. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Index of the frame in the referenced ImageSeries. + multivalued: true + range: int32 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.language.yaml new file mode 100644 index 0000000..c57e91f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.language.yaml @@ -0,0 +1,148 @@ +name: core.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.misc.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.misc.yaml new file mode 100644 index 0000000..f521f95 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.misc.yaml @@ -0,0 +1,406 @@ +name: core.nwb.misc +id: core.nwb.misc +version: 2.2.5 +imports: +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.ecephys +- core.nwb.language +default_prefix: core.nwb.misc/ +classes: + AbstractFeatureSeries: + name: AbstractFeatureSeries + description: Abstract features, such as quantitative descriptions of sensory stimuli. + The TimeSeries::data field is a 2D array, storing those features (e.g., for + visual grating stimulus this might be orientation, spatial frequency and contrast). + Null stimuli (eg, uniform gray) can be marked as being an independent feature + (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, + or through use of the TimeSeries::control fields. A set of features is considered + to persist until the next set of features is defined. The final set of features + stored should be the null set. This is useful when storing the raw stimulus + is impractical. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Values of each feature at each time. + multivalued: false + range: AbstractFeatureSeries__data + required: true + feature_units: + name: feature_units + description: Units of each feature. + multivalued: true + range: text + required: false + features: + name: features + description: Description of the features represented in TimeSeries::data. + multivalued: true + range: text + required: true + tree_root: true + AbstractFeatureSeries__data: + name: AbstractFeatureSeries__data + description: Values of each feature at each time. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Since there can be different units for different features, store + the units in 'feature_units'. The default value for this attribute is "see + 'feature_units'". + range: text + array: + name: array + range: AbstractFeatureSeries__data__Array + AbstractFeatureSeries__data__Array: + name: AbstractFeatureSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + AnnotationSeries: + name: AnnotationSeries + description: Stores user annotations made during an experiment. The data[] field + stores a text array, and timestamps are stored for each annotation (ie, interval=1). + This is largely an alias to a standard TimeSeries storing a text array but that + is identifiable as storing annotations in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Annotations made during an experiment. + multivalued: true + range: text + required: true + tree_root: true + IntervalSeries: + name: IntervalSeries + description: Stores intervals of data. The timestamps field stores the beginning + and end of intervals. The data field stores whether the interval just started + (>0 value) or ended (<0 value). Different interval types can be represented + in the same series by using multiple key values (eg, 1 for feature A, 2 for + feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This + is largely an alias of a standard TimeSeries but that is identifiable as representing + time intervals in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Use values >0 if interval started, <0 if interval ended. + multivalued: true + range: int8 + required: true + tree_root: true + DecompositionSeries: + name: DecompositionSeries + description: Spectral analysis of a time series, e.g. of an LFP or a speech signal. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Data decomposed into frequency bands. + multivalued: false + range: DecompositionSeries__data + required: true + metric: + name: metric + description: The metric used, e.g. phase, amplitude, power. + multivalued: false + range: text + required: true + bands: + name: bands + description: Table for describing the bands that this series was generated + from. There should be one row in this table for each band. + multivalued: false + range: DecompositionSeries__bands + required: true + tree_root: true + DecompositionSeries__data: + name: DecompositionSeries__data + description: Data decomposed into frequency bands. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: DecompositionSeries__data__Array + DecompositionSeries__data__Array: + name: DecompositionSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: true + num_bands: + name: num_bands + range: numeric + required: true + DecompositionSeries__bands: + name: DecompositionSeries__bands + description: Table for describing the bands that this series was generated from. + There should be one row in this table for each band. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(bands) + range: string + required: true + equals_string: bands + band_name: + name: band_name + description: Name of the band, e.g. theta. + multivalued: true + range: text + band_limits: + name: band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + multivalued: false + range: DecompositionSeries__bands__band_limits + required: true + band_mean: + name: band_mean + description: The mean Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + band_stdev: + name: band_stdev + description: The standard deviation of Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + DecompositionSeries__bands__band_limits: + name: DecompositionSeries__bands__band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(band_limits) + range: string + required: true + equals_string: band_limits + Units: + name: Units + description: Data about spiking units. Event times of observed units (e.g. cell, + synapse, etc.) should be concatenated and stored in spike_times. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + spike_times_index: + name: spike_times_index + description: Index into the spike_times dataset. + multivalued: false + range: Units__spike_times_index + required: false + spike_times: + name: spike_times + description: Spike times for each unit. + multivalued: false + range: Units__spike_times + required: false + obs_intervals_index: + name: obs_intervals_index + description: Index into the obs_intervals dataset. + multivalued: false + range: Units__obs_intervals_index + required: false + obs_intervals: + name: obs_intervals + description: Observation intervals for each unit. + multivalued: false + range: Units__obs_intervals + required: false + electrodes_index: + name: electrodes_index + description: Index into electrodes. + multivalued: false + range: Units__electrodes_index + required: false + electrodes: + name: electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + multivalued: false + range: Units__electrodes + required: false + electrode_group: + name: electrode_group + description: Electrode group that each spike unit came from. + multivalued: true + range: ElectrodeGroup + waveform_mean: + name: waveform_mean + description: Spike waveform mean for each spike unit. + multivalued: false + range: Units__waveform_mean + required: false + waveform_sd: + name: waveform_sd + description: Spike waveform standard deviation for each spike unit. + multivalued: false + range: Units__waveform_sd + required: false + tree_root: true + Units__spike_times_index: + name: Units__spike_times_index + description: Index into the spike_times dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(spike_times_index) + range: string + required: true + equals_string: spike_times_index + Units__spike_times: + name: Units__spike_times + description: Spike times for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(spike_times) + range: string + required: true + equals_string: spike_times + resolution: + name: resolution + description: The smallest possible difference between two spike times. Usually + 1 divided by the acquisition sampling rate from which spike times were extracted, + but could be larger if the acquisition time series was downsampled or smaller + if the acquisition time series was smoothed/interpolated and it is possible + for the spike time to be between samples. + range: float64 + Units__obs_intervals_index: + name: Units__obs_intervals_index + description: Index into the obs_intervals dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(obs_intervals_index) + range: string + required: true + equals_string: obs_intervals_index + Units__obs_intervals: + name: Units__obs_intervals + description: Observation intervals for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(obs_intervals) + range: string + required: true + equals_string: obs_intervals + Units__electrodes_index: + name: Units__electrodes_index + description: Index into electrodes. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(electrodes_index) + range: string + required: true + equals_string: electrodes_index + Units__electrodes: + name: Units__electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + Units__waveform_mean: + name: Units__waveform_mean + description: Spike waveform mean for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveform_sd: + name: Units__waveform_sd + description: Spike waveform standard deviation for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.ogen.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.ogen.yaml new file mode 100644 index 0000000..9bd39aa --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.ogen.yaml @@ -0,0 +1,55 @@ +name: core.nwb.ogen +id: core.nwb.ogen +version: 2.2.5 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ogen/ +classes: + OptogeneticSeries: + name: OptogeneticSeries + description: An optogenetic stimulus. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Applied power for optogenetic stimulus, in watts. + multivalued: true + range: numeric + required: true + tree_root: true + OptogeneticStimulusSite: + name: OptogeneticStimulusSite + description: A site of optogenetic stimulation. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of stimulation site. + multivalued: false + range: text + required: true + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + location: + name: location + description: Location of the stimulation site. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.ophys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.ophys.yaml new file mode 100644 index 0000000..1ca82b9 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.ophys.yaml @@ -0,0 +1,550 @@ +name: core.nwb.ophys +id: core.nwb.ophys +version: 2.2.5 +imports: +- core.nwb.image +- core.nwb.base +- ../../hdmf_common/v1_1_3/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ophys/ +classes: + TwoPhotonSeries: + name: TwoPhotonSeries + description: Image stack recorded over time from 2-photon microscope. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + pmt_gain: + name: pmt_gain + description: Photomultiplier gain. + range: float32 + scan_line_rate: + name: scan_line_rate + description: Lines imaged per second. This is also stored in /general/optophysiology + but is kept here as it is useful information for analysis, and so good to + be stored w/ the actual data. + range: float32 + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: TwoPhotonSeries__field_of_view + required: false + tree_root: true + TwoPhotonSeries__field_of_view: + name: TwoPhotonSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: TwoPhotonSeries__field_of_view__Array + TwoPhotonSeries__field_of_view__Array: + name: TwoPhotonSeries__field_of_view__Array + is_a: Arraylike + attributes: + width|height: + name: width|height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width|height|depth: + name: width|height|depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + RoiResponseSeries: + name: RoiResponseSeries + description: ROI responses over an imaging plane. The first dimension represents + time. The second dimension, if present, represents ROIs. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Signals from ROIs. + multivalued: false + range: RoiResponseSeries__data + required: true + rois: + name: rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + multivalued: false + range: RoiResponseSeries__rois + required: true + tree_root: true + RoiResponseSeries__data: + name: RoiResponseSeries__data + description: Signals from ROIs. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: RoiResponseSeries__data__Array + RoiResponseSeries__data__Array: + name: RoiResponseSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_ROIs: + name: num_ROIs + range: numeric + required: false + RoiResponseSeries__rois: + name: RoiResponseSeries__rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(rois) + range: string + required: true + equals_string: rois + DfOverF: + name: DfOverF + description: dF/F information about a region of interest (ROI). Storage hierarchy + of dF/F should be the same as for segmentation (i.e., same names for ROIs and + for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing dF/F for a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + Fluorescence: + name: Fluorescence + description: Fluorescence information about a region of interest (ROI). Storage + hierarchy of fluorescence should be the same as for segmentation (ie, same names + for ROIs and for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing fluorescence data for + a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + ImageSegmentation: + name: ImageSegmentation + description: Stores pixels in an image that represent different regions of interest + (ROIs) or masks. All segmentation for a given imaging plane is stored together, + with storage for multiple imaging planes (masks) supported. Each ROI is stored + in its own subgroup, with the ROI group containing both a 2D mask and a list + of pixels that make up this mask. Segments can also be used for masking neuropil. + If segmentation is allowed to change with time, a new imaging plane (or module) + is required and ROI names should remain consistent between them. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + plane_segmentation: + name: plane_segmentation + description: Results from image segmentation of a specific imaging plane. + multivalued: true + range: PlaneSegmentation + required: true + tree_root: true + PlaneSegmentation: + name: PlaneSegmentation + description: Results from image segmentation of a specific imaging plane. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + image_mask: + name: image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + multivalued: false + range: PlaneSegmentation__image_mask + required: false + pixel_mask_index: + name: pixel_mask_index + description: Index into pixel_mask. + multivalued: false + range: PlaneSegmentation__pixel_mask_index + required: false + pixel_mask: + name: pixel_mask + description: 'Pixel masks for each ROI: a list of indices and weights for + the ROI. Pixel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + voxel_mask_index: + name: voxel_mask_index + description: Index into voxel_mask. + multivalued: false + range: PlaneSegmentation__voxel_mask_index + required: false + voxel_mask: + name: voxel_mask + description: 'Voxel masks for each ROI: a list of indices and weights for + the ROI. Voxel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + reference_images: + name: reference_images + description: Image stacks that the segmentation masks apply to. + multivalued: true + any_of: + - range: ImageSeries + tree_root: true + PlaneSegmentation__image_mask: + name: PlaneSegmentation__image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(image_mask) + range: string + required: true + equals_string: image_mask + PlaneSegmentation__pixel_mask_index: + name: PlaneSegmentation__pixel_mask_index + description: Index into pixel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(pixel_mask_index) + range: string + required: true + equals_string: pixel_mask_index + PlaneSegmentation__voxel_mask_index: + name: PlaneSegmentation__voxel_mask_index + description: Index into voxel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(voxel_mask_index) + range: string + required: true + equals_string: voxel_mask_index + ImagingPlane: + name: ImagingPlane + description: An imaging plane and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the imaging plane. + multivalued: false + range: text + required: false + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + imaging_rate: + name: imaging_rate + description: Rate that images are acquired, in Hz. If the corresponding TimeSeries + is present, the rate should be stored there instead. + multivalued: false + range: float32 + required: false + indicator: + name: indicator + description: Calcium indicator. + multivalued: false + range: text + required: true + location: + name: location + description: Location of the imaging plane. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + manifold: + name: manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents + the position of the pixel relative to the defined coordinate space. Deprecated + in favor of origin_coords and grid_spacing. + multivalued: false + range: ImagingPlane__manifold + required: false + origin_coords: + name: origin_coords + description: Physical location of the first element of the imaging plane (0, + 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for + what the physical location is relative to (e.g., bregma). + multivalued: false + range: ImagingPlane__origin_coords + required: false + grid_spacing: + name: grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also + reference_frame to interpret the grid. + multivalued: false + range: ImagingPlane__grid_spacing + required: false + reference_frame: + name: reference_frame + description: Describes reference frame of origin_coords and grid_spacing. + For example, this can be a text description of the anatomical location and + orientation of the grid defined by origin_coords and grid_spacing or the + vectors needed to transform or rotate the grid to a common anatomical axis + (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and + grid_spacing. If origin_coords and grid_spacing are not present, then this + field is not required. For example, if the microscope takes 10 x 10 x 2 + images, where the first value of the data matrix (index (0, 0, 0)) corresponds + to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is + 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means + more anterior, larger numbers in y means more rightward, and larger numbers + in z means more ventral, then enter the following -- origin_coords = (-1.2, + -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = "Origin coordinates + are relative to bregma. First dimension corresponds to anterior-posterior + axis (larger index = more anterior). Second dimension corresponds to medial-lateral + axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral + axis (larger index = more ventral)." + multivalued: false + range: text + required: false + optical_channel: + name: optical_channel + description: An optical channel used to record from an imaging plane. + multivalued: true + range: OpticalChannel + required: true + tree_root: true + ImagingPlane__manifold: + name: ImagingPlane__manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents the + position of the pixel relative to the defined coordinate space. Deprecated in + favor of origin_coords and grid_spacing. + attributes: + name: + name: name + ifabsent: string(manifold) + range: string + required: true + equals_string: manifold + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as pixels from + x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then + the 'conversion' multiplier to get from raw data acquisition pixel units + to meters is 2/1000. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__manifold__Array + ImagingPlane__manifold__Array: + name: ImagingPlane__manifold__Array + is_a: Arraylike + attributes: + height: + name: height + range: float32 + required: true + width: + name: width + range: float32 + required: true + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + depth: + name: depth + range: float32 + required: false + ImagingPlane__origin_coords: + name: ImagingPlane__origin_coords + description: Physical location of the first element of the imaging plane (0, 0) + for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the + physical location is relative to (e.g., bregma). + attributes: + name: + name: name + ifabsent: string(origin_coords) + range: string + required: true + equals_string: origin_coords + unit: + name: unit + description: Measurement units for origin_coords. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__origin_coords__Array + ImagingPlane__origin_coords__Array: + name: ImagingPlane__origin_coords__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + ImagingPlane__grid_spacing: + name: ImagingPlane__grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame + to interpret the grid. + attributes: + name: + name: name + ifabsent: string(grid_spacing) + range: string + required: true + equals_string: grid_spacing + unit: + name: unit + description: Measurement units for grid_spacing. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__grid_spacing__Array + ImagingPlane__grid_spacing__Array: + name: ImagingPlane__grid_spacing__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalChannel: + name: OpticalChannel + description: An optical channel used to record from an imaging plane. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description or other notes about the channel. + multivalued: false + range: text + required: true + emission_lambda: + name: emission_lambda + description: Emission wavelength for channel, in nm. + multivalued: false + range: float32 + required: true + tree_root: true + MotionCorrection: + name: MotionCorrection + description: 'An image stack where all frames are shifted (registered) to a common + coordinate system, to account for movement and drift between frames. Note: each + frame at each point in time is assumed to be 2-D (has only x & y dimensions).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected_image_stack: + name: corrected_image_stack + description: Reuslts from motion correction of an image stack. + multivalued: true + range: CorrectedImageStack + required: true + tree_root: true + CorrectedImageStack: + name: CorrectedImageStack + description: Reuslts from motion correction of an image stack. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected: + name: corrected + description: Image stack with frames shifted to the common coordinates. + multivalued: false + range: ImageSeries + required: true + xy_translation: + name: xy_translation + description: Stores the x,y delta necessary to align each frame to the common + coordinates, for example, to align each frame to a reference image. + multivalued: false + range: TimeSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.retinotopy.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.retinotopy.yaml new file mode 100644 index 0000000..5494d98 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/core.nwb.retinotopy.yaml @@ -0,0 +1,362 @@ +name: core.nwb.retinotopy +id: core.nwb.retinotopy +version: 2.2.5 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.retinotopy/ +classes: + ImagingRetinotopy: + name: ImagingRetinotopy + description: 'Intrinsic signal optical imaging or widefield imaging for measuring + retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of + responses to specific stimuli and a combined polarity map from which to identify + visual areas. This group does not store the raw responses imaged during retinotopic + mapping or the stimuli presented, but rather the resulting phase and power maps + after applying a Fourier transform on the averaged responses. Note: for data + consistency, all images and arrays are stored in the format [row][column] and + [row, col], which equates to [y][x]. Field of view and dimension arrays may + appear backward (i.e., y before x).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + axis_1_phase_map: + name: axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + multivalued: false + range: ImagingRetinotopy__axis_1_phase_map + required: true + axis_1_power_map: + name: axis_1_power_map + description: Power response on the first measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_1_power_map + required: false + axis_2_phase_map: + name: axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_phase_map + required: true + axis_2_power_map: + name: axis_2_power_map + description: Power response on the second measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_2_power_map + required: false + axis_descriptions: + name: axis_descriptions + description: Two-element array describing the contents of the two response + axis fields. Description should be something like ['altitude', 'azimuth'] + or '['radius', 'theta']. + multivalued: true + range: text + required: true + focal_depth_image: + name: focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., + focal depth, wavelength) as data collection. Array format: [rows][columns].' + multivalued: false + range: ImagingRetinotopy__focal_depth_image + required: false + sign_map: + name: sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + multivalued: false + range: ImagingRetinotopy__sign_map + required: false + vasculature_image: + name: vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + multivalued: false + range: ImagingRetinotopy__vasculature_image + required: true + tree_root: true + ImagingRetinotopy__axis_1_phase_map: + name: ImagingRetinotopy__axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + attributes: + name: + name: name + ifabsent: string(axis_1_phase_map) + range: string + required: true + equals_string: axis_1_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_phase_map__Array + ImagingRetinotopy__axis_1_phase_map__Array: + name: ImagingRetinotopy__axis_1_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_1_power_map: + name: ImagingRetinotopy__axis_1_power_map + description: Power response on the first measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_1_power_map) + range: string + required: true + equals_string: axis_1_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_power_map__Array + ImagingRetinotopy__axis_1_power_map__Array: + name: ImagingRetinotopy__axis_1_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_phase_map: + name: ImagingRetinotopy__axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + attributes: + name: + name: name + ifabsent: string(axis_2_phase_map) + range: string + required: true + equals_string: axis_2_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_phase_map__Array + ImagingRetinotopy__axis_2_phase_map__Array: + name: ImagingRetinotopy__axis_2_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_power_map: + name: ImagingRetinotopy__axis_2_power_map + description: Power response on the second measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_2_power_map) + range: string + required: true + equals_string: axis_2_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_power_map__Array + ImagingRetinotopy__axis_2_power_map__Array: + name: ImagingRetinotopy__axis_2_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__focal_depth_image: + name: ImagingRetinotopy__focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., focal + depth, wavelength) as data collection. Array format: [rows][columns].' + attributes: + name: + name: name + ifabsent: string(focal_depth_image) + range: string + required: true + equals_string: focal_depth_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value. + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + focal_depth: + name: focal_depth + description: Focal depth offset, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__focal_depth_image__Array + ImagingRetinotopy__focal_depth_image__Array: + name: ImagingRetinotopy__focal_depth_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true + ImagingRetinotopy__sign_map: + name: ImagingRetinotopy__sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + attributes: + name: + name: name + ifabsent: string(sign_map) + range: string + required: true + equals_string: sign_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + array: + name: array + range: ImagingRetinotopy__sign_map__Array + ImagingRetinotopy__sign_map__Array: + name: ImagingRetinotopy__sign_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__vasculature_image: + name: ImagingRetinotopy__vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + attributes: + name: + name: name + ifabsent: string(vasculature_image) + range: string + required: true + equals_string: vasculature_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__vasculature_image__Array + ImagingRetinotopy__vasculature_image__Array: + name: ImagingRetinotopy__vasculature_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/namespace.yaml new file mode 100644 index 0000000..65d1766 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_2_5/namespace.yaml @@ -0,0 +1,24 @@ +name: core +annotations: + namespace: + tag: namespace + value: 'True' +description: NWB namespace +id: core +version: 2.2.5 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.epoch +- core.nwb.image +- core.nwb.file +- core.nwb.misc +- core.nwb.behavior +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.retinotopy +- core.nwb.language +- ../../hdmf_common/v1_1_3/namespace +default_prefix: core/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.base.yaml new file mode 100644 index 0000000..312362e --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.base.yaml @@ -0,0 +1,316 @@ +name: core.nwb.base +id: core.nwb.base +version: 2.3.0 +imports: +- ../../hdmf_common/v1_5_0/namespace +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.language +default_prefix: core.nwb.base/ +classes: + NWBData: + name: NWBData + description: An abstract data type for a dataset. + is_a: Data + attributes: + name: + name: name + range: string + required: true + tree_root: true + Image: + name: Image + description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D + where the third dimension can have three or four elements, e.g. (x, y, (r, g, + b)) or (x, y, (r, g, b, a)). + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + resolution: + name: resolution + description: Pixel resolution of the image, in pixels per centimeter. + range: float32 + description: + name: description + description: Description of the image. + range: text + array: + name: array + range: Image__Array + tree_root: true + Image__Array: + name: Image__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + r, g, b, a: + name: r, g, b, a + range: numeric + required: false + minimum_cardinality: 4 + maximum_cardinality: 4 + NWBContainer: + name: NWBContainer + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + is_a: Container + attributes: + name: + name: name + range: string + required: true + tree_root: true + NWBDataInterface: + name: NWBDataInterface + description: An abstract data type for a generic container storing collections + of data, as opposed to metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeries: + name: TimeSeries + description: General purpose time series. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the time series. + range: text + comments: + name: comments + description: Human-readable comments about the TimeSeries. This second descriptive + field can be used to store additional information, or descriptive information + if the primary description field is populated with a computer-readable string. + range: text + data: + name: data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first + dimension should always represent time. This can also be used to store binary + data (e.g., image frames). This can also be a link to data stored in an + external file. + multivalued: false + range: TimeSeries__data + required: true + starting_time: + name: starting_time + description: Timestamp of the first sample in seconds. When timestamps are + uniformly spaced, the timestamp of the first sample can be specified and + all subsequent ones calculated from the sampling rate attribute. + multivalued: false + range: TimeSeries__starting_time + required: false + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + multivalued: true + range: float64 + required: false + control: + name: control + description: Numerical labels that apply to each time point in data for the + purpose of querying and slicing data by these values. If present, the length + of this array should be the same size as the first dimension of data. + multivalued: true + range: uint8 + required: false + control_description: + name: control_description + description: Description of each control value. Must be present if control + is present. If present, control_description[0] should describe time points + where control == 0. + multivalued: true + range: text + required: false + sync: + name: sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored + external to the NWB file, in files storing raw data. Once timestamp data + is calculated, the contents of 'sync' are mostly for archival purposes. + multivalued: false + range: TimeSeries__sync + required: false + tree_root: true + TimeSeries__data: + name: TimeSeries__data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension + should always represent time. This can also be used to store binary data (e.g., + image frames). This can also be a link to data stored in an external file. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as signed 16-bit + integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V + to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' + multiplier to get from raw data acquisition values to recorded volts is + 2.5/32768/8000 = 9.5367e-9. + range: float32 + resolution: + name: resolution + description: Smallest meaningful difference between values in data, stored + in the specified by unit, e.g., the change in value of the least significant + bit, or a larger number if signal noise is known to be present. If unknown, + use -1.0. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + continuity: + name: continuity + description: Optionally describe the continuity of the data. Can be "continuous", + "instantaneous", or "step". For example, a voltage trace would be "continuous", + because samples are recorded from a continuous process. An array of lick + times would be "instantaneous", because the data represents distinct moments + in time. Times of image presentations would be "step" because the picture + remains the same until the next timepoint. This field is optional, but is + useful in providing information about the underlying data. It may inform + the way this data is interpreted, the way it is visualized, and what analysis + methods are applicable. + range: text + array: + name: array + range: TimeSeries__data__Array + TimeSeries__data__Array: + name: TimeSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: AnyType + required: true + num_DIM2: + name: num_DIM2 + range: AnyType + required: false + num_DIM3: + name: num_DIM3 + range: AnyType + required: false + num_DIM4: + name: num_DIM4 + range: AnyType + required: false + TimeSeries__starting_time: + name: TimeSeries__starting_time + description: Timestamp of the first sample in seconds. When timestamps are uniformly + spaced, the timestamp of the first sample can be specified and all subsequent + ones calculated from the sampling rate attribute. + attributes: + name: + name: name + ifabsent: string(starting_time) + range: string + required: true + equals_string: starting_time + rate: + name: rate + description: Sampling rate, in Hz. + range: float32 + unit: + name: unit + description: Unit of measurement for time, which is fixed to 'seconds'. + range: text + value: + name: value + range: float64 + required: true + TimeSeries__sync: + name: TimeSeries__sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored external + to the NWB file, in files storing raw data. Once timestamp data is calculated, + the contents of 'sync' are mostly for archival purposes. + attributes: + name: + name: name + ifabsent: string(sync) + range: string + required: true + equals_string: sync + ProcessingModule: + name: ProcessingModule + description: A collection of processed data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of processed data. + range: text + nwb_data_interface: + name: nwb_data_interface + description: Data objects stored in this collection. + multivalued: true + range: NWBDataInterface + required: false + dynamic_table: + name: dynamic_table + description: Tables stored in this collection. + multivalued: true + range: DynamicTable + required: false + tree_root: true + Images: + name: Images + description: A collection of images. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of images. + range: text + image: + name: image + description: Images stored in this collection. + multivalued: true + range: Image + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.behavior.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.behavior.yaml new file mode 100644 index 0000000..5c925d5 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.behavior.yaml @@ -0,0 +1,201 @@ +name: core.nwb.behavior +id: core.nwb.behavior +version: 2.3.0 +imports: +- core.nwb.base +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.behavior/ +classes: + SpatialSeries: + name: SpatialSeries + description: 'Direction, e.g., of gaze or travel, or position. The TimeSeries::data + field is a 2D array storing position or direction relative to some reference + frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries + has a text dataset reference_frame that indicates the zero-position, or the + zero-axes for direction. For example, if representing gaze direction, ''straight-ahead'' + might be a specific pixel on the monitor, or some other point in space. For + position data, the 0,0 point might be the top-left corner of an enclosure, as + viewed from the tracking camera. The unit of data will indicate how to interpret + SpatialSeries values.' + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: 1-D or 2-D array storing position or direction relative to some + reference frame. + multivalued: false + range: SpatialSeries__data + required: true + reference_frame: + name: reference_frame + description: Description defining what exactly 'straight-ahead' means. + multivalued: false + range: text + required: false + tree_root: true + SpatialSeries__data: + name: SpatialSeries__data + description: 1-D or 2-D array storing position or direction relative to some reference + frame. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: SpatialSeries__data__Array + SpatialSeries__data__Array: + name: SpatialSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + BehavioralEpochs: + name: BehavioralEpochs + description: TimeSeries for storing behavioral epochs. The objective of this + and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) + is to provide generic hooks for software tools/scripts. This allows a tool/script + to take the output one specific interface (e.g., UnitTimes) and plot that data + relative to another data modality (e.g., behavioral events) without having to + define all possible modalities in advance. Declaring one of these interfaces + means that one or more TimeSeries of the specified type is published. These + TimeSeries should reside in a group having the same name as the interface. For + example, if a BehavioralTimeSeries interface is declared, the module will have + one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. + BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular + events. BehavioralTimeSeries is for continuous data. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + interval_series: + name: interval_series + description: IntervalSeries object containing start and stop times of epochs. + multivalued: true + range: IntervalSeries + required: false + tree_root: true + BehavioralEvents: + name: BehavioralEvents + description: TimeSeries for storing behavioral events. See description of BehavioralEpochs + for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing behavioral events. + multivalued: true + range: TimeSeries + required: false + tree_root: true + BehavioralTimeSeries: + name: BehavioralTimeSeries + description: TimeSeries for storing Behavoioral time series data. See description + of BehavioralEpochs for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing continuous behavioral data. + multivalued: true + range: TimeSeries + required: false + tree_root: true + PupilTracking: + name: PupilTracking + description: Eye-tracking data, representing pupil size. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing time series data on pupil size. + multivalued: true + range: TimeSeries + required: true + tree_root: true + EyeTracking: + name: EyeTracking + description: Eye-tracking data, representing direction of gaze. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing data measuring direction of gaze. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + CompassDirection: + name: CompassDirection + description: With a CompassDirection interface, a module publishes a SpatialSeries + object representing a floating point value for theta. The SpatialSeries::reference_frame + field should indicate what direction corresponds to 0 and which is the direction + of rotation (this should be clockwise). The si_unit for the SpatialSeries should + be radians or degrees. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing direction of gaze travel. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + Position: + name: Position + description: Position data, whether along the x, x/y or x/y/z axis. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing position data. + multivalued: true + range: SpatialSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.device.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.device.yaml new file mode 100644 index 0000000..9c25c58 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.device.yaml @@ -0,0 +1,28 @@ +name: core.nwb.device +id: core.nwb.device +version: 2.3.0 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.device/ +classes: + Device: + name: Device + description: Metadata about a data acquisition device, e.g., recording system, + electrode, microscope. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the device (e.g., model, firmware version, processing + software version, etc.) as free-form text. + range: text + manufacturer: + name: manufacturer + description: The name of the manufacturer of the device. + range: text + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.ecephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.ecephys.yaml new file mode 100644 index 0000000..b180e94 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.ecephys.yaml @@ -0,0 +1,502 @@ +name: core.nwb.ecephys +id: core.nwb.ecephys +version: 2.3.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ecephys/ +classes: + ElectricalSeries: + name: ElectricalSeries + description: A time series of acquired voltage data from extracellular recordings. + The data field is an int or float array storing data in volts. The first dimension + should always represent time. The second dimension, if present, should represent + channels. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + filtering: + name: filtering + description: Filtering applied to all channels of the data. For example, if + this ElectricalSeries represents high-pass-filtered data (also known as + AP Band), then this value could be "High-pass 4-pole Bessel filter at 500 + Hz". If this ElectricalSeries represents low-pass-filtered LFP data and + the type of filter is unknown, then this value could be "Low-pass filter + at 300 Hz". If a non-standard filter type is used, provide as much detail + about the filter properties as possible. + range: text + data: + name: data + description: Recorded voltage data. + multivalued: false + range: ElectricalSeries__data + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: ElectricalSeries__electrodes + required: true + channel_conversion: + name: channel_conversion + description: Channel-specific conversion factor. Multiply the data in the + 'data' dataset by these values along the channel axis (as indicated by axis + attribute) AND by the global conversion factor in the 'conversion' attribute + of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion + * channel_conversion. This approach allows for both global and per-channel + data conversion factors needed to support the storage of electrical recordings + as native values generated by data acquisition systems. If this dataset + is not present, then there is no channel-specific conversion factor, i.e. + it is 1 for all channels. + multivalued: true + range: float32 + required: false + tree_root: true + ElectricalSeries__data: + name: ElectricalSeries__data + description: Recorded voltage data. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. This value + is fixed to 'volts'. Actual stored values are not necessarily stored in + these units. To access the data in these units, multiply 'data' by 'conversion' + and 'channel_conversion' (if present). + range: text + array: + name: array + range: ElectricalSeries__data__Array + ElectricalSeries__data__Array: + name: ElectricalSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + num_samples: + name: num_samples + range: numeric + required: false + ElectricalSeries__electrodes: + name: ElectricalSeries__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + SpikeEventSeries: + name: SpikeEventSeries + description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold + crossings). This may also be raw data, as reported by ephys hardware. If so, + the TimeSeries::description field should describe how events were detected. + All SpikeEventSeries should reside in a module (under EventWaveform interface) + even if the spikes were reported and stored by hardware. All events span the + same recording channels and store snapshots of equal duration. TimeSeries::data + array structure: [num events] [num channels] [num samples] (or [num events] + [num samples] for single electrode).' + is_a: ElectricalSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Spike waveforms. + multivalued: false + range: SpikeEventSeries__data + required: true + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + Timestamps are required for the events. Unlike for TimeSeries, timestamps + are required for SpikeEventSeries and are thus re-specified here. + multivalued: true + range: float64 + required: true + tree_root: true + SpikeEventSeries__data: + name: SpikeEventSeries__data + description: Spike waveforms. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Unit of measurement for waveforms, which is fixed to 'volts'. + range: text + array: + name: array + range: SpikeEventSeries__data__Array + SpikeEventSeries__data__Array: + name: SpikeEventSeries__data__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: numeric + required: true + num_samples: + name: num_samples + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + FeatureExtraction: + name: FeatureExtraction + description: Features, such as PC1 and PC2, that are extracted from signals stored + in a SpikeEventSeries or other source. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of features (eg, ''PC1'') for each of the extracted + features. + multivalued: true + range: text + required: true + features: + name: features + description: Multi-dimensional array of features extracted from each event. + multivalued: false + range: FeatureExtraction__features + required: true + times: + name: times + description: Times of events that features correspond to (can be a link). + multivalued: true + range: float64 + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: FeatureExtraction__electrodes + required: true + tree_root: true + FeatureExtraction__features: + name: FeatureExtraction__features + description: Multi-dimensional array of features extracted from each event. + attributes: + name: + name: name + ifabsent: string(features) + range: string + required: true + equals_string: features + array: + name: array + range: FeatureExtraction__features__Array + FeatureExtraction__features__Array: + name: FeatureExtraction__features__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: float32 + required: true + num_channels: + name: num_channels + range: float32 + required: true + num_features: + name: num_features + range: float32 + required: true + FeatureExtraction__electrodes: + name: FeatureExtraction__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + EventDetection: + name: EventDetection + description: Detected spike events from voltage trace(s). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + detection_method: + name: detection_method + description: Description of how events were detected, such as voltage threshold, + or dV/dT threshold, as well as relevant values. + multivalued: false + range: text + required: true + source_idx: + name: source_idx + description: Indices (zero-based) into source ElectricalSeries::data array + corresponding to time of event. ''description'' should define what is meant + by time of event (e.g., .25 ms before action potential peak, zero-crossing + time, etc). The index points to each event from the raw data. + multivalued: true + range: int32 + required: true + times: + name: times + description: Timestamps of events, in seconds. + multivalued: true + range: float64 + required: true + tree_root: true + EventWaveform: + name: EventWaveform + description: Represents either the waveforms of detected events, as extracted + from a raw data trace in /acquisition, or the event waveforms that were stored + during experiment acquisition. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spike_event_series: + name: spike_event_series + description: SpikeEventSeries object(s) containing detected spike event waveforms. + multivalued: true + range: SpikeEventSeries + required: false + tree_root: true + FilteredEphys: + name: FilteredEphys + description: Electrophysiology data from one or more channels that has been subjected + to filtering. Examples of filtered data include Theta and Gamma (LFP has its + own interface). FilteredEphys modules publish an ElectricalSeries for each filtered + channel or set of channels. The name of each ElectricalSeries is arbitrary but + should be informative. The source of the filtered data, whether this is from + analysis of another time series or as acquired by hardware, should be noted + in each's TimeSeries::description field. There is no assumed 1::1 correspondence + between filtered ephys signals and electrodes, as a single signal can apply + to many nearby electrodes, and one electrode may have different filtered (e.g., + theta and/or gamma) signals represented. Filter properties should be noted in + the ElectricalSeries 'filtering' attribute. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing filtered electrophysiology + data. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + LFP: + name: LFP + description: LFP data from one or more channels. The electrode map in each published + ElectricalSeries will identify which channels are providing LFP data. Filter + properties should be noted in the ElectricalSeries 'filtering' attribute. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing LFP data for one or more + channels. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + ElectrodeGroup: + name: ElectrodeGroup + description: A physical grouping of electrodes, e.g. a shank of an array. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this electrode group. + range: text + location: + name: location + description: Location of electrode group. Specify the area, layer, comments + on estimation of area/layer, etc. Use standard atlas names for anatomical + regions when possible. + range: text + position: + name: position + description: stereotaxic or common framework coordinates + multivalued: false + range: AnyType + required: false + tree_root: true + ClusterWaveforms: + name: ClusterWaveforms + description: DEPRECATED The mean waveform shape, including standard deviation, + of the different clusters. Ideally, the waveform analysis should be performed + on data that is only high-pass filtered. This is a separate module because it + is expected to require updating. For example, IMEC probes may require different + storage requirements to store/display mean waveforms, requiring a new interface + or an extension of this one. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + waveform_filtering: + name: waveform_filtering + description: Filtering applied to data before generating mean/sd + multivalued: false + range: text + required: true + waveform_mean: + name: waveform_mean + description: The mean waveform for each cluster, using the same indices for + each wave as cluster numbers in the associated Clustering module (i.e, cluster + 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence + should be empty (e.g., zero- filled) + multivalued: false + range: ClusterWaveforms__waveform_mean + required: true + waveform_sd: + name: waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as + in mean + multivalued: false + range: ClusterWaveforms__waveform_sd + required: true + tree_root: true + ClusterWaveforms__waveform_mean: + name: ClusterWaveforms__waveform_mean + description: The mean waveform for each cluster, using the same indices for each + wave as cluster numbers in the associated Clustering module (i.e, cluster 3 + is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should + be empty (e.g., zero- filled) + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + array: + name: array + range: ClusterWaveforms__waveform_mean__Array + ClusterWaveforms__waveform_mean__Array: + name: ClusterWaveforms__waveform_mean__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + ClusterWaveforms__waveform_sd: + name: ClusterWaveforms__waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as in + mean + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + array: + name: array + range: ClusterWaveforms__waveform_sd__Array + ClusterWaveforms__waveform_sd__Array: + name: ClusterWaveforms__waveform_sd__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + Clustering: + name: Clustering + description: DEPRECATED Clustered spike data, whether from automatic clustering + tools (e.g., klustakwik) or as a result of manual sorting. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of clusters or clustering, (e.g. cluster 0 is noise, + clusters curated using Klusters, etc) + multivalued: false + range: text + required: true + num: + name: num + description: Cluster number of each event + multivalued: true + range: int32 + required: true + peak_over_rms: + name: peak_over_rms + description: Maximum ratio of waveform peak to RMS on any channel in the cluster + (provides a basic clustering metric). + multivalued: true + range: float32 + required: true + times: + name: times + description: Times of clustered events, in seconds. This may be a link to + times field in associated FeatureExtraction module. + multivalued: true + range: float64 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.epoch.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.epoch.yaml new file mode 100644 index 0000000..aae2c02 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.epoch.yaml @@ -0,0 +1,74 @@ +name: core.nwb.epoch +id: core.nwb.epoch +version: 2.3.0 +imports: +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.epoch/ +classes: + TimeIntervals: + name: TimeIntervals + description: A container for aggregating epoch data and the TimeSeries that each + epoch applies to. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + start_time: + name: start_time + description: Start time of epoch, in seconds. + multivalued: true + range: float32 + stop_time: + name: stop_time + description: Stop time of epoch, in seconds. + multivalued: true + range: float32 + tags: + name: tags + description: User-defined tags that identify or categorize events. + multivalued: true + range: text + tags_index: + name: tags_index + description: Index for tags. + multivalued: false + range: TimeIntervals__tags_index + required: false + timeseries: + name: timeseries + description: An index into a TimeSeries object. + multivalued: true + range: AnyType + timeseries_index: + name: timeseries_index + description: Index for timeseries. + multivalued: false + range: TimeIntervals__timeseries_index + required: false + tree_root: true + TimeIntervals__tags_index: + name: TimeIntervals__tags_index + description: Index for tags. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(tags_index) + range: string + required: true + equals_string: tags_index + TimeIntervals__timeseries_index: + name: TimeIntervals__timeseries_index + description: Index for timeseries. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(timeseries_index) + range: string + required: true + equals_string: timeseries_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.file.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.file.yaml new file mode 100644 index 0000000..f0492c1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.file.yaml @@ -0,0 +1,666 @@ +name: core.nwb.file +id: core.nwb.file +version: 2.3.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.device +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.epoch +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.file/ +classes: + ScratchData: + name: ScratchData + description: Any one-off datasets + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + notes: + name: notes + description: Any notes the user has about the dataset being stored + range: text + tree_root: true + NWBFile: + name: NWBFile + description: An NWB:N file storing cellular-based neurophysiology data from a + single experimental session. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(root) + range: string + required: true + equals_string: root + nwb_version: + name: nwb_version + description: File version string. Use semantic versioning, e.g. 1.2.1. This + will be the name of the format with trailing major, minor and patch numbers. + range: text + file_create_date: + name: file_create_date + description: 'A record of the date the file was created and of subsequent + modifications. The date is stored in UTC with local timezone offset as ISO + 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored + in UTC end in "Z" with no timezone offset. Date accuracy is up to milliseconds. + The file can be created after the experiment was run, so this may differ + from the experiment start time. Each modification to the nwb file adds a + new entry to the array.' + multivalued: true + range: isodatetime + required: true + identifier: + name: identifier + description: A unique text identifier for the file. For example, concatenated + lab name, file creation date/time and experimentalist, or a hash of these + and/or other values. The goal is that the string should be unique to all + other files. + multivalued: false + range: text + required: true + session_description: + name: session_description + description: A description of the experimental session and data in the file. + multivalued: false + range: text + required: true + session_start_time: + name: session_start_time + description: 'Date and time of the experiment/session start. The date is stored + in UTC with local timezone offset as ISO 8601 extended formatted string: + 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in "Z" with no timezone + offset. Date accuracy is up to milliseconds.' + multivalued: false + range: isodatetime + required: true + timestamps_reference_time: + name: timestamps_reference_time + description: 'Date and time corresponding to time zero of all timestamps. + The date is stored in UTC with local timezone offset as ISO 8601 extended + formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end + in "Z" with no timezone offset. Date accuracy is up to milliseconds. All + times stored in the file use this time as reference (i.e., time zero).' + multivalued: false + range: isodatetime + required: true + acquisition: + name: acquisition + description: Data streams recorded from the system, including ephys, ophys, + tracking, etc. This group should be read-only after the experiment is completed + and timestamps are corrected to a common timebase. The data stored here + may be links to raw data stored in external NWB files. This will allow keeping + bulky raw data out of the file while preserving the option of keeping some/all + in the file. Acquired data includes tracking and experimental data streams + (i.e., everything measured from the system). If bulky data is stored in + the /acquisition group, the data can exist in a separate NWB file that is + linked to by the file being used for processing and analysis. + multivalued: true + any_of: + - range: NWBDataInterface + - range: DynamicTable + analysis: + name: analysis + description: Lab-specific and custom scientific analysis of data. There is + no defined format for the content of this group - the format is up to the + individual user/lab. To facilitate sharing analysis data between labs, the + contents here should be stored in standard types (e.g., neurodata_types) + and appropriately documented. The file can store lab-specific and custom + data analysis without restriction on its form or schema, reducing data formatting + restrictions on end users. Such data should be placed in the analysis group. + The analysis data should be documented so that it could be shared with other + labs. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + scratch: + name: scratch + description: A place to store one-off analysis results. Data placed here is + not intended for sharing. By placing data here, users acknowledge that there + is no guarantee that their data meets any standard. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + processing: + name: processing + description: The home for ProcessingModules. These modules perform intermediate + analysis of data that is necessary to perform before scientific analysis. + Examples include spike clustering, extracting position from tracking data, + stitching together image slices. ProcessingModules can be large and express + many data sets from relatively complex analysis (e.g., spike detection and + clustering) or small, representing extraction of position information from + tracking video, or even binary lick/no-lick decisions. Common software tools + (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' + refers to intermediate analysis of the acquired data to make it more amenable + to scientific analysis. + multivalued: true + any_of: + - range: ProcessingModule + stimulus: + name: stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment + complete and timestamps are corrected to common timebase. Stores both presented + stimuli and stimulus templates, the latter in case the same stimulus is + presented multiple times, or is pulled from an external stimulus library. + Stimuli are here defined as any signal that is pushed into the system as + part of the experiment (eg, sound, video, voltage, etc). Many different + experiments can use the same stimuli, and stimuli can be re-used during + an experiment. The stimulus group is organized so that one version of template + stimuli can be stored and these be used multiple times. These templates + can exist in the present file or can be linked to a remote library file. + multivalued: false + range: NWBFile__stimulus + required: true + general: + name: general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used + to describe the experiment. Metadata necessary for interpreting the data + is stored with the data. General experimental metadata, including animal + strain, experimental protocols, experimenter, devices, etc, are stored under + 'general'. Core metadata (e.g., that required to interpret data fields) + is stored with the data itself, and implicitly defined by the file specification + (e.g., time is in seconds). The strategy used here for storing non-core + metadata is to use free-form text fields, such as would appear in sentences + or paragraphs from a Methods section. Metadata fields are text to enable + them to be more general, for example to represent ranges instead of numerical + values. Machine-readable metadata is stored as attributes to these free-form + datasets. All entries in the below table are to be included when data is + present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) + should not be created unless there is data to store within them. + multivalued: false + range: NWBFile__general + required: true + intervals: + name: intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during + an experiment, or epochs (see epochs subgroup) deriving from analysis of + data. + multivalued: false + range: NWBFile__intervals + required: false + units: + name: units + description: Data about sorted spike units. + multivalued: false + range: Units + required: false + tree_root: true + NWBFile__stimulus: + name: NWBFile__stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment complete + and timestamps are corrected to common timebase. Stores both presented stimuli + and stimulus templates, the latter in case the same stimulus is presented multiple + times, or is pulled from an external stimulus library. Stimuli are here defined + as any signal that is pushed into the system as part of the experiment (eg, + sound, video, voltage, etc). Many different experiments can use the same stimuli, + and stimuli can be re-used during an experiment. The stimulus group is organized + so that one version of template stimuli can be stored and these be used multiple + times. These templates can exist in the present file or can be linked to a remote + library file. + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + presentation: + name: presentation + description: Stimuli presented during the experiment. + multivalued: true + any_of: + - range: TimeSeries + templates: + name: templates + description: Template stimuli. Timestamps in templates are based on stimulus + design and are relative to the beginning of the stimulus. When templates + are used, the stimulus instances must convert presentation times to the + experiment`s time reference frame. + multivalued: true + any_of: + - range: TimeSeries + NWBFile__general: + name: NWBFile__general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used to + describe the experiment. Metadata necessary for interpreting the data is stored + with the data. General experimental metadata, including animal strain, experimental + protocols, experimenter, devices, etc, are stored under 'general'. Core metadata + (e.g., that required to interpret data fields) is stored with the data itself, + and implicitly defined by the file specification (e.g., time is in seconds). + The strategy used here for storing non-core metadata is to use free-form text + fields, such as would appear in sentences or paragraphs from a Methods section. + Metadata fields are text to enable them to be more general, for example to represent + ranges instead of numerical values. Machine-readable metadata is stored as attributes + to these free-form datasets. All entries in the below table are to be included + when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology + experiment) should not be created unless there is data to store within them. + attributes: + name: + name: name + ifabsent: string(general) + range: string + required: true + equals_string: general + data_collection: + name: data_collection + description: Notes about data collection and analysis. + multivalued: false + range: text + required: false + experiment_description: + name: experiment_description + description: General description of the experiment. + multivalued: false + range: text + required: false + experimenter: + name: experimenter + description: Name of person(s) who performed the experiment. Can also specify + roles of different people involved. + multivalued: true + range: text + required: false + institution: + name: institution + description: Institution(s) where experiment was performed. + multivalued: false + range: text + required: false + keywords: + name: keywords + description: Terms to search over. + multivalued: true + range: text + required: false + lab: + name: lab + description: Laboratory where experiment was performed. + multivalued: false + range: text + required: false + notes: + name: notes + description: Notes about the experiment. + multivalued: false + range: text + required: false + pharmacology: + name: pharmacology + description: Description of drugs used, including how and when they were administered. + Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc. + multivalued: false + range: text + required: false + protocol: + name: protocol + description: Experimental protocol, if applicable. e.g., include IACUC protocol + number. + multivalued: false + range: text + required: false + related_publications: + name: related_publications + description: Publication information. PMID, DOI, URL, etc. + multivalued: true + range: text + required: false + session_id: + name: session_id + description: Lab-specific ID for the session. + multivalued: false + range: text + required: false + slices: + name: slices + description: Description of slices, including information about preparation + thickness, orientation, temperature, and bath solution. + multivalued: false + range: text + required: false + source_script: + name: source_script + description: Script file or link to public source code used to create this + NWB file. + multivalued: false + range: NWBFile__general__source_script + required: false + stimulus: + name: stimulus + description: Notes about stimuli, such as how and where they were presented. + multivalued: false + range: text + required: false + surgery: + name: surgery + description: Narrative description about surgery/surgeries, including date(s) + and who performed surgery. + multivalued: false + range: text + required: false + virus: + name: virus + description: Information about virus(es) used in experiments, including virus + ID, source, date made, injection location, volume, etc. + multivalued: false + range: text + required: false + lab_meta_data: + name: lab_meta_data + description: Place-holder than can be extended so that lab-specific meta-data + can be placed in /general. + multivalued: true + range: LabMetaData + required: false + devices: + name: devices + description: Description of hardware devices used during experiment, e.g., + monitors, ADC boards, microscopes, etc. + multivalued: true + any_of: + - range: Device + subject: + name: subject + description: Information about the animal or person from which the data was + measured. + multivalued: false + range: Subject + required: false + extracellular_ephys: + name: extracellular_ephys + description: Metadata related to extracellular electrophysiology. + multivalued: false + range: NWBFile__general__extracellular_ephys + required: false + intracellular_ephys: + name: intracellular_ephys + description: Metadata related to intracellular electrophysiology. + multivalued: false + range: NWBFile__general__intracellular_ephys + required: false + optogenetics: + name: optogenetics + description: Metadata describing optogenetic stimuluation. + multivalued: true + any_of: + - range: OptogeneticStimulusSite + optophysiology: + name: optophysiology + description: Metadata related to optophysiology. + multivalued: true + any_of: + - range: ImagingPlane + NWBFile__general__source_script: + name: NWBFile__general__source_script + description: Script file or link to public source code used to create this NWB + file. + attributes: + name: + name: name + ifabsent: string(source_script) + range: string + required: true + equals_string: source_script + file_name: + name: file_name + description: Name of script file. + range: text + value: + name: value + range: text + required: true + NWBFile__general__extracellular_ephys: + name: NWBFile__general__extracellular_ephys + description: Metadata related to extracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(extracellular_ephys) + range: string + required: true + equals_string: extracellular_ephys + electrode_group: + name: electrode_group + description: Physical group of electrodes. + multivalued: true + range: ElectrodeGroup + required: false + electrodes: + name: electrodes + description: A table of all electrodes (i.e. channels) used for recording. + multivalued: false + range: NWBFile__general__extracellular_ephys__electrodes + required: false + NWBFile__general__extracellular_ephys__electrodes: + name: NWBFile__general__extracellular_ephys__electrodes + description: A table of all electrodes (i.e. channels) used for recording. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + x: + name: x + description: x coordinate of the channel location in the brain (+x is posterior). + multivalued: true + range: float32 + y: + name: y + description: y coordinate of the channel location in the brain (+y is inferior). + multivalued: true + range: float32 + z: + name: z + description: z coordinate of the channel location in the brain (+z is right). + multivalued: true + range: float32 + imp: + name: imp + description: Impedance of the channel, in ohms. + multivalued: true + range: float32 + location: + name: location + description: Location of the electrode (channel). Specify the area, layer, + comments on estimation of area/layer, stereotaxic coordinates if in vivo, + etc. Use standard atlas names for anatomical regions when possible. + multivalued: true + range: text + filtering: + name: filtering + description: Description of hardware filtering, including the filter name + and frequency cutoffs. + multivalued: true + range: float32 + group: + name: group + description: Reference to the ElectrodeGroup this electrode is a part of. + multivalued: true + range: ElectrodeGroup + group_name: + name: group_name + description: Name of the ElectrodeGroup this electrode is a part of. + multivalued: true + range: text + rel_x: + name: rel_x + description: x coordinate in electrode group + multivalued: true + range: float32 + rel_y: + name: rel_y + description: y coordinate in electrode group + multivalued: true + range: float32 + rel_z: + name: rel_z + description: z coordinate in electrode group + multivalued: true + range: float32 + reference: + name: reference + description: Description of the reference used for this electrode. + multivalued: true + range: text + NWBFile__general__intracellular_ephys: + name: NWBFile__general__intracellular_ephys + description: Metadata related to intracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(intracellular_ephys) + range: string + required: true + equals_string: intracellular_ephys + filtering: + name: filtering + description: Description of filtering used. Includes filtering type and parameters, + frequency fall-off, etc. If this changes between TimeSeries, filter description + should be stored as a text attribute for each TimeSeries. + multivalued: false + range: text + required: false + intracellular_electrode: + name: intracellular_electrode + description: An intracellular electrode. + multivalued: true + range: IntracellularElectrode + required: false + sweep_table: + name: sweep_table + description: The table which groups different PatchClampSeries together. + multivalued: false + range: SweepTable + required: false + NWBFile__intervals: + name: NWBFile__intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during an + experiment, or epochs (see epochs subgroup) deriving from analysis of data. + attributes: + name: + name: name + ifabsent: string(intervals) + range: string + required: true + equals_string: intervals + epochs: + name: epochs + description: Divisions in time marking experimental stages or sub-divisions + of a single recording session. + multivalued: false + range: TimeIntervals + required: false + trials: + name: trials + description: Repeated experimental events that have a logical grouping. + multivalued: false + range: TimeIntervals + required: false + invalid_times: + name: invalid_times + description: Time intervals that should be removed from analysis. + multivalued: false + range: TimeIntervals + required: false + time_intervals: + name: time_intervals + description: Optional additional table(s) for describing other experimental + time intervals. + multivalued: true + range: TimeIntervals + required: false + LabMetaData: + name: LabMetaData + description: Lab-specific meta-data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + Subject: + name: Subject + description: Information about the animal or person from which the data was measured. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + age: + name: age + description: Age of subject. Can be supplied instead of 'date_of_birth'. + multivalued: false + range: text + required: false + date_of_birth: + name: date_of_birth + description: Date of birth of subject. Can be supplied instead of 'age'. + multivalued: false + range: isodatetime + required: false + description: + name: description + description: Description of subject and where subject came from (e.g., breeder, + if animal). + multivalued: false + range: text + required: false + genotype: + name: genotype + description: Genetic strain. If absent, assume Wild Type (WT). + multivalued: false + range: text + required: false + sex: + name: sex + description: Gender of subject. + multivalued: false + range: text + required: false + species: + name: species + description: Species of subject. + multivalued: false + range: text + required: false + strain: + name: strain + description: Strain of subject. + multivalued: false + range: text + required: false + subject_id: + name: subject_id + description: ID of animal/person used/participating in experiment (lab convention). + multivalued: false + range: text + required: false + weight: + name: weight + description: Weight at time of experiment, at time of surgery and at other + important times. + multivalued: false + range: text + required: false + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.icephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.icephys.yaml new file mode 100644 index 0000000..d7eb6cb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.icephys.yaml @@ -0,0 +1,508 @@ +name: core.nwb.icephys +id: core.nwb.icephys +version: 2.3.0 +imports: +- core.nwb.base +- core.nwb.device +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.language +default_prefix: core.nwb.icephys/ +classes: + PatchClampSeries: + name: PatchClampSeries + description: An abstract base class for patch-clamp data - stimulus or response, + current or voltage. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: Protocol/stimulus name for this patch-clamp dataset. + range: text + sweep_number: + name: sweep_number + description: Sweep number, allows to group different PatchClampSeries together. + range: uint32 + data: + name: data + description: Recorded voltage or current. + multivalued: true + range: numeric + required: true + gain: + name: gain + description: Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt + (c-clamp). + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries: + name: CurrentClampSeries + description: Voltage data from an intracellular current-clamp recording. A corresponding + CurrentClampStimulusSeries (stored separately as a stimulus) is used to store + the current injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage. + multivalued: false + range: CurrentClampSeries__data + required: true + bias_current: + name: bias_current + description: Bias current, in amps. + multivalued: false + range: float32 + required: false + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms. + multivalued: false + range: float32 + required: false + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads. + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries__data: + name: CurrentClampSeries__data + description: Recorded voltage. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IZeroClampSeries: + name: IZeroClampSeries + description: Voltage data from an intracellular recording when all current and + amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There + is no CurrentClampStimulusSeries associated with an IZero series because the + amplifier is disconnected and no stimulus can reach the cell. + is_a: CurrentClampSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: An IZeroClampSeries has no stimulus, so this attribute is automatically + set to "N/A" + range: text + bias_current: + name: bias_current + description: Bias current, in amps, fixed to 0.0. + multivalued: false + range: float32 + required: true + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms, fixed to 0.0. + multivalued: false + range: float32 + required: true + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads, fixed to 0.0. + multivalued: false + range: float32 + required: true + tree_root: true + CurrentClampStimulusSeries: + name: CurrentClampStimulusSeries + description: Stimulus current applied during current clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus current applied. + multivalued: false + range: CurrentClampStimulusSeries__data + required: true + tree_root: true + CurrentClampStimulusSeries__data: + name: CurrentClampStimulusSeries__data + description: Stimulus current applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries: + name: VoltageClampSeries + description: Current data from an intracellular voltage-clamp recording. A corresponding + VoltageClampStimulusSeries (stored separately as a stimulus) is used to store + the voltage injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded current. + multivalued: false + range: VoltageClampSeries__data + required: true + capacitance_fast: + name: capacitance_fast + description: Fast capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_fast + required: false + capacitance_slow: + name: capacitance_slow + description: Slow capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_slow + required: false + resistance_comp_bandwidth: + name: resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + multivalued: false + range: VoltageClampSeries__resistance_comp_bandwidth + required: false + resistance_comp_correction: + name: resistance_comp_correction + description: Resistance compensation correction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_correction + required: false + resistance_comp_prediction: + name: resistance_comp_prediction + description: Resistance compensation prediction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_prediction + required: false + whole_cell_capacitance_comp: + name: whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + multivalued: false + range: VoltageClampSeries__whole_cell_capacitance_comp + required: false + whole_cell_series_resistance_comp: + name: whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + multivalued: false + range: VoltageClampSeries__whole_cell_series_resistance_comp + required: false + tree_root: true + VoltageClampSeries__data: + name: VoltageClampSeries__data + description: Recorded current. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries__capacitance_fast: + name: VoltageClampSeries__capacitance_fast + description: Fast capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_fast) + range: string + required: true + equals_string: capacitance_fast + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__capacitance_slow: + name: VoltageClampSeries__capacitance_slow + description: Slow capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_slow) + range: string + required: true + equals_string: capacitance_slow + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_bandwidth: + name: VoltageClampSeries__resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + attributes: + name: + name: name + ifabsent: string(resistance_comp_bandwidth) + range: string + required: true + equals_string: resistance_comp_bandwidth + unit: + name: unit + description: Unit of measurement for resistance_comp_bandwidth, which is fixed + to 'hertz'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_correction: + name: VoltageClampSeries__resistance_comp_correction + description: Resistance compensation correction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_correction) + range: string + required: true + equals_string: resistance_comp_correction + unit: + name: unit + description: Unit of measurement for resistance_comp_correction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_prediction: + name: VoltageClampSeries__resistance_comp_prediction + description: Resistance compensation prediction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_prediction) + range: string + required: true + equals_string: resistance_comp_prediction + unit: + name: unit + description: Unit of measurement for resistance_comp_prediction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_capacitance_comp: + name: VoltageClampSeries__whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + attributes: + name: + name: name + ifabsent: string(whole_cell_capacitance_comp) + range: string + required: true + equals_string: whole_cell_capacitance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_capacitance_comp, which is + fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_series_resistance_comp: + name: VoltageClampSeries__whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + attributes: + name: + name: name + ifabsent: string(whole_cell_series_resistance_comp) + range: string + required: true + equals_string: whole_cell_series_resistance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_series_resistance_comp, which + is fixed to 'ohms'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampStimulusSeries: + name: VoltageClampStimulusSeries + description: Stimulus voltage applied during a voltage clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus voltage applied. + multivalued: false + range: VoltageClampStimulusSeries__data + required: true + tree_root: true + VoltageClampStimulusSeries__data: + name: VoltageClampStimulusSeries__data + description: Stimulus voltage applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IntracellularElectrode: + name: IntracellularElectrode + description: An intracellular electrode and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of electrode (e.g., whole-cell, sharp, etc.). + multivalued: false + range: text + required: true + filtering: + name: filtering + description: Electrode specific filtering. + multivalued: false + range: text + required: false + initial_access_resistance: + name: initial_access_resistance + description: Initial access resistance. + multivalued: false + range: text + required: false + location: + name: location + description: Location of the electrode. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: false + resistance: + name: resistance + description: Electrode resistance, in ohms. + multivalued: false + range: text + required: false + seal: + name: seal + description: Information about seal used for recording. + multivalued: false + range: text + required: false + slice: + name: slice + description: Information about slice used for recording. + multivalued: false + range: text + required: false + tree_root: true + SweepTable: + name: SweepTable + description: The table which groups different PatchClampSeries together. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + sweep_number: + name: sweep_number + description: Sweep number of the PatchClampSeries in that row. + multivalued: true + range: uint32 + series: + name: series + description: The PatchClampSeries with the sweep number in that row. + multivalued: true + range: PatchClampSeries + series_index: + name: series_index + description: Index for series. + multivalued: false + range: SweepTable__series_index + required: true + tree_root: true + SweepTable__series_index: + name: SweepTable__series_index + description: Index for series. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(series_index) + range: string + required: true + equals_string: series_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.image.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.image.yaml new file mode 100644 index 0000000..03f2006 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.image.yaml @@ -0,0 +1,313 @@ +name: core.nwb.image +id: core.nwb.image +version: 2.3.0 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.image/ +classes: + GrayscaleImage: + name: GrayscaleImage + description: A grayscale image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: GrayscaleImage__Array + tree_root: true + GrayscaleImage__Array: + name: GrayscaleImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + RGBImage: + name: RGBImage + description: A color image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBImage__Array + tree_root: true + RGBImage__Array: + name: RGBImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RGBAImage: + name: RGBAImage + description: A color image with transparency. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBAImage__Array + tree_root: true + RGBAImage__Array: + name: RGBAImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b, a: + name: r, g, b, a + range: numeric + required: true + minimum_cardinality: 4 + maximum_cardinality: 4 + ImageSeries: + name: ImageSeries + description: General image data that is common between acquisition and stimulus + time series. Sometimes the image data is stored in the file in a raw format + while other times it will be stored as a series of external image files in the + host file system. The data field will either be binary data, if the data is + stored in the NWB file, or empty, if the data is stored in an external image + stack. [frame][x][y] or [frame][x][y][z]. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Binary data representing images across frames. + multivalued: false + range: ImageSeries__data + required: false + dimension: + name: dimension + description: Number of pixels on x, y, (and z) axes. + multivalued: true + range: int32 + required: false + external_file: + name: external_file + description: Paths to one or more external file(s). The field is only present + if format='external'. This is only relevant if the image series is stored + in the file system as one or more image file(s). This field should NOT be + used if the image is stored in another NWB file and that file is linked + to this file. + multivalued: true + range: text + required: false + format: + name: format + description: Format of image. If this is 'external', then the attribute 'external_file' + contains the path information to the image files. If this is 'raw', then + the raw (single-channel) binary data is stored in the 'data' dataset. If + this attribute is not present, then the default format='raw' case is assumed. + multivalued: false + range: text + required: false + tree_root: true + ImageSeries__data: + name: ImageSeries__data + description: Binary data representing images across frames. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: ImageSeries__data__Array + ImageSeries__data__Array: + name: ImageSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + z: + name: z + range: numeric + required: false + ImageMaskSeries: + name: ImageMaskSeries + description: An alpha mask that is applied to a presented visual stimulus. The + 'data' array contains an array of mask values that are applied to the displayed + image. Mask values are stored as RGBA. Mask can vary with time. The timestamps + array indicates the starting time of a mask, and that mask pattern continues + until it's explicitly changed. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + tree_root: true + OpticalSeries: + name: OpticalSeries + description: Image data that is presented or recorded. A stimulus template movie + will be stored only as an image. When the image is presented as stimulus, additional + data is required, such as field of view (e.g., how much of the visual field + the image covers, or how what is the area of the target being imaged). If the + OpticalSeries represents acquired imaging data, orientation is also important. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + distance: + name: distance + description: Distance from camera/monitor to target/eye. + multivalued: false + range: float32 + required: false + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: OpticalSeries__field_of_view + required: false + data: + name: data + description: Images presented to subject, either grayscale or RGB + multivalued: false + range: OpticalSeries__data + required: true + orientation: + name: orientation + description: Description of image relative to some reference frame (e.g., + which way is up). Must also specify frame of reference. + multivalued: false + range: text + required: false + tree_root: true + OpticalSeries__field_of_view: + name: OpticalSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: OpticalSeries__field_of_view__Array + OpticalSeries__field_of_view__Array: + name: OpticalSeries__field_of_view__Array + is_a: Arraylike + attributes: + width, height: + name: width, height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width, height, depth: + name: width, height, depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalSeries__data: + name: OpticalSeries__data + description: Images presented to subject, either grayscale or RGB + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: OpticalSeries__data__Array + OpticalSeries__data__Array: + name: OpticalSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + IndexSeries: + name: IndexSeries + description: Stores indices to image frames stored in an ImageSeries. The purpose + of the ImageIndexSeries is to allow a static image stack to be stored somewhere, + and the images in the stack to be referenced out-of-order. This can be for the + display of individual images, or of movie segments (as a movie is simply a series + of images). The data field stores the index of the frame in the referenced ImageSeries, + and the timestamps array indicates when that image was displayed. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Index of the frame in the referenced ImageSeries. + multivalued: true + range: int32 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.language.yaml new file mode 100644 index 0000000..c57e91f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.language.yaml @@ -0,0 +1,148 @@ +name: core.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.misc.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.misc.yaml new file mode 100644 index 0000000..71e2dac --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.misc.yaml @@ -0,0 +1,532 @@ +name: core.nwb.misc +id: core.nwb.misc +version: 2.3.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.ecephys +- core.nwb.language +default_prefix: core.nwb.misc/ +classes: + AbstractFeatureSeries: + name: AbstractFeatureSeries + description: Abstract features, such as quantitative descriptions of sensory stimuli. + The TimeSeries::data field is a 2D array, storing those features (e.g., for + visual grating stimulus this might be orientation, spatial frequency and contrast). + Null stimuli (eg, uniform gray) can be marked as being an independent feature + (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, + or through use of the TimeSeries::control fields. A set of features is considered + to persist until the next set of features is defined. The final set of features + stored should be the null set. This is useful when storing the raw stimulus + is impractical. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Values of each feature at each time. + multivalued: false + range: AbstractFeatureSeries__data + required: true + feature_units: + name: feature_units + description: Units of each feature. + multivalued: true + range: text + required: false + features: + name: features + description: Description of the features represented in TimeSeries::data. + multivalued: true + range: text + required: true + tree_root: true + AbstractFeatureSeries__data: + name: AbstractFeatureSeries__data + description: Values of each feature at each time. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Since there can be different units for different features, store + the units in 'feature_units'. The default value for this attribute is "see + 'feature_units'". + range: text + array: + name: array + range: AbstractFeatureSeries__data__Array + AbstractFeatureSeries__data__Array: + name: AbstractFeatureSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + AnnotationSeries: + name: AnnotationSeries + description: Stores user annotations made during an experiment. The data[] field + stores a text array, and timestamps are stored for each annotation (ie, interval=1). + This is largely an alias to a standard TimeSeries storing a text array but that + is identifiable as storing annotations in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Annotations made during an experiment. + multivalued: true + range: text + required: true + tree_root: true + IntervalSeries: + name: IntervalSeries + description: Stores intervals of data. The timestamps field stores the beginning + and end of intervals. The data field stores whether the interval just started + (>0 value) or ended (<0 value). Different interval types can be represented + in the same series by using multiple key values (eg, 1 for feature A, 2 for + feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This + is largely an alias of a standard TimeSeries but that is identifiable as representing + time intervals in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Use values >0 if interval started, <0 if interval ended. + multivalued: true + range: int8 + required: true + tree_root: true + DecompositionSeries: + name: DecompositionSeries + description: Spectral analysis of a time series, e.g. of an LFP or a speech signal. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Data decomposed into frequency bands. + multivalued: false + range: DecompositionSeries__data + required: true + metric: + name: metric + description: The metric used, e.g. phase, amplitude, power. + multivalued: false + range: text + required: true + source_channels: + name: source_channels + description: DynamicTableRegion pointer to the channels that this decomposition + series was generated from. + multivalued: false + range: DecompositionSeries__source_channels + required: false + bands: + name: bands + description: Table for describing the bands that this series was generated + from. There should be one row in this table for each band. + multivalued: false + range: DecompositionSeries__bands + required: true + tree_root: true + DecompositionSeries__data: + name: DecompositionSeries__data + description: Data decomposed into frequency bands. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: DecompositionSeries__data__Array + DecompositionSeries__data__Array: + name: DecompositionSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: true + num_bands: + name: num_bands + range: numeric + required: true + DecompositionSeries__source_channels: + name: DecompositionSeries__source_channels + description: DynamicTableRegion pointer to the channels that this decomposition + series was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(source_channels) + range: string + required: true + equals_string: source_channels + DecompositionSeries__bands: + name: DecompositionSeries__bands + description: Table for describing the bands that this series was generated from. + There should be one row in this table for each band. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(bands) + range: string + required: true + equals_string: bands + band_name: + name: band_name + description: Name of the band, e.g. theta. + multivalued: true + range: text + band_limits: + name: band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + multivalued: false + range: DecompositionSeries__bands__band_limits + required: true + band_mean: + name: band_mean + description: The mean Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + band_stdev: + name: band_stdev + description: The standard deviation of Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + DecompositionSeries__bands__band_limits: + name: DecompositionSeries__bands__band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(band_limits) + range: string + required: true + equals_string: band_limits + Units: + name: Units + description: Data about spiking units. Event times of observed units (e.g. cell, + synapse, etc.) should be concatenated and stored in spike_times. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + spike_times_index: + name: spike_times_index + description: Index into the spike_times dataset. + multivalued: false + range: Units__spike_times_index + required: false + spike_times: + name: spike_times + description: Spike times for each unit. + multivalued: false + range: Units__spike_times + required: false + obs_intervals_index: + name: obs_intervals_index + description: Index into the obs_intervals dataset. + multivalued: false + range: Units__obs_intervals_index + required: false + obs_intervals: + name: obs_intervals + description: Observation intervals for each unit. + multivalued: false + range: Units__obs_intervals + required: false + electrodes_index: + name: electrodes_index + description: Index into electrodes. + multivalued: false + range: Units__electrodes_index + required: false + electrodes: + name: electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + multivalued: false + range: Units__electrodes + required: false + electrode_group: + name: electrode_group + description: Electrode group that each spike unit came from. + multivalued: true + range: ElectrodeGroup + waveform_mean: + name: waveform_mean + description: Spike waveform mean for each spike unit. + multivalued: false + range: Units__waveform_mean + required: false + waveform_sd: + name: waveform_sd + description: Spike waveform standard deviation for each spike unit. + multivalued: false + range: Units__waveform_sd + required: false + waveforms: + name: waveforms + description: Individual waveforms for each spike on each electrode. This is + a doubly indexed column. The 'waveforms_index' column indexes which waveforms + in this column belong to the same spike event for a given unit, where each + waveform was recorded from a different electrode. The 'waveforms_index_index' + column indexes the 'waveforms_index' column to indicate which spike events + belong to a given unit. For example, if the 'waveforms_index_index' column + has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' + column correspond to the 2 spike events of the first unit, the next 3 elements + of the 'waveforms_index' column correspond to the 3 spike events of the + second unit, and the next 1 element of the 'waveforms_index' column corresponds + to the 1 spike event of the third unit. If the 'waveforms_index' column + has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' + column contain the 3 spike waveforms that were recorded from 3 different + electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays + for a graphical representation of this example. When there is only one electrode + for each unit (i.e., each spike time is associated with a single waveform), + then the 'waveforms_index' column will have values 1, 2, ..., N, where N + is the number of spike events. The number of electrodes for each spike event + should be the same within a given unit. The 'electrodes' column should be + used to indicate which electrodes are associated with each unit, and the + order of the waveforms within a given unit x spike event should be in the + same order as the electrodes referenced in the 'electrodes' column of this + table. The number of samples for each waveform must be the same. + multivalued: false + range: Units__waveforms + required: false + waveforms_index: + name: waveforms_index + description: Index into the waveforms dataset. One value for every spike event. + See 'waveforms' for more detail. + multivalued: false + range: Units__waveforms_index + required: false + waveforms_index_index: + name: waveforms_index_index + description: Index into the waveforms_index dataset. One value for every unit + (row in the table). See 'waveforms' for more detail. + multivalued: false + range: Units__waveforms_index_index + required: false + tree_root: true + Units__spike_times_index: + name: Units__spike_times_index + description: Index into the spike_times dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(spike_times_index) + range: string + required: true + equals_string: spike_times_index + Units__spike_times: + name: Units__spike_times + description: Spike times for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(spike_times) + range: string + required: true + equals_string: spike_times + resolution: + name: resolution + description: The smallest possible difference between two spike times. Usually + 1 divided by the acquisition sampling rate from which spike times were extracted, + but could be larger if the acquisition time series was downsampled or smaller + if the acquisition time series was smoothed/interpolated and it is possible + for the spike time to be between samples. + range: float64 + Units__obs_intervals_index: + name: Units__obs_intervals_index + description: Index into the obs_intervals dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(obs_intervals_index) + range: string + required: true + equals_string: obs_intervals_index + Units__obs_intervals: + name: Units__obs_intervals + description: Observation intervals for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(obs_intervals) + range: string + required: true + equals_string: obs_intervals + Units__electrodes_index: + name: Units__electrodes_index + description: Index into electrodes. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(electrodes_index) + range: string + required: true + equals_string: electrodes_index + Units__electrodes: + name: Units__electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + Units__waveform_mean: + name: Units__waveform_mean + description: Spike waveform mean for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveform_sd: + name: Units__waveform_sd + description: Spike waveform standard deviation for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveforms: + name: Units__waveforms + description: Individual waveforms for each spike on each electrode. This is a + doubly indexed column. The 'waveforms_index' column indexes which waveforms + in this column belong to the same spike event for a given unit, where each waveform + was recorded from a different electrode. The 'waveforms_index_index' column + indexes the 'waveforms_index' column to indicate which spike events belong to + a given unit. For example, if the 'waveforms_index_index' column has values + [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond + to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' + column correspond to the 3 spike events of the second unit, and the next 1 element + of the 'waveforms_index' column corresponds to the 1 spike event of the third + unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then + the first 3 elements of the 'waveforms' column contain the 3 spike waveforms + that were recorded from 3 different electrodes for the first spike time of the + first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays + for a graphical representation of this example. When there is only one electrode + for each unit (i.e., each spike time is associated with a single waveform), + then the 'waveforms_index' column will have values 1, 2, ..., N, where N is + the number of spike events. The number of electrodes for each spike event should + be the same within a given unit. The 'electrodes' column should be used to indicate + which electrodes are associated with each unit, and the order of the waveforms + within a given unit x spike event should be in the same order as the electrodes + referenced in the 'electrodes' column of this table. The number of samples for + each waveform must be the same. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveforms) + range: string + required: true + equals_string: waveforms + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveforms_index: + name: Units__waveforms_index + description: Index into the waveforms dataset. One value for every spike event. + See 'waveforms' for more detail. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(waveforms_index) + range: string + required: true + equals_string: waveforms_index + Units__waveforms_index_index: + name: Units__waveforms_index_index + description: Index into the waveforms_index dataset. One value for every unit + (row in the table). See 'waveforms' for more detail. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(waveforms_index_index) + range: string + required: true + equals_string: waveforms_index_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.ogen.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.ogen.yaml new file mode 100644 index 0000000..e884aff --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.ogen.yaml @@ -0,0 +1,55 @@ +name: core.nwb.ogen +id: core.nwb.ogen +version: 2.3.0 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ogen/ +classes: + OptogeneticSeries: + name: OptogeneticSeries + description: An optogenetic stimulus. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Applied power for optogenetic stimulus, in watts. + multivalued: true + range: numeric + required: true + tree_root: true + OptogeneticStimulusSite: + name: OptogeneticStimulusSite + description: A site of optogenetic stimulation. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of stimulation site. + multivalued: false + range: text + required: true + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + location: + name: location + description: Location of the stimulation site. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.ophys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.ophys.yaml new file mode 100644 index 0000000..0713766 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.ophys.yaml @@ -0,0 +1,550 @@ +name: core.nwb.ophys +id: core.nwb.ophys +version: 2.3.0 +imports: +- core.nwb.image +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ophys/ +classes: + TwoPhotonSeries: + name: TwoPhotonSeries + description: Image stack recorded over time from 2-photon microscope. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + pmt_gain: + name: pmt_gain + description: Photomultiplier gain. + range: float32 + scan_line_rate: + name: scan_line_rate + description: Lines imaged per second. This is also stored in /general/optophysiology + but is kept here as it is useful information for analysis, and so good to + be stored w/ the actual data. + range: float32 + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: TwoPhotonSeries__field_of_view + required: false + tree_root: true + TwoPhotonSeries__field_of_view: + name: TwoPhotonSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: TwoPhotonSeries__field_of_view__Array + TwoPhotonSeries__field_of_view__Array: + name: TwoPhotonSeries__field_of_view__Array + is_a: Arraylike + attributes: + width|height: + name: width|height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width|height|depth: + name: width|height|depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + RoiResponseSeries: + name: RoiResponseSeries + description: ROI responses over an imaging plane. The first dimension represents + time. The second dimension, if present, represents ROIs. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Signals from ROIs. + multivalued: false + range: RoiResponseSeries__data + required: true + rois: + name: rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + multivalued: false + range: RoiResponseSeries__rois + required: true + tree_root: true + RoiResponseSeries__data: + name: RoiResponseSeries__data + description: Signals from ROIs. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: RoiResponseSeries__data__Array + RoiResponseSeries__data__Array: + name: RoiResponseSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_ROIs: + name: num_ROIs + range: numeric + required: false + RoiResponseSeries__rois: + name: RoiResponseSeries__rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(rois) + range: string + required: true + equals_string: rois + DfOverF: + name: DfOverF + description: dF/F information about a region of interest (ROI). Storage hierarchy + of dF/F should be the same as for segmentation (i.e., same names for ROIs and + for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing dF/F for a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + Fluorescence: + name: Fluorescence + description: Fluorescence information about a region of interest (ROI). Storage + hierarchy of fluorescence should be the same as for segmentation (ie, same names + for ROIs and for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing fluorescence data for + a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + ImageSegmentation: + name: ImageSegmentation + description: Stores pixels in an image that represent different regions of interest + (ROIs) or masks. All segmentation for a given imaging plane is stored together, + with storage for multiple imaging planes (masks) supported. Each ROI is stored + in its own subgroup, with the ROI group containing both a 2D mask and a list + of pixels that make up this mask. Segments can also be used for masking neuropil. + If segmentation is allowed to change with time, a new imaging plane (or module) + is required and ROI names should remain consistent between them. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + plane_segmentation: + name: plane_segmentation + description: Results from image segmentation of a specific imaging plane. + multivalued: true + range: PlaneSegmentation + required: true + tree_root: true + PlaneSegmentation: + name: PlaneSegmentation + description: Results from image segmentation of a specific imaging plane. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + image_mask: + name: image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + multivalued: false + range: PlaneSegmentation__image_mask + required: false + pixel_mask_index: + name: pixel_mask_index + description: Index into pixel_mask. + multivalued: false + range: PlaneSegmentation__pixel_mask_index + required: false + pixel_mask: + name: pixel_mask + description: 'Pixel masks for each ROI: a list of indices and weights for + the ROI. Pixel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + voxel_mask_index: + name: voxel_mask_index + description: Index into voxel_mask. + multivalued: false + range: PlaneSegmentation__voxel_mask_index + required: false + voxel_mask: + name: voxel_mask + description: 'Voxel masks for each ROI: a list of indices and weights for + the ROI. Voxel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + reference_images: + name: reference_images + description: Image stacks that the segmentation masks apply to. + multivalued: true + any_of: + - range: ImageSeries + tree_root: true + PlaneSegmentation__image_mask: + name: PlaneSegmentation__image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(image_mask) + range: string + required: true + equals_string: image_mask + PlaneSegmentation__pixel_mask_index: + name: PlaneSegmentation__pixel_mask_index + description: Index into pixel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(pixel_mask_index) + range: string + required: true + equals_string: pixel_mask_index + PlaneSegmentation__voxel_mask_index: + name: PlaneSegmentation__voxel_mask_index + description: Index into voxel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(voxel_mask_index) + range: string + required: true + equals_string: voxel_mask_index + ImagingPlane: + name: ImagingPlane + description: An imaging plane and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the imaging plane. + multivalued: false + range: text + required: false + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + imaging_rate: + name: imaging_rate + description: Rate that images are acquired, in Hz. If the corresponding TimeSeries + is present, the rate should be stored there instead. + multivalued: false + range: float32 + required: false + indicator: + name: indicator + description: Calcium indicator. + multivalued: false + range: text + required: true + location: + name: location + description: Location of the imaging plane. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + manifold: + name: manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents + the position of the pixel relative to the defined coordinate space. Deprecated + in favor of origin_coords and grid_spacing. + multivalued: false + range: ImagingPlane__manifold + required: false + origin_coords: + name: origin_coords + description: Physical location of the first element of the imaging plane (0, + 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for + what the physical location is relative to (e.g., bregma). + multivalued: false + range: ImagingPlane__origin_coords + required: false + grid_spacing: + name: grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also + reference_frame to interpret the grid. + multivalued: false + range: ImagingPlane__grid_spacing + required: false + reference_frame: + name: reference_frame + description: Describes reference frame of origin_coords and grid_spacing. + For example, this can be a text description of the anatomical location and + orientation of the grid defined by origin_coords and grid_spacing or the + vectors needed to transform or rotate the grid to a common anatomical axis + (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and + grid_spacing. If origin_coords and grid_spacing are not present, then this + field is not required. For example, if the microscope takes 10 x 10 x 2 + images, where the first value of the data matrix (index (0, 0, 0)) corresponds + to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is + 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means + more anterior, larger numbers in y means more rightward, and larger numbers + in z means more ventral, then enter the following -- origin_coords = (-1.2, + -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = "Origin coordinates + are relative to bregma. First dimension corresponds to anterior-posterior + axis (larger index = more anterior). Second dimension corresponds to medial-lateral + axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral + axis (larger index = more ventral)." + multivalued: false + range: text + required: false + optical_channel: + name: optical_channel + description: An optical channel used to record from an imaging plane. + multivalued: true + range: OpticalChannel + required: true + tree_root: true + ImagingPlane__manifold: + name: ImagingPlane__manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents the + position of the pixel relative to the defined coordinate space. Deprecated in + favor of origin_coords and grid_spacing. + attributes: + name: + name: name + ifabsent: string(manifold) + range: string + required: true + equals_string: manifold + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as pixels from + x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then + the 'conversion' multiplier to get from raw data acquisition pixel units + to meters is 2/1000. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__manifold__Array + ImagingPlane__manifold__Array: + name: ImagingPlane__manifold__Array + is_a: Arraylike + attributes: + height: + name: height + range: float32 + required: true + width: + name: width + range: float32 + required: true + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + depth: + name: depth + range: float32 + required: false + ImagingPlane__origin_coords: + name: ImagingPlane__origin_coords + description: Physical location of the first element of the imaging plane (0, 0) + for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the + physical location is relative to (e.g., bregma). + attributes: + name: + name: name + ifabsent: string(origin_coords) + range: string + required: true + equals_string: origin_coords + unit: + name: unit + description: Measurement units for origin_coords. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__origin_coords__Array + ImagingPlane__origin_coords__Array: + name: ImagingPlane__origin_coords__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + ImagingPlane__grid_spacing: + name: ImagingPlane__grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame + to interpret the grid. + attributes: + name: + name: name + ifabsent: string(grid_spacing) + range: string + required: true + equals_string: grid_spacing + unit: + name: unit + description: Measurement units for grid_spacing. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__grid_spacing__Array + ImagingPlane__grid_spacing__Array: + name: ImagingPlane__grid_spacing__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalChannel: + name: OpticalChannel + description: An optical channel used to record from an imaging plane. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description or other notes about the channel. + multivalued: false + range: text + required: true + emission_lambda: + name: emission_lambda + description: Emission wavelength for channel, in nm. + multivalued: false + range: float32 + required: true + tree_root: true + MotionCorrection: + name: MotionCorrection + description: 'An image stack where all frames are shifted (registered) to a common + coordinate system, to account for movement and drift between frames. Note: each + frame at each point in time is assumed to be 2-D (has only x & y dimensions).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected_image_stack: + name: corrected_image_stack + description: Reuslts from motion correction of an image stack. + multivalued: true + range: CorrectedImageStack + required: true + tree_root: true + CorrectedImageStack: + name: CorrectedImageStack + description: Reuslts from motion correction of an image stack. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected: + name: corrected + description: Image stack with frames shifted to the common coordinates. + multivalued: false + range: ImageSeries + required: true + xy_translation: + name: xy_translation + description: Stores the x,y delta necessary to align each frame to the common + coordinates, for example, to align each frame to a reference image. + multivalued: false + range: TimeSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.retinotopy.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.retinotopy.yaml new file mode 100644 index 0000000..700a8f8 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/core.nwb.retinotopy.yaml @@ -0,0 +1,362 @@ +name: core.nwb.retinotopy +id: core.nwb.retinotopy +version: 2.3.0 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.retinotopy/ +classes: + ImagingRetinotopy: + name: ImagingRetinotopy + description: 'Intrinsic signal optical imaging or widefield imaging for measuring + retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of + responses to specific stimuli and a combined polarity map from which to identify + visual areas. This group does not store the raw responses imaged during retinotopic + mapping or the stimuli presented, but rather the resulting phase and power maps + after applying a Fourier transform on the averaged responses. Note: for data + consistency, all images and arrays are stored in the format [row][column] and + [row, col], which equates to [y][x]. Field of view and dimension arrays may + appear backward (i.e., y before x).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + axis_1_phase_map: + name: axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + multivalued: false + range: ImagingRetinotopy__axis_1_phase_map + required: true + axis_1_power_map: + name: axis_1_power_map + description: Power response on the first measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_1_power_map + required: false + axis_2_phase_map: + name: axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_phase_map + required: true + axis_2_power_map: + name: axis_2_power_map + description: Power response on the second measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_2_power_map + required: false + axis_descriptions: + name: axis_descriptions + description: Two-element array describing the contents of the two response + axis fields. Description should be something like ['altitude', 'azimuth'] + or '['radius', 'theta']. + multivalued: true + range: text + required: true + focal_depth_image: + name: focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., + focal depth, wavelength) as data collection. Array format: [rows][columns].' + multivalued: false + range: ImagingRetinotopy__focal_depth_image + required: false + sign_map: + name: sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + multivalued: false + range: ImagingRetinotopy__sign_map + required: false + vasculature_image: + name: vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + multivalued: false + range: ImagingRetinotopy__vasculature_image + required: true + tree_root: true + ImagingRetinotopy__axis_1_phase_map: + name: ImagingRetinotopy__axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + attributes: + name: + name: name + ifabsent: string(axis_1_phase_map) + range: string + required: true + equals_string: axis_1_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_phase_map__Array + ImagingRetinotopy__axis_1_phase_map__Array: + name: ImagingRetinotopy__axis_1_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_1_power_map: + name: ImagingRetinotopy__axis_1_power_map + description: Power response on the first measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_1_power_map) + range: string + required: true + equals_string: axis_1_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_power_map__Array + ImagingRetinotopy__axis_1_power_map__Array: + name: ImagingRetinotopy__axis_1_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_phase_map: + name: ImagingRetinotopy__axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + attributes: + name: + name: name + ifabsent: string(axis_2_phase_map) + range: string + required: true + equals_string: axis_2_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_phase_map__Array + ImagingRetinotopy__axis_2_phase_map__Array: + name: ImagingRetinotopy__axis_2_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_power_map: + name: ImagingRetinotopy__axis_2_power_map + description: Power response on the second measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_2_power_map) + range: string + required: true + equals_string: axis_2_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_power_map__Array + ImagingRetinotopy__axis_2_power_map__Array: + name: ImagingRetinotopy__axis_2_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__focal_depth_image: + name: ImagingRetinotopy__focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., focal + depth, wavelength) as data collection. Array format: [rows][columns].' + attributes: + name: + name: name + ifabsent: string(focal_depth_image) + range: string + required: true + equals_string: focal_depth_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value. + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + focal_depth: + name: focal_depth + description: Focal depth offset, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__focal_depth_image__Array + ImagingRetinotopy__focal_depth_image__Array: + name: ImagingRetinotopy__focal_depth_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true + ImagingRetinotopy__sign_map: + name: ImagingRetinotopy__sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + attributes: + name: + name: name + ifabsent: string(sign_map) + range: string + required: true + equals_string: sign_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + array: + name: array + range: ImagingRetinotopy__sign_map__Array + ImagingRetinotopy__sign_map__Array: + name: ImagingRetinotopy__sign_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__vasculature_image: + name: ImagingRetinotopy__vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + attributes: + name: + name: name + ifabsent: string(vasculature_image) + range: string + required: true + equals_string: vasculature_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__vasculature_image__Array + ImagingRetinotopy__vasculature_image__Array: + name: ImagingRetinotopy__vasculature_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/namespace.yaml new file mode 100644 index 0000000..cbe558c --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_3_0/namespace.yaml @@ -0,0 +1,25 @@ +name: core +annotations: + namespace: + tag: namespace + value: 'True' +description: NWB namespace +id: core +version: 2.3.0 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.epoch +- core.nwb.image +- core.nwb.file +- core.nwb.misc +- core.nwb.behavior +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.retinotopy +- core.nwb.language +- ../../hdmf_common/v1_5_0/namespace +- ../../hdmf_experimental/v0_1_0/namespace +default_prefix: core/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.base.yaml new file mode 100644 index 0000000..9ff2b8a --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.base.yaml @@ -0,0 +1,328 @@ +name: core.nwb.base +id: core.nwb.base +version: 2.4.0 +imports: +- ../../hdmf_common/v1_5_0/namespace +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.language +default_prefix: core.nwb.base/ +classes: + NWBData: + name: NWBData + description: An abstract data type for a dataset. + is_a: Data + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeriesReferenceVectorData: + name: TimeSeriesReferenceVectorData + description: Column storing references to a TimeSeries (rows). For each TimeSeries + this VectorData column stores the start_index and count to indicate the range + in time to be selected as well as an object reference to the TimeSeries. + is_a: VectorData + attributes: + name: + name: name + range: string + required: true + tree_root: true + Image: + name: Image + description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D + where the third dimension can have three or four elements, e.g. (x, y, (r, g, + b)) or (x, y, (r, g, b, a)). + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + resolution: + name: resolution + description: Pixel resolution of the image, in pixels per centimeter. + range: float32 + description: + name: description + description: Description of the image. + range: text + array: + name: array + range: Image__Array + tree_root: true + Image__Array: + name: Image__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + r, g, b, a: + name: r, g, b, a + range: numeric + required: false + minimum_cardinality: 4 + maximum_cardinality: 4 + NWBContainer: + name: NWBContainer + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + is_a: Container + attributes: + name: + name: name + range: string + required: true + tree_root: true + NWBDataInterface: + name: NWBDataInterface + description: An abstract data type for a generic container storing collections + of data, as opposed to metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeries: + name: TimeSeries + description: General purpose time series. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the time series. + range: text + comments: + name: comments + description: Human-readable comments about the TimeSeries. This second descriptive + field can be used to store additional information, or descriptive information + if the primary description field is populated with a computer-readable string. + range: text + data: + name: data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first + dimension should always represent time. This can also be used to store binary + data (e.g., image frames). This can also be a link to data stored in an + external file. + multivalued: false + range: TimeSeries__data + required: true + starting_time: + name: starting_time + description: Timestamp of the first sample in seconds. When timestamps are + uniformly spaced, the timestamp of the first sample can be specified and + all subsequent ones calculated from the sampling rate attribute. + multivalued: false + range: TimeSeries__starting_time + required: false + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + multivalued: true + range: float64 + required: false + control: + name: control + description: Numerical labels that apply to each time point in data for the + purpose of querying and slicing data by these values. If present, the length + of this array should be the same size as the first dimension of data. + multivalued: true + range: uint8 + required: false + control_description: + name: control_description + description: Description of each control value. Must be present if control + is present. If present, control_description[0] should describe time points + where control == 0. + multivalued: true + range: text + required: false + sync: + name: sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored + external to the NWB file, in files storing raw data. Once timestamp data + is calculated, the contents of 'sync' are mostly for archival purposes. + multivalued: false + range: TimeSeries__sync + required: false + tree_root: true + TimeSeries__data: + name: TimeSeries__data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension + should always represent time. This can also be used to store binary data (e.g., + image frames). This can also be a link to data stored in an external file. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as signed 16-bit + integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V + to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' + multiplier to get from raw data acquisition values to recorded volts is + 2.5/32768/8000 = 9.5367e-9. + range: float32 + resolution: + name: resolution + description: Smallest meaningful difference between values in data, stored + in the specified by unit, e.g., the change in value of the least significant + bit, or a larger number if signal noise is known to be present. If unknown, + use -1.0. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + continuity: + name: continuity + description: Optionally describe the continuity of the data. Can be "continuous", + "instantaneous", or "step". For example, a voltage trace would be "continuous", + because samples are recorded from a continuous process. An array of lick + times would be "instantaneous", because the data represents distinct moments + in time. Times of image presentations would be "step" because the picture + remains the same until the next timepoint. This field is optional, but is + useful in providing information about the underlying data. It may inform + the way this data is interpreted, the way it is visualized, and what analysis + methods are applicable. + range: text + array: + name: array + range: TimeSeries__data__Array + TimeSeries__data__Array: + name: TimeSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: AnyType + required: true + num_DIM2: + name: num_DIM2 + range: AnyType + required: false + num_DIM3: + name: num_DIM3 + range: AnyType + required: false + num_DIM4: + name: num_DIM4 + range: AnyType + required: false + TimeSeries__starting_time: + name: TimeSeries__starting_time + description: Timestamp of the first sample in seconds. When timestamps are uniformly + spaced, the timestamp of the first sample can be specified and all subsequent + ones calculated from the sampling rate attribute. + attributes: + name: + name: name + ifabsent: string(starting_time) + range: string + required: true + equals_string: starting_time + rate: + name: rate + description: Sampling rate, in Hz. + range: float32 + unit: + name: unit + description: Unit of measurement for time, which is fixed to 'seconds'. + range: text + value: + name: value + range: float64 + required: true + TimeSeries__sync: + name: TimeSeries__sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored external + to the NWB file, in files storing raw data. Once timestamp data is calculated, + the contents of 'sync' are mostly for archival purposes. + attributes: + name: + name: name + ifabsent: string(sync) + range: string + required: true + equals_string: sync + ProcessingModule: + name: ProcessingModule + description: A collection of processed data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of processed data. + range: text + nwb_data_interface: + name: nwb_data_interface + description: Data objects stored in this collection. + multivalued: true + range: NWBDataInterface + required: false + dynamic_table: + name: dynamic_table + description: Tables stored in this collection. + multivalued: true + range: DynamicTable + required: false + tree_root: true + Images: + name: Images + description: A collection of images. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of images. + range: text + image: + name: image + description: Images stored in this collection. + multivalued: true + range: Image + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.behavior.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.behavior.yaml new file mode 100644 index 0000000..4bf0e52 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.behavior.yaml @@ -0,0 +1,201 @@ +name: core.nwb.behavior +id: core.nwb.behavior +version: 2.4.0 +imports: +- core.nwb.base +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.behavior/ +classes: + SpatialSeries: + name: SpatialSeries + description: 'Direction, e.g., of gaze or travel, or position. The TimeSeries::data + field is a 2D array storing position or direction relative to some reference + frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries + has a text dataset reference_frame that indicates the zero-position, or the + zero-axes for direction. For example, if representing gaze direction, ''straight-ahead'' + might be a specific pixel on the monitor, or some other point in space. For + position data, the 0,0 point might be the top-left corner of an enclosure, as + viewed from the tracking camera. The unit of data will indicate how to interpret + SpatialSeries values.' + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: 1-D or 2-D array storing position or direction relative to some + reference frame. + multivalued: false + range: SpatialSeries__data + required: true + reference_frame: + name: reference_frame + description: Description defining what exactly 'straight-ahead' means. + multivalued: false + range: text + required: false + tree_root: true + SpatialSeries__data: + name: SpatialSeries__data + description: 1-D or 2-D array storing position or direction relative to some reference + frame. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: SpatialSeries__data__Array + SpatialSeries__data__Array: + name: SpatialSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + BehavioralEpochs: + name: BehavioralEpochs + description: TimeSeries for storing behavioral epochs. The objective of this + and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) + is to provide generic hooks for software tools/scripts. This allows a tool/script + to take the output one specific interface (e.g., UnitTimes) and plot that data + relative to another data modality (e.g., behavioral events) without having to + define all possible modalities in advance. Declaring one of these interfaces + means that one or more TimeSeries of the specified type is published. These + TimeSeries should reside in a group having the same name as the interface. For + example, if a BehavioralTimeSeries interface is declared, the module will have + one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. + BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular + events. BehavioralTimeSeries is for continuous data. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + interval_series: + name: interval_series + description: IntervalSeries object containing start and stop times of epochs. + multivalued: true + range: IntervalSeries + required: false + tree_root: true + BehavioralEvents: + name: BehavioralEvents + description: TimeSeries for storing behavioral events. See description of BehavioralEpochs + for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing behavioral events. + multivalued: true + range: TimeSeries + required: false + tree_root: true + BehavioralTimeSeries: + name: BehavioralTimeSeries + description: TimeSeries for storing Behavoioral time series data. See description + of BehavioralEpochs for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing continuous behavioral data. + multivalued: true + range: TimeSeries + required: false + tree_root: true + PupilTracking: + name: PupilTracking + description: Eye-tracking data, representing pupil size. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing time series data on pupil size. + multivalued: true + range: TimeSeries + required: true + tree_root: true + EyeTracking: + name: EyeTracking + description: Eye-tracking data, representing direction of gaze. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing data measuring direction of gaze. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + CompassDirection: + name: CompassDirection + description: With a CompassDirection interface, a module publishes a SpatialSeries + object representing a floating point value for theta. The SpatialSeries::reference_frame + field should indicate what direction corresponds to 0 and which is the direction + of rotation (this should be clockwise). The si_unit for the SpatialSeries should + be radians or degrees. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing direction of gaze travel. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + Position: + name: Position + description: Position data, whether along the x, x/y or x/y/z axis. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing position data. + multivalued: true + range: SpatialSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.device.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.device.yaml new file mode 100644 index 0000000..9332638 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.device.yaml @@ -0,0 +1,28 @@ +name: core.nwb.device +id: core.nwb.device +version: 2.4.0 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.device/ +classes: + Device: + name: Device + description: Metadata about a data acquisition device, e.g., recording system, + electrode, microscope. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the device (e.g., model, firmware version, processing + software version, etc.) as free-form text. + range: text + manufacturer: + name: manufacturer + description: The name of the manufacturer of the device. + range: text + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.ecephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.ecephys.yaml new file mode 100644 index 0000000..a13045e --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.ecephys.yaml @@ -0,0 +1,502 @@ +name: core.nwb.ecephys +id: core.nwb.ecephys +version: 2.4.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ecephys/ +classes: + ElectricalSeries: + name: ElectricalSeries + description: A time series of acquired voltage data from extracellular recordings. + The data field is an int or float array storing data in volts. The first dimension + should always represent time. The second dimension, if present, should represent + channels. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + filtering: + name: filtering + description: Filtering applied to all channels of the data. For example, if + this ElectricalSeries represents high-pass-filtered data (also known as + AP Band), then this value could be "High-pass 4-pole Bessel filter at 500 + Hz". If this ElectricalSeries represents low-pass-filtered LFP data and + the type of filter is unknown, then this value could be "Low-pass filter + at 300 Hz". If a non-standard filter type is used, provide as much detail + about the filter properties as possible. + range: text + data: + name: data + description: Recorded voltage data. + multivalued: false + range: ElectricalSeries__data + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: ElectricalSeries__electrodes + required: true + channel_conversion: + name: channel_conversion + description: Channel-specific conversion factor. Multiply the data in the + 'data' dataset by these values along the channel axis (as indicated by axis + attribute) AND by the global conversion factor in the 'conversion' attribute + of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion + * channel_conversion. This approach allows for both global and per-channel + data conversion factors needed to support the storage of electrical recordings + as native values generated by data acquisition systems. If this dataset + is not present, then there is no channel-specific conversion factor, i.e. + it is 1 for all channels. + multivalued: true + range: float32 + required: false + tree_root: true + ElectricalSeries__data: + name: ElectricalSeries__data + description: Recorded voltage data. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. This value + is fixed to 'volts'. Actual stored values are not necessarily stored in + these units. To access the data in these units, multiply 'data' by 'conversion' + and 'channel_conversion' (if present). + range: text + array: + name: array + range: ElectricalSeries__data__Array + ElectricalSeries__data__Array: + name: ElectricalSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + num_samples: + name: num_samples + range: numeric + required: false + ElectricalSeries__electrodes: + name: ElectricalSeries__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + SpikeEventSeries: + name: SpikeEventSeries + description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold + crossings). This may also be raw data, as reported by ephys hardware. If so, + the TimeSeries::description field should describe how events were detected. + All SpikeEventSeries should reside in a module (under EventWaveform interface) + even if the spikes were reported and stored by hardware. All events span the + same recording channels and store snapshots of equal duration. TimeSeries::data + array structure: [num events] [num channels] [num samples] (or [num events] + [num samples] for single electrode).' + is_a: ElectricalSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Spike waveforms. + multivalued: false + range: SpikeEventSeries__data + required: true + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + Timestamps are required for the events. Unlike for TimeSeries, timestamps + are required for SpikeEventSeries and are thus re-specified here. + multivalued: true + range: float64 + required: true + tree_root: true + SpikeEventSeries__data: + name: SpikeEventSeries__data + description: Spike waveforms. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Unit of measurement for waveforms, which is fixed to 'volts'. + range: text + array: + name: array + range: SpikeEventSeries__data__Array + SpikeEventSeries__data__Array: + name: SpikeEventSeries__data__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: numeric + required: true + num_samples: + name: num_samples + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + FeatureExtraction: + name: FeatureExtraction + description: Features, such as PC1 and PC2, that are extracted from signals stored + in a SpikeEventSeries or other source. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of features (eg, ''PC1'') for each of the extracted + features. + multivalued: true + range: text + required: true + features: + name: features + description: Multi-dimensional array of features extracted from each event. + multivalued: false + range: FeatureExtraction__features + required: true + times: + name: times + description: Times of events that features correspond to (can be a link). + multivalued: true + range: float64 + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: FeatureExtraction__electrodes + required: true + tree_root: true + FeatureExtraction__features: + name: FeatureExtraction__features + description: Multi-dimensional array of features extracted from each event. + attributes: + name: + name: name + ifabsent: string(features) + range: string + required: true + equals_string: features + array: + name: array + range: FeatureExtraction__features__Array + FeatureExtraction__features__Array: + name: FeatureExtraction__features__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: float32 + required: true + num_channels: + name: num_channels + range: float32 + required: true + num_features: + name: num_features + range: float32 + required: true + FeatureExtraction__electrodes: + name: FeatureExtraction__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + EventDetection: + name: EventDetection + description: Detected spike events from voltage trace(s). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + detection_method: + name: detection_method + description: Description of how events were detected, such as voltage threshold, + or dV/dT threshold, as well as relevant values. + multivalued: false + range: text + required: true + source_idx: + name: source_idx + description: Indices (zero-based) into source ElectricalSeries::data array + corresponding to time of event. ''description'' should define what is meant + by time of event (e.g., .25 ms before action potential peak, zero-crossing + time, etc). The index points to each event from the raw data. + multivalued: true + range: int32 + required: true + times: + name: times + description: Timestamps of events, in seconds. + multivalued: true + range: float64 + required: true + tree_root: true + EventWaveform: + name: EventWaveform + description: Represents either the waveforms of detected events, as extracted + from a raw data trace in /acquisition, or the event waveforms that were stored + during experiment acquisition. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spike_event_series: + name: spike_event_series + description: SpikeEventSeries object(s) containing detected spike event waveforms. + multivalued: true + range: SpikeEventSeries + required: false + tree_root: true + FilteredEphys: + name: FilteredEphys + description: Electrophysiology data from one or more channels that has been subjected + to filtering. Examples of filtered data include Theta and Gamma (LFP has its + own interface). FilteredEphys modules publish an ElectricalSeries for each filtered + channel or set of channels. The name of each ElectricalSeries is arbitrary but + should be informative. The source of the filtered data, whether this is from + analysis of another time series or as acquired by hardware, should be noted + in each's TimeSeries::description field. There is no assumed 1::1 correspondence + between filtered ephys signals and electrodes, as a single signal can apply + to many nearby electrodes, and one electrode may have different filtered (e.g., + theta and/or gamma) signals represented. Filter properties should be noted in + the ElectricalSeries 'filtering' attribute. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing filtered electrophysiology + data. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + LFP: + name: LFP + description: LFP data from one or more channels. The electrode map in each published + ElectricalSeries will identify which channels are providing LFP data. Filter + properties should be noted in the ElectricalSeries 'filtering' attribute. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing LFP data for one or more + channels. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + ElectrodeGroup: + name: ElectrodeGroup + description: A physical grouping of electrodes, e.g. a shank of an array. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this electrode group. + range: text + location: + name: location + description: Location of electrode group. Specify the area, layer, comments + on estimation of area/layer, etc. Use standard atlas names for anatomical + regions when possible. + range: text + position: + name: position + description: stereotaxic or common framework coordinates + multivalued: false + range: AnyType + required: false + tree_root: true + ClusterWaveforms: + name: ClusterWaveforms + description: DEPRECATED The mean waveform shape, including standard deviation, + of the different clusters. Ideally, the waveform analysis should be performed + on data that is only high-pass filtered. This is a separate module because it + is expected to require updating. For example, IMEC probes may require different + storage requirements to store/display mean waveforms, requiring a new interface + or an extension of this one. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + waveform_filtering: + name: waveform_filtering + description: Filtering applied to data before generating mean/sd + multivalued: false + range: text + required: true + waveform_mean: + name: waveform_mean + description: The mean waveform for each cluster, using the same indices for + each wave as cluster numbers in the associated Clustering module (i.e, cluster + 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence + should be empty (e.g., zero- filled) + multivalued: false + range: ClusterWaveforms__waveform_mean + required: true + waveform_sd: + name: waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as + in mean + multivalued: false + range: ClusterWaveforms__waveform_sd + required: true + tree_root: true + ClusterWaveforms__waveform_mean: + name: ClusterWaveforms__waveform_mean + description: The mean waveform for each cluster, using the same indices for each + wave as cluster numbers in the associated Clustering module (i.e, cluster 3 + is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should + be empty (e.g., zero- filled) + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + array: + name: array + range: ClusterWaveforms__waveform_mean__Array + ClusterWaveforms__waveform_mean__Array: + name: ClusterWaveforms__waveform_mean__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + ClusterWaveforms__waveform_sd: + name: ClusterWaveforms__waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as in + mean + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + array: + name: array + range: ClusterWaveforms__waveform_sd__Array + ClusterWaveforms__waveform_sd__Array: + name: ClusterWaveforms__waveform_sd__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + Clustering: + name: Clustering + description: DEPRECATED Clustered spike data, whether from automatic clustering + tools (e.g., klustakwik) or as a result of manual sorting. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of clusters or clustering, (e.g. cluster 0 is noise, + clusters curated using Klusters, etc) + multivalued: false + range: text + required: true + num: + name: num + description: Cluster number of each event + multivalued: true + range: int32 + required: true + peak_over_rms: + name: peak_over_rms + description: Maximum ratio of waveform peak to RMS on any channel in the cluster + (provides a basic clustering metric). + multivalued: true + range: float32 + required: true + times: + name: times + description: Times of clustered events, in seconds. This may be a link to + times field in associated FeatureExtraction module. + multivalued: true + range: float64 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.epoch.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.epoch.yaml new file mode 100644 index 0000000..259e1f3 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.epoch.yaml @@ -0,0 +1,74 @@ +name: core.nwb.epoch +id: core.nwb.epoch +version: 2.4.0 +imports: +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.epoch/ +classes: + TimeIntervals: + name: TimeIntervals + description: A container for aggregating epoch data and the TimeSeries that each + epoch applies to. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + start_time: + name: start_time + description: Start time of epoch, in seconds. + multivalued: true + range: float32 + stop_time: + name: stop_time + description: Stop time of epoch, in seconds. + multivalued: true + range: float32 + tags: + name: tags + description: User-defined tags that identify or categorize events. + multivalued: true + range: text + tags_index: + name: tags_index + description: Index for tags. + multivalued: false + range: TimeIntervals__tags_index + required: false + timeseries: + name: timeseries + description: An index into a TimeSeries object. + multivalued: true + range: AnyType + timeseries_index: + name: timeseries_index + description: Index for timeseries. + multivalued: false + range: TimeIntervals__timeseries_index + required: false + tree_root: true + TimeIntervals__tags_index: + name: TimeIntervals__tags_index + description: Index for tags. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(tags_index) + range: string + required: true + equals_string: tags_index + TimeIntervals__timeseries_index: + name: TimeIntervals__timeseries_index + description: Index for timeseries. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(timeseries_index) + range: string + required: true + equals_string: timeseries_index diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.file.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.file.yaml similarity index 91% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.file.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.file.yaml index e7c4967..0ee72c8 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.file.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.file.yaml @@ -1,8 +1,9 @@ name: core.nwb.file id: core.nwb.file +version: 2.4.0 imports: - core.nwb.base -- hdmf-common.table +- ../../hdmf_common/v1_5_0/namespace - core.nwb.device - core.nwb.ecephys - core.nwb.icephys @@ -10,7 +11,7 @@ imports: - core.nwb.ophys - core.nwb.epoch - core.nwb.misc -- nwb.language +- core.nwb.language default_prefix: core.nwb.file/ classes: ScratchData: @@ -29,8 +30,8 @@ classes: tree_root: true NWBFile: name: NWBFile - description: An NWB file storing cellular-based neurophysiology data from a single - experimental session. + description: An NWB:N file storing cellular-based neurophysiology data from a + single experimental session. is_a: NWBContainer attributes: name: @@ -233,7 +234,6 @@ classes: multivalued: true any_of: - range: TimeSeries - - range: Images NWBFile__general: name: NWBFile__general description: Experimental metadata, including protocol, notes and description @@ -444,8 +444,82 @@ classes: name: electrodes description: A table of all electrodes (i.e. channels) used for recording. multivalued: false - range: DynamicTable + range: NWBFile__general__extracellular_ephys__electrodes required: false + NWBFile__general__extracellular_ephys__electrodes: + name: NWBFile__general__extracellular_ephys__electrodes + description: A table of all electrodes (i.e. channels) used for recording. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + x: + name: x + description: x coordinate of the channel location in the brain (+x is posterior). + multivalued: true + range: float32 + y: + name: y + description: y coordinate of the channel location in the brain (+y is inferior). + multivalued: true + range: float32 + z: + name: z + description: z coordinate of the channel location in the brain (+z is right). + multivalued: true + range: float32 + imp: + name: imp + description: Impedance of the channel, in ohms. + multivalued: true + range: float32 + location: + name: location + description: Location of the electrode (channel). Specify the area, layer, + comments on estimation of area/layer, stereotaxic coordinates if in vivo, + etc. Use standard atlas names for anatomical regions when possible. + multivalued: true + range: text + filtering: + name: filtering + description: Description of hardware filtering, including the filter name + and frequency cutoffs. + multivalued: true + range: text + group: + name: group + description: Reference to the ElectrodeGroup this electrode is a part of. + multivalued: true + range: ElectrodeGroup + group_name: + name: group_name + description: Name of the ElectrodeGroup this electrode is a part of. + multivalued: true + range: text + rel_x: + name: rel_x + description: x coordinate in electrode group + multivalued: true + range: float32 + rel_y: + name: rel_y + description: y coordinate in electrode group + multivalued: true + range: float32 + rel_z: + name: rel_z + description: z coordinate in electrode group + multivalued: true + range: float32 + reference: + name: reference + description: Description of the reference used for this electrode. + multivalued: true + range: text NWBFile__general__intracellular_ephys: name: NWBFile__general__intracellular_ephys description: Metadata related to intracellular electrophysiology. @@ -475,7 +549,7 @@ classes: name: sweep_table description: '[DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable - tables. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions + tabels. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions tables provide enhanced support for experiment metadata.' multivalued: false range: SweepTable @@ -591,7 +665,7 @@ classes: name: age description: Age of subject. Can be supplied instead of 'date_of_birth'. multivalued: false - range: Subject__age + range: text required: false date_of_birth: name: date_of_birth @@ -644,22 +718,3 @@ classes: range: text required: false tree_root: true - Subject__age: - name: Subject__age - description: Age of subject. Can be supplied instead of 'date_of_birth'. - attributes: - name: - name: name - ifabsent: string(age) - range: string - required: true - equals_string: age - reference: - name: reference - description: Age is with reference to this event. Can be 'birth' or 'gestational'. - If reference is omitted, 'birth' is implied. - range: text - value: - name: value - range: text - required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.icephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.icephys.yaml new file mode 100644 index 0000000..31f1dcb --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.icephys.yaml @@ -0,0 +1,869 @@ +name: core.nwb.icephys +id: core.nwb.icephys +version: 2.4.0 +imports: +- core.nwb.base +- core.nwb.device +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.language +default_prefix: core.nwb.icephys/ +classes: + PatchClampSeries: + name: PatchClampSeries + description: An abstract base class for patch-clamp data - stimulus or response, + current or voltage. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: Protocol/stimulus name for this patch-clamp dataset. + range: text + sweep_number: + name: sweep_number + description: Sweep number, allows to group different PatchClampSeries together. + range: uint32 + data: + name: data + description: Recorded voltage or current. + multivalued: true + range: numeric + required: true + gain: + name: gain + description: Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt + (c-clamp). + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries: + name: CurrentClampSeries + description: Voltage data from an intracellular current-clamp recording. A corresponding + CurrentClampStimulusSeries (stored separately as a stimulus) is used to store + the current injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage. + multivalued: false + range: CurrentClampSeries__data + required: true + bias_current: + name: bias_current + description: Bias current, in amps. + multivalued: false + range: float32 + required: false + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms. + multivalued: false + range: float32 + required: false + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads. + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries__data: + name: CurrentClampSeries__data + description: Recorded voltage. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IZeroClampSeries: + name: IZeroClampSeries + description: Voltage data from an intracellular recording when all current and + amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There + is no CurrentClampStimulusSeries associated with an IZero series because the + amplifier is disconnected and no stimulus can reach the cell. + is_a: CurrentClampSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: An IZeroClampSeries has no stimulus, so this attribute is automatically + set to "N/A" + range: text + bias_current: + name: bias_current + description: Bias current, in amps, fixed to 0.0. + multivalued: false + range: float32 + required: true + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms, fixed to 0.0. + multivalued: false + range: float32 + required: true + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads, fixed to 0.0. + multivalued: false + range: float32 + required: true + tree_root: true + CurrentClampStimulusSeries: + name: CurrentClampStimulusSeries + description: Stimulus current applied during current clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus current applied. + multivalued: false + range: CurrentClampStimulusSeries__data + required: true + tree_root: true + CurrentClampStimulusSeries__data: + name: CurrentClampStimulusSeries__data + description: Stimulus current applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries: + name: VoltageClampSeries + description: Current data from an intracellular voltage-clamp recording. A corresponding + VoltageClampStimulusSeries (stored separately as a stimulus) is used to store + the voltage injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded current. + multivalued: false + range: VoltageClampSeries__data + required: true + capacitance_fast: + name: capacitance_fast + description: Fast capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_fast + required: false + capacitance_slow: + name: capacitance_slow + description: Slow capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_slow + required: false + resistance_comp_bandwidth: + name: resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + multivalued: false + range: VoltageClampSeries__resistance_comp_bandwidth + required: false + resistance_comp_correction: + name: resistance_comp_correction + description: Resistance compensation correction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_correction + required: false + resistance_comp_prediction: + name: resistance_comp_prediction + description: Resistance compensation prediction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_prediction + required: false + whole_cell_capacitance_comp: + name: whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + multivalued: false + range: VoltageClampSeries__whole_cell_capacitance_comp + required: false + whole_cell_series_resistance_comp: + name: whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + multivalued: false + range: VoltageClampSeries__whole_cell_series_resistance_comp + required: false + tree_root: true + VoltageClampSeries__data: + name: VoltageClampSeries__data + description: Recorded current. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries__capacitance_fast: + name: VoltageClampSeries__capacitance_fast + description: Fast capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_fast) + range: string + required: true + equals_string: capacitance_fast + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__capacitance_slow: + name: VoltageClampSeries__capacitance_slow + description: Slow capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_slow) + range: string + required: true + equals_string: capacitance_slow + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_bandwidth: + name: VoltageClampSeries__resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + attributes: + name: + name: name + ifabsent: string(resistance_comp_bandwidth) + range: string + required: true + equals_string: resistance_comp_bandwidth + unit: + name: unit + description: Unit of measurement for resistance_comp_bandwidth, which is fixed + to 'hertz'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_correction: + name: VoltageClampSeries__resistance_comp_correction + description: Resistance compensation correction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_correction) + range: string + required: true + equals_string: resistance_comp_correction + unit: + name: unit + description: Unit of measurement for resistance_comp_correction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_prediction: + name: VoltageClampSeries__resistance_comp_prediction + description: Resistance compensation prediction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_prediction) + range: string + required: true + equals_string: resistance_comp_prediction + unit: + name: unit + description: Unit of measurement for resistance_comp_prediction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_capacitance_comp: + name: VoltageClampSeries__whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + attributes: + name: + name: name + ifabsent: string(whole_cell_capacitance_comp) + range: string + required: true + equals_string: whole_cell_capacitance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_capacitance_comp, which is + fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_series_resistance_comp: + name: VoltageClampSeries__whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + attributes: + name: + name: name + ifabsent: string(whole_cell_series_resistance_comp) + range: string + required: true + equals_string: whole_cell_series_resistance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_series_resistance_comp, which + is fixed to 'ohms'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampStimulusSeries: + name: VoltageClampStimulusSeries + description: Stimulus voltage applied during a voltage clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus voltage applied. + multivalued: false + range: VoltageClampStimulusSeries__data + required: true + tree_root: true + VoltageClampStimulusSeries__data: + name: VoltageClampStimulusSeries__data + description: Stimulus voltage applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion'. + range: text + value: + name: value + range: AnyType + required: true + IntracellularElectrode: + name: IntracellularElectrode + description: An intracellular electrode and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of electrode (e.g., whole-cell, sharp, etc.). + multivalued: false + range: text + required: true + filtering: + name: filtering + description: Electrode specific filtering. + multivalued: false + range: text + required: false + initial_access_resistance: + name: initial_access_resistance + description: Initial access resistance. + multivalued: false + range: text + required: false + location: + name: location + description: Location of the electrode. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: false + resistance: + name: resistance + description: Electrode resistance, in ohms. + multivalued: false + range: text + required: false + seal: + name: seal + description: Information about seal used for recording. + multivalued: false + range: text + required: false + slice: + name: slice + description: Information about slice used for recording. + multivalued: false + range: text + required: false + tree_root: true + SweepTable: + name: SweepTable + description: '[DEPRECATED] Table used to group different PatchClampSeries. SweepTable + is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable + tables. Additional SequentialRecordingsTable, RepetitionsTable, and ExperimentalConditions + tables provide enhanced support for experiment metadata.' + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + sweep_number: + name: sweep_number + description: Sweep number of the PatchClampSeries in that row. + multivalued: true + range: uint32 + series: + name: series + description: The PatchClampSeries with the sweep number in that row. + multivalued: true + range: PatchClampSeries + series_index: + name: series_index + description: Index for series. + multivalued: false + range: SweepTable__series_index + required: true + tree_root: true + SweepTable__series_index: + name: SweepTable__series_index + description: Index for series. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(series_index) + range: string + required: true + equals_string: series_index + IntracellularElectrodesTable: + name: IntracellularElectrodesTable + description: Table for storing intracellular electrode related metadata. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of what is in this dynamic table. + range: text + electrode: + name: electrode + description: Column for storing the reference to the intracellular electrode. + multivalued: true + range: IntracellularElectrode + tree_root: true + IntracellularStimuliTable: + name: IntracellularStimuliTable + description: Table for storing intracellular stimulus related metadata. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of what is in this dynamic table. + range: text + stimulus: + name: stimulus + description: Column storing the reference to the recorded stimulus for the + recording (rows). + multivalued: false + range: IntracellularStimuliTable__stimulus + required: true + tree_root: true + IntracellularStimuliTable__stimulus: + name: IntracellularStimuliTable__stimulus + description: Column storing the reference to the recorded stimulus for the recording + (rows). + is_a: TimeSeriesReferenceVectorData + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + IntracellularResponsesTable: + name: IntracellularResponsesTable + description: Table for storing intracellular response related metadata. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of what is in this dynamic table. + range: text + response: + name: response + description: Column storing the reference to the recorded response for the + recording (rows) + multivalued: false + range: IntracellularResponsesTable__response + required: true + tree_root: true + IntracellularResponsesTable__response: + name: IntracellularResponsesTable__response + description: Column storing the reference to the recorded response for the recording + (rows) + is_a: TimeSeriesReferenceVectorData + attributes: + name: + name: name + ifabsent: string(response) + range: string + required: true + equals_string: response + IntracellularRecordingsTable: + name: IntracellularRecordingsTable + description: A table to group together a stimulus and response from a single electrode + and a single simultaneous recording. Each row in the table represents a single + recording consisting typically of a stimulus and a corresponding response. In + some cases, however, only a stimulus or a response is recorded as part of an + experiment. In this case, both the stimulus and response will point to the same + TimeSeries while the idx_start and count of the invalid column will be set to + -1, thus, indicating that no values have been recorded for the stimulus or response, + respectively. Note, a recording MUST contain at least a stimulus or a response. + Typically the stimulus and response are PatchClampSeries. However, the use of + AD/DA channels that are not associated to an electrode is also common in intracellular + electrophysiology, in which case other TimeSeries may be used. + is_a: AlignedDynamicTable + attributes: + name: + name: name + ifabsent: string(intracellular_recordings) + range: string + required: true + equals_string: intracellular_recordings + description: + name: description + description: Description of the contents of this table. Inherited from AlignedDynamicTable + and overwritten here to fix the value of the attribute. + range: text + electrodes: + name: electrodes + description: Table for storing intracellular electrode related metadata. + multivalued: false + range: IntracellularElectrodesTable + required: true + stimuli: + name: stimuli + description: Table for storing intracellular stimulus related metadata. + multivalued: false + range: IntracellularStimuliTable + required: true + responses: + name: responses + description: Table for storing intracellular response related metadata. + multivalued: false + range: IntracellularResponsesTable + required: true + tree_root: true + SimultaneousRecordingsTable: + name: SimultaneousRecordingsTable + description: A table for grouping different intracellular recordings from the + IntracellularRecordingsTable table together that were recorded simultaneously + from different electrodes. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(simultaneous_recordings) + range: string + required: true + equals_string: simultaneous_recordings + recordings: + name: recordings + description: A reference to one or more rows in the IntracellularRecordingsTable + table. + multivalued: false + range: SimultaneousRecordingsTable__recordings + required: true + recordings_index: + name: recordings_index + description: Index dataset for the recordings column. + multivalued: false + range: SimultaneousRecordingsTable__recordings_index + required: true + tree_root: true + SimultaneousRecordingsTable__recordings: + name: SimultaneousRecordingsTable__recordings + description: A reference to one or more rows in the IntracellularRecordingsTable + table. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(recordings) + range: string + required: true + equals_string: recordings + table: + name: table + description: Reference to the IntracellularRecordingsTable table that this + table region applies to. This specializes the attribute inherited from DynamicTableRegion + to fix the type of table that can be referenced here. + range: IntracellularRecordingsTable + SimultaneousRecordingsTable__recordings_index: + name: SimultaneousRecordingsTable__recordings_index + description: Index dataset for the recordings column. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(recordings_index) + range: string + required: true + equals_string: recordings_index + SequentialRecordingsTable: + name: SequentialRecordingsTable + description: A table for grouping different sequential recordings from the SimultaneousRecordingsTable + table together. This is typically used to group together sequential recordings + where a sequence of stimuli of the same type with varying parameters have been + presented in a sequence. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(sequential_recordings) + range: string + required: true + equals_string: sequential_recordings + simultaneous_recordings: + name: simultaneous_recordings + description: A reference to one or more rows in the SimultaneousRecordingsTable + table. + multivalued: false + range: SequentialRecordingsTable__simultaneous_recordings + required: true + simultaneous_recordings_index: + name: simultaneous_recordings_index + description: Index dataset for the simultaneous_recordings column. + multivalued: false + range: SequentialRecordingsTable__simultaneous_recordings_index + required: true + stimulus_type: + name: stimulus_type + description: The type of stimulus used for the sequential recording. + multivalued: true + range: text + tree_root: true + SequentialRecordingsTable__simultaneous_recordings: + name: SequentialRecordingsTable__simultaneous_recordings + description: A reference to one or more rows in the SimultaneousRecordingsTable + table. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(simultaneous_recordings) + range: string + required: true + equals_string: simultaneous_recordings + table: + name: table + description: Reference to the SimultaneousRecordingsTable table that this + table region applies to. This specializes the attribute inherited from DynamicTableRegion + to fix the type of table that can be referenced here. + range: SimultaneousRecordingsTable + SequentialRecordingsTable__simultaneous_recordings_index: + name: SequentialRecordingsTable__simultaneous_recordings_index + description: Index dataset for the simultaneous_recordings column. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(simultaneous_recordings_index) + range: string + required: true + equals_string: simultaneous_recordings_index + RepetitionsTable: + name: RepetitionsTable + description: A table for grouping different sequential intracellular recordings + together. With each SequentialRecording typically representing a particular + type of stimulus, the RepetitionsTable table is typically used to group sets + of stimuli applied in sequence. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(repetitions) + range: string + required: true + equals_string: repetitions + sequential_recordings: + name: sequential_recordings + description: A reference to one or more rows in the SequentialRecordingsTable + table. + multivalued: false + range: RepetitionsTable__sequential_recordings + required: true + sequential_recordings_index: + name: sequential_recordings_index + description: Index dataset for the sequential_recordings column. + multivalued: false + range: RepetitionsTable__sequential_recordings_index + required: true + tree_root: true + RepetitionsTable__sequential_recordings: + name: RepetitionsTable__sequential_recordings + description: A reference to one or more rows in the SequentialRecordingsTable + table. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(sequential_recordings) + range: string + required: true + equals_string: sequential_recordings + table: + name: table + description: Reference to the SequentialRecordingsTable table that this table + region applies to. This specializes the attribute inherited from DynamicTableRegion + to fix the type of table that can be referenced here. + range: SequentialRecordingsTable + RepetitionsTable__sequential_recordings_index: + name: RepetitionsTable__sequential_recordings_index + description: Index dataset for the sequential_recordings column. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(sequential_recordings_index) + range: string + required: true + equals_string: sequential_recordings_index + ExperimentalConditionsTable: + name: ExperimentalConditionsTable + description: A table for grouping different intracellular recording repetitions + together that belong to the same experimental condition. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(experimental_conditions) + range: string + required: true + equals_string: experimental_conditions + repetitions: + name: repetitions + description: A reference to one or more rows in the RepetitionsTable table. + multivalued: false + range: ExperimentalConditionsTable__repetitions + required: true + repetitions_index: + name: repetitions_index + description: Index dataset for the repetitions column. + multivalued: false + range: ExperimentalConditionsTable__repetitions_index + required: true + tree_root: true + ExperimentalConditionsTable__repetitions: + name: ExperimentalConditionsTable__repetitions + description: A reference to one or more rows in the RepetitionsTable table. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(repetitions) + range: string + required: true + equals_string: repetitions + table: + name: table + description: Reference to the RepetitionsTable table that this table region + applies to. This specializes the attribute inherited from DynamicTableRegion + to fix the type of table that can be referenced here. + range: RepetitionsTable + ExperimentalConditionsTable__repetitions_index: + name: ExperimentalConditionsTable__repetitions_index + description: Index dataset for the repetitions column. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(repetitions_index) + range: string + required: true + equals_string: repetitions_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.image.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.image.yaml new file mode 100644 index 0000000..300f1e2 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.image.yaml @@ -0,0 +1,315 @@ +name: core.nwb.image +id: core.nwb.image +version: 2.4.0 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.image/ +classes: + GrayscaleImage: + name: GrayscaleImage + description: A grayscale image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: GrayscaleImage__Array + tree_root: true + GrayscaleImage__Array: + name: GrayscaleImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + RGBImage: + name: RGBImage + description: A color image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBImage__Array + tree_root: true + RGBImage__Array: + name: RGBImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RGBAImage: + name: RGBAImage + description: A color image with transparency. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBAImage__Array + tree_root: true + RGBAImage__Array: + name: RGBAImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b, a: + name: r, g, b, a + range: numeric + required: true + minimum_cardinality: 4 + maximum_cardinality: 4 + ImageSeries: + name: ImageSeries + description: General image data that is common between acquisition and stimulus + time series. Sometimes the image data is stored in the file in a raw format + while other times it will be stored as a series of external image files in the + host file system. The data field will either be binary data, if the data is + stored in the NWB file, or empty, if the data is stored in an external image + stack. [frame][x][y] or [frame][x][y][z]. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Binary data representing images across frames. If data are stored + in an external file, this should be an empty 3D array. + multivalued: false + range: ImageSeries__data + required: true + dimension: + name: dimension + description: Number of pixels on x, y, (and z) axes. + multivalued: true + range: int32 + required: false + external_file: + name: external_file + description: Paths to one or more external file(s). The field is only present + if format='external'. This is only relevant if the image series is stored + in the file system as one or more image file(s). This field should NOT be + used if the image is stored in another NWB file and that file is linked + to this file. + multivalued: true + range: text + required: false + format: + name: format + description: Format of image. If this is 'external', then the attribute 'external_file' + contains the path information to the image files. If this is 'raw', then + the raw (single-channel) binary data is stored in the 'data' dataset. If + this attribute is not present, then the default format='raw' case is assumed. + multivalued: false + range: text + required: false + tree_root: true + ImageSeries__data: + name: ImageSeries__data + description: Binary data representing images across frames. If data are stored + in an external file, this should be an empty 3D array. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: ImageSeries__data__Array + ImageSeries__data__Array: + name: ImageSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + z: + name: z + range: numeric + required: false + ImageMaskSeries: + name: ImageMaskSeries + description: An alpha mask that is applied to a presented visual stimulus. The + 'data' array contains an array of mask values that are applied to the displayed + image. Mask values are stored as RGBA. Mask can vary with time. The timestamps + array indicates the starting time of a mask, and that mask pattern continues + until it's explicitly changed. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + tree_root: true + OpticalSeries: + name: OpticalSeries + description: Image data that is presented or recorded. A stimulus template movie + will be stored only as an image. When the image is presented as stimulus, additional + data is required, such as field of view (e.g., how much of the visual field + the image covers, or how what is the area of the target being imaged). If the + OpticalSeries represents acquired imaging data, orientation is also important. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + distance: + name: distance + description: Distance from camera/monitor to target/eye. + multivalued: false + range: float32 + required: false + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: OpticalSeries__field_of_view + required: false + data: + name: data + description: Images presented to subject, either grayscale or RGB + multivalued: false + range: OpticalSeries__data + required: true + orientation: + name: orientation + description: Description of image relative to some reference frame (e.g., + which way is up). Must also specify frame of reference. + multivalued: false + range: text + required: false + tree_root: true + OpticalSeries__field_of_view: + name: OpticalSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: OpticalSeries__field_of_view__Array + OpticalSeries__field_of_view__Array: + name: OpticalSeries__field_of_view__Array + is_a: Arraylike + attributes: + width, height: + name: width, height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width, height, depth: + name: width, height, depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalSeries__data: + name: OpticalSeries__data + description: Images presented to subject, either grayscale or RGB + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: OpticalSeries__data__Array + OpticalSeries__data__Array: + name: OpticalSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + IndexSeries: + name: IndexSeries + description: Stores indices to image frames stored in an ImageSeries. The purpose + of the ImageIndexSeries is to allow a static image stack to be stored somewhere, + and the images in the stack to be referenced out-of-order. This can be for the + display of individual images, or of movie segments (as a movie is simply a series + of images). The data field stores the index of the frame in the referenced ImageSeries, + and the timestamps array indicates when that image was displayed. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Index of the frame in the referenced ImageSeries. + multivalued: true + range: int32 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.language.yaml new file mode 100644 index 0000000..c57e91f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.language.yaml @@ -0,0 +1,148 @@ +name: core.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.misc.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.misc.yaml new file mode 100644 index 0000000..70066f1 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.misc.yaml @@ -0,0 +1,532 @@ +name: core.nwb.misc +id: core.nwb.misc +version: 2.4.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.ecephys +- core.nwb.language +default_prefix: core.nwb.misc/ +classes: + AbstractFeatureSeries: + name: AbstractFeatureSeries + description: Abstract features, such as quantitative descriptions of sensory stimuli. + The TimeSeries::data field is a 2D array, storing those features (e.g., for + visual grating stimulus this might be orientation, spatial frequency and contrast). + Null stimuli (eg, uniform gray) can be marked as being an independent feature + (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, + or through use of the TimeSeries::control fields. A set of features is considered + to persist until the next set of features is defined. The final set of features + stored should be the null set. This is useful when storing the raw stimulus + is impractical. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Values of each feature at each time. + multivalued: false + range: AbstractFeatureSeries__data + required: true + feature_units: + name: feature_units + description: Units of each feature. + multivalued: true + range: text + required: false + features: + name: features + description: Description of the features represented in TimeSeries::data. + multivalued: true + range: text + required: true + tree_root: true + AbstractFeatureSeries__data: + name: AbstractFeatureSeries__data + description: Values of each feature at each time. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Since there can be different units for different features, store + the units in 'feature_units'. The default value for this attribute is "see + 'feature_units'". + range: text + array: + name: array + range: AbstractFeatureSeries__data__Array + AbstractFeatureSeries__data__Array: + name: AbstractFeatureSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + AnnotationSeries: + name: AnnotationSeries + description: Stores user annotations made during an experiment. The data[] field + stores a text array, and timestamps are stored for each annotation (ie, interval=1). + This is largely an alias to a standard TimeSeries storing a text array but that + is identifiable as storing annotations in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Annotations made during an experiment. + multivalued: true + range: text + required: true + tree_root: true + IntervalSeries: + name: IntervalSeries + description: Stores intervals of data. The timestamps field stores the beginning + and end of intervals. The data field stores whether the interval just started + (>0 value) or ended (<0 value). Different interval types can be represented + in the same series by using multiple key values (eg, 1 for feature A, 2 for + feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This + is largely an alias of a standard TimeSeries but that is identifiable as representing + time intervals in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Use values >0 if interval started, <0 if interval ended. + multivalued: true + range: int8 + required: true + tree_root: true + DecompositionSeries: + name: DecompositionSeries + description: Spectral analysis of a time series, e.g. of an LFP or a speech signal. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Data decomposed into frequency bands. + multivalued: false + range: DecompositionSeries__data + required: true + metric: + name: metric + description: The metric used, e.g. phase, amplitude, power. + multivalued: false + range: text + required: true + source_channels: + name: source_channels + description: DynamicTableRegion pointer to the channels that this decomposition + series was generated from. + multivalued: false + range: DecompositionSeries__source_channels + required: false + bands: + name: bands + description: Table for describing the bands that this series was generated + from. There should be one row in this table for each band. + multivalued: false + range: DecompositionSeries__bands + required: true + tree_root: true + DecompositionSeries__data: + name: DecompositionSeries__data + description: Data decomposed into frequency bands. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: DecompositionSeries__data__Array + DecompositionSeries__data__Array: + name: DecompositionSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: true + num_bands: + name: num_bands + range: numeric + required: true + DecompositionSeries__source_channels: + name: DecompositionSeries__source_channels + description: DynamicTableRegion pointer to the channels that this decomposition + series was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(source_channels) + range: string + required: true + equals_string: source_channels + DecompositionSeries__bands: + name: DecompositionSeries__bands + description: Table for describing the bands that this series was generated from. + There should be one row in this table for each band. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(bands) + range: string + required: true + equals_string: bands + band_name: + name: band_name + description: Name of the band, e.g. theta. + multivalued: true + range: text + band_limits: + name: band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + multivalued: false + range: DecompositionSeries__bands__band_limits + required: true + band_mean: + name: band_mean + description: The mean Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + band_stdev: + name: band_stdev + description: The standard deviation of Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + DecompositionSeries__bands__band_limits: + name: DecompositionSeries__bands__band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(band_limits) + range: string + required: true + equals_string: band_limits + Units: + name: Units + description: Data about spiking units. Event times of observed units (e.g. cell, + synapse, etc.) should be concatenated and stored in spike_times. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + spike_times_index: + name: spike_times_index + description: Index into the spike_times dataset. + multivalued: false + range: Units__spike_times_index + required: false + spike_times: + name: spike_times + description: Spike times for each unit. + multivalued: false + range: Units__spike_times + required: false + obs_intervals_index: + name: obs_intervals_index + description: Index into the obs_intervals dataset. + multivalued: false + range: Units__obs_intervals_index + required: false + obs_intervals: + name: obs_intervals + description: Observation intervals for each unit. + multivalued: false + range: Units__obs_intervals + required: false + electrodes_index: + name: electrodes_index + description: Index into electrodes. + multivalued: false + range: Units__electrodes_index + required: false + electrodes: + name: electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + multivalued: false + range: Units__electrodes + required: false + electrode_group: + name: electrode_group + description: Electrode group that each spike unit came from. + multivalued: true + range: ElectrodeGroup + waveform_mean: + name: waveform_mean + description: Spike waveform mean for each spike unit. + multivalued: false + range: Units__waveform_mean + required: false + waveform_sd: + name: waveform_sd + description: Spike waveform standard deviation for each spike unit. + multivalued: false + range: Units__waveform_sd + required: false + waveforms: + name: waveforms + description: Individual waveforms for each spike on each electrode. This is + a doubly indexed column. The 'waveforms_index' column indexes which waveforms + in this column belong to the same spike event for a given unit, where each + waveform was recorded from a different electrode. The 'waveforms_index_index' + column indexes the 'waveforms_index' column to indicate which spike events + belong to a given unit. For example, if the 'waveforms_index_index' column + has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' + column correspond to the 2 spike events of the first unit, the next 3 elements + of the 'waveforms_index' column correspond to the 3 spike events of the + second unit, and the next 1 element of the 'waveforms_index' column corresponds + to the 1 spike event of the third unit. If the 'waveforms_index' column + has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' + column contain the 3 spike waveforms that were recorded from 3 different + electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays + for a graphical representation of this example. When there is only one electrode + for each unit (i.e., each spike time is associated with a single waveform), + then the 'waveforms_index' column will have values 1, 2, ..., N, where N + is the number of spike events. The number of electrodes for each spike event + should be the same within a given unit. The 'electrodes' column should be + used to indicate which electrodes are associated with each unit, and the + order of the waveforms within a given unit x spike event should be in the + same order as the electrodes referenced in the 'electrodes' column of this + table. The number of samples for each waveform must be the same. + multivalued: false + range: Units__waveforms + required: false + waveforms_index: + name: waveforms_index + description: Index into the waveforms dataset. One value for every spike event. + See 'waveforms' for more detail. + multivalued: false + range: Units__waveforms_index + required: false + waveforms_index_index: + name: waveforms_index_index + description: Index into the waveforms_index dataset. One value for every unit + (row in the table). See 'waveforms' for more detail. + multivalued: false + range: Units__waveforms_index_index + required: false + tree_root: true + Units__spike_times_index: + name: Units__spike_times_index + description: Index into the spike_times dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(spike_times_index) + range: string + required: true + equals_string: spike_times_index + Units__spike_times: + name: Units__spike_times + description: Spike times for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(spike_times) + range: string + required: true + equals_string: spike_times + resolution: + name: resolution + description: The smallest possible difference between two spike times. Usually + 1 divided by the acquisition sampling rate from which spike times were extracted, + but could be larger if the acquisition time series was downsampled or smaller + if the acquisition time series was smoothed/interpolated and it is possible + for the spike time to be between samples. + range: float64 + Units__obs_intervals_index: + name: Units__obs_intervals_index + description: Index into the obs_intervals dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(obs_intervals_index) + range: string + required: true + equals_string: obs_intervals_index + Units__obs_intervals: + name: Units__obs_intervals + description: Observation intervals for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(obs_intervals) + range: string + required: true + equals_string: obs_intervals + Units__electrodes_index: + name: Units__electrodes_index + description: Index into electrodes. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(electrodes_index) + range: string + required: true + equals_string: electrodes_index + Units__electrodes: + name: Units__electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + Units__waveform_mean: + name: Units__waveform_mean + description: Spike waveform mean for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveform_sd: + name: Units__waveform_sd + description: Spike waveform standard deviation for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveforms: + name: Units__waveforms + description: Individual waveforms for each spike on each electrode. This is a + doubly indexed column. The 'waveforms_index' column indexes which waveforms + in this column belong to the same spike event for a given unit, where each waveform + was recorded from a different electrode. The 'waveforms_index_index' column + indexes the 'waveforms_index' column to indicate which spike events belong to + a given unit. For example, if the 'waveforms_index_index' column has values + [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond + to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' + column correspond to the 3 spike events of the second unit, and the next 1 element + of the 'waveforms_index' column corresponds to the 1 spike event of the third + unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then + the first 3 elements of the 'waveforms' column contain the 3 spike waveforms + that were recorded from 3 different electrodes for the first spike time of the + first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays + for a graphical representation of this example. When there is only one electrode + for each unit (i.e., each spike time is associated with a single waveform), + then the 'waveforms_index' column will have values 1, 2, ..., N, where N is + the number of spike events. The number of electrodes for each spike event should + be the same within a given unit. The 'electrodes' column should be used to indicate + which electrodes are associated with each unit, and the order of the waveforms + within a given unit x spike event should be in the same order as the electrodes + referenced in the 'electrodes' column of this table. The number of samples for + each waveform must be the same. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveforms) + range: string + required: true + equals_string: waveforms + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveforms_index: + name: Units__waveforms_index + description: Index into the waveforms dataset. One value for every spike event. + See 'waveforms' for more detail. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(waveforms_index) + range: string + required: true + equals_string: waveforms_index + Units__waveforms_index_index: + name: Units__waveforms_index_index + description: Index into the waveforms_index dataset. One value for every unit + (row in the table). See 'waveforms' for more detail. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(waveforms_index_index) + range: string + required: true + equals_string: waveforms_index_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.ogen.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.ogen.yaml new file mode 100644 index 0000000..b60fe8f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.ogen.yaml @@ -0,0 +1,55 @@ +name: core.nwb.ogen +id: core.nwb.ogen +version: 2.4.0 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ogen/ +classes: + OptogeneticSeries: + name: OptogeneticSeries + description: An optogenetic stimulus. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Applied power for optogenetic stimulus, in watts. + multivalued: true + range: numeric + required: true + tree_root: true + OptogeneticStimulusSite: + name: OptogeneticStimulusSite + description: A site of optogenetic stimulation. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of stimulation site. + multivalued: false + range: text + required: true + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + location: + name: location + description: Location of the stimulation site. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.ophys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.ophys.yaml new file mode 100644 index 0000000..37d251e --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.ophys.yaml @@ -0,0 +1,550 @@ +name: core.nwb.ophys +id: core.nwb.ophys +version: 2.4.0 +imports: +- core.nwb.image +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ophys/ +classes: + TwoPhotonSeries: + name: TwoPhotonSeries + description: Image stack recorded over time from 2-photon microscope. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + pmt_gain: + name: pmt_gain + description: Photomultiplier gain. + range: float32 + scan_line_rate: + name: scan_line_rate + description: Lines imaged per second. This is also stored in /general/optophysiology + but is kept here as it is useful information for analysis, and so good to + be stored w/ the actual data. + range: float32 + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: TwoPhotonSeries__field_of_view + required: false + tree_root: true + TwoPhotonSeries__field_of_view: + name: TwoPhotonSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: TwoPhotonSeries__field_of_view__Array + TwoPhotonSeries__field_of_view__Array: + name: TwoPhotonSeries__field_of_view__Array + is_a: Arraylike + attributes: + width|height: + name: width|height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width|height|depth: + name: width|height|depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + RoiResponseSeries: + name: RoiResponseSeries + description: ROI responses over an imaging plane. The first dimension represents + time. The second dimension, if present, represents ROIs. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Signals from ROIs. + multivalued: false + range: RoiResponseSeries__data + required: true + rois: + name: rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + multivalued: false + range: RoiResponseSeries__rois + required: true + tree_root: true + RoiResponseSeries__data: + name: RoiResponseSeries__data + description: Signals from ROIs. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: RoiResponseSeries__data__Array + RoiResponseSeries__data__Array: + name: RoiResponseSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_ROIs: + name: num_ROIs + range: numeric + required: false + RoiResponseSeries__rois: + name: RoiResponseSeries__rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(rois) + range: string + required: true + equals_string: rois + DfOverF: + name: DfOverF + description: dF/F information about a region of interest (ROI). Storage hierarchy + of dF/F should be the same as for segmentation (i.e., same names for ROIs and + for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing dF/F for a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + Fluorescence: + name: Fluorescence + description: Fluorescence information about a region of interest (ROI). Storage + hierarchy of fluorescence should be the same as for segmentation (ie, same names + for ROIs and for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing fluorescence data for + a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + ImageSegmentation: + name: ImageSegmentation + description: Stores pixels in an image that represent different regions of interest + (ROIs) or masks. All segmentation for a given imaging plane is stored together, + with storage for multiple imaging planes (masks) supported. Each ROI is stored + in its own subgroup, with the ROI group containing both a 2D mask and a list + of pixels that make up this mask. Segments can also be used for masking neuropil. + If segmentation is allowed to change with time, a new imaging plane (or module) + is required and ROI names should remain consistent between them. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + plane_segmentation: + name: plane_segmentation + description: Results from image segmentation of a specific imaging plane. + multivalued: true + range: PlaneSegmentation + required: true + tree_root: true + PlaneSegmentation: + name: PlaneSegmentation + description: Results from image segmentation of a specific imaging plane. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + image_mask: + name: image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + multivalued: false + range: PlaneSegmentation__image_mask + required: false + pixel_mask_index: + name: pixel_mask_index + description: Index into pixel_mask. + multivalued: false + range: PlaneSegmentation__pixel_mask_index + required: false + pixel_mask: + name: pixel_mask + description: 'Pixel masks for each ROI: a list of indices and weights for + the ROI. Pixel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + voxel_mask_index: + name: voxel_mask_index + description: Index into voxel_mask. + multivalued: false + range: PlaneSegmentation__voxel_mask_index + required: false + voxel_mask: + name: voxel_mask + description: 'Voxel masks for each ROI: a list of indices and weights for + the ROI. Voxel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + reference_images: + name: reference_images + description: Image stacks that the segmentation masks apply to. + multivalued: true + any_of: + - range: ImageSeries + tree_root: true + PlaneSegmentation__image_mask: + name: PlaneSegmentation__image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(image_mask) + range: string + required: true + equals_string: image_mask + PlaneSegmentation__pixel_mask_index: + name: PlaneSegmentation__pixel_mask_index + description: Index into pixel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(pixel_mask_index) + range: string + required: true + equals_string: pixel_mask_index + PlaneSegmentation__voxel_mask_index: + name: PlaneSegmentation__voxel_mask_index + description: Index into voxel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(voxel_mask_index) + range: string + required: true + equals_string: voxel_mask_index + ImagingPlane: + name: ImagingPlane + description: An imaging plane and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the imaging plane. + multivalued: false + range: text + required: false + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + imaging_rate: + name: imaging_rate + description: Rate that images are acquired, in Hz. If the corresponding TimeSeries + is present, the rate should be stored there instead. + multivalued: false + range: float32 + required: false + indicator: + name: indicator + description: Calcium indicator. + multivalued: false + range: text + required: true + location: + name: location + description: Location of the imaging plane. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + manifold: + name: manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents + the position of the pixel relative to the defined coordinate space. Deprecated + in favor of origin_coords and grid_spacing. + multivalued: false + range: ImagingPlane__manifold + required: false + origin_coords: + name: origin_coords + description: Physical location of the first element of the imaging plane (0, + 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for + what the physical location is relative to (e.g., bregma). + multivalued: false + range: ImagingPlane__origin_coords + required: false + grid_spacing: + name: grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also + reference_frame to interpret the grid. + multivalued: false + range: ImagingPlane__grid_spacing + required: false + reference_frame: + name: reference_frame + description: Describes reference frame of origin_coords and grid_spacing. + For example, this can be a text description of the anatomical location and + orientation of the grid defined by origin_coords and grid_spacing or the + vectors needed to transform or rotate the grid to a common anatomical axis + (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and + grid_spacing. If origin_coords and grid_spacing are not present, then this + field is not required. For example, if the microscope takes 10 x 10 x 2 + images, where the first value of the data matrix (index (0, 0, 0)) corresponds + to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is + 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means + more anterior, larger numbers in y means more rightward, and larger numbers + in z means more ventral, then enter the following -- origin_coords = (-1.2, + -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = "Origin coordinates + are relative to bregma. First dimension corresponds to anterior-posterior + axis (larger index = more anterior). Second dimension corresponds to medial-lateral + axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral + axis (larger index = more ventral)." + multivalued: false + range: text + required: false + optical_channel: + name: optical_channel + description: An optical channel used to record from an imaging plane. + multivalued: true + range: OpticalChannel + required: true + tree_root: true + ImagingPlane__manifold: + name: ImagingPlane__manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents the + position of the pixel relative to the defined coordinate space. Deprecated in + favor of origin_coords and grid_spacing. + attributes: + name: + name: name + ifabsent: string(manifold) + range: string + required: true + equals_string: manifold + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as pixels from + x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then + the 'conversion' multiplier to get from raw data acquisition pixel units + to meters is 2/1000. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__manifold__Array + ImagingPlane__manifold__Array: + name: ImagingPlane__manifold__Array + is_a: Arraylike + attributes: + height: + name: height + range: float32 + required: true + width: + name: width + range: float32 + required: true + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + depth: + name: depth + range: float32 + required: false + ImagingPlane__origin_coords: + name: ImagingPlane__origin_coords + description: Physical location of the first element of the imaging plane (0, 0) + for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the + physical location is relative to (e.g., bregma). + attributes: + name: + name: name + ifabsent: string(origin_coords) + range: string + required: true + equals_string: origin_coords + unit: + name: unit + description: Measurement units for origin_coords. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__origin_coords__Array + ImagingPlane__origin_coords__Array: + name: ImagingPlane__origin_coords__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + ImagingPlane__grid_spacing: + name: ImagingPlane__grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame + to interpret the grid. + attributes: + name: + name: name + ifabsent: string(grid_spacing) + range: string + required: true + equals_string: grid_spacing + unit: + name: unit + description: Measurement units for grid_spacing. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__grid_spacing__Array + ImagingPlane__grid_spacing__Array: + name: ImagingPlane__grid_spacing__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalChannel: + name: OpticalChannel + description: An optical channel used to record from an imaging plane. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description or other notes about the channel. + multivalued: false + range: text + required: true + emission_lambda: + name: emission_lambda + description: Emission wavelength for channel, in nm. + multivalued: false + range: float32 + required: true + tree_root: true + MotionCorrection: + name: MotionCorrection + description: 'An image stack where all frames are shifted (registered) to a common + coordinate system, to account for movement and drift between frames. Note: each + frame at each point in time is assumed to be 2-D (has only x & y dimensions).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected_image_stack: + name: corrected_image_stack + description: Reuslts from motion correction of an image stack. + multivalued: true + range: CorrectedImageStack + required: true + tree_root: true + CorrectedImageStack: + name: CorrectedImageStack + description: Reuslts from motion correction of an image stack. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected: + name: corrected + description: Image stack with frames shifted to the common coordinates. + multivalued: false + range: ImageSeries + required: true + xy_translation: + name: xy_translation + description: Stores the x,y delta necessary to align each frame to the common + coordinates, for example, to align each frame to a reference image. + multivalued: false + range: TimeSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.retinotopy.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.retinotopy.yaml new file mode 100644 index 0000000..a3dea72 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/core.nwb.retinotopy.yaml @@ -0,0 +1,362 @@ +name: core.nwb.retinotopy +id: core.nwb.retinotopy +version: 2.4.0 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.retinotopy/ +classes: + ImagingRetinotopy: + name: ImagingRetinotopy + description: 'Intrinsic signal optical imaging or widefield imaging for measuring + retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of + responses to specific stimuli and a combined polarity map from which to identify + visual areas. This group does not store the raw responses imaged during retinotopic + mapping or the stimuli presented, but rather the resulting phase and power maps + after applying a Fourier transform on the averaged responses. Note: for data + consistency, all images and arrays are stored in the format [row][column] and + [row, col], which equates to [y][x]. Field of view and dimension arrays may + appear backward (i.e., y before x).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + axis_1_phase_map: + name: axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + multivalued: false + range: ImagingRetinotopy__axis_1_phase_map + required: true + axis_1_power_map: + name: axis_1_power_map + description: Power response on the first measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_1_power_map + required: false + axis_2_phase_map: + name: axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_phase_map + required: true + axis_2_power_map: + name: axis_2_power_map + description: Power response on the second measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_2_power_map + required: false + axis_descriptions: + name: axis_descriptions + description: Two-element array describing the contents of the two response + axis fields. Description should be something like ['altitude', 'azimuth'] + or '['radius', 'theta']. + multivalued: true + range: text + required: true + focal_depth_image: + name: focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., + focal depth, wavelength) as data collection. Array format: [rows][columns].' + multivalued: false + range: ImagingRetinotopy__focal_depth_image + required: false + sign_map: + name: sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + multivalued: false + range: ImagingRetinotopy__sign_map + required: false + vasculature_image: + name: vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + multivalued: false + range: ImagingRetinotopy__vasculature_image + required: true + tree_root: true + ImagingRetinotopy__axis_1_phase_map: + name: ImagingRetinotopy__axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + attributes: + name: + name: name + ifabsent: string(axis_1_phase_map) + range: string + required: true + equals_string: axis_1_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_phase_map__Array + ImagingRetinotopy__axis_1_phase_map__Array: + name: ImagingRetinotopy__axis_1_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_1_power_map: + name: ImagingRetinotopy__axis_1_power_map + description: Power response on the first measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_1_power_map) + range: string + required: true + equals_string: axis_1_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_power_map__Array + ImagingRetinotopy__axis_1_power_map__Array: + name: ImagingRetinotopy__axis_1_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_phase_map: + name: ImagingRetinotopy__axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + attributes: + name: + name: name + ifabsent: string(axis_2_phase_map) + range: string + required: true + equals_string: axis_2_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_phase_map__Array + ImagingRetinotopy__axis_2_phase_map__Array: + name: ImagingRetinotopy__axis_2_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_power_map: + name: ImagingRetinotopy__axis_2_power_map + description: Power response on the second measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_2_power_map) + range: string + required: true + equals_string: axis_2_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_power_map__Array + ImagingRetinotopy__axis_2_power_map__Array: + name: ImagingRetinotopy__axis_2_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__focal_depth_image: + name: ImagingRetinotopy__focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., focal + depth, wavelength) as data collection. Array format: [rows][columns].' + attributes: + name: + name: name + ifabsent: string(focal_depth_image) + range: string + required: true + equals_string: focal_depth_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value. + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + focal_depth: + name: focal_depth + description: Focal depth offset, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__focal_depth_image__Array + ImagingRetinotopy__focal_depth_image__Array: + name: ImagingRetinotopy__focal_depth_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true + ImagingRetinotopy__sign_map: + name: ImagingRetinotopy__sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + attributes: + name: + name: name + ifabsent: string(sign_map) + range: string + required: true + equals_string: sign_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + array: + name: array + range: ImagingRetinotopy__sign_map__Array + ImagingRetinotopy__sign_map__Array: + name: ImagingRetinotopy__sign_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__vasculature_image: + name: ImagingRetinotopy__vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + attributes: + name: + name: name + ifabsent: string(vasculature_image) + range: string + required: true + equals_string: vasculature_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__vasculature_image__Array + ImagingRetinotopy__vasculature_image__Array: + name: ImagingRetinotopy__vasculature_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/namespace.yaml new file mode 100644 index 0000000..00e8404 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_4_0/namespace.yaml @@ -0,0 +1,25 @@ +name: core +annotations: + namespace: + tag: namespace + value: 'True' +description: NWB namespace +id: core +version: 2.4.0 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.epoch +- core.nwb.image +- core.nwb.file +- core.nwb.misc +- core.nwb.behavior +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.retinotopy +- core.nwb.language +- ../../hdmf_common/v1_5_0/namespace +- ../../hdmf_experimental/v0_1_0/namespace +default_prefix: core/ diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.base.yaml similarity index 98% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.base.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.base.yaml index 7282098..69b8434 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.base.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.base.yaml @@ -1,9 +1,10 @@ name: core.nwb.base id: core.nwb.base +version: 2.5.0 imports: -- hdmf-common.base -- hdmf-common.table -- nwb.language +- ../../hdmf_common/v1_5_0/namespace +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.language default_prefix: core.nwb.base/ classes: NWBData: @@ -349,8 +350,8 @@ classes: name: description description: Description of this collection of images. range: text - Image: - name: Image + image: + name: image description: Images stored in this collection. multivalued: true range: Image diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.behavior.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.behavior.yaml similarity index 99% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.behavior.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.behavior.yaml index b7987c5..0fc60ff 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.behavior.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.behavior.yaml @@ -1,9 +1,10 @@ name: core.nwb.behavior id: core.nwb.behavior +version: 2.5.0 imports: - core.nwb.base - core.nwb.misc -- nwb.language +- core.nwb.language default_prefix: core.nwb.behavior/ classes: SpatialSeries: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.device.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.device.yaml new file mode 100644 index 0000000..91b8cc9 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.device.yaml @@ -0,0 +1,28 @@ +name: core.nwb.device +id: core.nwb.device +version: 2.5.0 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.device/ +classes: + Device: + name: Device + description: Metadata about a data acquisition device, e.g., recording system, + electrode, microscope. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the device (e.g., model, firmware version, processing + software version, etc.) as free-form text. + range: text + manufacturer: + name: manufacturer + description: The name of the manufacturer of the device. + range: text + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.ecephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.ecephys.yaml similarity index 99% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.ecephys.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.ecephys.yaml index 8d92a10..2c09143 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.ecephys.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.ecephys.yaml @@ -1,10 +1,11 @@ name: core.nwb.ecephys id: core.nwb.ecephys +version: 2.5.0 imports: - core.nwb.base -- hdmf-common.table +- ../../hdmf_common/v1_5_0/namespace - core.nwb.device -- nwb.language +- core.nwb.language default_prefix: core.nwb.ecephys/ classes: ElectricalSeries: diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.epoch.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.epoch.yaml similarity index 96% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.epoch.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.epoch.yaml index 5ed8973..d3e2f7c 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.epoch.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.epoch.yaml @@ -1,9 +1,10 @@ name: core.nwb.epoch id: core.nwb.epoch +version: 2.5.0 imports: -- hdmf-common.table +- ../../hdmf_common/v1_5_0/namespace - core.nwb.base -- nwb.language +- core.nwb.language default_prefix: core.nwb.epoch/ classes: TimeIntervals: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.file.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.file.yaml new file mode 100644 index 0000000..0913224 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.file.yaml @@ -0,0 +1,723 @@ +name: core.nwb.file +id: core.nwb.file +version: 2.5.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.device +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.epoch +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.file/ +classes: + ScratchData: + name: ScratchData + description: Any one-off datasets + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + notes: + name: notes + description: Any notes the user has about the dataset being stored + range: text + tree_root: true + NWBFile: + name: NWBFile + description: An NWB:N file storing cellular-based neurophysiology data from a + single experimental session. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(root) + range: string + required: true + equals_string: root + nwb_version: + name: nwb_version + description: File version string. Use semantic versioning, e.g. 1.2.1. This + will be the name of the format with trailing major, minor and patch numbers. + range: text + file_create_date: + name: file_create_date + description: 'A record of the date the file was created and of subsequent + modifications. The date is stored in UTC with local timezone offset as ISO + 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored + in UTC end in "Z" with no timezone offset. Date accuracy is up to milliseconds. + The file can be created after the experiment was run, so this may differ + from the experiment start time. Each modification to the nwb file adds a + new entry to the array.' + multivalued: true + range: isodatetime + required: true + identifier: + name: identifier + description: A unique text identifier for the file. For example, concatenated + lab name, file creation date/time and experimentalist, or a hash of these + and/or other values. The goal is that the string should be unique to all + other files. + multivalued: false + range: text + required: true + session_description: + name: session_description + description: A description of the experimental session and data in the file. + multivalued: false + range: text + required: true + session_start_time: + name: session_start_time + description: 'Date and time of the experiment/session start. The date is stored + in UTC with local timezone offset as ISO 8601 extended formatted string: + 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in "Z" with no timezone + offset. Date accuracy is up to milliseconds.' + multivalued: false + range: isodatetime + required: true + timestamps_reference_time: + name: timestamps_reference_time + description: 'Date and time corresponding to time zero of all timestamps. + The date is stored in UTC with local timezone offset as ISO 8601 extended + formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end + in "Z" with no timezone offset. Date accuracy is up to milliseconds. All + times stored in the file use this time as reference (i.e., time zero).' + multivalued: false + range: isodatetime + required: true + acquisition: + name: acquisition + description: Data streams recorded from the system, including ephys, ophys, + tracking, etc. This group should be read-only after the experiment is completed + and timestamps are corrected to a common timebase. The data stored here + may be links to raw data stored in external NWB files. This will allow keeping + bulky raw data out of the file while preserving the option of keeping some/all + in the file. Acquired data includes tracking and experimental data streams + (i.e., everything measured from the system). If bulky data is stored in + the /acquisition group, the data can exist in a separate NWB file that is + linked to by the file being used for processing and analysis. + multivalued: true + any_of: + - range: NWBDataInterface + - range: DynamicTable + analysis: + name: analysis + description: Lab-specific and custom scientific analysis of data. There is + no defined format for the content of this group - the format is up to the + individual user/lab. To facilitate sharing analysis data between labs, the + contents here should be stored in standard types (e.g., neurodata_types) + and appropriately documented. The file can store lab-specific and custom + data analysis without restriction on its form or schema, reducing data formatting + restrictions on end users. Such data should be placed in the analysis group. + The analysis data should be documented so that it could be shared with other + labs. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + scratch: + name: scratch + description: A place to store one-off analysis results. Data placed here is + not intended for sharing. By placing data here, users acknowledge that there + is no guarantee that their data meets any standard. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + processing: + name: processing + description: The home for ProcessingModules. These modules perform intermediate + analysis of data that is necessary to perform before scientific analysis. + Examples include spike clustering, extracting position from tracking data, + stitching together image slices. ProcessingModules can be large and express + many data sets from relatively complex analysis (e.g., spike detection and + clustering) or small, representing extraction of position information from + tracking video, or even binary lick/no-lick decisions. Common software tools + (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' + refers to intermediate analysis of the acquired data to make it more amenable + to scientific analysis. + multivalued: true + any_of: + - range: ProcessingModule + stimulus: + name: stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment + complete and timestamps are corrected to common timebase. Stores both presented + stimuli and stimulus templates, the latter in case the same stimulus is + presented multiple times, or is pulled from an external stimulus library. + Stimuli are here defined as any signal that is pushed into the system as + part of the experiment (eg, sound, video, voltage, etc). Many different + experiments can use the same stimuli, and stimuli can be re-used during + an experiment. The stimulus group is organized so that one version of template + stimuli can be stored and these be used multiple times. These templates + can exist in the present file or can be linked to a remote library file. + multivalued: false + range: NWBFile__stimulus + required: true + general: + name: general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used + to describe the experiment. Metadata necessary for interpreting the data + is stored with the data. General experimental metadata, including animal + strain, experimental protocols, experimenter, devices, etc, are stored under + 'general'. Core metadata (e.g., that required to interpret data fields) + is stored with the data itself, and implicitly defined by the file specification + (e.g., time is in seconds). The strategy used here for storing non-core + metadata is to use free-form text fields, such as would appear in sentences + or paragraphs from a Methods section. Metadata fields are text to enable + them to be more general, for example to represent ranges instead of numerical + values. Machine-readable metadata is stored as attributes to these free-form + datasets. All entries in the below table are to be included when data is + present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) + should not be created unless there is data to store within them. + multivalued: false + range: NWBFile__general + required: true + intervals: + name: intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during + an experiment, or epochs (see epochs subgroup) deriving from analysis of + data. + multivalued: false + range: NWBFile__intervals + required: false + units: + name: units + description: Data about sorted spike units. + multivalued: false + range: Units + required: false + tree_root: true + NWBFile__stimulus: + name: NWBFile__stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment complete + and timestamps are corrected to common timebase. Stores both presented stimuli + and stimulus templates, the latter in case the same stimulus is presented multiple + times, or is pulled from an external stimulus library. Stimuli are here defined + as any signal that is pushed into the system as part of the experiment (eg, + sound, video, voltage, etc). Many different experiments can use the same stimuli, + and stimuli can be re-used during an experiment. The stimulus group is organized + so that one version of template stimuli can be stored and these be used multiple + times. These templates can exist in the present file or can be linked to a remote + library file. + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + presentation: + name: presentation + description: Stimuli presented during the experiment. + multivalued: true + any_of: + - range: TimeSeries + templates: + name: templates + description: Template stimuli. Timestamps in templates are based on stimulus + design and are relative to the beginning of the stimulus. When templates + are used, the stimulus instances must convert presentation times to the + experiment`s time reference frame. + multivalued: true + any_of: + - range: TimeSeries + - range: Images + NWBFile__general: + name: NWBFile__general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used to + describe the experiment. Metadata necessary for interpreting the data is stored + with the data. General experimental metadata, including animal strain, experimental + protocols, experimenter, devices, etc, are stored under 'general'. Core metadata + (e.g., that required to interpret data fields) is stored with the data itself, + and implicitly defined by the file specification (e.g., time is in seconds). + The strategy used here for storing non-core metadata is to use free-form text + fields, such as would appear in sentences or paragraphs from a Methods section. + Metadata fields are text to enable them to be more general, for example to represent + ranges instead of numerical values. Machine-readable metadata is stored as attributes + to these free-form datasets. All entries in the below table are to be included + when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology + experiment) should not be created unless there is data to store within them. + attributes: + name: + name: name + ifabsent: string(general) + range: string + required: true + equals_string: general + data_collection: + name: data_collection + description: Notes about data collection and analysis. + multivalued: false + range: text + required: false + experiment_description: + name: experiment_description + description: General description of the experiment. + multivalued: false + range: text + required: false + experimenter: + name: experimenter + description: Name of person(s) who performed the experiment. Can also specify + roles of different people involved. + multivalued: true + range: text + required: false + institution: + name: institution + description: Institution(s) where experiment was performed. + multivalued: false + range: text + required: false + keywords: + name: keywords + description: Terms to search over. + multivalued: true + range: text + required: false + lab: + name: lab + description: Laboratory where experiment was performed. + multivalued: false + range: text + required: false + notes: + name: notes + description: Notes about the experiment. + multivalued: false + range: text + required: false + pharmacology: + name: pharmacology + description: Description of drugs used, including how and when they were administered. + Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc. + multivalued: false + range: text + required: false + protocol: + name: protocol + description: Experimental protocol, if applicable. e.g., include IACUC protocol + number. + multivalued: false + range: text + required: false + related_publications: + name: related_publications + description: Publication information. PMID, DOI, URL, etc. + multivalued: true + range: text + required: false + session_id: + name: session_id + description: Lab-specific ID for the session. + multivalued: false + range: text + required: false + slices: + name: slices + description: Description of slices, including information about preparation + thickness, orientation, temperature, and bath solution. + multivalued: false + range: text + required: false + source_script: + name: source_script + description: Script file or link to public source code used to create this + NWB file. + multivalued: false + range: NWBFile__general__source_script + required: false + stimulus: + name: stimulus + description: Notes about stimuli, such as how and where they were presented. + multivalued: false + range: text + required: false + surgery: + name: surgery + description: Narrative description about surgery/surgeries, including date(s) + and who performed surgery. + multivalued: false + range: text + required: false + virus: + name: virus + description: Information about virus(es) used in experiments, including virus + ID, source, date made, injection location, volume, etc. + multivalued: false + range: text + required: false + lab_meta_data: + name: lab_meta_data + description: Place-holder than can be extended so that lab-specific meta-data + can be placed in /general. + multivalued: true + range: LabMetaData + required: false + devices: + name: devices + description: Description of hardware devices used during experiment, e.g., + monitors, ADC boards, microscopes, etc. + multivalued: true + any_of: + - range: Device + subject: + name: subject + description: Information about the animal or person from which the data was + measured. + multivalued: false + range: Subject + required: false + extracellular_ephys: + name: extracellular_ephys + description: Metadata related to extracellular electrophysiology. + multivalued: false + range: NWBFile__general__extracellular_ephys + required: false + intracellular_ephys: + name: intracellular_ephys + description: Metadata related to intracellular electrophysiology. + multivalued: false + range: NWBFile__general__intracellular_ephys + required: false + optogenetics: + name: optogenetics + description: Metadata describing optogenetic stimuluation. + multivalued: true + any_of: + - range: OptogeneticStimulusSite + optophysiology: + name: optophysiology + description: Metadata related to optophysiology. + multivalued: true + any_of: + - range: ImagingPlane + NWBFile__general__source_script: + name: NWBFile__general__source_script + description: Script file or link to public source code used to create this NWB + file. + attributes: + name: + name: name + ifabsent: string(source_script) + range: string + required: true + equals_string: source_script + file_name: + name: file_name + description: Name of script file. + range: text + value: + name: value + range: text + required: true + NWBFile__general__extracellular_ephys: + name: NWBFile__general__extracellular_ephys + description: Metadata related to extracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(extracellular_ephys) + range: string + required: true + equals_string: extracellular_ephys + electrode_group: + name: electrode_group + description: Physical group of electrodes. + multivalued: true + range: ElectrodeGroup + required: false + electrodes: + name: electrodes + description: A table of all electrodes (i.e. channels) used for recording. + multivalued: false + range: NWBFile__general__extracellular_ephys__electrodes + required: false + NWBFile__general__extracellular_ephys__electrodes: + name: NWBFile__general__extracellular_ephys__electrodes + description: A table of all electrodes (i.e. channels) used for recording. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + x: + name: x + description: x coordinate of the channel location in the brain (+x is posterior). + multivalued: true + range: float32 + y: + name: y + description: y coordinate of the channel location in the brain (+y is inferior). + multivalued: true + range: float32 + z: + name: z + description: z coordinate of the channel location in the brain (+z is right). + multivalued: true + range: float32 + imp: + name: imp + description: Impedance of the channel, in ohms. + multivalued: true + range: float32 + location: + name: location + description: Location of the electrode (channel). Specify the area, layer, + comments on estimation of area/layer, stereotaxic coordinates if in vivo, + etc. Use standard atlas names for anatomical regions when possible. + multivalued: true + range: text + filtering: + name: filtering + description: Description of hardware filtering, including the filter name + and frequency cutoffs. + multivalued: true + range: text + group: + name: group + description: Reference to the ElectrodeGroup this electrode is a part of. + multivalued: true + range: ElectrodeGroup + group_name: + name: group_name + description: Name of the ElectrodeGroup this electrode is a part of. + multivalued: true + range: text + rel_x: + name: rel_x + description: x coordinate in electrode group + multivalued: true + range: float32 + rel_y: + name: rel_y + description: y coordinate in electrode group + multivalued: true + range: float32 + rel_z: + name: rel_z + description: z coordinate in electrode group + multivalued: true + range: float32 + reference: + name: reference + description: Description of the reference electrode and/or reference scheme + used for this electrode, e.g., "stainless steel skull screw" or "online + common average referencing". + multivalued: true + range: text + NWBFile__general__intracellular_ephys: + name: NWBFile__general__intracellular_ephys + description: Metadata related to intracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(intracellular_ephys) + range: string + required: true + equals_string: intracellular_ephys + filtering: + name: filtering + description: '[DEPRECATED] Use IntracellularElectrode.filtering instead. Description + of filtering used. Includes filtering type and parameters, frequency fall-off, + etc. If this changes between TimeSeries, filter description should be stored + as a text attribute for each TimeSeries.' + multivalued: false + range: text + required: false + intracellular_electrode: + name: intracellular_electrode + description: An intracellular electrode. + multivalued: true + range: IntracellularElectrode + required: false + sweep_table: + name: sweep_table + description: '[DEPRECATED] Table used to group different PatchClampSeries. + SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable + tabels. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions + tables provide enhanced support for experiment metadata.' + multivalued: false + range: SweepTable + required: false + intracellular_recordings: + name: intracellular_recordings + description: A table to group together a stimulus and response from a single + electrode and a single simultaneous recording. Each row in the table represents + a single recording consisting typically of a stimulus and a corresponding + response. In some cases, however, only a stimulus or a response are recorded + as as part of an experiment. In this case both, the stimulus and response + will point to the same TimeSeries while the idx_start and count of the invalid + column will be set to -1, thus, indicating that no values have been recorded + for the stimulus or response, respectively. Note, a recording MUST contain + at least a stimulus or a response. Typically the stimulus and response are + PatchClampSeries. However, the use of AD/DA channels that are not associated + to an electrode is also common in intracellular electrophysiology, in which + case other TimeSeries may be used. + multivalued: false + range: IntracellularRecordingsTable + required: false + simultaneous_recordings: + name: simultaneous_recordings + description: A table for grouping different intracellular recordings from + the IntracellularRecordingsTable table together that were recorded simultaneously + from different electrodes + multivalued: false + range: SimultaneousRecordingsTable + required: false + sequential_recordings: + name: sequential_recordings + description: A table for grouping different sequential recordings from the + SimultaneousRecordingsTable table together. This is typically used to group + together sequential recordings where the a sequence of stimuli of the same + type with varying parameters have been presented in a sequence. + multivalued: false + range: SequentialRecordingsTable + required: false + repetitions: + name: repetitions + description: A table for grouping different sequential intracellular recordings + together. With each SequentialRecording typically representing a particular + type of stimulus, the RepetitionsTable table is typically used to group + sets of stimuli applied in sequence. + multivalued: false + range: RepetitionsTable + required: false + experimental_conditions: + name: experimental_conditions + description: A table for grouping different intracellular recording repetitions + together that belong to the same experimental experimental_conditions. + multivalued: false + range: ExperimentalConditionsTable + required: false + NWBFile__intervals: + name: NWBFile__intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during an + experiment, or epochs (see epochs subgroup) deriving from analysis of data. + attributes: + name: + name: name + ifabsent: string(intervals) + range: string + required: true + equals_string: intervals + epochs: + name: epochs + description: Divisions in time marking experimental stages or sub-divisions + of a single recording session. + multivalued: false + range: TimeIntervals + required: false + trials: + name: trials + description: Repeated experimental events that have a logical grouping. + multivalued: false + range: TimeIntervals + required: false + invalid_times: + name: invalid_times + description: Time intervals that should be removed from analysis. + multivalued: false + range: TimeIntervals + required: false + time_intervals: + name: time_intervals + description: Optional additional table(s) for describing other experimental + time intervals. + multivalued: true + range: TimeIntervals + required: false + LabMetaData: + name: LabMetaData + description: Lab-specific meta-data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + Subject: + name: Subject + description: Information about the animal or person from which the data was measured. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + age: + name: age + description: Age of subject. Can be supplied instead of 'date_of_birth'. + multivalued: false + range: text + required: false + date_of_birth: + name: date_of_birth + description: Date of birth of subject. Can be supplied instead of 'age'. + multivalued: false + range: isodatetime + required: false + description: + name: description + description: Description of subject and where subject came from (e.g., breeder, + if animal). + multivalued: false + range: text + required: false + genotype: + name: genotype + description: Genetic strain. If absent, assume Wild Type (WT). + multivalued: false + range: text + required: false + sex: + name: sex + description: Gender of subject. + multivalued: false + range: text + required: false + species: + name: species + description: Species of subject. + multivalued: false + range: text + required: false + strain: + name: strain + description: Strain of subject. + multivalued: false + range: text + required: false + subject_id: + name: subject_id + description: ID of animal/person used/participating in experiment (lab convention). + multivalued: false + range: text + required: false + weight: + name: weight + description: Weight at time of experiment, at time of surgery and at other + important times. + multivalued: false + range: text + required: false + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.icephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.icephys.yaml similarity index 99% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.icephys.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.icephys.yaml index a8a467d..c7068f5 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.icephys.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.icephys.yaml @@ -1,10 +1,11 @@ name: core.nwb.icephys id: core.nwb.icephys +version: 2.5.0 imports: - core.nwb.base - core.nwb.device -- hdmf-common.table -- nwb.language +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.language default_prefix: core.nwb.icephys/ classes: PatchClampSeries: diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.image.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.image.yaml similarity index 99% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.image.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.image.yaml index 7fced1d..7f45178 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.image.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.image.yaml @@ -1,9 +1,10 @@ name: core.nwb.image id: core.nwb.image +version: 2.5.0 imports: - core.nwb.base - core.nwb.device -- nwb.language +- core.nwb.language default_prefix: core.nwb.image/ classes: GrayscaleImage: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.language.yaml new file mode 100644 index 0000000..c57e91f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.language.yaml @@ -0,0 +1,148 @@ +name: core.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.misc.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.misc.yaml new file mode 100644 index 0000000..8bbb17c --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.misc.yaml @@ -0,0 +1,532 @@ +name: core.nwb.misc +id: core.nwb.misc +version: 2.5.0 +imports: +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.ecephys +- core.nwb.language +default_prefix: core.nwb.misc/ +classes: + AbstractFeatureSeries: + name: AbstractFeatureSeries + description: Abstract features, such as quantitative descriptions of sensory stimuli. + The TimeSeries::data field is a 2D array, storing those features (e.g., for + visual grating stimulus this might be orientation, spatial frequency and contrast). + Null stimuli (eg, uniform gray) can be marked as being an independent feature + (eg, 1.0 for gray, 0.0 for actual stimulus) or by storing NaNs for feature values, + or through use of the TimeSeries::control fields. A set of features is considered + to persist until the next set of features is defined. The final set of features + stored should be the null set. This is useful when storing the raw stimulus + is impractical. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Values of each feature at each time. + multivalued: false + range: AbstractFeatureSeries__data + required: true + feature_units: + name: feature_units + description: Units of each feature. + multivalued: true + range: text + required: false + features: + name: features + description: Description of the features represented in TimeSeries::data. + multivalued: true + range: text + required: true + tree_root: true + AbstractFeatureSeries__data: + name: AbstractFeatureSeries__data + description: Values of each feature at each time. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Since there can be different units for different features, store + the units in 'feature_units'. The default value for this attribute is "see + 'feature_units'". + range: text + array: + name: array + range: AbstractFeatureSeries__data__Array + AbstractFeatureSeries__data__Array: + name: AbstractFeatureSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_features: + name: num_features + range: numeric + required: false + AnnotationSeries: + name: AnnotationSeries + description: Stores user annotations made during an experiment. The data[] field + stores a text array, and timestamps are stored for each annotation (ie, interval=1). + This is largely an alias to a standard TimeSeries storing a text array but that + is identifiable as storing annotations in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Annotations made during an experiment. + multivalued: true + range: text + required: true + tree_root: true + IntervalSeries: + name: IntervalSeries + description: Stores intervals of data. The timestamps field stores the beginning + and end of intervals. The data field stores whether the interval just started + (>0 value) or ended (<0 value). Different interval types can be represented + in the same series by using multiple key values (eg, 1 for feature A, 2 for + feature B, 3 for feature C, etc). The field data stores an 8-bit integer. This + is largely an alias of a standard TimeSeries but that is identifiable as representing + time intervals in a machine-readable way. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Use values >0 if interval started, <0 if interval ended. + multivalued: true + range: int8 + required: true + tree_root: true + DecompositionSeries: + name: DecompositionSeries + description: Spectral analysis of a time series, e.g. of an LFP or a speech signal. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Data decomposed into frequency bands. + multivalued: false + range: DecompositionSeries__data + required: true + metric: + name: metric + description: The metric used, e.g. phase, amplitude, power. + multivalued: false + range: text + required: true + source_channels: + name: source_channels + description: DynamicTableRegion pointer to the channels that this decomposition + series was generated from. + multivalued: false + range: DecompositionSeries__source_channels + required: false + bands: + name: bands + description: Table for describing the bands that this series was generated + from. There should be one row in this table for each band. + multivalued: false + range: DecompositionSeries__bands + required: true + tree_root: true + DecompositionSeries__data: + name: DecompositionSeries__data + description: Data decomposed into frequency bands. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion'. + range: text + array: + name: array + range: DecompositionSeries__data__Array + DecompositionSeries__data__Array: + name: DecompositionSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: true + num_bands: + name: num_bands + range: numeric + required: true + DecompositionSeries__source_channels: + name: DecompositionSeries__source_channels + description: DynamicTableRegion pointer to the channels that this decomposition + series was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(source_channels) + range: string + required: true + equals_string: source_channels + DecompositionSeries__bands: + name: DecompositionSeries__bands + description: Table for describing the bands that this series was generated from. + There should be one row in this table for each band. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(bands) + range: string + required: true + equals_string: bands + band_name: + name: band_name + description: Name of the band, e.g. theta. + multivalued: true + range: text + band_limits: + name: band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + multivalued: false + range: DecompositionSeries__bands__band_limits + required: true + band_mean: + name: band_mean + description: The mean Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + band_stdev: + name: band_stdev + description: The standard deviation of Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + DecompositionSeries__bands__band_limits: + name: DecompositionSeries__bands__band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(band_limits) + range: string + required: true + equals_string: band_limits + Units: + name: Units + description: Data about spiking units. Event times of observed units (e.g. cell, + synapse, etc.) should be concatenated and stored in spike_times. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + spike_times_index: + name: spike_times_index + description: Index into the spike_times dataset. + multivalued: false + range: Units__spike_times_index + required: false + spike_times: + name: spike_times + description: Spike times for each unit. + multivalued: false + range: Units__spike_times + required: false + obs_intervals_index: + name: obs_intervals_index + description: Index into the obs_intervals dataset. + multivalued: false + range: Units__obs_intervals_index + required: false + obs_intervals: + name: obs_intervals + description: Observation intervals for each unit. + multivalued: false + range: Units__obs_intervals + required: false + electrodes_index: + name: electrodes_index + description: Index into electrodes. + multivalued: false + range: Units__electrodes_index + required: false + electrodes: + name: electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + multivalued: false + range: Units__electrodes + required: false + electrode_group: + name: electrode_group + description: Electrode group that each spike unit came from. + multivalued: true + range: ElectrodeGroup + waveform_mean: + name: waveform_mean + description: Spike waveform mean for each spike unit. + multivalued: false + range: Units__waveform_mean + required: false + waveform_sd: + name: waveform_sd + description: Spike waveform standard deviation for each spike unit. + multivalued: false + range: Units__waveform_sd + required: false + waveforms: + name: waveforms + description: Individual waveforms for each spike on each electrode. This is + a doubly indexed column. The 'waveforms_index' column indexes which waveforms + in this column belong to the same spike event for a given unit, where each + waveform was recorded from a different electrode. The 'waveforms_index_index' + column indexes the 'waveforms_index' column to indicate which spike events + belong to a given unit. For example, if the 'waveforms_index_index' column + has values [2, 5, 6], then the first 2 elements of the 'waveforms_index' + column correspond to the 2 spike events of the first unit, the next 3 elements + of the 'waveforms_index' column correspond to the 3 spike events of the + second unit, and the next 1 element of the 'waveforms_index' column corresponds + to the 1 spike event of the third unit. If the 'waveforms_index' column + has values [3, 6, 8, 10, 12, 13], then the first 3 elements of the 'waveforms' + column contain the 3 spike waveforms that were recorded from 3 different + electrodes for the first spike time of the first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays + for a graphical representation of this example. When there is only one electrode + for each unit (i.e., each spike time is associated with a single waveform), + then the 'waveforms_index' column will have values 1, 2, ..., N, where N + is the number of spike events. The number of electrodes for each spike event + should be the same within a given unit. The 'electrodes' column should be + used to indicate which electrodes are associated with each unit, and the + order of the waveforms within a given unit x spike event should be in the + same order as the electrodes referenced in the 'electrodes' column of this + table. The number of samples for each waveform must be the same. + multivalued: false + range: Units__waveforms + required: false + waveforms_index: + name: waveforms_index + description: Index into the waveforms dataset. One value for every spike event. + See 'waveforms' for more detail. + multivalued: false + range: Units__waveforms_index + required: false + waveforms_index_index: + name: waveforms_index_index + description: Index into the waveforms_index dataset. One value for every unit + (row in the table). See 'waveforms' for more detail. + multivalued: false + range: Units__waveforms_index_index + required: false + tree_root: true + Units__spike_times_index: + name: Units__spike_times_index + description: Index into the spike_times dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(spike_times_index) + range: string + required: true + equals_string: spike_times_index + Units__spike_times: + name: Units__spike_times + description: Spike times for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(spike_times) + range: string + required: true + equals_string: spike_times + resolution: + name: resolution + description: The smallest possible difference between two spike times. Usually + 1 divided by the acquisition sampling rate from which spike times were extracted, + but could be larger if the acquisition time series was downsampled or smaller + if the acquisition time series was smoothed/interpolated and it is possible + for the spike time to be between samples. + range: float64 + Units__obs_intervals_index: + name: Units__obs_intervals_index + description: Index into the obs_intervals dataset. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(obs_intervals_index) + range: string + required: true + equals_string: obs_intervals_index + Units__obs_intervals: + name: Units__obs_intervals + description: Observation intervals for each unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(obs_intervals) + range: string + required: true + equals_string: obs_intervals + Units__electrodes_index: + name: Units__electrodes_index + description: Index into electrodes. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(electrodes_index) + range: string + required: true + equals_string: electrodes_index + Units__electrodes: + name: Units__electrodes + description: Electrode that each spike unit came from, specified using a DynamicTableRegion. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + Units__waveform_mean: + name: Units__waveform_mean + description: Spike waveform mean for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveform_sd: + name: Units__waveform_sd + description: Spike waveform standard deviation for each spike unit. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveforms: + name: Units__waveforms + description: Individual waveforms for each spike on each electrode. This is a + doubly indexed column. The 'waveforms_index' column indexes which waveforms + in this column belong to the same spike event for a given unit, where each waveform + was recorded from a different electrode. The 'waveforms_index_index' column + indexes the 'waveforms_index' column to indicate which spike events belong to + a given unit. For example, if the 'waveforms_index_index' column has values + [2, 5, 6], then the first 2 elements of the 'waveforms_index' column correspond + to the 2 spike events of the first unit, the next 3 elements of the 'waveforms_index' + column correspond to the 3 spike events of the second unit, and the next 1 element + of the 'waveforms_index' column corresponds to the 1 spike event of the third + unit. If the 'waveforms_index' column has values [3, 6, 8, 10, 12, 13], then + the first 3 elements of the 'waveforms' column contain the 3 spike waveforms + that were recorded from 3 different electrodes for the first spike time of the + first unit. See https://nwb-schema.readthedocs.io/en/stable/format_description.html#doubly-ragged-arrays + for a graphical representation of this example. When there is only one electrode + for each unit (i.e., each spike time is associated with a single waveform), + then the 'waveforms_index' column will have values 1, 2, ..., N, where N is + the number of spike events. The number of electrodes for each spike event should + be the same within a given unit. The 'electrodes' column should be used to indicate + which electrodes are associated with each unit, and the order of the waveforms + within a given unit x spike event should be in the same order as the electrodes + referenced in the 'electrodes' column of this table. The number of samples for + each waveform must be the same. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(waveforms) + range: string + required: true + equals_string: waveforms + sampling_rate: + name: sampling_rate + description: Sampling rate, in hertz. + range: float32 + unit: + name: unit + description: Unit of measurement. This value is fixed to 'volts'. + range: text + Units__waveforms_index: + name: Units__waveforms_index + description: Index into the waveforms dataset. One value for every spike event. + See 'waveforms' for more detail. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(waveforms_index) + range: string + required: true + equals_string: waveforms_index + Units__waveforms_index_index: + name: Units__waveforms_index_index + description: Index into the waveforms_index dataset. One value for every unit + (row in the table). See 'waveforms' for more detail. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(waveforms_index_index) + range: string + required: true + equals_string: waveforms_index_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.ogen.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.ogen.yaml new file mode 100644 index 0000000..eea23f7 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.ogen.yaml @@ -0,0 +1,55 @@ +name: core.nwb.ogen +id: core.nwb.ogen +version: 2.5.0 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ogen/ +classes: + OptogeneticSeries: + name: OptogeneticSeries + description: An optogenetic stimulus. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Applied power for optogenetic stimulus, in watts. + multivalued: true + range: numeric + required: true + tree_root: true + OptogeneticStimulusSite: + name: OptogeneticStimulusSite + description: A site of optogenetic stimulation. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of stimulation site. + multivalued: false + range: text + required: true + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + location: + name: location + description: Location of the stimulation site. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.ophys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.ophys.yaml new file mode 100644 index 0000000..b74041f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.ophys.yaml @@ -0,0 +1,550 @@ +name: core.nwb.ophys +id: core.nwb.ophys +version: 2.5.0 +imports: +- core.nwb.image +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ophys/ +classes: + TwoPhotonSeries: + name: TwoPhotonSeries + description: Image stack recorded over time from 2-photon microscope. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + pmt_gain: + name: pmt_gain + description: Photomultiplier gain. + range: float32 + scan_line_rate: + name: scan_line_rate + description: Lines imaged per second. This is also stored in /general/optophysiology + but is kept here as it is useful information for analysis, and so good to + be stored w/ the actual data. + range: float32 + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: TwoPhotonSeries__field_of_view + required: false + tree_root: true + TwoPhotonSeries__field_of_view: + name: TwoPhotonSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: TwoPhotonSeries__field_of_view__Array + TwoPhotonSeries__field_of_view__Array: + name: TwoPhotonSeries__field_of_view__Array + is_a: Arraylike + attributes: + width|height: + name: width|height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width|height|depth: + name: width|height|depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + RoiResponseSeries: + name: RoiResponseSeries + description: ROI responses over an imaging plane. The first dimension represents + time. The second dimension, if present, represents ROIs. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Signals from ROIs. + multivalued: false + range: RoiResponseSeries__data + required: true + rois: + name: rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + multivalued: false + range: RoiResponseSeries__rois + required: true + tree_root: true + RoiResponseSeries__data: + name: RoiResponseSeries__data + description: Signals from ROIs. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: RoiResponseSeries__data__Array + RoiResponseSeries__data__Array: + name: RoiResponseSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_ROIs: + name: num_ROIs + range: numeric + required: false + RoiResponseSeries__rois: + name: RoiResponseSeries__rois + description: DynamicTableRegion referencing into an ROITable containing information + on the ROIs stored in this timeseries. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(rois) + range: string + required: true + equals_string: rois + DfOverF: + name: DfOverF + description: dF/F information about a region of interest (ROI). Storage hierarchy + of dF/F should be the same as for segmentation (i.e., same names for ROIs and + for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing dF/F for a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + Fluorescence: + name: Fluorescence + description: Fluorescence information about a region of interest (ROI). Storage + hierarchy of fluorescence should be the same as for segmentation (ie, same names + for ROIs and for image planes). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + roi_response_series: + name: roi_response_series + description: RoiResponseSeries object(s) containing fluorescence data for + a ROI. + multivalued: true + range: RoiResponseSeries + required: true + tree_root: true + ImageSegmentation: + name: ImageSegmentation + description: Stores pixels in an image that represent different regions of interest + (ROIs) or masks. All segmentation for a given imaging plane is stored together, + with storage for multiple imaging planes (masks) supported. Each ROI is stored + in its own subgroup, with the ROI group containing both a 2D mask and a list + of pixels that make up this mask. Segments can also be used for masking neuropil. + If segmentation is allowed to change with time, a new imaging plane (or module) + is required and ROI names should remain consistent between them. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + plane_segmentation: + name: plane_segmentation + description: Results from image segmentation of a specific imaging plane. + multivalued: true + range: PlaneSegmentation + required: true + tree_root: true + PlaneSegmentation: + name: PlaneSegmentation + description: Results from image segmentation of a specific imaging plane. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + image_mask: + name: image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + multivalued: false + range: PlaneSegmentation__image_mask + required: false + pixel_mask_index: + name: pixel_mask_index + description: Index into pixel_mask. + multivalued: false + range: PlaneSegmentation__pixel_mask_index + required: false + pixel_mask: + name: pixel_mask + description: 'Pixel masks for each ROI: a list of indices and weights for + the ROI. Pixel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + voxel_mask_index: + name: voxel_mask_index + description: Index into voxel_mask. + multivalued: false + range: PlaneSegmentation__voxel_mask_index + required: false + voxel_mask: + name: voxel_mask + description: 'Voxel masks for each ROI: a list of indices and weights for + the ROI. Voxel masks are concatenated and parsing of this dataset is maintained + by the PlaneSegmentation' + multivalued: true + range: AnyType + reference_images: + name: reference_images + description: Image stacks that the segmentation masks apply to. + multivalued: true + any_of: + - range: ImageSeries + tree_root: true + PlaneSegmentation__image_mask: + name: PlaneSegmentation__image_mask + description: ROI masks for each ROI. Each image mask is the size of the original + imaging plane (or volume) and members of the ROI are finite non-zero. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(image_mask) + range: string + required: true + equals_string: image_mask + PlaneSegmentation__pixel_mask_index: + name: PlaneSegmentation__pixel_mask_index + description: Index into pixel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(pixel_mask_index) + range: string + required: true + equals_string: pixel_mask_index + PlaneSegmentation__voxel_mask_index: + name: PlaneSegmentation__voxel_mask_index + description: Index into voxel_mask. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(voxel_mask_index) + range: string + required: true + equals_string: voxel_mask_index + ImagingPlane: + name: ImagingPlane + description: An imaging plane and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the imaging plane. + multivalued: false + range: text + required: false + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + imaging_rate: + name: imaging_rate + description: Rate that images are acquired, in Hz. If the corresponding TimeSeries + is present, the rate should be stored there instead. + multivalued: false + range: float32 + required: false + indicator: + name: indicator + description: Calcium indicator. + multivalued: false + range: text + required: true + location: + name: location + description: Location of the imaging plane. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + manifold: + name: manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents + the position of the pixel relative to the defined coordinate space. Deprecated + in favor of origin_coords and grid_spacing. + multivalued: false + range: ImagingPlane__manifold + required: false + origin_coords: + name: origin_coords + description: Physical location of the first element of the imaging plane (0, + 0) for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for + what the physical location is relative to (e.g., bregma). + multivalued: false + range: ImagingPlane__origin_coords + required: false + grid_spacing: + name: grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also + reference_frame to interpret the grid. + multivalued: false + range: ImagingPlane__grid_spacing + required: false + reference_frame: + name: reference_frame + description: Describes reference frame of origin_coords and grid_spacing. + For example, this can be a text description of the anatomical location and + orientation of the grid defined by origin_coords and grid_spacing or the + vectors needed to transform or rotate the grid to a common anatomical axis + (e.g., AP/DV/ML). This field is necessary to interpret origin_coords and + grid_spacing. If origin_coords and grid_spacing are not present, then this + field is not required. For example, if the microscope takes 10 x 10 x 2 + images, where the first value of the data matrix (index (0, 0, 0)) corresponds + to (-1.2, -0.6, -2) mm relative to bregma, the spacing between pixels is + 0.2 mm in x, 0.2 mm in y and 0.5 mm in z, and larger numbers in x means + more anterior, larger numbers in y means more rightward, and larger numbers + in z means more ventral, then enter the following -- origin_coords = (-1.2, + -0.6, -2) grid_spacing = (0.2, 0.2, 0.5) reference_frame = "Origin coordinates + are relative to bregma. First dimension corresponds to anterior-posterior + axis (larger index = more anterior). Second dimension corresponds to medial-lateral + axis (larger index = more rightward). Third dimension corresponds to dorsal-ventral + axis (larger index = more ventral)." + multivalued: false + range: text + required: false + optical_channel: + name: optical_channel + description: An optical channel used to record from an imaging plane. + multivalued: true + range: OpticalChannel + required: true + tree_root: true + ImagingPlane__manifold: + name: ImagingPlane__manifold + description: DEPRECATED Physical position of each pixel. 'xyz' represents the + position of the pixel relative to the defined coordinate space. Deprecated in + favor of origin_coords and grid_spacing. + attributes: + name: + name: name + ifabsent: string(manifold) + range: string + required: true + equals_string: manifold + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as pixels from + x = -500 to 499, y = -500 to 499 that correspond to a 2 m x 2 m range, then + the 'conversion' multiplier to get from raw data acquisition pixel units + to meters is 2/1000. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__manifold__Array + ImagingPlane__manifold__Array: + name: ImagingPlane__manifold__Array + is_a: Arraylike + attributes: + height: + name: height + range: float32 + required: true + width: + name: width + range: float32 + required: true + x, y, z: + name: x, y, z + range: float32 + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + depth: + name: depth + range: float32 + required: false + ImagingPlane__origin_coords: + name: ImagingPlane__origin_coords + description: Physical location of the first element of the imaging plane (0, 0) + for 2-D data or (0, 0, 0) for 3-D data. See also reference_frame for what the + physical location is relative to (e.g., bregma). + attributes: + name: + name: name + ifabsent: string(origin_coords) + range: string + required: true + equals_string: origin_coords + unit: + name: unit + description: Measurement units for origin_coords. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__origin_coords__Array + ImagingPlane__origin_coords__Array: + name: ImagingPlane__origin_coords__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + ImagingPlane__grid_spacing: + name: ImagingPlane__grid_spacing + description: Space between pixels in (x, y) or voxels in (x, y, z) directions, + in the specified unit. Assumes imaging plane is a regular grid. See also reference_frame + to interpret the grid. + attributes: + name: + name: name + ifabsent: string(grid_spacing) + range: string + required: true + equals_string: grid_spacing + unit: + name: unit + description: Measurement units for grid_spacing. The default value is 'meters'. + range: text + array: + name: array + range: ImagingPlane__grid_spacing__Array + ImagingPlane__grid_spacing__Array: + name: ImagingPlane__grid_spacing__Array + is_a: Arraylike + attributes: + x, y: + name: x, y + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + x, y, z: + name: x, y, z + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalChannel: + name: OpticalChannel + description: An optical channel used to record from an imaging plane. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description or other notes about the channel. + multivalued: false + range: text + required: true + emission_lambda: + name: emission_lambda + description: Emission wavelength for channel, in nm. + multivalued: false + range: float32 + required: true + tree_root: true + MotionCorrection: + name: MotionCorrection + description: 'An image stack where all frames are shifted (registered) to a common + coordinate system, to account for movement and drift between frames. Note: each + frame at each point in time is assumed to be 2-D (has only x & y dimensions).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected_image_stack: + name: corrected_image_stack + description: Reuslts from motion correction of an image stack. + multivalued: true + range: CorrectedImageStack + required: true + tree_root: true + CorrectedImageStack: + name: CorrectedImageStack + description: Reuslts from motion correction of an image stack. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + corrected: + name: corrected + description: Image stack with frames shifted to the common coordinates. + multivalued: false + range: ImageSeries + required: true + xy_translation: + name: xy_translation + description: Stores the x,y delta necessary to align each frame to the common + coordinates, for example, to align each frame to a reference image. + multivalued: false + range: TimeSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.retinotopy.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.retinotopy.yaml new file mode 100644 index 0000000..25ea251 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/core.nwb.retinotopy.yaml @@ -0,0 +1,362 @@ +name: core.nwb.retinotopy +id: core.nwb.retinotopy +version: 2.5.0 +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.retinotopy/ +classes: + ImagingRetinotopy: + name: ImagingRetinotopy + description: 'Intrinsic signal optical imaging or widefield imaging for measuring + retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of + responses to specific stimuli and a combined polarity map from which to identify + visual areas. This group does not store the raw responses imaged during retinotopic + mapping or the stimuli presented, but rather the resulting phase and power maps + after applying a Fourier transform on the averaged responses. Note: for data + consistency, all images and arrays are stored in the format [row][column] and + [row, col], which equates to [y][x]. Field of view and dimension arrays may + appear backward (i.e., y before x).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + axis_1_phase_map: + name: axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + multivalued: false + range: ImagingRetinotopy__axis_1_phase_map + required: true + axis_1_power_map: + name: axis_1_power_map + description: Power response on the first measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_1_power_map + required: false + axis_2_phase_map: + name: axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_phase_map + required: true + axis_2_power_map: + name: axis_2_power_map + description: Power response on the second measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_2_power_map + required: false + axis_descriptions: + name: axis_descriptions + description: Two-element array describing the contents of the two response + axis fields. Description should be something like ['altitude', 'azimuth'] + or '['radius', 'theta']. + multivalued: true + range: text + required: true + focal_depth_image: + name: focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., + focal depth, wavelength) as data collection. Array format: [rows][columns].' + multivalued: false + range: ImagingRetinotopy__focal_depth_image + required: false + sign_map: + name: sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + multivalued: false + range: ImagingRetinotopy__sign_map + required: false + vasculature_image: + name: vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + multivalued: false + range: ImagingRetinotopy__vasculature_image + required: true + tree_root: true + ImagingRetinotopy__axis_1_phase_map: + name: ImagingRetinotopy__axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + attributes: + name: + name: name + ifabsent: string(axis_1_phase_map) + range: string + required: true + equals_string: axis_1_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_phase_map__Array + ImagingRetinotopy__axis_1_phase_map__Array: + name: ImagingRetinotopy__axis_1_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_1_power_map: + name: ImagingRetinotopy__axis_1_power_map + description: Power response on the first measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_1_power_map) + range: string + required: true + equals_string: axis_1_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_power_map__Array + ImagingRetinotopy__axis_1_power_map__Array: + name: ImagingRetinotopy__axis_1_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_phase_map: + name: ImagingRetinotopy__axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + attributes: + name: + name: name + ifabsent: string(axis_2_phase_map) + range: string + required: true + equals_string: axis_2_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_phase_map__Array + ImagingRetinotopy__axis_2_phase_map__Array: + name: ImagingRetinotopy__axis_2_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_power_map: + name: ImagingRetinotopy__axis_2_power_map + description: Power response on the second measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_2_power_map) + range: string + required: true + equals_string: axis_2_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_power_map__Array + ImagingRetinotopy__axis_2_power_map__Array: + name: ImagingRetinotopy__axis_2_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__focal_depth_image: + name: ImagingRetinotopy__focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., focal + depth, wavelength) as data collection. Array format: [rows][columns].' + attributes: + name: + name: name + ifabsent: string(focal_depth_image) + range: string + required: true + equals_string: focal_depth_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value. + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + focal_depth: + name: focal_depth + description: Focal depth offset, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__focal_depth_image__Array + ImagingRetinotopy__focal_depth_image__Array: + name: ImagingRetinotopy__focal_depth_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true + ImagingRetinotopy__sign_map: + name: ImagingRetinotopy__sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + attributes: + name: + name: name + ifabsent: string(sign_map) + range: string + required: true + equals_string: sign_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + array: + name: array + range: ImagingRetinotopy__sign_map__Array + ImagingRetinotopy__sign_map__Array: + name: ImagingRetinotopy__sign_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__vasculature_image: + name: ImagingRetinotopy__vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + attributes: + name: + name: name + ifabsent: string(vasculature_image) + range: string + required: true + equals_string: vasculature_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__vasculature_image__Array + ImagingRetinotopy__vasculature_image__Array: + name: ImagingRetinotopy__vasculature_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/namespace.yaml new file mode 100644 index 0000000..e7d33bd --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_5_0/namespace.yaml @@ -0,0 +1,25 @@ +name: core +annotations: + namespace: + tag: namespace + value: 'True' +description: NWB namespace +id: core +version: 2.5.0 +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.epoch +- core.nwb.image +- core.nwb.file +- core.nwb.misc +- core.nwb.behavior +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.retinotopy +- core.nwb.language +- ../../hdmf_common/v1_5_0/namespace +- ../../hdmf_experimental/v0_1_0/namespace +default_prefix: core/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.base.yaml new file mode 100644 index 0000000..1a09d50 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.base.yaml @@ -0,0 +1,381 @@ +name: core.nwb.base +id: core.nwb.base +version: 2.6.0-alpha +imports: +- ../../hdmf_common/v1_5_0/namespace +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.language +default_prefix: core.nwb.base/ +classes: + NWBData: + name: NWBData + description: An abstract data type for a dataset. + is_a: Data + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeriesReferenceVectorData: + name: TimeSeriesReferenceVectorData + description: Column storing references to a TimeSeries (rows). For each TimeSeries + this VectorData column stores the start_index and count to indicate the range + in time to be selected as well as an object reference to the TimeSeries. + is_a: VectorData + attributes: + name: + name: name + range: string + required: true + tree_root: true + Image: + name: Image + description: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D + where the third dimension can have three or four elements, e.g. (x, y, (r, g, + b)) or (x, y, (r, g, b, a)). + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + resolution: + name: resolution + description: Pixel resolution of the image, in pixels per centimeter. + range: float32 + description: + name: description + description: Description of the image. + range: text + array: + name: array + range: Image__Array + tree_root: true + Image__Array: + name: Image__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + r, g, b, a: + name: r, g, b, a + range: numeric + required: false + minimum_cardinality: 4 + maximum_cardinality: 4 + ImageReferences: + name: ImageReferences + description: Ordered dataset of references to Image objects. + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: ImageReferences__Array + tree_root: true + ImageReferences__Array: + name: ImageReferences__Array + is_a: Arraylike + attributes: + num_images: + name: num_images + range: Image + required: true + NWBContainer: + name: NWBContainer + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + is_a: Container + attributes: + name: + name: name + range: string + required: true + tree_root: true + NWBDataInterface: + name: NWBDataInterface + description: An abstract data type for a generic container storing collections + of data, as opposed to metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + TimeSeries: + name: TimeSeries + description: General purpose time series. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the time series. + range: text + comments: + name: comments + description: Human-readable comments about the TimeSeries. This second descriptive + field can be used to store additional information, or descriptive information + if the primary description field is populated with a computer-readable string. + range: text + data: + name: data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first + dimension should always represent time. This can also be used to store binary + data (e.g., image frames). This can also be a link to data stored in an + external file. + multivalued: false + range: TimeSeries__data + required: true + starting_time: + name: starting_time + description: Timestamp of the first sample in seconds. When timestamps are + uniformly spaced, the timestamp of the first sample can be specified and + all subsequent ones calculated from the sampling rate attribute. + multivalued: false + range: TimeSeries__starting_time + required: false + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + multivalued: true + range: float64 + required: false + control: + name: control + description: Numerical labels that apply to each time point in data for the + purpose of querying and slicing data by these values. If present, the length + of this array should be the same size as the first dimension of data. + multivalued: true + range: uint8 + required: false + control_description: + name: control_description + description: Description of each control value. Must be present if control + is present. If present, control_description[0] should describe time points + where control == 0. + multivalued: true + range: text + required: false + sync: + name: sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored + external to the NWB file, in files storing raw data. Once timestamp data + is calculated, the contents of 'sync' are mostly for archival purposes. + multivalued: false + range: TimeSeries__sync + required: false + tree_root: true + TimeSeries__data: + name: TimeSeries__data + description: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension + should always represent time. This can also be used to store binary data (e.g., + image frames). This can also be a link to data stored in an external file. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + conversion: + name: conversion + description: Scalar to multiply each element in data to convert it to the + specified 'unit'. If the data are stored in acquisition system units or + other units that require a conversion to be interpretable, multiply the + data by 'conversion' to convert the data to the specified 'unit'. e.g. if + the data acquisition system stores values in this object as signed 16-bit + integers (int16 range -32,768 to 32,767) that correspond to a 5V range (-2.5V + to 2.5V), and the data acquisition system gain is 8000X, then the 'conversion' + multiplier to get from raw data acquisition values to recorded volts is + 2.5/32768/8000 = 9.5367e-9. + range: float32 + offset: + name: offset + description: Scalar to add to the data after scaling by 'conversion' to finalize + its coercion to the specified 'unit'. Two common examples of this include + (a) data stored in an unsigned type that requires a shift after scaling + to re-center the data, and (b) specialized recording devices that naturally + cause a scalar offset with respect to the true units. + range: float32 + resolution: + name: resolution + description: Smallest meaningful difference between values in data, stored + in the specified by unit, e.g., the change in value of the least significant + bit, or a larger number if signal noise is known to be present. If unknown, + use -1.0. + range: float32 + unit: + name: unit + description: Base unit of measurement for working with the data. Actual stored + values are not necessarily stored in these units. To access the data in + these units, multiply 'data' by 'conversion' and add 'offset'. + range: text + continuity: + name: continuity + description: Optionally describe the continuity of the data. Can be "continuous", + "instantaneous", or "step". For example, a voltage trace would be "continuous", + because samples are recorded from a continuous process. An array of lick + times would be "instantaneous", because the data represents distinct moments + in time. Times of image presentations would be "step" because the picture + remains the same until the next timepoint. This field is optional, but is + useful in providing information about the underlying data. It may inform + the way this data is interpreted, the way it is visualized, and what analysis + methods are applicable. + range: text + array: + name: array + range: TimeSeries__data__Array + TimeSeries__data__Array: + name: TimeSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: AnyType + required: true + num_DIM2: + name: num_DIM2 + range: AnyType + required: false + num_DIM3: + name: num_DIM3 + range: AnyType + required: false + num_DIM4: + name: num_DIM4 + range: AnyType + required: false + TimeSeries__starting_time: + name: TimeSeries__starting_time + description: Timestamp of the first sample in seconds. When timestamps are uniformly + spaced, the timestamp of the first sample can be specified and all subsequent + ones calculated from the sampling rate attribute. + attributes: + name: + name: name + ifabsent: string(starting_time) + range: string + required: true + equals_string: starting_time + rate: + name: rate + description: Sampling rate, in Hz. + range: float32 + unit: + name: unit + description: Unit of measurement for time, which is fixed to 'seconds'. + range: text + value: + name: value + range: float64 + required: true + TimeSeries__sync: + name: TimeSeries__sync + description: Lab-specific time and sync information as provided directly from + hardware devices and that is necessary for aligning all acquired time information + to a common timebase. The timestamp array stores time in the common timebase. + This group will usually only be populated in TimeSeries that are stored external + to the NWB file, in files storing raw data. Once timestamp data is calculated, + the contents of 'sync' are mostly for archival purposes. + attributes: + name: + name: name + ifabsent: string(sync) + range: string + required: true + equals_string: sync + ProcessingModule: + name: ProcessingModule + description: A collection of processed data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of processed data. + range: text + nwb_data_interface: + name: nwb_data_interface + description: Data objects stored in this collection. + multivalued: true + range: NWBDataInterface + required: false + dynamic_table: + name: dynamic_table + description: Tables stored in this collection. + multivalued: true + range: DynamicTable + required: false + tree_root: true + Images: + name: Images + description: A collection of images with an optional way to specify the order + of the images using the "order_of_images" dataset. An order must be specified + if the images are referenced by index, e.g., from an IndexSeries. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this collection of images. + range: text + image: + name: image + description: Images stored in this collection. + multivalued: true + range: Image + required: true + order_of_images: + name: order_of_images + description: Ordered dataset of references to Image objects stored in the + parent group. Each Image object in the Images group should be stored once + and only once, so the dataset should have the same length as the number + of images. + multivalued: false + range: Images__order_of_images + required: false + tree_root: true + Images__order_of_images: + name: Images__order_of_images + description: Ordered dataset of references to Image objects stored in the parent + group. Each Image object in the Images group should be stored once and only + once, so the dataset should have the same length as the number of images. + is_a: ImageReferences + attributes: + name: + name: name + ifabsent: string(order_of_images) + range: string + required: true + equals_string: order_of_images diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.behavior.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.behavior.yaml new file mode 100644 index 0000000..af2f562 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.behavior.yaml @@ -0,0 +1,216 @@ +name: core.nwb.behavior +id: core.nwb.behavior +version: 2.6.0-alpha +imports: +- core.nwb.base +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.behavior/ +classes: + SpatialSeries: + name: SpatialSeries + description: 'Direction, e.g., of gaze or travel, or position. The TimeSeries::data + field is a 2D array storing position or direction relative to some reference + frame. Array structure: [num measurements] [num dimensions]. Each SpatialSeries + has a text dataset reference_frame that indicates the zero-position, or the + zero-axes for direction. For example, if representing gaze direction, ''straight-ahead'' + might be a specific pixel on the monitor, or some other point in space. For + position data, the 0,0 point might be the top-left corner of an enclosure, as + viewed from the tracking camera. The unit of data will indicate how to interpret + SpatialSeries values.' + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: 1-D or 2-D array storing position or direction relative to some + reference frame. + multivalued: false + range: SpatialSeries__data + required: true + reference_frame: + name: reference_frame + description: Description defining what exactly 'straight-ahead' means. + multivalued: false + range: text + required: false + tree_root: true + SpatialSeries__data: + name: SpatialSeries__data + description: 1-D or 2-D array storing position or direction relative to some reference + frame. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. The default + value is 'meters'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion' + and add 'offset'. + range: text + array: + name: array + range: SpatialSeries__data__Array + SpatialSeries__data__Array: + name: SpatialSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + x: + name: x + range: numeric + required: false + minimum_cardinality: 1 + maximum_cardinality: 1 + x,y: + name: x,y + range: numeric + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + x,y,z: + name: x,y,z + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + BehavioralEpochs: + name: BehavioralEpochs + description: TimeSeries for storing behavioral epochs. The objective of this + and the other two Behavioral interfaces (e.g. BehavioralEvents and BehavioralTimeSeries) + is to provide generic hooks for software tools/scripts. This allows a tool/script + to take the output one specific interface (e.g., UnitTimes) and plot that data + relative to another data modality (e.g., behavioral events) without having to + define all possible modalities in advance. Declaring one of these interfaces + means that one or more TimeSeries of the specified type is published. These + TimeSeries should reside in a group having the same name as the interface. For + example, if a BehavioralTimeSeries interface is declared, the module will have + one or more TimeSeries defined in the module sub-group 'BehavioralTimeSeries'. + BehavioralEpochs should use IntervalSeries. BehavioralEvents is used for irregular + events. BehavioralTimeSeries is for continuous data. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + interval_series: + name: interval_series + description: IntervalSeries object containing start and stop times of epochs. + multivalued: true + range: IntervalSeries + required: false + tree_root: true + BehavioralEvents: + name: BehavioralEvents + description: TimeSeries for storing behavioral events. See description of BehavioralEpochs + for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing behavioral events. + multivalued: true + range: TimeSeries + required: false + tree_root: true + BehavioralTimeSeries: + name: BehavioralTimeSeries + description: TimeSeries for storing Behavoioral time series data. See description + of BehavioralEpochs for more details. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing continuous behavioral data. + multivalued: true + range: TimeSeries + required: false + tree_root: true + PupilTracking: + name: PupilTracking + description: Eye-tracking data, representing pupil size. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + time_series: + name: time_series + description: TimeSeries object containing time series data on pupil size. + multivalued: true + range: TimeSeries + required: true + tree_root: true + EyeTracking: + name: EyeTracking + description: Eye-tracking data, representing direction of gaze. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing data measuring direction of gaze. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + CompassDirection: + name: CompassDirection + description: With a CompassDirection interface, a module publishes a SpatialSeries + object representing a floating point value for theta. The SpatialSeries::reference_frame + field should indicate what direction corresponds to 0 and which is the direction + of rotation (this should be clockwise). The si_unit for the SpatialSeries should + be radians or degrees. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing direction of gaze travel. + multivalued: true + range: SpatialSeries + required: false + tree_root: true + Position: + name: Position + description: Position data, whether along the x, x/y or x/y/z axis. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spatial_series: + name: spatial_series + description: SpatialSeries object containing position data. + multivalued: true + range: SpatialSeries + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.device.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.device.yaml new file mode 100644 index 0000000..c31222b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.device.yaml @@ -0,0 +1,28 @@ +name: core.nwb.device +id: core.nwb.device +version: 2.6.0-alpha +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.device/ +classes: + Device: + name: Device + description: Metadata about a data acquisition device, e.g., recording system, + electrode, microscope. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of the device (e.g., model, firmware version, processing + software version, etc.) as free-form text. + range: text + manufacturer: + name: manufacturer + description: The name of the manufacturer of the device. + range: text + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.ecephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.ecephys.yaml new file mode 100644 index 0000000..ab74060 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.ecephys.yaml @@ -0,0 +1,502 @@ +name: core.nwb.ecephys +id: core.nwb.ecephys +version: 2.6.0-alpha +imports: +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ecephys/ +classes: + ElectricalSeries: + name: ElectricalSeries + description: A time series of acquired voltage data from extracellular recordings. + The data field is an int or float array storing data in volts. The first dimension + should always represent time. The second dimension, if present, should represent + channels. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + filtering: + name: filtering + description: Filtering applied to all channels of the data. For example, if + this ElectricalSeries represents high-pass-filtered data (also known as + AP Band), then this value could be "High-pass 4-pole Bessel filter at 500 + Hz". If this ElectricalSeries represents low-pass-filtered LFP data and + the type of filter is unknown, then this value could be "Low-pass filter + at 300 Hz". If a non-standard filter type is used, provide as much detail + about the filter properties as possible. + range: text + data: + name: data + description: Recorded voltage data. + multivalued: false + range: ElectricalSeries__data + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: ElectricalSeries__electrodes + required: true + channel_conversion: + name: channel_conversion + description: Channel-specific conversion factor. Multiply the data in the + 'data' dataset by these values along the channel axis (as indicated by axis + attribute) AND by the global conversion factor in the 'conversion' attribute + of 'data' to get the data values in Volts, i.e, data in Volts = data * data.conversion + * channel_conversion. This approach allows for both global and per-channel + data conversion factors needed to support the storage of electrical recordings + as native values generated by data acquisition systems. If this dataset + is not present, then there is no channel-specific conversion factor, i.e. + it is 1 for all channels. + multivalued: true + range: float32 + required: false + tree_root: true + ElectricalSeries__data: + name: ElectricalSeries__data + description: Recorded voltage data. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. This value + is fixed to 'volts'. Actual stored values are not necessarily stored in + these units. To access the data in these units, multiply 'data' by 'conversion', + followed by 'channel_conversion' (if present), and then add 'offset'. + range: text + array: + name: array + range: ElectricalSeries__data__Array + ElectricalSeries__data__Array: + name: ElectricalSeries__data__Array + is_a: Arraylike + attributes: + num_times: + name: num_times + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + num_samples: + name: num_samples + range: numeric + required: false + ElectricalSeries__electrodes: + name: ElectricalSeries__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + SpikeEventSeries: + name: SpikeEventSeries + description: 'Stores snapshots/snippets of recorded spike events (i.e., threshold + crossings). This may also be raw data, as reported by ephys hardware. If so, + the TimeSeries::description field should describe how events were detected. + All SpikeEventSeries should reside in a module (under EventWaveform interface) + even if the spikes were reported and stored by hardware. All events span the + same recording channels and store snapshots of equal duration. TimeSeries::data + array structure: [num events] [num channels] [num samples] (or [num events] + [num samples] for single electrode).' + is_a: ElectricalSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Spike waveforms. + multivalued: false + range: SpikeEventSeries__data + required: true + timestamps: + name: timestamps + description: Timestamps for samples stored in data, in seconds, relative to + the common experiment master-clock stored in NWBFile.timestamps_reference_time. + Timestamps are required for the events. Unlike for TimeSeries, timestamps + are required for SpikeEventSeries and are thus re-specified here. + multivalued: true + range: float64 + required: true + tree_root: true + SpikeEventSeries__data: + name: SpikeEventSeries__data + description: Spike waveforms. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Unit of measurement for waveforms, which is fixed to 'volts'. + range: text + array: + name: array + range: SpikeEventSeries__data__Array + SpikeEventSeries__data__Array: + name: SpikeEventSeries__data__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: numeric + required: true + num_samples: + name: num_samples + range: numeric + required: true + num_channels: + name: num_channels + range: numeric + required: false + FeatureExtraction: + name: FeatureExtraction + description: Features, such as PC1 and PC2, that are extracted from signals stored + in a SpikeEventSeries or other source. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of features (eg, ''PC1'') for each of the extracted + features. + multivalued: true + range: text + required: true + features: + name: features + description: Multi-dimensional array of features extracted from each event. + multivalued: false + range: FeatureExtraction__features + required: true + times: + name: times + description: Times of events that features correspond to (can be a link). + multivalued: true + range: float64 + required: true + electrodes: + name: electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + multivalued: false + range: FeatureExtraction__electrodes + required: true + tree_root: true + FeatureExtraction__features: + name: FeatureExtraction__features + description: Multi-dimensional array of features extracted from each event. + attributes: + name: + name: name + ifabsent: string(features) + range: string + required: true + equals_string: features + array: + name: array + range: FeatureExtraction__features__Array + FeatureExtraction__features__Array: + name: FeatureExtraction__features__Array + is_a: Arraylike + attributes: + num_events: + name: num_events + range: float32 + required: true + num_channels: + name: num_channels + range: float32 + required: true + num_features: + name: num_features + range: float32 + required: true + FeatureExtraction__electrodes: + name: FeatureExtraction__electrodes + description: DynamicTableRegion pointer to the electrodes that this time series + was generated from. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + EventDetection: + name: EventDetection + description: Detected spike events from voltage trace(s). + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + detection_method: + name: detection_method + description: Description of how events were detected, such as voltage threshold, + or dV/dT threshold, as well as relevant values. + multivalued: false + range: text + required: true + source_idx: + name: source_idx + description: Indices (zero-based) into source ElectricalSeries::data array + corresponding to time of event. ''description'' should define what is meant + by time of event (e.g., .25 ms before action potential peak, zero-crossing + time, etc). The index points to each event from the raw data. + multivalued: true + range: int32 + required: true + times: + name: times + description: Timestamps of events, in seconds. + multivalued: true + range: float64 + required: true + tree_root: true + EventWaveform: + name: EventWaveform + description: Represents either the waveforms of detected events, as extracted + from a raw data trace in /acquisition, or the event waveforms that were stored + during experiment acquisition. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + spike_event_series: + name: spike_event_series + description: SpikeEventSeries object(s) containing detected spike event waveforms. + multivalued: true + range: SpikeEventSeries + required: false + tree_root: true + FilteredEphys: + name: FilteredEphys + description: Electrophysiology data from one or more channels that has been subjected + to filtering. Examples of filtered data include Theta and Gamma (LFP has its + own interface). FilteredEphys modules publish an ElectricalSeries for each filtered + channel or set of channels. The name of each ElectricalSeries is arbitrary but + should be informative. The source of the filtered data, whether this is from + analysis of another time series or as acquired by hardware, should be noted + in each's TimeSeries::description field. There is no assumed 1::1 correspondence + between filtered ephys signals and electrodes, as a single signal can apply + to many nearby electrodes, and one electrode may have different filtered (e.g., + theta and/or gamma) signals represented. Filter properties should be noted in + the ElectricalSeries 'filtering' attribute. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing filtered electrophysiology + data. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + LFP: + name: LFP + description: LFP data from one or more channels. The electrode map in each published + ElectricalSeries will identify which channels are providing LFP data. Filter + properties should be noted in the ElectricalSeries 'filtering' attribute. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + electrical_series: + name: electrical_series + description: ElectricalSeries object(s) containing LFP data for one or more + channels. + multivalued: true + range: ElectricalSeries + required: true + tree_root: true + ElectrodeGroup: + name: ElectrodeGroup + description: A physical grouping of electrodes, e.g. a shank of an array. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of this electrode group. + range: text + location: + name: location + description: Location of electrode group. Specify the area, layer, comments + on estimation of area/layer, etc. Use standard atlas names for anatomical + regions when possible. + range: text + position: + name: position + description: stereotaxic or common framework coordinates + multivalued: false + range: AnyType + required: false + tree_root: true + ClusterWaveforms: + name: ClusterWaveforms + description: DEPRECATED The mean waveform shape, including standard deviation, + of the different clusters. Ideally, the waveform analysis should be performed + on data that is only high-pass filtered. This is a separate module because it + is expected to require updating. For example, IMEC probes may require different + storage requirements to store/display mean waveforms, requiring a new interface + or an extension of this one. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + waveform_filtering: + name: waveform_filtering + description: Filtering applied to data before generating mean/sd + multivalued: false + range: text + required: true + waveform_mean: + name: waveform_mean + description: The mean waveform for each cluster, using the same indices for + each wave as cluster numbers in the associated Clustering module (i.e, cluster + 3 is in array slot [3]). Waveforms corresponding to gaps in cluster sequence + should be empty (e.g., zero- filled) + multivalued: false + range: ClusterWaveforms__waveform_mean + required: true + waveform_sd: + name: waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as + in mean + multivalued: false + range: ClusterWaveforms__waveform_sd + required: true + tree_root: true + ClusterWaveforms__waveform_mean: + name: ClusterWaveforms__waveform_mean + description: The mean waveform for each cluster, using the same indices for each + wave as cluster numbers in the associated Clustering module (i.e, cluster 3 + is in array slot [3]). Waveforms corresponding to gaps in cluster sequence should + be empty (e.g., zero- filled) + attributes: + name: + name: name + ifabsent: string(waveform_mean) + range: string + required: true + equals_string: waveform_mean + array: + name: array + range: ClusterWaveforms__waveform_mean__Array + ClusterWaveforms__waveform_mean__Array: + name: ClusterWaveforms__waveform_mean__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + ClusterWaveforms__waveform_sd: + name: ClusterWaveforms__waveform_sd + description: Stdev of waveforms for each cluster, using the same indices as in + mean + attributes: + name: + name: name + ifabsent: string(waveform_sd) + range: string + required: true + equals_string: waveform_sd + array: + name: array + range: ClusterWaveforms__waveform_sd__Array + ClusterWaveforms__waveform_sd__Array: + name: ClusterWaveforms__waveform_sd__Array + is_a: Arraylike + attributes: + num_clusters: + name: num_clusters + range: float32 + required: true + num_samples: + name: num_samples + range: float32 + required: true + Clustering: + name: Clustering + description: DEPRECATED Clustered spike data, whether from automatic clustering + tools (e.g., klustakwik) or as a result of manual sorting. + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of clusters or clustering, (e.g. cluster 0 is noise, + clusters curated using Klusters, etc) + multivalued: false + range: text + required: true + num: + name: num + description: Cluster number of each event + multivalued: true + range: int32 + required: true + peak_over_rms: + name: peak_over_rms + description: Maximum ratio of waveform peak to RMS on any channel in the cluster + (provides a basic clustering metric). + multivalued: true + range: float32 + required: true + times: + name: times + description: Times of clustered events, in seconds. This may be a link to + times field in associated FeatureExtraction module. + multivalued: true + range: float64 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.epoch.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.epoch.yaml new file mode 100644 index 0000000..8246857 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.epoch.yaml @@ -0,0 +1,86 @@ +name: core.nwb.epoch +id: core.nwb.epoch +version: 2.6.0-alpha +imports: +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.epoch/ +classes: + TimeIntervals: + name: TimeIntervals + description: A container for aggregating epoch data and the TimeSeries that each + epoch applies to. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + start_time: + name: start_time + description: Start time of epoch, in seconds. + multivalued: true + range: float32 + stop_time: + name: stop_time + description: Stop time of epoch, in seconds. + multivalued: true + range: float32 + tags: + name: tags + description: User-defined tags that identify or categorize events. + multivalued: true + range: text + tags_index: + name: tags_index + description: Index for tags. + multivalued: false + range: TimeIntervals__tags_index + required: false + timeseries: + name: timeseries + description: An index into a TimeSeries object. + multivalued: false + range: TimeIntervals__timeseries + required: false + timeseries_index: + name: timeseries_index + description: Index for timeseries. + multivalued: false + range: TimeIntervals__timeseries_index + required: false + tree_root: true + TimeIntervals__tags_index: + name: TimeIntervals__tags_index + description: Index for tags. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(tags_index) + range: string + required: true + equals_string: tags_index + TimeIntervals__timeseries: + name: TimeIntervals__timeseries + description: An index into a TimeSeries object. + is_a: TimeSeriesReferenceVectorData + attributes: + name: + name: name + ifabsent: string(timeseries) + range: string + required: true + equals_string: timeseries + TimeIntervals__timeseries_index: + name: TimeIntervals__timeseries_index + description: Index for timeseries. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(timeseries_index) + range: string + required: true + equals_string: timeseries_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.file.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.file.yaml new file mode 100644 index 0000000..027a8b4 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.file.yaml @@ -0,0 +1,742 @@ +name: core.nwb.file +id: core.nwb.file +version: 2.6.0-alpha +imports: +- core.nwb.base +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.device +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.epoch +- core.nwb.misc +- core.nwb.language +default_prefix: core.nwb.file/ +classes: + ScratchData: + name: ScratchData + description: Any one-off datasets + is_a: NWBData + attributes: + name: + name: name + range: string + required: true + notes: + name: notes + description: Any notes the user has about the dataset being stored + range: text + tree_root: true + NWBFile: + name: NWBFile + description: An NWB file storing cellular-based neurophysiology data from a single + experimental session. + is_a: NWBContainer + attributes: + name: + name: name + ifabsent: string(root) + range: string + required: true + equals_string: root + nwb_version: + name: nwb_version + description: File version string. Use semantic versioning, e.g. 1.2.1. This + will be the name of the format with trailing major, minor and patch numbers. + range: text + file_create_date: + name: file_create_date + description: 'A record of the date the file was created and of subsequent + modifications. The date is stored in UTC with local timezone offset as ISO + 8601 extended formatted strings: 2018-09-28T14:43:54.123+02:00. Dates stored + in UTC end in "Z" with no timezone offset. Date accuracy is up to milliseconds. + The file can be created after the experiment was run, so this may differ + from the experiment start time. Each modification to the nwb file adds a + new entry to the array.' + multivalued: true + range: isodatetime + required: true + identifier: + name: identifier + description: A unique text identifier for the file. For example, concatenated + lab name, file creation date/time and experimentalist, or a hash of these + and/or other values. The goal is that the string should be unique to all + other files. + multivalued: false + range: text + required: true + session_description: + name: session_description + description: A description of the experimental session and data in the file. + multivalued: false + range: text + required: true + session_start_time: + name: session_start_time + description: 'Date and time of the experiment/session start. The date is stored + in UTC with local timezone offset as ISO 8601 extended formatted string: + 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end in "Z" with no timezone + offset. Date accuracy is up to milliseconds.' + multivalued: false + range: isodatetime + required: true + timestamps_reference_time: + name: timestamps_reference_time + description: 'Date and time corresponding to time zero of all timestamps. + The date is stored in UTC with local timezone offset as ISO 8601 extended + formatted string: 2018-09-28T14:43:54.123+02:00. Dates stored in UTC end + in "Z" with no timezone offset. Date accuracy is up to milliseconds. All + times stored in the file use this time as reference (i.e., time zero).' + multivalued: false + range: isodatetime + required: true + acquisition: + name: acquisition + description: Data streams recorded from the system, including ephys, ophys, + tracking, etc. This group should be read-only after the experiment is completed + and timestamps are corrected to a common timebase. The data stored here + may be links to raw data stored in external NWB files. This will allow keeping + bulky raw data out of the file while preserving the option of keeping some/all + in the file. Acquired data includes tracking and experimental data streams + (i.e., everything measured from the system). If bulky data is stored in + the /acquisition group, the data can exist in a separate NWB file that is + linked to by the file being used for processing and analysis. + multivalued: true + any_of: + - range: NWBDataInterface + - range: DynamicTable + analysis: + name: analysis + description: Lab-specific and custom scientific analysis of data. There is + no defined format for the content of this group - the format is up to the + individual user/lab. To facilitate sharing analysis data between labs, the + contents here should be stored in standard types (e.g., neurodata_types) + and appropriately documented. The file can store lab-specific and custom + data analysis without restriction on its form or schema, reducing data formatting + restrictions on end users. Such data should be placed in the analysis group. + The analysis data should be documented so that it could be shared with other + labs. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + scratch: + name: scratch + description: A place to store one-off analysis results. Data placed here is + not intended for sharing. By placing data here, users acknowledge that there + is no guarantee that their data meets any standard. + multivalued: true + any_of: + - range: NWBContainer + - range: DynamicTable + processing: + name: processing + description: The home for ProcessingModules. These modules perform intermediate + analysis of data that is necessary to perform before scientific analysis. + Examples include spike clustering, extracting position from tracking data, + stitching together image slices. ProcessingModules can be large and express + many data sets from relatively complex analysis (e.g., spike detection and + clustering) or small, representing extraction of position information from + tracking video, or even binary lick/no-lick decisions. Common software tools + (e.g., klustakwik, MClust) are expected to read/write data here. 'Processing' + refers to intermediate analysis of the acquired data to make it more amenable + to scientific analysis. + multivalued: true + any_of: + - range: ProcessingModule + stimulus: + name: stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment + complete and timestamps are corrected to common timebase. Stores both presented + stimuli and stimulus templates, the latter in case the same stimulus is + presented multiple times, or is pulled from an external stimulus library. + Stimuli are here defined as any signal that is pushed into the system as + part of the experiment (eg, sound, video, voltage, etc). Many different + experiments can use the same stimuli, and stimuli can be re-used during + an experiment. The stimulus group is organized so that one version of template + stimuli can be stored and these be used multiple times. These templates + can exist in the present file or can be linked to a remote library file. + multivalued: false + range: NWBFile__stimulus + required: true + general: + name: general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used + to describe the experiment. Metadata necessary for interpreting the data + is stored with the data. General experimental metadata, including animal + strain, experimental protocols, experimenter, devices, etc, are stored under + 'general'. Core metadata (e.g., that required to interpret data fields) + is stored with the data itself, and implicitly defined by the file specification + (e.g., time is in seconds). The strategy used here for storing non-core + metadata is to use free-form text fields, such as would appear in sentences + or paragraphs from a Methods section. Metadata fields are text to enable + them to be more general, for example to represent ranges instead of numerical + values. Machine-readable metadata is stored as attributes to these free-form + datasets. All entries in the below table are to be included when data is + present. Unused groups (e.g., intracellular_ephys in an optophysiology experiment) + should not be created unless there is data to store within them. + multivalued: false + range: NWBFile__general + required: true + intervals: + name: intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during + an experiment, or epochs (see epochs subgroup) deriving from analysis of + data. + multivalued: false + range: NWBFile__intervals + required: false + units: + name: units + description: Data about sorted spike units. + multivalued: false + range: Units + required: false + tree_root: true + NWBFile__stimulus: + name: NWBFile__stimulus + description: Data pushed into the system (eg, video stimulus, sound, voltage, + etc) and secondary representations of that data (eg, measurements of something + used as a stimulus). This group should be made read-only after experiment complete + and timestamps are corrected to common timebase. Stores both presented stimuli + and stimulus templates, the latter in case the same stimulus is presented multiple + times, or is pulled from an external stimulus library. Stimuli are here defined + as any signal that is pushed into the system as part of the experiment (eg, + sound, video, voltage, etc). Many different experiments can use the same stimuli, + and stimuli can be re-used during an experiment. The stimulus group is organized + so that one version of template stimuli can be stored and these be used multiple + times. These templates can exist in the present file or can be linked to a remote + library file. + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + presentation: + name: presentation + description: Stimuli presented during the experiment. + multivalued: true + any_of: + - range: TimeSeries + templates: + name: templates + description: Template stimuli. Timestamps in templates are based on stimulus + design and are relative to the beginning of the stimulus. When templates + are used, the stimulus instances must convert presentation times to the + experiment`s time reference frame. + multivalued: true + any_of: + - range: TimeSeries + - range: Images + NWBFile__general: + name: NWBFile__general + description: Experimental metadata, including protocol, notes and description + of hardware device(s). The metadata stored in this section should be used to + describe the experiment. Metadata necessary for interpreting the data is stored + with the data. General experimental metadata, including animal strain, experimental + protocols, experimenter, devices, etc, are stored under 'general'. Core metadata + (e.g., that required to interpret data fields) is stored with the data itself, + and implicitly defined by the file specification (e.g., time is in seconds). + The strategy used here for storing non-core metadata is to use free-form text + fields, such as would appear in sentences or paragraphs from a Methods section. + Metadata fields are text to enable them to be more general, for example to represent + ranges instead of numerical values. Machine-readable metadata is stored as attributes + to these free-form datasets. All entries in the below table are to be included + when data is present. Unused groups (e.g., intracellular_ephys in an optophysiology + experiment) should not be created unless there is data to store within them. + attributes: + name: + name: name + ifabsent: string(general) + range: string + required: true + equals_string: general + data_collection: + name: data_collection + description: Notes about data collection and analysis. + multivalued: false + range: text + required: false + experiment_description: + name: experiment_description + description: General description of the experiment. + multivalued: false + range: text + required: false + experimenter: + name: experimenter + description: Name of person(s) who performed the experiment. Can also specify + roles of different people involved. + multivalued: true + range: text + required: false + institution: + name: institution + description: Institution(s) where experiment was performed. + multivalued: false + range: text + required: false + keywords: + name: keywords + description: Terms to search over. + multivalued: true + range: text + required: false + lab: + name: lab + description: Laboratory where experiment was performed. + multivalued: false + range: text + required: false + notes: + name: notes + description: Notes about the experiment. + multivalued: false + range: text + required: false + pharmacology: + name: pharmacology + description: Description of drugs used, including how and when they were administered. + Anesthesia(s), painkiller(s), etc., plus dosage, concentration, etc. + multivalued: false + range: text + required: false + protocol: + name: protocol + description: Experimental protocol, if applicable. e.g., include IACUC protocol + number. + multivalued: false + range: text + required: false + related_publications: + name: related_publications + description: Publication information. PMID, DOI, URL, etc. + multivalued: true + range: text + required: false + session_id: + name: session_id + description: Lab-specific ID for the session. + multivalued: false + range: text + required: false + slices: + name: slices + description: Description of slices, including information about preparation + thickness, orientation, temperature, and bath solution. + multivalued: false + range: text + required: false + source_script: + name: source_script + description: Script file or link to public source code used to create this + NWB file. + multivalued: false + range: NWBFile__general__source_script + required: false + stimulus: + name: stimulus + description: Notes about stimuli, such as how and where they were presented. + multivalued: false + range: text + required: false + surgery: + name: surgery + description: Narrative description about surgery/surgeries, including date(s) + and who performed surgery. + multivalued: false + range: text + required: false + virus: + name: virus + description: Information about virus(es) used in experiments, including virus + ID, source, date made, injection location, volume, etc. + multivalued: false + range: text + required: false + lab_meta_data: + name: lab_meta_data + description: Place-holder than can be extended so that lab-specific meta-data + can be placed in /general. + multivalued: true + range: LabMetaData + required: false + devices: + name: devices + description: Description of hardware devices used during experiment, e.g., + monitors, ADC boards, microscopes, etc. + multivalued: true + any_of: + - range: Device + subject: + name: subject + description: Information about the animal or person from which the data was + measured. + multivalued: false + range: Subject + required: false + extracellular_ephys: + name: extracellular_ephys + description: Metadata related to extracellular electrophysiology. + multivalued: false + range: NWBFile__general__extracellular_ephys + required: false + intracellular_ephys: + name: intracellular_ephys + description: Metadata related to intracellular electrophysiology. + multivalued: false + range: NWBFile__general__intracellular_ephys + required: false + optogenetics: + name: optogenetics + description: Metadata describing optogenetic stimuluation. + multivalued: true + any_of: + - range: OptogeneticStimulusSite + optophysiology: + name: optophysiology + description: Metadata related to optophysiology. + multivalued: true + any_of: + - range: ImagingPlane + NWBFile__general__source_script: + name: NWBFile__general__source_script + description: Script file or link to public source code used to create this NWB + file. + attributes: + name: + name: name + ifabsent: string(source_script) + range: string + required: true + equals_string: source_script + file_name: + name: file_name + description: Name of script file. + range: text + value: + name: value + range: text + required: true + NWBFile__general__extracellular_ephys: + name: NWBFile__general__extracellular_ephys + description: Metadata related to extracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(extracellular_ephys) + range: string + required: true + equals_string: extracellular_ephys + electrode_group: + name: electrode_group + description: Physical group of electrodes. + multivalued: true + range: ElectrodeGroup + required: false + electrodes: + name: electrodes + description: A table of all electrodes (i.e. channels) used for recording. + multivalued: false + range: NWBFile__general__extracellular_ephys__electrodes + required: false + NWBFile__general__extracellular_ephys__electrodes: + name: NWBFile__general__extracellular_ephys__electrodes + description: A table of all electrodes (i.e. channels) used for recording. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(electrodes) + range: string + required: true + equals_string: electrodes + x: + name: x + description: x coordinate of the channel location in the brain (+x is posterior). + multivalued: true + range: float32 + y: + name: y + description: y coordinate of the channel location in the brain (+y is inferior). + multivalued: true + range: float32 + z: + name: z + description: z coordinate of the channel location in the brain (+z is right). + multivalued: true + range: float32 + imp: + name: imp + description: Impedance of the channel, in ohms. + multivalued: true + range: float32 + location: + name: location + description: Location of the electrode (channel). Specify the area, layer, + comments on estimation of area/layer, stereotaxic coordinates if in vivo, + etc. Use standard atlas names for anatomical regions when possible. + multivalued: true + range: text + filtering: + name: filtering + description: Description of hardware filtering, including the filter name + and frequency cutoffs. + multivalued: true + range: text + group: + name: group + description: Reference to the ElectrodeGroup this electrode is a part of. + multivalued: true + range: ElectrodeGroup + group_name: + name: group_name + description: Name of the ElectrodeGroup this electrode is a part of. + multivalued: true + range: text + rel_x: + name: rel_x + description: x coordinate in electrode group + multivalued: true + range: float32 + rel_y: + name: rel_y + description: y coordinate in electrode group + multivalued: true + range: float32 + rel_z: + name: rel_z + description: z coordinate in electrode group + multivalued: true + range: float32 + reference: + name: reference + description: Description of the reference electrode and/or reference scheme + used for this electrode, e.g., "stainless steel skull screw" or "online + common average referencing". + multivalued: true + range: text + NWBFile__general__intracellular_ephys: + name: NWBFile__general__intracellular_ephys + description: Metadata related to intracellular electrophysiology. + attributes: + name: + name: name + ifabsent: string(intracellular_ephys) + range: string + required: true + equals_string: intracellular_ephys + filtering: + name: filtering + description: '[DEPRECATED] Use IntracellularElectrode.filtering instead. Description + of filtering used. Includes filtering type and parameters, frequency fall-off, + etc. If this changes between TimeSeries, filter description should be stored + as a text attribute for each TimeSeries.' + multivalued: false + range: text + required: false + intracellular_electrode: + name: intracellular_electrode + description: An intracellular electrode. + multivalued: true + range: IntracellularElectrode + required: false + sweep_table: + name: sweep_table + description: '[DEPRECATED] Table used to group different PatchClampSeries. + SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable + tabels. Additional SequentialRecordingsTable, RepetitionsTable and ExperimentalConditions + tables provide enhanced support for experiment metadata.' + multivalued: false + range: SweepTable + required: false + intracellular_recordings: + name: intracellular_recordings + description: A table to group together a stimulus and response from a single + electrode and a single simultaneous recording. Each row in the table represents + a single recording consisting typically of a stimulus and a corresponding + response. In some cases, however, only a stimulus or a response are recorded + as as part of an experiment. In this case both, the stimulus and response + will point to the same TimeSeries while the idx_start and count of the invalid + column will be set to -1, thus, indicating that no values have been recorded + for the stimulus or response, respectively. Note, a recording MUST contain + at least a stimulus or a response. Typically the stimulus and response are + PatchClampSeries. However, the use of AD/DA channels that are not associated + to an electrode is also common in intracellular electrophysiology, in which + case other TimeSeries may be used. + multivalued: false + range: IntracellularRecordingsTable + required: false + simultaneous_recordings: + name: simultaneous_recordings + description: A table for grouping different intracellular recordings from + the IntracellularRecordingsTable table together that were recorded simultaneously + from different electrodes + multivalued: false + range: SimultaneousRecordingsTable + required: false + sequential_recordings: + name: sequential_recordings + description: A table for grouping different sequential recordings from the + SimultaneousRecordingsTable table together. This is typically used to group + together sequential recordings where the a sequence of stimuli of the same + type with varying parameters have been presented in a sequence. + multivalued: false + range: SequentialRecordingsTable + required: false + repetitions: + name: repetitions + description: A table for grouping different sequential intracellular recordings + together. With each SequentialRecording typically representing a particular + type of stimulus, the RepetitionsTable table is typically used to group + sets of stimuli applied in sequence. + multivalued: false + range: RepetitionsTable + required: false + experimental_conditions: + name: experimental_conditions + description: A table for grouping different intracellular recording repetitions + together that belong to the same experimental experimental_conditions. + multivalued: false + range: ExperimentalConditionsTable + required: false + NWBFile__intervals: + name: NWBFile__intervals + description: Experimental intervals, whether that be logically distinct sub-experiments + having a particular scientific goal, trials (see trials subgroup) during an + experiment, or epochs (see epochs subgroup) deriving from analysis of data. + attributes: + name: + name: name + ifabsent: string(intervals) + range: string + required: true + equals_string: intervals + epochs: + name: epochs + description: Divisions in time marking experimental stages or sub-divisions + of a single recording session. + multivalued: false + range: TimeIntervals + required: false + trials: + name: trials + description: Repeated experimental events that have a logical grouping. + multivalued: false + range: TimeIntervals + required: false + invalid_times: + name: invalid_times + description: Time intervals that should be removed from analysis. + multivalued: false + range: TimeIntervals + required: false + time_intervals: + name: time_intervals + description: Optional additional table(s) for describing other experimental + time intervals. + multivalued: true + range: TimeIntervals + required: false + LabMetaData: + name: LabMetaData + description: Lab-specific meta-data. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + tree_root: true + Subject: + name: Subject + description: Information about the animal or person from which the data was measured. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + age: + name: age + description: Age of subject. Can be supplied instead of 'date_of_birth'. + multivalued: false + range: Subject__age + required: false + date_of_birth: + name: date_of_birth + description: Date of birth of subject. Can be supplied instead of 'age'. + multivalued: false + range: isodatetime + required: false + description: + name: description + description: Description of subject and where subject came from (e.g., breeder, + if animal). + multivalued: false + range: text + required: false + genotype: + name: genotype + description: Genetic strain. If absent, assume Wild Type (WT). + multivalued: false + range: text + required: false + sex: + name: sex + description: Gender of subject. + multivalued: false + range: text + required: false + species: + name: species + description: Species of subject. + multivalued: false + range: text + required: false + strain: + name: strain + description: Strain of subject. + multivalued: false + range: text + required: false + subject_id: + name: subject_id + description: ID of animal/person used/participating in experiment (lab convention). + multivalued: false + range: text + required: false + weight: + name: weight + description: Weight at time of experiment, at time of surgery and at other + important times. + multivalued: false + range: text + required: false + tree_root: true + Subject__age: + name: Subject__age + description: Age of subject. Can be supplied instead of 'date_of_birth'. + attributes: + name: + name: name + ifabsent: string(age) + range: string + required: true + equals_string: age + reference: + name: reference + description: Age is with reference to this event. Can be 'birth' or 'gestational'. + If reference is omitted, 'birth' is implied. + range: text + value: + name: value + range: text + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.icephys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.icephys.yaml new file mode 100644 index 0000000..6f06dbd --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.icephys.yaml @@ -0,0 +1,879 @@ +name: core.nwb.icephys +id: core.nwb.icephys +version: 2.6.0-alpha +imports: +- core.nwb.base +- core.nwb.device +- ../../hdmf_common/v1_5_0/namespace +- core.nwb.language +default_prefix: core.nwb.icephys/ +classes: + PatchClampSeries: + name: PatchClampSeries + description: An abstract base class for patch-clamp data - stimulus or response, + current or voltage. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: Protocol/stimulus name for this patch-clamp dataset. + range: text + sweep_number: + name: sweep_number + description: Sweep number, allows to group different PatchClampSeries together. + range: uint32 + data: + name: data + description: Recorded voltage or current. + multivalued: true + range: numeric + required: true + gain: + name: gain + description: Gain of the recording, in units Volt/Amp (v-clamp) or Volt/Volt + (c-clamp). + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries: + name: CurrentClampSeries + description: Voltage data from an intracellular current-clamp recording. A corresponding + CurrentClampStimulusSeries (stored separately as a stimulus) is used to store + the current injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded voltage. + multivalued: false + range: CurrentClampSeries__data + required: true + bias_current: + name: bias_current + description: Bias current, in amps. + multivalued: false + range: float32 + required: false + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms. + multivalued: false + range: float32 + required: false + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads. + multivalued: false + range: float32 + required: false + tree_root: true + CurrentClampSeries__data: + name: CurrentClampSeries__data + description: Recorded voltage. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion' + and add 'offset'. + range: text + value: + name: value + range: AnyType + required: true + IZeroClampSeries: + name: IZeroClampSeries + description: Voltage data from an intracellular recording when all current and + amplifier settings are off (i.e., CurrentClampSeries fields will be zero). There + is no CurrentClampStimulusSeries associated with an IZero series because the + amplifier is disconnected and no stimulus can reach the cell. + is_a: CurrentClampSeries + attributes: + name: + name: name + range: string + required: true + stimulus_description: + name: stimulus_description + description: An IZeroClampSeries has no stimulus, so this attribute is automatically + set to "N/A" + range: text + bias_current: + name: bias_current + description: Bias current, in amps, fixed to 0.0. + multivalued: false + range: float32 + required: true + bridge_balance: + name: bridge_balance + description: Bridge balance, in ohms, fixed to 0.0. + multivalued: false + range: float32 + required: true + capacitance_compensation: + name: capacitance_compensation + description: Capacitance compensation, in farads, fixed to 0.0. + multivalued: false + range: float32 + required: true + tree_root: true + CurrentClampStimulusSeries: + name: CurrentClampStimulusSeries + description: Stimulus current applied during current clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus current applied. + multivalued: false + range: CurrentClampStimulusSeries__data + required: true + tree_root: true + CurrentClampStimulusSeries__data: + name: CurrentClampStimulusSeries__data + description: Stimulus current applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion' + and add 'offset'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries: + name: VoltageClampSeries + description: Current data from an intracellular voltage-clamp recording. A corresponding + VoltageClampStimulusSeries (stored separately as a stimulus) is used to store + the voltage injected. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Recorded current. + multivalued: false + range: VoltageClampSeries__data + required: true + capacitance_fast: + name: capacitance_fast + description: Fast capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_fast + required: false + capacitance_slow: + name: capacitance_slow + description: Slow capacitance, in farads. + multivalued: false + range: VoltageClampSeries__capacitance_slow + required: false + resistance_comp_bandwidth: + name: resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + multivalued: false + range: VoltageClampSeries__resistance_comp_bandwidth + required: false + resistance_comp_correction: + name: resistance_comp_correction + description: Resistance compensation correction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_correction + required: false + resistance_comp_prediction: + name: resistance_comp_prediction + description: Resistance compensation prediction, in percent. + multivalued: false + range: VoltageClampSeries__resistance_comp_prediction + required: false + whole_cell_capacitance_comp: + name: whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + multivalued: false + range: VoltageClampSeries__whole_cell_capacitance_comp + required: false + whole_cell_series_resistance_comp: + name: whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + multivalued: false + range: VoltageClampSeries__whole_cell_series_resistance_comp + required: false + tree_root: true + VoltageClampSeries__data: + name: VoltageClampSeries__data + description: Recorded current. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'amperes'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion' + and add 'offset'. + range: text + value: + name: value + range: AnyType + required: true + VoltageClampSeries__capacitance_fast: + name: VoltageClampSeries__capacitance_fast + description: Fast capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_fast) + range: string + required: true + equals_string: capacitance_fast + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__capacitance_slow: + name: VoltageClampSeries__capacitance_slow + description: Slow capacitance, in farads. + attributes: + name: + name: name + ifabsent: string(capacitance_slow) + range: string + required: true + equals_string: capacitance_slow + unit: + name: unit + description: Unit of measurement for capacitance_fast, which is fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_bandwidth: + name: VoltageClampSeries__resistance_comp_bandwidth + description: Resistance compensation bandwidth, in hertz. + attributes: + name: + name: name + ifabsent: string(resistance_comp_bandwidth) + range: string + required: true + equals_string: resistance_comp_bandwidth + unit: + name: unit + description: Unit of measurement for resistance_comp_bandwidth, which is fixed + to 'hertz'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_correction: + name: VoltageClampSeries__resistance_comp_correction + description: Resistance compensation correction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_correction) + range: string + required: true + equals_string: resistance_comp_correction + unit: + name: unit + description: Unit of measurement for resistance_comp_correction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__resistance_comp_prediction: + name: VoltageClampSeries__resistance_comp_prediction + description: Resistance compensation prediction, in percent. + attributes: + name: + name: name + ifabsent: string(resistance_comp_prediction) + range: string + required: true + equals_string: resistance_comp_prediction + unit: + name: unit + description: Unit of measurement for resistance_comp_prediction, which is + fixed to 'percent'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_capacitance_comp: + name: VoltageClampSeries__whole_cell_capacitance_comp + description: Whole cell capacitance compensation, in farads. + attributes: + name: + name: name + ifabsent: string(whole_cell_capacitance_comp) + range: string + required: true + equals_string: whole_cell_capacitance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_capacitance_comp, which is + fixed to 'farads'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampSeries__whole_cell_series_resistance_comp: + name: VoltageClampSeries__whole_cell_series_resistance_comp + description: Whole cell series resistance compensation, in ohms. + attributes: + name: + name: name + ifabsent: string(whole_cell_series_resistance_comp) + range: string + required: true + equals_string: whole_cell_series_resistance_comp + unit: + name: unit + description: Unit of measurement for whole_cell_series_resistance_comp, which + is fixed to 'ohms'. + range: text + value: + name: value + range: float32 + required: true + VoltageClampStimulusSeries: + name: VoltageClampStimulusSeries + description: Stimulus voltage applied during a voltage clamp recording. + is_a: PatchClampSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Stimulus voltage applied. + multivalued: false + range: VoltageClampStimulusSeries__data + required: true + tree_root: true + VoltageClampStimulusSeries__data: + name: VoltageClampStimulusSeries__data + description: Stimulus voltage applied. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + unit: + name: unit + description: Base unit of measurement for working with the data. which is + fixed to 'volts'. Actual stored values are not necessarily stored in these + units. To access the data in these units, multiply 'data' by 'conversion' + and add 'offset'. + range: text + value: + name: value + range: AnyType + required: true + IntracellularElectrode: + name: IntracellularElectrode + description: An intracellular electrode and its metadata. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + cell_id: + name: cell_id + description: unique ID of the cell + multivalued: false + range: text + required: false + description: + name: description + description: Description of electrode (e.g., whole-cell, sharp, etc.). + multivalued: false + range: text + required: true + filtering: + name: filtering + description: Electrode specific filtering. + multivalued: false + range: text + required: false + initial_access_resistance: + name: initial_access_resistance + description: Initial access resistance. + multivalued: false + range: text + required: false + location: + name: location + description: Location of the electrode. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: false + resistance: + name: resistance + description: Electrode resistance, in ohms. + multivalued: false + range: text + required: false + seal: + name: seal + description: Information about seal used for recording. + multivalued: false + range: text + required: false + slice: + name: slice + description: Information about slice used for recording. + multivalued: false + range: text + required: false + tree_root: true + SweepTable: + name: SweepTable + description: '[DEPRECATED] Table used to group different PatchClampSeries. SweepTable + is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable + tables. Additional SequentialRecordingsTable, RepetitionsTable, and ExperimentalConditions + tables provide enhanced support for experiment metadata.' + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + sweep_number: + name: sweep_number + description: Sweep number of the PatchClampSeries in that row. + multivalued: true + range: uint32 + series: + name: series + description: The PatchClampSeries with the sweep number in that row. + multivalued: true + range: PatchClampSeries + series_index: + name: series_index + description: Index for series. + multivalued: false + range: SweepTable__series_index + required: true + tree_root: true + SweepTable__series_index: + name: SweepTable__series_index + description: Index for series. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(series_index) + range: string + required: true + equals_string: series_index + IntracellularElectrodesTable: + name: IntracellularElectrodesTable + description: Table for storing intracellular electrode related metadata. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of what is in this dynamic table. + range: text + electrode: + name: electrode + description: Column for storing the reference to the intracellular electrode. + multivalued: true + range: IntracellularElectrode + tree_root: true + IntracellularStimuliTable: + name: IntracellularStimuliTable + description: Table for storing intracellular stimulus related metadata. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of what is in this dynamic table. + range: text + stimulus: + name: stimulus + description: Column storing the reference to the recorded stimulus for the + recording (rows). + multivalued: false + range: IntracellularStimuliTable__stimulus + required: true + tree_root: true + IntracellularStimuliTable__stimulus: + name: IntracellularStimuliTable__stimulus + description: Column storing the reference to the recorded stimulus for the recording + (rows). + is_a: TimeSeriesReferenceVectorData + attributes: + name: + name: name + ifabsent: string(stimulus) + range: string + required: true + equals_string: stimulus + IntracellularResponsesTable: + name: IntracellularResponsesTable + description: Table for storing intracellular response related metadata. + is_a: DynamicTable + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of what is in this dynamic table. + range: text + response: + name: response + description: Column storing the reference to the recorded response for the + recording (rows) + multivalued: false + range: IntracellularResponsesTable__response + required: true + tree_root: true + IntracellularResponsesTable__response: + name: IntracellularResponsesTable__response + description: Column storing the reference to the recorded response for the recording + (rows) + is_a: TimeSeriesReferenceVectorData + attributes: + name: + name: name + ifabsent: string(response) + range: string + required: true + equals_string: response + IntracellularRecordingsTable: + name: IntracellularRecordingsTable + description: A table to group together a stimulus and response from a single electrode + and a single simultaneous recording. Each row in the table represents a single + recording consisting typically of a stimulus and a corresponding response. In + some cases, however, only a stimulus or a response is recorded as part of an + experiment. In this case, both the stimulus and response will point to the same + TimeSeries while the idx_start and count of the invalid column will be set to + -1, thus, indicating that no values have been recorded for the stimulus or response, + respectively. Note, a recording MUST contain at least a stimulus or a response. + Typically the stimulus and response are PatchClampSeries. However, the use of + AD/DA channels that are not associated to an electrode is also common in intracellular + electrophysiology, in which case other TimeSeries may be used. + is_a: AlignedDynamicTable + attributes: + name: + name: name + ifabsent: string(intracellular_recordings) + range: string + required: true + equals_string: intracellular_recordings + description: + name: description + description: Description of the contents of this table. Inherited from AlignedDynamicTable + and overwritten here to fix the value of the attribute. + range: text + electrodes: + name: electrodes + description: Table for storing intracellular electrode related metadata. + multivalued: false + range: IntracellularElectrodesTable + required: true + stimuli: + name: stimuli + description: Table for storing intracellular stimulus related metadata. + multivalued: false + range: IntracellularStimuliTable + required: true + responses: + name: responses + description: Table for storing intracellular response related metadata. + multivalued: false + range: IntracellularResponsesTable + required: true + tree_root: true + SimultaneousRecordingsTable: + name: SimultaneousRecordingsTable + description: A table for grouping different intracellular recordings from the + IntracellularRecordingsTable table together that were recorded simultaneously + from different electrodes. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(simultaneous_recordings) + range: string + required: true + equals_string: simultaneous_recordings + recordings: + name: recordings + description: A reference to one or more rows in the IntracellularRecordingsTable + table. + multivalued: false + range: SimultaneousRecordingsTable__recordings + required: true + recordings_index: + name: recordings_index + description: Index dataset for the recordings column. + multivalued: false + range: SimultaneousRecordingsTable__recordings_index + required: true + tree_root: true + SimultaneousRecordingsTable__recordings: + name: SimultaneousRecordingsTable__recordings + description: A reference to one or more rows in the IntracellularRecordingsTable + table. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(recordings) + range: string + required: true + equals_string: recordings + table: + name: table + description: Reference to the IntracellularRecordingsTable table that this + table region applies to. This specializes the attribute inherited from DynamicTableRegion + to fix the type of table that can be referenced here. + range: IntracellularRecordingsTable + SimultaneousRecordingsTable__recordings_index: + name: SimultaneousRecordingsTable__recordings_index + description: Index dataset for the recordings column. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(recordings_index) + range: string + required: true + equals_string: recordings_index + SequentialRecordingsTable: + name: SequentialRecordingsTable + description: A table for grouping different sequential recordings from the SimultaneousRecordingsTable + table together. This is typically used to group together sequential recordings + where a sequence of stimuli of the same type with varying parameters have been + presented in a sequence. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(sequential_recordings) + range: string + required: true + equals_string: sequential_recordings + simultaneous_recordings: + name: simultaneous_recordings + description: A reference to one or more rows in the SimultaneousRecordingsTable + table. + multivalued: false + range: SequentialRecordingsTable__simultaneous_recordings + required: true + simultaneous_recordings_index: + name: simultaneous_recordings_index + description: Index dataset for the simultaneous_recordings column. + multivalued: false + range: SequentialRecordingsTable__simultaneous_recordings_index + required: true + stimulus_type: + name: stimulus_type + description: The type of stimulus used for the sequential recording. + multivalued: true + range: text + tree_root: true + SequentialRecordingsTable__simultaneous_recordings: + name: SequentialRecordingsTable__simultaneous_recordings + description: A reference to one or more rows in the SimultaneousRecordingsTable + table. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(simultaneous_recordings) + range: string + required: true + equals_string: simultaneous_recordings + table: + name: table + description: Reference to the SimultaneousRecordingsTable table that this + table region applies to. This specializes the attribute inherited from DynamicTableRegion + to fix the type of table that can be referenced here. + range: SimultaneousRecordingsTable + SequentialRecordingsTable__simultaneous_recordings_index: + name: SequentialRecordingsTable__simultaneous_recordings_index + description: Index dataset for the simultaneous_recordings column. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(simultaneous_recordings_index) + range: string + required: true + equals_string: simultaneous_recordings_index + RepetitionsTable: + name: RepetitionsTable + description: A table for grouping different sequential intracellular recordings + together. With each SequentialRecording typically representing a particular + type of stimulus, the RepetitionsTable table is typically used to group sets + of stimuli applied in sequence. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(repetitions) + range: string + required: true + equals_string: repetitions + sequential_recordings: + name: sequential_recordings + description: A reference to one or more rows in the SequentialRecordingsTable + table. + multivalued: false + range: RepetitionsTable__sequential_recordings + required: true + sequential_recordings_index: + name: sequential_recordings_index + description: Index dataset for the sequential_recordings column. + multivalued: false + range: RepetitionsTable__sequential_recordings_index + required: true + tree_root: true + RepetitionsTable__sequential_recordings: + name: RepetitionsTable__sequential_recordings + description: A reference to one or more rows in the SequentialRecordingsTable + table. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(sequential_recordings) + range: string + required: true + equals_string: sequential_recordings + table: + name: table + description: Reference to the SequentialRecordingsTable table that this table + region applies to. This specializes the attribute inherited from DynamicTableRegion + to fix the type of table that can be referenced here. + range: SequentialRecordingsTable + RepetitionsTable__sequential_recordings_index: + name: RepetitionsTable__sequential_recordings_index + description: Index dataset for the sequential_recordings column. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(sequential_recordings_index) + range: string + required: true + equals_string: sequential_recordings_index + ExperimentalConditionsTable: + name: ExperimentalConditionsTable + description: A table for grouping different intracellular recording repetitions + together that belong to the same experimental condition. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(experimental_conditions) + range: string + required: true + equals_string: experimental_conditions + repetitions: + name: repetitions + description: A reference to one or more rows in the RepetitionsTable table. + multivalued: false + range: ExperimentalConditionsTable__repetitions + required: true + repetitions_index: + name: repetitions_index + description: Index dataset for the repetitions column. + multivalued: false + range: ExperimentalConditionsTable__repetitions_index + required: true + tree_root: true + ExperimentalConditionsTable__repetitions: + name: ExperimentalConditionsTable__repetitions + description: A reference to one or more rows in the RepetitionsTable table. + is_a: DynamicTableRegion + attributes: + name: + name: name + ifabsent: string(repetitions) + range: string + required: true + equals_string: repetitions + table: + name: table + description: Reference to the RepetitionsTable table that this table region + applies to. This specializes the attribute inherited from DynamicTableRegion + to fix the type of table that can be referenced here. + range: RepetitionsTable + ExperimentalConditionsTable__repetitions_index: + name: ExperimentalConditionsTable__repetitions_index + description: Index dataset for the repetitions column. + is_a: VectorIndex + attributes: + name: + name: name + ifabsent: string(repetitions_index) + range: string + required: true + equals_string: repetitions_index diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.image.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.image.yaml new file mode 100644 index 0000000..972785b --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.image.yaml @@ -0,0 +1,317 @@ +name: core.nwb.image +id: core.nwb.image +version: 2.6.0-alpha +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.image/ +classes: + GrayscaleImage: + name: GrayscaleImage + description: A grayscale image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: GrayscaleImage__Array + tree_root: true + GrayscaleImage__Array: + name: GrayscaleImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + RGBImage: + name: RGBImage + description: A color image. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBImage__Array + tree_root: true + RGBImage__Array: + name: RGBImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: true + minimum_cardinality: 3 + maximum_cardinality: 3 + RGBAImage: + name: RGBAImage + description: A color image with transparency. + is_a: Image + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: RGBAImage__Array + tree_root: true + RGBAImage__Array: + name: RGBAImage__Array + is_a: Arraylike + attributes: + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b, a: + name: r, g, b, a + range: numeric + required: true + minimum_cardinality: 4 + maximum_cardinality: 4 + ImageSeries: + name: ImageSeries + description: General image data that is common between acquisition and stimulus + time series. Sometimes the image data is stored in the file in a raw format + while other times it will be stored as a series of external image files in the + host file system. The data field will either be binary data, if the data is + stored in the NWB file, or empty, if the data is stored in an external image + stack. [frame][x][y] or [frame][x][y][z]. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Binary data representing images across frames. If data are stored + in an external file, this should be an empty 3D array. + multivalued: false + range: ImageSeries__data + required: true + dimension: + name: dimension + description: Number of pixels on x, y, (and z) axes. + multivalued: true + range: int32 + required: false + external_file: + name: external_file + description: Paths to one or more external file(s). The field is only present + if format='external'. This is only relevant if the image series is stored + in the file system as one or more image file(s). This field should NOT be + used if the image is stored in another NWB file and that file is linked + to this file. + multivalued: true + range: text + required: false + format: + name: format + description: Format of image. If this is 'external', then the attribute 'external_file' + contains the path information to the image files. If this is 'raw', then + the raw (single-channel) binary data is stored in the 'data' dataset. If + this attribute is not present, then the default format='raw' case is assumed. + multivalued: false + range: text + required: false + tree_root: true + ImageSeries__data: + name: ImageSeries__data + description: Binary data representing images across frames. If data are stored + in an external file, this should be an empty 3D array. + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: ImageSeries__data__Array + ImageSeries__data__Array: + name: ImageSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + z: + name: z + range: numeric + required: false + ImageMaskSeries: + name: ImageMaskSeries + description: An alpha mask that is applied to a presented visual stimulus. The + 'data' array contains an array of mask values that are applied to the displayed + image. Mask values are stored as RGBA. Mask can vary with time. The timestamps + array indicates the starting time of a mask, and that mask pattern continues + until it's explicitly changed. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + tree_root: true + OpticalSeries: + name: OpticalSeries + description: Image data that is presented or recorded. A stimulus template movie + will be stored only as an image. When the image is presented as stimulus, additional + data is required, such as field of view (e.g., how much of the visual field + the image covers, or how what is the area of the target being imaged). If the + OpticalSeries represents acquired imaging data, orientation is also important. + is_a: ImageSeries + attributes: + name: + name: name + range: string + required: true + distance: + name: distance + description: Distance from camera/monitor to target/eye. + multivalued: false + range: float32 + required: false + field_of_view: + name: field_of_view + description: Width, height and depth of image, or imaged area, in meters. + multivalued: false + range: OpticalSeries__field_of_view + required: false + data: + name: data + description: Images presented to subject, either grayscale or RGB + multivalued: false + range: OpticalSeries__data + required: true + orientation: + name: orientation + description: Description of image relative to some reference frame (e.g., + which way is up). Must also specify frame of reference. + multivalued: false + range: text + required: false + tree_root: true + OpticalSeries__field_of_view: + name: OpticalSeries__field_of_view + description: Width, height and depth of image, or imaged area, in meters. + attributes: + name: + name: name + ifabsent: string(field_of_view) + range: string + required: true + equals_string: field_of_view + array: + name: array + range: OpticalSeries__field_of_view__Array + OpticalSeries__field_of_view__Array: + name: OpticalSeries__field_of_view__Array + is_a: Arraylike + attributes: + width, height: + name: width, height + range: float32 + required: false + minimum_cardinality: 2 + maximum_cardinality: 2 + width, height, depth: + name: width, height, depth + range: float32 + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + OpticalSeries__data: + name: OpticalSeries__data + description: Images presented to subject, either grayscale or RGB + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data + array: + name: array + range: OpticalSeries__data__Array + OpticalSeries__data__Array: + name: OpticalSeries__data__Array + is_a: Arraylike + attributes: + frame: + name: frame + range: numeric + required: true + x: + name: x + range: numeric + required: true + y: + name: y + range: numeric + required: true + r, g, b: + name: r, g, b + range: numeric + required: false + minimum_cardinality: 3 + maximum_cardinality: 3 + IndexSeries: + name: IndexSeries + description: Stores indices to image frames stored in an ImageSeries. The purpose + of the IndexSeries is to allow a static image stack to be stored in an Images + object, and the images in the stack to be referenced out-of-order. This can + be for the display of individual images, or of movie segments (as a movie is + simply a series of images). The data field stores the index of the frame in + the referenced Images object, and the timestamps array indicates when that image + was displayed. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Index of the image (using zero-indexing) in the linked Images + object. + multivalued: true + range: uint32 + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.language.yaml new file mode 100644 index 0000000..c57e91f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.language.yaml @@ -0,0 +1,148 @@ +name: core.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.misc.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.misc.yaml similarity index 91% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.misc.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.misc.yaml index 49fced7..24a465a 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.misc.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.misc.yaml @@ -1,10 +1,11 @@ name: core.nwb.misc id: core.nwb.misc +version: 2.6.0-alpha imports: - core.nwb.base -- hdmf-common.table +- ../../hdmf_common/v1_5_0/namespace - core.nwb.ecephys -- nwb.language +- core.nwb.language default_prefix: core.nwb.misc/ classes: AbstractFeatureSeries: @@ -148,7 +149,7 @@ classes: description: Table for describing the bands that this series was generated from. There should be one row in this table for each band. multivalued: false - range: DynamicTable + range: DecompositionSeries__bands required: true tree_root: true DecompositionSeries__data: @@ -198,6 +199,54 @@ classes: range: string required: true equals_string: source_channels + DecompositionSeries__bands: + name: DecompositionSeries__bands + description: Table for describing the bands that this series was generated from. + There should be one row in this table for each band. + is_a: DynamicTable + attributes: + name: + name: name + ifabsent: string(bands) + range: string + required: true + equals_string: bands + band_name: + name: band_name + description: Name of the band, e.g. theta. + multivalued: true + range: text + band_limits: + name: band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + multivalued: false + range: DecompositionSeries__bands__band_limits + required: true + band_mean: + name: band_mean + description: The mean Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + band_stdev: + name: band_stdev + description: The standard deviation of Gaussian filters, in Hz. + multivalued: true + range: float32 + required: true + DecompositionSeries__bands__band_limits: + name: DecompositionSeries__bands__band_limits + description: Low and high limit of each band in Hz. If it is a Gaussian filter, + use 2 SD on either side of the center. + is_a: VectorData + attributes: + name: + name: name + ifabsent: string(band_limits) + range: string + required: true + equals_string: band_limits Units: name: Units description: Data about spiking units. Event times of observed units (e.g. cell, diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.ogen.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.ogen.yaml new file mode 100644 index 0000000..6a286bd --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.ogen.yaml @@ -0,0 +1,55 @@ +name: core.nwb.ogen +id: core.nwb.ogen +version: 2.6.0-alpha +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.language +default_prefix: core.nwb.ogen/ +classes: + OptogeneticSeries: + name: OptogeneticSeries + description: An optogenetic stimulus. + is_a: TimeSeries + attributes: + name: + name: name + range: string + required: true + data: + name: data + description: Applied power for optogenetic stimulus, in watts. + multivalued: true + range: numeric + required: true + tree_root: true + OptogeneticStimulusSite: + name: OptogeneticStimulusSite + description: A site of optogenetic stimulation. + is_a: NWBContainer + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of stimulation site. + multivalued: false + range: text + required: true + excitation_lambda: + name: excitation_lambda + description: Excitation wavelength, in nm. + multivalued: false + range: float32 + required: true + location: + name: location + description: Location of the stimulation site. Specify the area, layer, comments + on estimation of area/layer, stereotaxic coordinates if in vivo, etc. Use + standard atlas names for anatomical regions when possible. + multivalued: false + range: text + required: true + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/core.nwb.ophys.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.ophys.yaml similarity index 99% rename from nwb_linkml/src/nwb_linkml/schema/core.nwb.ophys.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.ophys.yaml index b9a597a..bc0c561 100644 --- a/nwb_linkml/src/nwb_linkml/schema/core.nwb.ophys.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.ophys.yaml @@ -1,11 +1,12 @@ name: core.nwb.ophys id: core.nwb.ophys +version: 2.6.0-alpha imports: - core.nwb.image - core.nwb.base -- hdmf-common.table +- ../../hdmf_common/v1_5_0/namespace - core.nwb.device -- nwb.language +- core.nwb.language default_prefix: core.nwb.ophys/ classes: OnePhotonSeries: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.retinotopy.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.retinotopy.yaml new file mode 100644 index 0000000..7434ea6 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/core.nwb.retinotopy.yaml @@ -0,0 +1,362 @@ +name: core.nwb.retinotopy +id: core.nwb.retinotopy +version: 2.6.0-alpha +imports: +- core.nwb.base +- core.nwb.language +default_prefix: core.nwb.retinotopy/ +classes: + ImagingRetinotopy: + name: ImagingRetinotopy + description: 'Intrinsic signal optical imaging or widefield imaging for measuring + retinotopy. Stores orthogonal maps (e.g., altitude/azimuth; radius/theta) of + responses to specific stimuli and a combined polarity map from which to identify + visual areas. This group does not store the raw responses imaged during retinotopic + mapping or the stimuli presented, but rather the resulting phase and power maps + after applying a Fourier transform on the averaged responses. Note: for data + consistency, all images and arrays are stored in the format [row][column] and + [row, col], which equates to [y][x]. Field of view and dimension arrays may + appear backward (i.e., y before x).' + is_a: NWBDataInterface + attributes: + name: + name: name + range: string + required: true + axis_1_phase_map: + name: axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + multivalued: false + range: ImagingRetinotopy__axis_1_phase_map + required: true + axis_1_power_map: + name: axis_1_power_map + description: Power response on the first measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_1_power_map + required: false + axis_2_phase_map: + name: axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + multivalued: false + range: ImagingRetinotopy__axis_2_phase_map + required: true + axis_2_power_map: + name: axis_2_power_map + description: Power response on the second measured axis. Response is scaled + so 0.0 is no power in the response and 1.0 is maximum relative power. + multivalued: false + range: ImagingRetinotopy__axis_2_power_map + required: false + axis_descriptions: + name: axis_descriptions + description: Two-element array describing the contents of the two response + axis fields. Description should be something like ['altitude', 'azimuth'] + or '['radius', 'theta']. + multivalued: true + range: text + required: true + focal_depth_image: + name: focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., + focal depth, wavelength) as data collection. Array format: [rows][columns].' + multivalued: false + range: ImagingRetinotopy__focal_depth_image + required: false + sign_map: + name: sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + multivalued: false + range: ImagingRetinotopy__sign_map + required: false + vasculature_image: + name: vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + multivalued: false + range: ImagingRetinotopy__vasculature_image + required: true + tree_root: true + ImagingRetinotopy__axis_1_phase_map: + name: ImagingRetinotopy__axis_1_phase_map + description: Phase response to stimulus on the first measured axis. + attributes: + name: + name: name + ifabsent: string(axis_1_phase_map) + range: string + required: true + equals_string: axis_1_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_phase_map__Array + ImagingRetinotopy__axis_1_phase_map__Array: + name: ImagingRetinotopy__axis_1_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_1_power_map: + name: ImagingRetinotopy__axis_1_power_map + description: Power response on the first measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_1_power_map) + range: string + required: true + equals_string: axis_1_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_1_power_map__Array + ImagingRetinotopy__axis_1_power_map__Array: + name: ImagingRetinotopy__axis_1_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_phase_map: + name: ImagingRetinotopy__axis_2_phase_map + description: Phase response to stimulus on the second measured axis. + attributes: + name: + name: name + ifabsent: string(axis_2_phase_map) + range: string + required: true + equals_string: axis_2_phase_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_phase_map__Array + ImagingRetinotopy__axis_2_phase_map__Array: + name: ImagingRetinotopy__axis_2_phase_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__axis_2_power_map: + name: ImagingRetinotopy__axis_2_power_map + description: Power response on the second measured axis. Response is scaled so + 0.0 is no power in the response and 1.0 is maximum relative power. + attributes: + name: + name: name + ifabsent: string(axis_2_power_map) + range: string + required: true + equals_string: axis_2_power_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + unit: + name: unit + description: Unit that axis data is stored in (e.g., degrees). + range: text + array: + name: array + range: ImagingRetinotopy__axis_2_power_map__Array + ImagingRetinotopy__axis_2_power_map__Array: + name: ImagingRetinotopy__axis_2_power_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__focal_depth_image: + name: ImagingRetinotopy__focal_depth_image + description: 'Gray-scale image taken with same settings/parameters (e.g., focal + depth, wavelength) as data collection. Array format: [rows][columns].' + attributes: + name: + name: name + ifabsent: string(focal_depth_image) + range: string + required: true + equals_string: focal_depth_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value. + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + focal_depth: + name: focal_depth + description: Focal depth offset, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__focal_depth_image__Array + ImagingRetinotopy__focal_depth_image__Array: + name: ImagingRetinotopy__focal_depth_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true + ImagingRetinotopy__sign_map: + name: ImagingRetinotopy__sign_map + description: Sine of the angle between the direction of the gradient in axis_1 + and axis_2. + attributes: + name: + name: name + ifabsent: string(sign_map) + range: string + required: true + equals_string: sign_map + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + array: + name: array + range: ImagingRetinotopy__sign_map__Array + ImagingRetinotopy__sign_map__Array: + name: ImagingRetinotopy__sign_map__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: float32 + required: true + num_cols: + name: num_cols + range: float32 + required: true + ImagingRetinotopy__vasculature_image: + name: ImagingRetinotopy__vasculature_image + description: 'Gray-scale anatomical image of cortical surface. Array structure: + [rows][columns]' + attributes: + name: + name: name + ifabsent: string(vasculature_image) + range: string + required: true + equals_string: vasculature_image + bits_per_pixel: + name: bits_per_pixel + description: Number of bits used to represent each value. This is necessary + to determine maximum (white) pixel value + range: int32 + dimension: + name: dimension + description: 'Number of rows and columns in the image. NOTE: row, column representation + is equivalent to height, width.' + range: int32 + field_of_view: + name: field_of_view + description: Size of viewing area, in meters. + range: float32 + format: + name: format + description: Format of image. Right now only 'raw' is supported. + range: text + array: + name: array + range: ImagingRetinotopy__vasculature_image__Array + ImagingRetinotopy__vasculature_image__Array: + name: ImagingRetinotopy__vasculature_image__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: uint16 + required: true + num_cols: + name: num_cols + range: uint16 + required: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/namespace.yaml new file mode 100644 index 0000000..c254e70 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/core/v2_6_0_alpha/namespace.yaml @@ -0,0 +1,25 @@ +name: core +annotations: + namespace: + tag: namespace + value: 'True' +description: NWB namespace +id: core +version: 2.6.0-alpha +imports: +- core.nwb.base +- core.nwb.device +- core.nwb.epoch +- core.nwb.image +- core.nwb.file +- core.nwb.misc +- core.nwb.behavior +- core.nwb.ecephys +- core.nwb.icephys +- core.nwb.ogen +- core.nwb.ophys +- core.nwb.retinotopy +- core.nwb.language +- ../../hdmf_common/v1_5_0/namespace +- ../../hdmf_experimental/v0_1_0/namespace +default_prefix: core/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.nwb.language.yaml new file mode 100644 index 0000000..e499b2f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.nwb.language.yaml @@ -0,0 +1,148 @@ +name: hdmf-common.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.sparse.yaml new file mode 100644 index 0000000..e2f3298 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.sparse.yaml @@ -0,0 +1,68 @@ +name: hdmf-common.sparse +id: hdmf-common.sparse +version: 1.1.0 +imports: +- hdmf-common.nwb.language +default_prefix: hdmf-common.sparse/ +classes: + CSRMatrix: + name: CSRMatrix + description: a compressed sparse row matrix + attributes: + name: + name: name + range: string + required: true + shape: + name: shape + description: the shape of this sparse matrix + range: int + indices: + name: indices + description: column indices + multivalued: false + range: CSRMatrix__indices + required: true + indptr: + name: indptr + description: index pointer + multivalued: false + range: CSRMatrix__indptr + required: true + data: + name: data + description: values in the matrix + multivalued: false + range: CSRMatrix__data + required: true + tree_root: true + CSRMatrix__indices: + name: CSRMatrix__indices + description: column indices + attributes: + name: + name: name + ifabsent: string(indices) + range: string + required: true + equals_string: indices + CSRMatrix__indptr: + name: CSRMatrix__indptr + description: index pointer + attributes: + name: + name: name + ifabsent: string(indptr) + range: string + required: true + equals_string: indptr + CSRMatrix__data: + name: CSRMatrix__data + description: values in the matrix + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.table.yaml new file mode 100644 index 0000000..c201613 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/hdmf-common.table.yaml @@ -0,0 +1,183 @@ +name: hdmf-common.table +id: hdmf-common.table +version: 1.1.0 +imports: +- hdmf-common.nwb.language +default_prefix: hdmf-common.table/ +classes: + Data: + name: Data + description: An abstract data type for a dataset. + attributes: + name: + name: name + range: string + required: true + tree_root: true + Index: + name: Index + description: Pointers that index data values. + is_a: Data + attributes: + name: + name: name + range: string + required: true + target: + name: target + description: Target dataset that this index applies to. + range: Data + tree_root: true + VectorData: + name: VectorData + description: An n-dimensional dataset representing a column of a DynamicTable. + If used without an accompanying VectorIndex, first dimension is along the rows + of the DynamicTable and each step along the first dimension is a cell of the + larger table. VectorData can also be used to represent a ragged array if paired + with a VectorIndex. This allows for storing arrays of varying length in a single + cell of the DynamicTable by indexing into this VectorData. The first vector + is at VectorData[0:VectorIndex(0)+1]. The second vector is at VectorData[VectorIndex(0)+1:VectorIndex(1)+1], + and so on. + is_a: Data + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of what these vectors represent. + range: text + tree_root: true + VectorIndex: + name: VectorIndex + description: Used with VectorData to encode a ragged array. An array of indices + into the first dimension of the target VectorData, and forming a map between + the rows of a DynamicTable and the indices of the VectorData. + is_a: Index + attributes: + name: + name: name + range: string + required: true + target: + name: target + description: Reference to the target dataset that this index applies to. + range: VectorData + tree_root: true + ElementIdentifiers: + name: ElementIdentifiers + description: A list of unique identifiers for values within a dataset, e.g. rows + of a DynamicTable. + is_a: Data + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: ElementIdentifiers__Array + tree_root: true + ElementIdentifiers__Array: + name: ElementIdentifiers__Array + is_a: Arraylike + attributes: + num_elements: + name: num_elements + range: int + required: true + DynamicTableRegion: + name: DynamicTableRegion + description: DynamicTableRegion provides a link from one table to an index or + region of another. The `table` attribute is a link to another `DynamicTable`, + indicating which table is referenced, and the data is int(s) indicating the + row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to + associate rows with repeated meta-data without data duplication. They can also + be used to create hierarchical relationships between multiple `DynamicTable`s. + `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create + ragged references, so a single cell of a `DynamicTable` can reference many rows + of another `DynamicTable`. + is_a: VectorData + attributes: + name: + name: name + range: string + required: true + table: + name: table + description: Reference to the DynamicTable object that this region applies + to. + range: DynamicTable + description: + name: description + description: Description of what this table region points to. + range: text + tree_root: true + Container: + name: Container + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + attributes: + name: + name: name + range: string + required: true + tree_root: true + DynamicTable: + name: DynamicTable + description: A group containing multiple datasets that are aligned on the first + dimension (Currently, this requirement if left up to APIs to check and enforce). + Apart from a column that contains unique identifiers for each row there are + no other required datasets. Users are free to add any number of VectorData objects + here. Table functionality is already supported through compound types, which + is analogous to storing an array-of-structs. DynamicTable can be thought of + as a struct-of-arrays. This provides an alternative structure to choose from + when optimizing storage for anticipated access patterns. Additionally, this + type provides a way of creating a table without having to define a compound + type up front. Although this convenience may be attractive, users should think + carefully about how data will be accessed. DynamicTable is more appropriate + for column-centric access, whereas a dataset with a compound type would be more + appropriate for row-centric access. Finally, data size should also be taken + into account. For small tables, performance loss may be an acceptable trade-off + for the flexibility of a DynamicTable. For example, DynamicTable was originally + developed for storing trial data and spike unit metadata. Both of these use + cases are expected to produce relatively small tables, so the spatial locality + of multiple datasets present in a DynamicTable is not expected to have a significant + performance impact. Additionally, requirements of trial and unit metadata tables + are sufficiently diverse that performance implications can be overlooked in + favor of usability. + is_a: Container + attributes: + name: + name: name + range: string + required: true + colnames: + name: colnames + description: The names of the columns in this table. This should be used to + specify an order to the columns. + range: text + description: + name: description + description: Description of what is in this dynamic table. + range: text + id: + name: id + description: Array of unique identifiers for the rows of this dynamic table. + multivalued: true + range: int + required: true + vector_data: + name: vector_data + description: Vector columns of this dynamic table. + multivalued: true + range: VectorData + required: false + vector_index: + name: vector_index + description: Indices for the vector columns of this dynamic table. + multivalued: true + range: VectorIndex + required: false + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/namespace.yaml new file mode 100644 index 0000000..9df791d --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_0/namespace.yaml @@ -0,0 +1,13 @@ +name: hdmf-common +annotations: + namespace: + tag: namespace + value: 'True' +description: Common data structures provided by HDMF +id: hdmf-common +version: 1.1.0 +imports: +- hdmf-common.table +- hdmf-common.sparse +- hdmf-common.nwb.language +default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.nwb.language.yaml new file mode 100644 index 0000000..e499b2f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.nwb.language.yaml @@ -0,0 +1,148 @@ +name: hdmf-common.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.sparse.yaml new file mode 100644 index 0000000..950c944 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.sparse.yaml @@ -0,0 +1,68 @@ +name: hdmf-common.sparse +id: hdmf-common.sparse +version: 1.1.2 +imports: +- hdmf-common.nwb.language +default_prefix: hdmf-common.sparse/ +classes: + CSRMatrix: + name: CSRMatrix + description: a compressed sparse row matrix + attributes: + name: + name: name + range: string + required: true + shape: + name: shape + description: the shape of this sparse matrix + range: int + indices: + name: indices + description: column indices + multivalued: false + range: CSRMatrix__indices + required: true + indptr: + name: indptr + description: index pointer + multivalued: false + range: CSRMatrix__indptr + required: true + data: + name: data + description: values in the matrix + multivalued: false + range: CSRMatrix__data + required: true + tree_root: true + CSRMatrix__indices: + name: CSRMatrix__indices + description: column indices + attributes: + name: + name: name + ifabsent: string(indices) + range: string + required: true + equals_string: indices + CSRMatrix__indptr: + name: CSRMatrix__indptr + description: index pointer + attributes: + name: + name: name + ifabsent: string(indptr) + range: string + required: true + equals_string: indptr + CSRMatrix__data: + name: CSRMatrix__data + description: values in the matrix + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.table.yaml new file mode 100644 index 0000000..151e82f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/hdmf-common.table.yaml @@ -0,0 +1,183 @@ +name: hdmf-common.table +id: hdmf-common.table +version: 1.1.2 +imports: +- hdmf-common.nwb.language +default_prefix: hdmf-common.table/ +classes: + Data: + name: Data + description: An abstract data type for a dataset. + attributes: + name: + name: name + range: string + required: true + tree_root: true + Index: + name: Index + description: Pointers that index data values. + is_a: Data + attributes: + name: + name: name + range: string + required: true + target: + name: target + description: Target dataset that this index applies to. + range: Data + tree_root: true + VectorData: + name: VectorData + description: An n-dimensional dataset representing a column of a DynamicTable. + If used without an accompanying VectorIndex, first dimension is along the rows + of the DynamicTable and each step along the first dimension is a cell of the + larger table. VectorData can also be used to represent a ragged array if paired + with a VectorIndex. This allows for storing arrays of varying length in a single + cell of the DynamicTable by indexing into this VectorData. The first vector + is at VectorData[0:VectorIndex(0)+1]. The second vector is at VectorData[VectorIndex(0)+1:VectorIndex(1)+1], + and so on. + is_a: Data + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of what these vectors represent. + range: text + tree_root: true + VectorIndex: + name: VectorIndex + description: Used with VectorData to encode a ragged array. An array of indices + into the first dimension of the target VectorData, and forming a map between + the rows of a DynamicTable and the indices of the VectorData. + is_a: Index + attributes: + name: + name: name + range: string + required: true + target: + name: target + description: Reference to the target dataset that this index applies to. + range: VectorData + tree_root: true + ElementIdentifiers: + name: ElementIdentifiers + description: A list of unique identifiers for values within a dataset, e.g. rows + of a DynamicTable. + is_a: Data + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: ElementIdentifiers__Array + tree_root: true + ElementIdentifiers__Array: + name: ElementIdentifiers__Array + is_a: Arraylike + attributes: + num_elements: + name: num_elements + range: int + required: true + DynamicTableRegion: + name: DynamicTableRegion + description: DynamicTableRegion provides a link from one table to an index or + region of another. The `table` attribute is a link to another `DynamicTable`, + indicating which table is referenced, and the data is int(s) indicating the + row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to + associate rows with repeated meta-data without data duplication. They can also + be used to create hierarchical relationships between multiple `DynamicTable`s. + `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create + ragged references, so a single cell of a `DynamicTable` can reference many rows + of another `DynamicTable`. + is_a: VectorData + attributes: + name: + name: name + range: string + required: true + table: + name: table + description: Reference to the DynamicTable object that this region applies + to. + range: DynamicTable + description: + name: description + description: Description of what this table region points to. + range: text + tree_root: true + Container: + name: Container + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + attributes: + name: + name: name + range: string + required: true + tree_root: true + DynamicTable: + name: DynamicTable + description: A group containing multiple datasets that are aligned on the first + dimension (Currently, this requirement if left up to APIs to check and enforce). + Apart from a column that contains unique identifiers for each row there are + no other required datasets. Users are free to add any number of VectorData objects + here. Table functionality is already supported through compound types, which + is analogous to storing an array-of-structs. DynamicTable can be thought of + as a struct-of-arrays. This provides an alternative structure to choose from + when optimizing storage for anticipated access patterns. Additionally, this + type provides a way of creating a table without having to define a compound + type up front. Although this convenience may be attractive, users should think + carefully about how data will be accessed. DynamicTable is more appropriate + for column-centric access, whereas a dataset with a compound type would be more + appropriate for row-centric access. Finally, data size should also be taken + into account. For small tables, performance loss may be an acceptable trade-off + for the flexibility of a DynamicTable. For example, DynamicTable was originally + developed for storing trial data and spike unit metadata. Both of these use + cases are expected to produce relatively small tables, so the spatial locality + of multiple datasets present in a DynamicTable is not expected to have a significant + performance impact. Additionally, requirements of trial and unit metadata tables + are sufficiently diverse that performance implications can be overlooked in + favor of usability. + is_a: Container + attributes: + name: + name: name + range: string + required: true + colnames: + name: colnames + description: The names of the columns in this table. This should be used to + specify an order to the columns. + range: text + description: + name: description + description: Description of what is in this dynamic table. + range: text + id: + name: id + description: Array of unique identifiers for the rows of this dynamic table. + multivalued: true + range: int + required: true + vector_data: + name: vector_data + description: Vector columns of this dynamic table. + multivalued: true + range: VectorData + required: false + vector_index: + name: vector_index + description: Indices for the vector columns of this dynamic table. + multivalued: true + range: VectorIndex + required: false + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/namespace.yaml new file mode 100644 index 0000000..95cb847 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_2/namespace.yaml @@ -0,0 +1,13 @@ +name: hdmf-common +annotations: + namespace: + tag: namespace + value: 'True' +description: Common data structures provided by HDMF +id: hdmf-common +version: 1.1.2 +imports: +- hdmf-common.table +- hdmf-common.sparse +- hdmf-common.nwb.language +default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.nwb.language.yaml new file mode 100644 index 0000000..e499b2f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.nwb.language.yaml @@ -0,0 +1,148 @@ +name: hdmf-common.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.sparse.yaml new file mode 100644 index 0000000..daee26e --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.sparse.yaml @@ -0,0 +1,68 @@ +name: hdmf-common.sparse +id: hdmf-common.sparse +version: 1.1.3 +imports: +- hdmf-common.nwb.language +default_prefix: hdmf-common.sparse/ +classes: + CSRMatrix: + name: CSRMatrix + description: a compressed sparse row matrix + attributes: + name: + name: name + range: string + required: true + shape: + name: shape + description: the shape of this sparse matrix + range: int + indices: + name: indices + description: column indices + multivalued: false + range: CSRMatrix__indices + required: true + indptr: + name: indptr + description: index pointer + multivalued: false + range: CSRMatrix__indptr + required: true + data: + name: data + description: values in the matrix + multivalued: false + range: CSRMatrix__data + required: true + tree_root: true + CSRMatrix__indices: + name: CSRMatrix__indices + description: column indices + attributes: + name: + name: name + ifabsent: string(indices) + range: string + required: true + equals_string: indices + CSRMatrix__indptr: + name: CSRMatrix__indptr + description: index pointer + attributes: + name: + name: name + ifabsent: string(indptr) + range: string + required: true + equals_string: indptr + CSRMatrix__data: + name: CSRMatrix__data + description: values in the matrix + attributes: + name: + name: name + ifabsent: string(data) + range: string + required: true + equals_string: data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.table.yaml new file mode 100644 index 0000000..5b2f0a4 --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/hdmf-common.table.yaml @@ -0,0 +1,217 @@ +name: hdmf-common.table +id: hdmf-common.table +version: 1.1.3 +imports: +- hdmf-common.nwb.language +default_prefix: hdmf-common.table/ +classes: + Data: + name: Data + description: An abstract data type for a dataset. + attributes: + name: + name: name + range: string + required: true + tree_root: true + Index: + name: Index + description: Pointers that index data values. + is_a: Data + attributes: + name: + name: name + range: string + required: true + target: + name: target + description: Target dataset that this index applies to. + range: Data + tree_root: true + VectorData: + name: VectorData + description: An n-dimensional dataset representing a column of a DynamicTable. + If used without an accompanying VectorIndex, first dimension is along the rows + of the DynamicTable and each step along the first dimension is a cell of the + larger table. VectorData can also be used to represent a ragged array if paired + with a VectorIndex. This allows for storing arrays of varying length in a single + cell of the DynamicTable by indexing into this VectorData. The first vector + is at VectorData[0:VectorIndex(0)+1]. The second vector is at VectorData[VectorIndex(0)+1:VectorIndex(1)+1], + and so on. + is_a: Data + attributes: + name: + name: name + range: string + required: true + description: + name: description + description: Description of what these vectors represent. + range: text + array: + name: array + range: VectorData__Array + tree_root: true + VectorData__Array: + name: VectorData__Array + is_a: Arraylike + attributes: + dim0: + name: dim0 + range: AnyType + required: true + dim1: + name: dim1 + range: AnyType + required: false + dim2: + name: dim2 + range: AnyType + required: false + dim3: + name: dim3 + range: AnyType + required: false + VectorIndex: + name: VectorIndex + description: Used with VectorData to encode a ragged array. An array of indices + into the first dimension of the target VectorData, and forming a map between + the rows of a DynamicTable and the indices of the VectorData. + is_a: Index + attributes: + name: + name: name + range: string + required: true + target: + name: target + description: Reference to the target dataset that this index applies to. + range: VectorData + array: + name: array + range: VectorIndex__Array + tree_root: true + VectorIndex__Array: + name: VectorIndex__Array + is_a: Arraylike + attributes: + num_rows: + name: num_rows + range: AnyType + required: true + ElementIdentifiers: + name: ElementIdentifiers + description: A list of unique identifiers for values within a dataset, e.g. rows + of a DynamicTable. + is_a: Data + attributes: + name: + name: name + range: string + required: true + array: + name: array + range: ElementIdentifiers__Array + tree_root: true + ElementIdentifiers__Array: + name: ElementIdentifiers__Array + is_a: Arraylike + attributes: + num_elements: + name: num_elements + range: int + required: true + DynamicTableRegion: + name: DynamicTableRegion + description: DynamicTableRegion provides a link from one table to an index or + region of another. The `table` attribute is a link to another `DynamicTable`, + indicating which table is referenced, and the data is int(s) indicating the + row(s) (0-indexed) of the target array. `DynamicTableRegion`s can be used to + associate rows with repeated meta-data without data duplication. They can also + be used to create hierarchical relationships between multiple `DynamicTable`s. + `DynamicTableRegion` objects may be paired with a `VectorIndex` object to create + ragged references, so a single cell of a `DynamicTable` can reference many rows + of another `DynamicTable`. + is_a: VectorData + attributes: + name: + name: name + range: string + required: true + table: + name: table + description: Reference to the DynamicTable object that this region applies + to. + range: DynamicTable + description: + name: description + description: Description of what this table region points to. + range: text + tree_root: true + Container: + name: Container + description: An abstract data type for a generic container storing collections + of data and metadata. Base type for all data and metadata containers. + attributes: + name: + name: name + range: string + required: true + tree_root: true + DynamicTable: + name: DynamicTable + description: A group containing multiple datasets that are aligned on the first + dimension (Currently, this requirement if left up to APIs to check and enforce). + Apart from a column that contains unique identifiers for each row there are + no other required datasets. Users are free to add any number of VectorData objects + here. Table functionality is already supported through compound types, which + is analogous to storing an array-of-structs. DynamicTable can be thought of + as a struct-of-arrays. This provides an alternative structure to choose from + when optimizing storage for anticipated access patterns. Additionally, this + type provides a way of creating a table without having to define a compound + type up front. Although this convenience may be attractive, users should think + carefully about how data will be accessed. DynamicTable is more appropriate + for column-centric access, whereas a dataset with a compound type would be more + appropriate for row-centric access. Finally, data size should also be taken + into account. For small tables, performance loss may be an acceptable trade-off + for the flexibility of a DynamicTable. For example, DynamicTable was originally + developed for storing trial data and spike unit metadata. Both of these use + cases are expected to produce relatively small tables, so the spatial locality + of multiple datasets present in a DynamicTable is not expected to have a significant + performance impact. Additionally, requirements of trial and unit metadata tables + are sufficiently diverse that performance implications can be overlooked in + favor of usability. + is_a: Container + attributes: + name: + name: name + range: string + required: true + colnames: + name: colnames + description: The names of the columns in this table. This should be used to + specify an order to the columns. + range: text + description: + name: description + description: Description of what is in this dynamic table. + range: text + id: + name: id + description: Array of unique identifiers for the rows of this dynamic table. + multivalued: true + range: int + required: true + vector_data: + name: vector_data + description: Vector columns of this dynamic table. + multivalued: true + range: VectorData + required: false + vector_index: + name: vector_index + description: Indices for the vector columns of this dynamic table. + multivalued: true + range: VectorIndex + required: false + tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/namespace.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/namespace.yaml new file mode 100644 index 0000000..c97f2ad --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_1_3/namespace.yaml @@ -0,0 +1,13 @@ +name: hdmf-common +annotations: + namespace: + tag: namespace + value: 'True' +description: Common data structures provided by HDMF +id: hdmf-common +version: 1.1.3 +imports: +- hdmf-common.table +- hdmf-common.sparse +- hdmf-common.nwb.language +default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/hdmf-common.base.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.base.yaml similarity index 94% rename from nwb_linkml/src/nwb_linkml/schema/hdmf-common.base.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.base.yaml index b2db755..72fb832 100644 --- a/nwb_linkml/src/nwb_linkml/schema/hdmf-common.base.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.base.yaml @@ -1,7 +1,8 @@ name: hdmf-common.base id: hdmf-common.base +version: 1.5.0 imports: -- nwb.language +- hdmf-common.nwb.language default_prefix: hdmf-common.base/ classes: Data: @@ -32,8 +33,8 @@ classes: name: name range: string required: true - Data: - name: Data + data: + name: data description: Data objects held within this SimpleMultiContainer. multivalued: true range: Data diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.nwb.language.yaml new file mode 100644 index 0000000..e499b2f --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.nwb.language.yaml @@ -0,0 +1,148 @@ +name: hdmf-common.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/hdmf-common.sparse.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.sparse.yaml similarity index 96% rename from nwb_linkml/src/nwb_linkml/schema/hdmf-common.sparse.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.sparse.yaml index 779be11..dcb0c4e 100644 --- a/nwb_linkml/src/nwb_linkml/schema/hdmf-common.sparse.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.sparse.yaml @@ -1,8 +1,9 @@ name: hdmf-common.sparse id: hdmf-common.sparse +version: 1.5.0 imports: - hdmf-common.base -- nwb.language +- hdmf-common.nwb.language default_prefix: hdmf-common.sparse/ classes: CSRMatrix: diff --git a/nwb_linkml/src/nwb_linkml/schema/hdmf-common.table.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.table.yaml similarity index 98% rename from nwb_linkml/src/nwb_linkml/schema/hdmf-common.table.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.table.yaml index e4a4cf0..f95e6b9 100644 --- a/nwb_linkml/src/nwb_linkml/schema/hdmf-common.table.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/hdmf-common.table.yaml @@ -1,8 +1,9 @@ name: hdmf-common.table id: hdmf-common.table +version: 1.5.0 imports: - hdmf-common.base -- nwb.language +- hdmf-common.nwb.language default_prefix: hdmf-common.table/ classes: VectorData: @@ -157,8 +158,8 @@ classes: multivalued: true range: int required: true - VectorData: - name: VectorData + vector_data: + name: vector_data description: Vector columns, including index columns, of this dynamic table. multivalued: true range: VectorData diff --git a/nwb_linkml/src/nwb_linkml/schema/hdmf-common.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/namespace.yaml similarity index 85% rename from nwb_linkml/src/nwb_linkml/schema/hdmf-common.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/namespace.yaml index 88c45d1..30ce551 100644 --- a/nwb_linkml/src/nwb_linkml/schema/hdmf-common.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_common/v1_5_0/namespace.yaml @@ -5,9 +5,10 @@ annotations: value: 'True' description: Common data structures provided by HDMF id: hdmf-common -version: 1.8.0 +version: 1.5.0 imports: - hdmf-common.base - hdmf-common.table - hdmf-common.sparse +- hdmf-common.nwb.language default_prefix: hdmf-common/ diff --git a/nwb_linkml/src/nwb_linkml/schema/hdmf-experimental.experimental.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.experimental.yaml similarity index 88% rename from nwb_linkml/src/nwb_linkml/schema/hdmf-experimental.experimental.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.experimental.yaml index 389f525..947fee5 100644 --- a/nwb_linkml/src/nwb_linkml/schema/hdmf-experimental.experimental.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.experimental.yaml @@ -1,8 +1,9 @@ name: hdmf-experimental.experimental id: hdmf-experimental.experimental +version: 0.1.0 imports: -- hdmf-common.table -- nwb.language +- ../../hdmf_common/v1_5_0/namespace +- hdmf-experimental.nwb.language default_prefix: hdmf-experimental.experimental/ classes: EnumData: diff --git a/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.nwb.language.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.nwb.language.yaml new file mode 100644 index 0000000..fc1debc --- /dev/null +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.nwb.language.yaml @@ -0,0 +1,148 @@ +name: hdmf-experimental.nwb.language +description: Adapter objects to mimic the behavior of elements in the nwb-schema-language +id: nwb.language +imports: +- linkml:types +prefixes: + linkml: + prefix_prefix: linkml + prefix_reference: https://w3id.org/linkml +default_prefix: nwb.language/ +types: + float32: + name: float32 + typeof: float + float64: + name: float64 + typeof: double + long: + name: long + typeof: integer + int64: + name: int64 + typeof: integer + int: + name: int + typeof: integer + int32: + name: int32 + typeof: integer + int16: + name: int16 + typeof: integer + short: + name: short + typeof: integer + int8: + name: int8 + typeof: integer + uint: + name: uint + typeof: integer + minimum_value: 0 + uint32: + name: uint32 + typeof: integer + minimum_value: 0 + uint16: + name: uint16 + typeof: integer + minimum_value: 0 + uint8: + name: uint8 + typeof: integer + minimum_value: 0 + uint64: + name: uint64 + typeof: integer + minimum_value: 0 + numeric: + name: numeric + typeof: float + text: + name: text + typeof: string + utf: + name: utf + typeof: string + utf8: + name: utf8 + typeof: string + utf_8: + name: utf_8 + typeof: string + ascii: + name: ascii + typeof: string + bool: + name: bool + typeof: boolean + isodatetime: + name: isodatetime + typeof: datetime +enums: + FlatDType: + name: FlatDType + permissible_values: + float: + text: float + float32: + text: float32 + double: + text: double + float64: + text: float64 + long: + text: long + int64: + text: int64 + int: + text: int + int32: + text: int32 + int16: + text: int16 + short: + text: short + int8: + text: int8 + uint: + text: uint + uint32: + text: uint32 + uint16: + text: uint16 + uint8: + text: uint8 + uint64: + text: uint64 + numeric: + text: numeric + text: + text: text + utf: + text: utf + utf8: + text: utf8 + utf_8: + text: utf_8 + ascii: + text: ascii + bool: + text: bool + isodatetime: + text: isodatetime +classes: + Arraylike: + name: Arraylike + description: Container for arraylike information held in the dims, shape, and + dtype properties.this is a special case to be interpreted by downstream i/o. + this class has no slotsand is abstract by default.- Each slot within a subclass + indicates a possible dimension.- Only dimensions that are present in all the + dimension specifiers in the original schema are required.- Shape requirements + are indicated using max/min cardinalities on the slot. + abstract: true + AnyType: + name: AnyType + description: Needed because some classes in hdmf-common are datasets without dtype + class_uri: linkml:Any diff --git a/nwb_linkml/src/nwb_linkml/schema/hdmf-experimental.resources.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.resources.yaml similarity index 68% rename from nwb_linkml/src/nwb_linkml/schema/hdmf-experimental.resources.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.resources.yaml index 184bbc6..d20006d 100644 --- a/nwb_linkml/src/nwb_linkml/schema/hdmf-experimental.resources.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/hdmf-experimental.resources.yaml @@ -1,14 +1,16 @@ name: hdmf-experimental.resources id: hdmf-experimental.resources +version: 0.1.0 imports: -- hdmf-common.base -- nwb.language +- ../../hdmf_common/v1_5_0/namespace +- hdmf-experimental.nwb.language default_prefix: hdmf-experimental.resources/ classes: - HERD: - name: HERD - description: HDMF External Resources Data Structure. A set of six tables for tracking - external resource references in a file or across multiple files. + ExternalResources: + name: ExternalResources + description: 'A set of four tables for tracking external resource references in + a file. NOTE: this data type is in beta testing and is subject to change in + a later version.' is_a: Container attributes: name: @@ -22,14 +24,14 @@ classes: multivalued: true range: AnyType required: true - files: - name: files - description: A table for storing object ids of files used in external resources. + entities: + name: entities + description: A table for mapping user terms (i.e., keys) to resource entities. multivalued: true range: AnyType required: true - entities: - name: entities + resources: + name: resources description: A table for mapping user terms (i.e., keys) to resource entities. multivalued: true range: AnyType @@ -47,10 +49,4 @@ classes: multivalued: true range: AnyType required: true - entity_keys: - name: entity_keys - description: A table for identifying which keys use which entity. - multivalued: true - range: AnyType - required: true tree_root: true diff --git a/nwb_linkml/src/nwb_linkml/schema/hdmf-experimental.yaml b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/namespace.yaml similarity index 79% rename from nwb_linkml/src/nwb_linkml/schema/hdmf-experimental.yaml rename to nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/namespace.yaml index a97469f..4e39cad 100644 --- a/nwb_linkml/src/nwb_linkml/schema/hdmf-experimental.yaml +++ b/nwb_linkml/src/nwb_linkml/schema/linkml/hdmf_experimental/v0_1_0/namespace.yaml @@ -4,10 +4,11 @@ annotations: tag: namespace value: 'True' description: Experimental data structures provided by HDMF. These are not guaranteed - to be available in the future. + to be available in the future id: hdmf-experimental -version: 0.5.0 +version: 0.1.0 imports: - hdmf-experimental.experimental - hdmf-experimental.resources +- hdmf-experimental.nwb.language default_prefix: hdmf-experimental/ diff --git a/scripts/generate_core.py b/scripts/generate_core.py index 514e171..de270b3 100644 --- a/scripts/generate_core.py +++ b/scripts/generate_core.py @@ -132,9 +132,22 @@ def generate_versions(yaml_path:Path, pydantic_path:Path, dry_run:bool=False): pydantic_task = None if not dry_run: + shutil.rmtree(yaml_path / 'linkml') + shutil.rmtree(pydantic_path / 'pydantic') shutil.move(tmp_dir / 'linkml', yaml_path) shutil.move(tmp_dir / 'pydantic', pydantic_path) + # import the most recent version of the schemaz we built + latest_version = sorted((pydantic_path / 'pydantic' / 'core').iterdir(), key=os.path.getmtime)[-1] + + # make inits to use the schema! we don't usually do this in the + # provider class because we directly import the files there. + with open(pydantic_path / 'pydantic' / '__init__.py', 'w') as initfile: + initfile.write(' ') + + with open(pydantic_path / '__init__.py', 'w') as initfile: + initfile.write(f'from .pydantic.core.{latest_version.name}.namespace import *') + if len(failed_versions) > 0: print('Failed Building Versions:') print(failed_versions)