tl.feature_signature returns an object io.validate rejects

Open Beginner friendly
#103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

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

bug

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from scverse/mantispy

All issues in scverse/mantispy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.