Add a DataItemType enum to record what a DataItem represents

Open
#71 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start by reading the repository’s DataItem and Modality schema definitions; the issue does not name their files. Resolve the open questions about slot placement, whether it is required, and whether to include VOXEL before implementing the proposed DataItemType enum and dataitem_type slot. Done means the schema records the item’s type while keeping location separate.

Written by the indexing model from the issue text.

Description

bug schema

Problem

CCM deliberately doesn't assume a DataItem is a single cell. Some modalities don't reach cell resolution, so their items may be populations, injection sites, regions or fiber tracts. But nothing in the schema records what an item actually is.

Modality doesn't answer this. It describes how the data was acquired, not what each item stands for:

  • One EM dataset can contain proofread neurons and orphan axon fragments.
  • Tracer DataItems are injections. Each one is a labeled population, often spread across several regions.
  • MAPseq and BARseq items are both single cells, but they're located with very different precision.

The DataItem description itself mixes kinds: "neuron reconstruction" is a cell, while "injection experiment" is a population.

So users can't filter for, say, single cells only, or tell whether two datasets compare like with like.

Scope

This is for labeling and filtering. It isn't initially meant to drive automatic aggregation or decide when comparisons are valid.

Proposal

Add an enum DataItemType and a slot dataitem_type on DataItem.

Value Meaning
SINGLE_CELL One cell (reconstructed, recorded, barcoded, sequenced)
CELL_FRAGMENT Part of a cell not attributed to a soma (e.g. EM orphan axon)
CELL_POPULATION A set of cells defined by the experiment (injection, Cre line × region, multi-unit)
ANATOMICAL_REGION The item is an atlas region (see #)
FIBER_TRACT An axon bundle / white-matter tract
VOXEL (optional) A spatial unit with no biological identity (fMRI voxel, imaging tile)

The enum describes what the item is. Where it is located is a separate question (see #).

Rule for the enum descriptions: a matrix row labeled "VISp" is usually a population of cells located in VISp (CELL_POPULATION), not VISp itself. Use ANATOMICAL_REGION only when the region itself is what's being measured.

Typical mapping

Modality / data dataitem_type
Whole-neuron morphology, patch-seq SINGLE_CELL
EM (MICrONS, V1DD) SINGLE_CELL or CELL_FRAGMENT
BARseq, MAPseq, MERFISH SINGLE_CELL
Anterograde / retrograde tracer, rabies CELL_POPULATION
Neuropixels / Ca²⁺ imaging SINGLE_CELL (units) or CELL_POPULATION (multi-unit / neuropil)
dMRI tractography ANATOMICAL_REGION (nodes), FIBER_TRACT
fMRI ANATOMICAL_REGION or VOXEL
X-ray / expansion microscopy Depends on resolution

Open questions

  • Where should the slot live? Options: on DataItem only, or on DataSet as a default that items can override. Mixed datasets (EM cells and fragments) argue for overrides.
  • Required or optional?
  • MAPseq cells are inferred from barcodes and placed only to a dissection area. Is SINGLE_CELL enough, or do we need a flag for inferred cells or for how precisely an item is located?
  • Keep VOXEL, or leave it out until a dataset needs it?
Dominant language
Python
Stars
4
Forks
1
Avg merge
3d 14h
Merged PRs (30d)
8

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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 AllenInstitute/ConnectsCommonConnectivity

All issues in AllenInstitute/ConnectsCommonConnectivity

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.