Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proofreading schema #90

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.",
)
Loading