From c4d534d347447861268a63a84dab2edd46898532 Mon Sep 17 00:00:00 2001 From: "bethanny.danskin" Date: Mon, 3 Jun 2024 09:30:12 -0700 Subject: [PATCH] Add proofreading schema (#90) * added spatial pt schema for myelination table * new proofreading schema added proofreading status with strategy --- emannotationschemas/__init__.py | 4 ++++ emannotationschemas/schemas/bound_bool_tag.py | 15 ++++++++++++++- emannotationschemas/schemas/proofreading.py | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/emannotationschemas/__init__.py b/emannotationschemas/__init__.py index b876f33..53b737f 100644 --- a/emannotationschemas/__init__.py +++ b/emannotationschemas/__init__.py @@ -47,6 +47,7 @@ CompartmentProofreadStatus, ProofreadStatus, ProofreadingBoolStatusUser, + CompartmentProofreadStatusStrategy, ) from emannotationschemas.schemas.neuropil import FlyNeuropil from emannotationschemas.schemas.groups import SimpleGroup @@ -58,6 +59,7 @@ BoundBoolAnnotation, BoundBoolWithValid, BoundTagWithValid, + SpatialPointBoolWithValid, ) from emannotationschemas.schemas.reference_text_float import ( ReferenceTagFloat, @@ -113,8 +115,10 @@ "bound_tag_bool": BoundBoolAnnotation, "bound_tag_bool_valid": BoundBoolWithValid, "bound_tag_valid": BoundTagWithValid, + "pt_bool_valid": SpatialPointBoolWithValid, "reference_integer": ReferenceInteger, "reference_tag_float": ReferenceTagFloat, + "compartment_proofread_status_strategy": CompartmentProofreadStatusStrategy, } diff --git a/emannotationschemas/schemas/bound_bool_tag.py b/emannotationschemas/schemas/bound_bool_tag.py index c94b8b7..a27751d 100644 --- a/emannotationschemas/schemas/bound_bool_tag.py +++ b/emannotationschemas/schemas/bound_bool_tag.py @@ -1,5 +1,5 @@ import marshmallow as mm -from emannotationschemas.schemas.base import AnnotationSchema, BoundSpatialPoint, NumericField +from emannotationschemas.schemas.base import AnnotationSchema, BoundSpatialPoint, NumericField, SpatialPoint from emannotationschemas.schemas.bound_text_tag import BoundTagAnnotation class BoundBoolAnnotation(AnnotationSchema): @@ -20,4 +20,17 @@ class BoundTagWithValid(BoundTagAnnotation): valid_id = NumericField( required=True, description="Root id of the object when location was assessed. If the pt_root_id has changed, the associated segment has undergone proofreading.", + ) + +class SpatialPointBoolWithValid(AnnotationSchema): + pt = mm.fields.Nested( + SpatialPoint, + required=True, + description="Location associated with the tag" + ) + tag = mm.fields.Bool(required=True, description="Boolean at location") + + valid_id = NumericField( + required=True, + description="Root id of the object when location was assessed.", ) \ No newline at end of file diff --git a/emannotationschemas/schemas/proofreading.py b/emannotationschemas/schemas/proofreading.py index 9e85f3c..b60c920 100644 --- a/emannotationschemas/schemas/proofreading.py +++ b/emannotationschemas/schemas/proofreading.py @@ -54,3 +54,21 @@ class ProofreadingBoolStatusUser(ProofreadingBoolStatus): required=True, description="User who assessed the proofreading status.", ) + +class CompartmentProofreadStatusStrategy(PointWithValid): + status_dendrite = fields.Bool( + required=True, + description=f"Proofread status of the dendrite only. True indicates dendrite is at least clean.", + ) + status_axon = fields.Bool( + required=True, + description=f"Proofread status of the axon only. True indicates axon is at least clean.", + ) + strategy_dendrite = fields.String( + required=True, + description=f"Strategy used when proofreading dendrite. See table description for more details.", + ) + 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