Skip to content

Commit c694513

Browse files
committed
update to use hrd_score db column
1 parent fea3c7e commit c694513

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

pori_python/ipr/content.spec.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,23 @@
541541
},
542542
"type": "array"
543543
},
544+
"hrd": {
545+
"items": {
546+
"properties": {
547+
"kbCategory": {
548+
"type": "string"
549+
},
550+
"score": {
551+
"type": "number"
552+
}
553+
},
554+
"required": [
555+
"score"
556+
],
557+
"type": "object"
558+
},
559+
"type": "array"
560+
},
544561
"images": {
545562
"items": {
546563
"example": {

pori_python/ipr/main.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -548,15 +548,12 @@ def ipr_report(
548548
)
549549
output.setdefault("images", []).extend(select_expression_plots(gkb_matches, all_variants))
550550

551-
# TODO: fix this once hrdScore is created in ipr api/db
552-
# this would also be the place to handle the alternate input format hrdScore instead of hrd: {score:}
553-
if output.get('hrdScore'):
554-
output['hrdetectScore'] = output['hrdScore']
555-
output.pop('hrdScore')
556-
elif output.get('hrd'):
551+
# if input includes hrdScore field, that is ok to pass to db
552+
# but prefer the 'hrd' field if it exists
553+
if output.get('hrd'):
557554
if output.get('hrd').get('score'):
558-
output['hrdetectScore'] = output['hrd']['score']
559-
output.pop('hrd')
555+
output['hrdScore'] = output['hrd']['score']
556+
output.pop('hrd') # kbmatches have already been made
560557

561558
ipr_spec = ipr_conn.get_spec()
562559
output = clean_unsupported_content(output, ipr_spec)

0 commit comments

Comments
 (0)