From f07b6aa1564107bad9297c31e0aa1e2d1b78bd32 Mon Sep 17 00:00:00 2001 From: Dennis Hendriksen Date: Thu, 23 Jun 2022 14:28:27 +0200 Subject: [PATCH 1/2] fix:clinVar_CLNSIG, clinVar_CLNREVSTAT metadata feat:clinVar_CLNSIGINCL metadata --- package.json | 2 +- src/VepMetadataParser.ts | 23 ++++++++++-- src/__tests__/VepMetadataParser.test.ts | 49 ++++++++++++++++++------- 3 files changed, 56 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index aab51ef..0f58d01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@molgenis/vip-report-vcf", - "version": "1.2.0", + "version": "1.2.1", "description": "TypeScript VCF library with support for both reading and writing", "scripts": { "build": "tsc --build", diff --git a/src/VepMetadataParser.ts b/src/VepMetadataParser.ts index ce4061f..6cb26cd 100644 --- a/src/VepMetadataParser.ts +++ b/src/VepMetadataParser.ts @@ -70,10 +70,25 @@ function parseVepInfoMetadata(infoMetadata: InfoMetadata, token: string): InfoMe type = "INTEGER"; break; case "clinVar_CLNSIG": - label = "ClinVar"; - description = "ClinVar classification(s)"; + label = "ClinVar variant"; + description = "Clinical significance for this single variant"; + numberType = "OTHER"; + separator = "&"; + type = "CATEGORICAL"; + categories = [ + "Benign", + "Likely_benign", + "Uncertain_significance", + "Likely_pathogenic", + "Pathogenic", + "Conflicting_interpretations_of_pathogenicity", + ]; + break; + case "clinVar_CLNSIGINCL": + label = "ClinVar variant combination"; + description = "Clinical significance for a haplotype or genotype that includes this variant"; numberType = "OTHER"; - separator = "/"; + separator = "&"; type = "CATEGORICAL"; categories = [ "Benign", @@ -88,7 +103,7 @@ function parseVepInfoMetadata(infoMetadata: InfoMetadata, token: string): InfoMe label = "ClinVar status"; description = "ClinVar review status"; numberType = "OTHER"; - separator = ","; + separator = "&"; type = "CATEGORICAL"; categories = [ "practice_guideline", diff --git a/src/__tests__/VepMetadataParser.test.ts b/src/__tests__/VepMetadataParser.test.ts index d4dbe1d..1ffa5ac 100644 --- a/src/__tests__/VepMetadataParser.test.ts +++ b/src/__tests__/VepMetadataParser.test.ts @@ -7,7 +7,7 @@ const vepInfoMetadata: InfoMetadata = { number: { type: "OTHER", separator: "|" }, type: "STRING", description: - "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNREVSTAT", + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", required: true, }; @@ -52,7 +52,7 @@ test("create vep metadata", () => { number: { type: "OTHER", separator: "|" }, type: "STRING", description: - "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNREVSTAT", + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", required: true, }, label: "Effect", @@ -67,7 +67,7 @@ test("create vep metadata", () => { number: { type: "OTHER", separator: "|" }, type: "STRING", description: - "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNREVSTAT", + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", required: true, }, }, @@ -80,7 +80,7 @@ test("create vep metadata", () => { number: { type: "OTHER", separator: "|" }, type: "STRING", description: - "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNREVSTAT", + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", required: true, }, }, @@ -93,7 +93,7 @@ test("create vep metadata", () => { number: { type: "OTHER", separator: "|" }, type: "STRING", description: - "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNREVSTAT", + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", required: true, }, label: "gnomAD AF", @@ -108,7 +108,7 @@ test("create vep metadata", () => { number: { type: "OTHER", separator: "|" }, type: "STRING", description: - "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNREVSTAT", + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", required: true, }, }, @@ -121,7 +121,7 @@ test("create vep metadata", () => { number: { type: "OTHER", separator: "|" }, type: "STRING", description: - "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNREVSTAT", + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", required: true, }, label: "ClinVar ID", @@ -129,14 +129,14 @@ test("create vep metadata", () => { }, { id: "clinVar_CLNSIG", - number: { type: "OTHER", separator: "/" }, + number: { type: "OTHER", separator: "&" }, type: "CATEGORICAL", parent: { id: "CSQ", number: { type: "OTHER", separator: "|" }, type: "STRING", description: - "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNREVSTAT", + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", required: true, }, categories: [ @@ -147,19 +147,42 @@ test("create vep metadata", () => { "Pathogenic", "Conflicting_interpretations_of_pathogenicity", ], - label: "ClinVar", - description: "ClinVar classification(s)", + label: "ClinVar variant", + description: "Clinical significance for this single variant", + }, + { + id: "clinVar_CLNSIGINCL", + number: { type: "OTHER", separator: "&" }, + type: "CATEGORICAL", + parent: { + id: "CSQ", + number: { type: "OTHER", separator: "|" }, + type: "STRING", + description: + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", + required: true, + }, + categories: [ + "Benign", + "Likely_benign", + "Uncertain_significance", + "Likely_pathogenic", + "Pathogenic", + "Conflicting_interpretations_of_pathogenicity", + ], + label: "ClinVar variant combination", + description: "Clinical significance for a haplotype or genotype that includes this variant", }, { id: "clinVar_CLNREVSTAT", - number: { type: "OTHER", separator: "," }, + number: { type: "OTHER", separator: "&" }, type: "CATEGORICAL", parent: { id: "CSQ", number: { type: "OTHER", separator: "|" }, type: "STRING", description: - "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNREVSTAT", + "Consequence annotations from Ensembl VEP. Format: Consequence|PHENO|STRAND|gnomAD_AF|X|clinVar|clinVar_CLNSIG|clinVar_CLNSIGINCL|clinVar_CLNREVSTAT", required: true, }, categories: [ From b1c364e56d0506b21fce33e94eff73ad189c46a1 Mon Sep 17 00:00:00 2001 From: Dennis Hendriksen Date: Thu, 23 Jun 2022 14:36:25 +0200 Subject: [PATCH 2/2] fix:clinVar metadata --- src/VepMetadataParser.ts | 3 +-- src/__tests__/VepMetadataParser.test.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/VepMetadataParser.ts b/src/VepMetadataParser.ts index 6cb26cd..4b4e6b9 100644 --- a/src/VepMetadataParser.ts +++ b/src/VepMetadataParser.ts @@ -65,8 +65,7 @@ function parseVepInfoMetadata(infoMetadata: InfoMetadata, token: string): InfoMe case "clinVar": label = "ClinVar ID"; description = "ClinVar Variation ID"; - numberType = "NUMBER"; - numberCount = 1; + numberType = "OTHER"; type = "INTEGER"; break; case "clinVar_CLNSIG": diff --git a/src/__tests__/VepMetadataParser.test.ts b/src/__tests__/VepMetadataParser.test.ts index 1ffa5ac..ec73728 100644 --- a/src/__tests__/VepMetadataParser.test.ts +++ b/src/__tests__/VepMetadataParser.test.ts @@ -114,7 +114,7 @@ test("create vep metadata", () => { }, { id: "clinVar", - number: { type: "NUMBER", count: 1 }, + number: { type: "OTHER" }, type: "INTEGER", parent: { id: "CSQ",