diff --git a/src/__tests__/apiClient.test.ts b/src/__tests__/apiClient.test.ts index cdcb536..3139c9c 100644 --- a/src/__tests__/apiClient.test.ts +++ b/src/__tests__/apiClient.test.ts @@ -205,15 +205,15 @@ test("postProcess - sample tree categories", async () => { expect(metadata.format["VIPC_S"].categories).toEqual({ U1: { description: "Usable: probably", - label: "U1", + label: "probably", }, U2: { description: "Usable: maybe", - label: "U2", + label: "maybe", }, U3: { description: "Usable: probably not", - label: "U3", + label: "probably not", }, }); }); @@ -224,23 +224,23 @@ test("postProcess - decision tree categories", async () => { const csqItem = csqItems.find((item) => item.id === "VIPC"); expect(csqItem.categories).toEqual({ B: { - label: "B", + label: "Benign", }, LB: { - label: "LB", + label: "Likely Benign", }, LP: { - label: "LP", + label: "Likely Pathogenic", }, LQ: { description: "Low quality variants.", - label: "LQ", + label: "LowQual", }, P: { - label: "P", + label: "Pathogenic", }, VUS: { - label: "VUS", + label: "Unknown Significance", }, }); }); diff --git a/src/__tests__/decisionTree.json b/src/__tests__/decisionTree.json index eff7c5c..440b747 100644 --- a/src/__tests__/decisionTree.json +++ b/src/__tests__/decisionTree.json @@ -326,27 +326,33 @@ } }, "exit_lq": { + "label": "LowQual", "description": "Low quality variants.", "type": "LEAF", "class": "LQ" }, "exit_b": { + "label": "Benign", "type": "LEAF", "class": "B" }, "exit_lb": { + "label": "Likely Benign", "type": "LEAF", "class": "LB" }, "exit_vus": { + "label": "Unknown Significance", "type": "LEAF", "class": "VUS" }, "exit_lp": { + "label": "Likely Pathogenic", "type": "LEAF", "class": "LP" }, "exit_p": { + "label": "Pathogenic", "type": "LEAF", "class": "P" } diff --git a/src/__tests__/sampleTree.json b/src/__tests__/sampleTree.json index b051211..a9dbc67 100644 --- a/src/__tests__/sampleTree.json +++ b/src/__tests__/sampleTree.json @@ -105,16 +105,19 @@ } }, "exit_u1": { + "label": "probably", "description": "Usable: probably", "type": "LEAF", "class": "U1" }, "exit_u2": { + "label": "maybe", "description": "Usable: maybe", "type": "LEAF", "class": "U2" }, "exit_u3": { + "label": "probably not", "description": "Usable: probably not", "type": "LEAF", "class": "U3" diff --git a/src/apiClient.ts b/src/apiClient.ts index 2321120..eddf88e 100644 --- a/src/apiClient.ts +++ b/src/apiClient.ts @@ -119,7 +119,7 @@ export class ApiClient implements Api { .reduce( (acc, node) => ({ ...acc, - [node.class]: { label: node.class, description: node.description }, + [node.class]: { label: node.label, description: node.description }, }), {}, ); @@ -143,7 +143,7 @@ export class ApiClient implements Api { .reduce( (acc, node) => ({ ...acc, - [node.class]: { label: node.class, description: node.description }, + [node.class]: { label: node.label, description: node.description }, }), {}, ); diff --git a/src/index.ts b/src/index.ts index 2fee230..836fb78 100644 --- a/src/index.ts +++ b/src/index.ts @@ -236,6 +236,7 @@ export interface LeafNode extends Node { export interface Node { type: Type; + label: string; description: string; }