From 3fdb212fe737cf75709022af203959f378dda984 Mon Sep 17 00:00:00 2001 From: Nicole Guittari Date: Mon, 29 Jul 2024 17:33:07 -0400 Subject: [PATCH 1/2] Adding fields from existing schema --- emannotationschemas/schemas/synapse.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/emannotationschemas/schemas/synapse.py b/emannotationschemas/schemas/synapse.py index 743621f..e13b7f5 100644 --- a/emannotationschemas/schemas/synapse.py +++ b/emannotationschemas/schemas/synapse.py @@ -92,3 +92,22 @@ class ValidSynapse(ReferenceAnnotation): required=True, description="Valid annotation for synapses", ) + +# Adding classes from https://github.com/aplbrain/BENCHMARK-Metadata/blob/1.1-and-1.2-annotation-metadata-for-review/annotation-metadata/CAVE-implemented-annotation-metadata-version-1.2.plantuml +# With explanations from here: https://github.com/aplbrain/BENCHMARK-Metadata/blob/1.1-and-1.2-annotation-metadata-for-review/annotation-metadata/required-field-names.md +class Chemical(BaseSynapseSchema): + presynaptic = mm.fields.Float( + description="Specialized sites that transmit signals between presynaptic neurons and their respective postsynaptic targets" + ) + postsynaptic = mm.fields.Float( + description="Specialized sites that transmit signals between presynaptic neurons and their respective postsynaptic targets" + ) + +class Electrical(BaseSynapseSchema): + gap_junction_location = mm.fields.Float( + description="The location where channels that allow for cell to cell transfers between ions and small molecules" + ) + gap_junction_id = mm.fields.Float( + description="The identification tag for gap junctions" + ) + From 432e00565d3638aa9d29f934688b4c27d3a1eaa8 Mon Sep 17 00:00:00 2001 From: Nicole Guittari Date: Wed, 14 Aug 2024 13:33:28 -0400 Subject: [PATCH 2/2] Updating Files to Correspond With BENCHMARK Schema --- emannotationschemas/schemas/braincircuits.py | 6 +++ .../schemas/extended_classical_cell_type.py | 5 +++ .../schemas/functional_coregistration.py | 11 +++++ .../schemas/nucleus_detection.py | 4 ++ emannotationschemas/schemas/proofreading.py | 41 ++++++++++++++++++- emannotationschemas/schemas/synapse.py | 8 ++-- 6 files changed, 71 insertions(+), 4 deletions(-) diff --git a/emannotationschemas/schemas/braincircuits.py b/emannotationschemas/schemas/braincircuits.py index 1514e2c..1f4d827 100644 --- a/emannotationschemas/schemas/braincircuits.py +++ b/emannotationschemas/schemas/braincircuits.py @@ -11,3 +11,9 @@ class BrainCircuitsBoundTagAnnotationUser(AnnotationSchema): required=True, description=f"User who created the tag.", ) + +class RegionsOfInterest(AnnotationSchema): + layer = fields.Boolean(description="Layer regions") + brain_regions = fields.Boolean(description="Brain regions") + cylinder = fields.Boolean(description="Cylinder regions") + other = fields.String(description="Other regions of interest") diff --git a/emannotationschemas/schemas/extended_classical_cell_type.py b/emannotationschemas/schemas/extended_classical_cell_type.py index 18c5fdd..a1e30d2 100644 --- a/emannotationschemas/schemas/extended_classical_cell_type.py +++ b/emannotationschemas/schemas/extended_classical_cell_type.py @@ -29,3 +29,8 @@ schema_type_name, class_name, ) + +# Adding classes from https://github.com/aplbrain/BENCHMARK-Metadata/blob/1.1-and-1.2-annotation-metadata-for-review/annotation-metadata/CAVE-implemented-annotation-metadata-version-1.2.plantuml +# With explanations from here: https://github.com/aplbrain/BENCHMARK-Metadata/blob/1.1-and-1.2-annotation-metadata-for-review/annotation-metadata/required-field-names.md + + diff --git a/emannotationschemas/schemas/functional_coregistration.py b/emannotationschemas/schemas/functional_coregistration.py index 328ac96..1e240be 100644 --- a/emannotationschemas/schemas/functional_coregistration.py +++ b/emannotationschemas/schemas/functional_coregistration.py @@ -49,6 +49,17 @@ class FunctionalUnitCoregistrationExtended(ReferenceAnnotation): required=False, description="confidence score associated with match" ) +# Adding classes from https://github.com/aplbrain/BENCHMARK-Metadata/blob/1.1-and-1.2-annotation-metadata-for-review/annotation-metadata/CAVE-implemented-annotation-metadata-version-1.2.plantuml +# With explanations from here: https://github.com/aplbrain/BENCHMARK-Metadata/blob/1.1-and-1.2-annotation-metadata-for-review/annotation-metadata/required-field-names.md +class CoRegistration(ReferenceAnnotation): + valid = fields.Boolean(description="Indicates if the co-registration is valid") + pt = fields.Nested('PointSchema', description="Point schema for location data") + valid_id = fields.Float(description="Validation ID") + status_dendrite = fields.String(description="Status of the dendrite") + object_id = fields.String(description="Object ID for co-registration") + other = fields.String(description="Other co-registration-related information") + +# Moving this to the bottom/after BENCHMARK additions: class FunctionalUnitCoregistrationQC(ReferenceAnnotation): pass diff --git a/emannotationschemas/schemas/nucleus_detection.py b/emannotationschemas/schemas/nucleus_detection.py index 76a2f84..d4fe3d3 100644 --- a/emannotationschemas/schemas/nucleus_detection.py +++ b/emannotationschemas/schemas/nucleus_detection.py @@ -23,3 +23,7 @@ class NucleusDetection(AnnotationSchema): required=False, description="high corner of the bounding box", ) + +class NucleusProperties(AnnotationSchema): + nucleolus = fields.Boolean(description="Presence of nucleolus") + other = fields.String(description="Other nucleus properties") diff --git a/emannotationschemas/schemas/proofreading.py b/emannotationschemas/schemas/proofreading.py index b60c920..396f3a5 100644 --- a/emannotationschemas/schemas/proofreading.py +++ b/emannotationschemas/schemas/proofreading.py @@ -71,4 +71,43 @@ class CompartmentProofreadStatusStrategy(PointWithValid): strategy_axon = fields.String( required=True, description=f"Strategy used when proofreading axon. See table description for more details.", - ) \ No newline at end of file + ) + +# Adding classes from https://github.com/aplbrain/BENCHMARK-Metadata/blob/1.1-and-1.2-annotation-metadata-for-review/annotation-metadata/CAVE-implemented-annotation-metadata-version-1.2.plantuml +# With explanations from here: https://github.com/aplbrain/BENCHMARK-Metadata/blob/1.1-and-1.2-annotation-metadata-for-review/annotation-metadata/required-field-names.md + +class AnnotationProvenance(PointWithValid): + valid = fields.Boolean(description="Indicates if the annotation is valid") + pt = fields.Nested('PointSchema', description="Point schema for location data") + valid_id = fields.Float(description="Validation ID") + status = fields.String(description="Status of the annotation") + + +class Annotator(PointWithValid): + valid = fields.Boolean(description="Indicates if the annotator data is valid") + pt = fields.Nested('PointSchema', description="Point schema for location data") + valid_id = fields.Float(description="Validation ID") + contributor_method = fields.String(description="Method used by the contributor") + novice_annotator = fields.Boolean(description="Indicates if the annotator is a novice") + expert_annotator = fields.Boolean(description="Indicates if the annotator is an expert") + novice_proofreader = fields.Boolean(description="Indicates if the proofreader is a novice") + expert_proofreader = fields.Boolean(description="Indicates if the proofreader is an expert") + contributor = fields.String(description="Name of the contributor") + other = fields.String(description="Other annotator-related information") + +class Score(PointWithValid): + valid = fields.Boolean(description="Indicates if the score is valid") + pt = fields.Nested('PointSchema', description="Point schema for location data") + valid_id = fields.Float(description="Validation ID") + annotation_reviewed = fields.Integer(description="Number of annotations reviewed") + review_time_hours = fields.Integer(description="Time spent reviewing annotations (in hours)") + confidence_value = fields.Integer(description="Confidence value of the annotation") + other = fields.Integer(description="Other score-related information") + +class Versioning(PointWithValid): + valid = fields.Boolean(description="Indicates if the versioning is valid") + pt = fields.Nested('PointSchema', description="Point schema for location data") + valid_id = fields.Float(description="Validation ID") + version_checkpoint_value = fields.Integer(description="Version checkpoint value") + version_checkpoint_updates = fields.String(description="Updates made in this version") + other = fields.String(description="Other versioning-related information") \ No newline at end of file diff --git a/emannotationschemas/schemas/synapse.py b/emannotationschemas/schemas/synapse.py index e13b7f5..8cdff23 100644 --- a/emannotationschemas/schemas/synapse.py +++ b/emannotationschemas/schemas/synapse.py @@ -6,7 +6,6 @@ ReferenceAnnotation, ) - class BaseSynapseSchema(AnnotationSchema): pre_pt = mm.fields.Nested( BoundSpatialPoint, @@ -36,13 +35,11 @@ def check_root_id(self, data, **kwargs): data.pop("valid", None) return data - class NoCleftSynapse(BaseSynapseSchema): score = mm.fields.Float( description="synapse score (see table metadata for description of score)" ) - class SynapseSchema(BaseSynapseSchema): ctr_pt = mm.fields.Nested( SpatialPoint, required=True, description="central point", order=1 @@ -111,3 +108,8 @@ class Electrical(BaseSynapseSchema): description="The identification tag for gap junctions" ) +class SynapseSite(BaseSynapseSchema): + type = fields.String(description="Synapse site type") + class_label = fields.String(description="Class label") + neuron_id = fields.String(description="Neuron ID") + other = fields.String(description="Other synapse site information")