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..4b4e6b9 100644 --- a/src/VepMetadataParser.ts +++ b/src/VepMetadataParser.ts @@ -65,15 +65,29 @@ 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": - label = "ClinVar"; - description = "ClinVar classification(s)"; + label = "ClinVar variant"; + description = "Clinical significance for this single variant"; numberType = "OTHER"; - separator = "/"; + 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 = "&"; type = "CATEGORICAL"; categories = [ "Benign", @@ -88,7 +102,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..ec73728 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,20 +108,20 @@ 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, }, }, { id: "clinVar", - number: { type: "NUMBER", count: 1 }, + number: { type: "OTHER" }, type: "INTEGER", 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, }, label: "ClinVar ID", @@ -129,14 +129,37 @@ 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_CLNSIGINCL|clinVar_CLNREVSTAT", + required: true, + }, + categories: [ + "Benign", + "Likely_benign", + "Uncertain_significance", + "Likely_pathogenic", + "Pathogenic", + "Conflicting_interpretations_of_pathogenicity", + ], + 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_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 +170,19 @@ test("create vep metadata", () => { "Pathogenic", "Conflicting_interpretations_of_pathogenicity", ], - label: "ClinVar", - description: "ClinVar classification(s)", + 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: [