Skip to content

Commit

Permalink
Add proofreading schema (#90)
Browse files Browse the repository at this point in the history
* added spatial pt schema

for myelination table

* new proofreading schema

added proofreading status with strategy
  • Loading branch information
bpdanskin authored Jun 3, 2024
1 parent b83bd33 commit c4d534d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
4 changes: 4 additions & 0 deletions emannotationschemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
CompartmentProofreadStatus,
ProofreadStatus,
ProofreadingBoolStatusUser,
CompartmentProofreadStatusStrategy,
)
from emannotationschemas.schemas.neuropil import FlyNeuropil
from emannotationschemas.schemas.groups import SimpleGroup
Expand All @@ -58,6 +59,7 @@
BoundBoolAnnotation,
BoundBoolWithValid,
BoundTagWithValid,
SpatialPointBoolWithValid,
)
from emannotationschemas.schemas.reference_text_float import (
ReferenceTagFloat,
Expand Down Expand Up @@ -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,
}


Expand Down
15 changes: 14 additions & 1 deletion emannotationschemas/schemas/bound_bool_tag.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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.",
)
18 changes: 18 additions & 0 deletions emannotationschemas/schemas/proofreading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)

0 comments on commit c4d534d

Please sign in to comment.