Skip to content

Commit 19b910b

Browse files
valearnaclaude
andcommitted
fix(dashboard): restrict gene agreement stats to curation-completed papers
Filter gene curator agreement calculations to only include papers marked as completed for gene curation in pap_curation_done ('genestudied'). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 06a1f96 commit 19b910b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/backend/api/endpoints/curator_dashboard.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,15 @@ def _compute_entity_curator_agreement(self):
614614
if name:
615615
species_name_to_id[name.strip().lower()] = taxon_id.strip()
616616

617+
# Papers with completed gene curation
618+
curs.execute(
619+
"SELECT DISTINCT joinkey FROM pap_curation_done "
620+
"WHERE pap_curation_done = 'genestudied'"
621+
)
622+
genes_curation_done = set(
623+
r[0] for r in curs.fetchall()
624+
)
625+
617626
for label, cfg in [
618627
("genes", {
619628
"tfp_table": "tfp_genestudied",
@@ -646,6 +655,11 @@ def _compute_entity_curator_agreement(self):
646655
)
647656
paper_data = {}
648657
for joinkey, tfp_val, afp_val in curs.fetchall():
658+
# For genes, only include papers with completed
659+
# gene curation
660+
if (label == "genes"
661+
and joinkey not in genes_curation_done):
662+
continue
649663
raw_extracted = set(
650664
e.strip() for e in (tfp_val or "").split(" | ")
651665
if e.strip()
@@ -1152,6 +1166,15 @@ def _compute_entity_curator_timeseries(self, bin_period='y'):
11521166
for tid, name in curs.fetchall() if name
11531167
}
11541168

1169+
# Papers with completed gene curation
1170+
curs.execute(
1171+
"SELECT DISTINCT joinkey FROM pap_curation_done "
1172+
"WHERE pap_curation_done = 'genestudied'"
1173+
)
1174+
genes_curation_done = set(
1175+
r[0] for r in curs.fetchall()
1176+
)
1177+
11551178
period_data = defaultdict(lambda: defaultdict(
11561179
lambda: {
11571180
"afp": 0, "tfp": 0, "curator": 0,
@@ -1204,6 +1227,11 @@ def _compute_entity_curator_timeseries(self, bin_period='y'):
12041227
for jk, tfp_val, afp_val, email_ts in paper_rows:
12051228
if email_ts is None:
12061229
continue
1230+
# For genes, only include papers with completed
1231+
# gene curation
1232+
if (label == "genes"
1233+
and jk not in genes_curation_done):
1234+
continue
12071235
curated = curator_entities.get(jk, set())
12081236
if not curated:
12091237
continue

0 commit comments

Comments
 (0)