Repository navigation
Validate tumor types before annotating input files - #248
AleksaGavric wants to merge 4 commits into
Conversation
|
@calvinlu3 please take a look when you have some time. |
calvinlu3
left a comment
There was a problem hiding this comment.
Firstly, thanks for taking the time to address this issue!
After thinking it over, I'm leaning towards fixing this in oncokb-core repo. The underlying problem is that the OncoKB api accepts an invalid OncoTree code like BLAH and returns generic results instead of an error. Checking in the annotator works around that for annotator users, but anyone calling the api directly still gets the same silent behavior. It also gives the annotator a hard dependency on oncotree.mskcc.org, which would break any firewalled users and add unneccesary dependency.
We'd rather fix this in OncoKB core, where the API should return an error when it can't resolve the tumor type. The annotator would then report those errors with no extra requests and no second service to depend on, and the check would always match what the OncoKB server actually recognizes.
| if cancer_index >= len(row): | ||
| raise TumorTypeValidationError('Missing tumor-type column at input line %s' % reader.line_num) | ||
| add(get_cell_content(row, cancer_index), 'input line %s' % reader.line_num) |
There was a problem hiding this comment.
Regression here since missing cancer type will stop the script whereas before it will just log a warning and continue. We should maintain the original behavior.
Unknown tumor types such as
BLAHcurrently reach annotation requests and can produce generic results. Validate tumor types before annotation or output-file creation in the MAF, CNA, fusion and structural-variant commands.Use the OncoTree release reported by the selected OncoKB server's
/api/v1/info. Accept codes, names, main types and OncoKB special tumor types case-insensitively, includingMDS/MPN. Preserve clinical-file > input-row > default precedence, sample filters and optional empty types; trim surrounding whitespace in submitted types. GISTIC uses its clinical/default types.Unknown values and unavailable/malformed metadata exit with status 2 before creating or overwriting output. This adds an OncoTree metadata request when a nonempty tumor type needs validation; a custom OncoKB instance must report a version available from that service. The OncoKB bearer token is never forwarded to OncoTree. README and CLI help describe the behavior.
The test workflow also supports manual runs. Hosted validation exposed an existing runner incompatibility:
ubuntu-latestnow resolves to Ubuntu 26.04, which has nosetup-pythonbuild for Python 3.9. Use compatible Ubuntu 24.04 and macOS Intel images for the Python 3.8–3.13 matrix, update the official setup/checkout actions, and run the same flake8 configuration directly without extra check-write permissions. All 18 OS/Python combinations are retained.Validation
d7381cc9883adcf91219a53d999307dd60b876c8: 19 successful jobs, including lint and all 18 Linux/macOS/Windows × Python 3.8–3.13 combinations. Every test job reports 73 passed and the same 11 token-required skips. Upstream workflows require maintainer approval.oncotree_2025_10_03:MDS/MPN,ICPN,IPN,MBLNWS,PANECand a main-type name accepted;BLAHrejected. No live variant annotation or patient data was used.Fixes #214.