tl.feature_signature returns an object io.validate rejects
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Read _core/features.empty_annotation and the cited blocks in tl/_signature.py (lines 74-78) and tl/_heterogeneity.py (98-102). Run the reproduction and inspect the resulting var columns; completion is mt.io.validate(...) succeeding and the signature being accepted by mt.io.write.
Written by the indexing model from the issue text.
Description
Problem
tl.feature_signature stamps its result as a mantispy object, but builds var with four columns instead of the ten the schema requires. io.validate then fails it, and io.write refuses it.
Reproduction
import mantispy as mt
from mantispy.ds import synthetic_plate
cells = synthetic_plate(n_plates=2, n_wells=24, n_cells=5, n_features=20, n_perturbations=3, effect_size=3.0, seed=0)
wells = mt.tl.aggregate(cells, min_cells=0)
mt.tl.differential_features(wells)
signature = mt.tl.feature_signature(wells)
print(list(signature.var.columns))
# ['feature_group', 'channel', 'object', 'n_features']
print(mt.io.validate(signature).ok)
# False -- var is missing 'feature', 'scale', 'angle', 'gray_levels', 'radial_bin', 'params', 'is_feature'
Expected
mt.io.validate(mt.tl.feature_signature(...)).ok is true, and the result can be written.
_core.features.empty_annotation supplies the schema's annotation columns empty, for features that are not CellProfiler measurements. tl/_signature.py:74-78 should build var from it and then set the three columns it knows. tl/_heterogeneity.py:98-102 solves the same problem by hard-coding the ten column names, and should use the helper too.
- Dominant language
- Python
- Stars
- 8
- Forks
- 0
- Avg merge
- 10h 48m
- Merged PRs (30d)
- 37
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from scverse/mantispy
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 3/5 1-2 days Newbie friendliness 84/100
All issues in scverse/mantispy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100