Skip to content

Commit b008099

Browse files
sanghoonioclaude
andcommitted
Drop median_neighbor_distance from collection aggregation
The scalar was mapped to bed_stats.tssdist, a leftover TSS column that nothing writes: BedStatsModel has never declared the field, so the value bedboss computed was discarded by extra="ignore" before insert. count() returned 0, `if not n: continue` fired, and the key was silently absent from every scalar_summaries payload since the aggregation was written. Rather than adding a column, a model field and a migration to wire it up, drop it. Remove the aggregation entry, the matching key in the _old_stats_to_scalar_summaries fallback, and the BedSetDistributions docstring line that pointed readers at it as the replacement for the neighbor_distances KDE. That line now states the real reason the KDE is not aggregated: each file's curve is fit over its own log10 range, so bin i means a different bp value per file. bed_stats.tssdist is left in place; removing it needs its own migration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PRGhWjGiUXFoygd35QsKQ7
1 parent 2fd21d3 commit b008099

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

‎bbconf/models/bedset_models.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ class BedSetDistributions(BaseModel):
3333
Dropped (retained in per-file distributions blob, not aggregated):
3434
- widths_histogram: per-file variable-range bins aren't summable; use
3535
scalar_summaries.mean_region_width histogram instead
36-
- neighbor_distances KDE: per-file within-bedset variance is low; use
37-
scalar_summaries.median_neighbor_distance instead
36+
- neighbor_distances KDE: each file's KDE is fit over its own log10 range,
37+
so bin i means a different bp value per file; no collection-level
38+
equivalent yet
3839
- gc_content KDE: per-file distribution is unimodal; use
3940
scalar_summaries.gc_content mean instead
4041
- chromosome_summaries: redundant with region_distribution

‎bbconf/modules/aggregation.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,12 @@ def _ids_array(bed_ids: List[str]):
4545
LARGE_COLLECTION_WARN_THRESHOLD = 5000
4646

4747
# Scalar columns aggregated into ``scalar_summaries``, as
48-
# (output key, ORM column) pairs. ``median_neighbor_distance`` is stored in the
49-
# legacy ``bed_stats.tssdist`` column; it is surfaced under the descriptive key
50-
# without renaming the underlying database column.
48+
# (output key, ORM column) pairs.
5149
_SCALAR_COLUMNS = [
5250
("number_of_regions", BedStats.number_of_regions),
5351
("mean_region_width", BedStats.mean_region_width),
5452
("median_tss_dist", BedStats.median_tss_dist),
5553
("gc_content", BedStats.gc_content),
56-
("median_neighbor_distance", BedStats.tssdist),
5754
]
5855

5956
# Genomic partition columns aggregated into ``partitions``, as

‎bbconf/modules/bedsets.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,6 @@ def _old_stats_to_scalar_summaries(
731731
"mean_region_width",
732732
"median_tss_dist",
733733
"gc_content",
734-
"median_neighbor_distance",
735734
]
736735
result = {}
737736
for key in scalar_keys:

0 commit comments

Comments
 (0)