Skip to content

Commit b8f7676

Browse files
committed
Restrict assay outcome QC to sheets with assay outcome column
1 parent ee769be commit b8f7676

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

metpo/scripts/qc_metpo_sheets.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,16 @@ def check_assay_outcome_pairing(sheets: list[SheetData]) -> list[QCIssue]:
332332
issues: list[QCIssue] = []
333333

334334
for sheet in sheets:
335+
# Only process sheets that declare an "assay outcome" column.
336+
# This avoids mis-parsing files with different schemas (e.g., metpo_sheet.tsv).
337+
header_cells: list[str] = []
338+
for header_row in sheet.rows[:2]:
339+
for cell in header_row:
340+
if cell:
341+
header_cells.append(str(cell).strip().lower())
342+
if not any("assay outcome" in cell for cell in header_cells):
343+
continue
344+
335345
# synonym column (index 9) and assay outcome column (index 11)
336346
synonym_map: dict[str, list[tuple[int, str, str, str]]] = defaultdict(list)
337347

0 commit comments

Comments
 (0)