From 02286fa15be47053d2e80a8f707dbb2361772033 Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Fri, 13 Oct 2023 16:58:21 +0200 Subject: [PATCH] feat: proper serde renames for Consequence and PutativeImpact (#214) --- src/annotate/seqvars/ann.rs | 13 +++++++++++++ ...__csq__test__annotate_snv_brca1_one_variant.snap | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/annotate/seqvars/ann.rs b/src/annotate/seqvars/ann.rs index b0932c85..aee0a16a 100644 --- a/src/annotate/seqvars/ann.rs +++ b/src/annotate/seqvars/ann.rs @@ -29,6 +29,7 @@ use strum::IntoEnumIterator; strum::EnumIter, )] #[display(style = "UPPERCASE")] +#[serde(rename_all = "UPPERCASE")] pub enum PutativeImpact { High, Moderate, @@ -53,6 +54,7 @@ pub enum PutativeImpact { strum::EnumIter, )] #[display(style = "snake_case")] +#[serde(rename_all = "snake_case")] pub enum Consequence { // high impact ChromosomeNumberVariation, @@ -67,8 +69,10 @@ pub enum Consequence { TranscriptAblation, // moderate impact #[display("3_prime_UTR_truncation")] + #[serde(rename = "3_prime_UTR_truncation")] ThreePrimeUtrTruncation, #[display("5_prime_UTR_truncation")] + #[serde(rename = "5_prime_UTR_truncation")] FivePrimeUtrTruncaction, ConservativeInframeDeletion, ConservativeInframeInsertion, @@ -78,9 +82,11 @@ pub enum Consequence { RegulatoryRegionAblation, SpliceRegionVariant, #[display("TFBS_ablation")] + #[serde(rename = "TFBS_ablation")] TbfsAblation, // low impact #[display("5_prime_UTR_premature_start_codon_gain_variant")] + #[serde(rename = "5_prime_UTR_premature_start_codon_gain_variant")] FivePrimeUtrPrematureStartCodonGainVariant, InitiatorCodonVariant, StartRetained, @@ -88,8 +94,10 @@ pub enum Consequence { SynonymousVariant, // modifier #[display("3_prime_UTR_variant")] + #[serde(rename = "3_prime_UTR_variant")] ThreePrimeUtrVariant, #[display("5_prime_UTR_variant")] + #[serde(rename = "5_prime_UTR_variant")] FivePrimeUtrVariant, CodingSequenceVariant, ConservedIntergenicVariant, @@ -102,18 +110,23 @@ pub enum Consequence { IntergenicVariant, IntronVariant, #[display("mature_miRNA_variant")] + #[serde(rename = "mature_miRNA_variant")] MatureMirnaVariant, #[display("miRNA")] + #[serde(rename = "miRNA")] Mirna, #[display("NMD_transcript_variant")] + #[serde(rename = "NMD_transcript_variant")] NmdTranscriptVariant, NonCodingTranscriptExonVariant, NonCodingTranscriptIntronVariant, RegulatoryRegionAmplification, RegulatoryRegionVariant, #[display("TF_binding_site_variant")] + #[serde(rename = "TF_binding_site_variant")] TfBindingSiteVariant, #[display("TFBS_amplification")] + #[serde(rename = "TFBS_amplification")] TfbsAmplification, TranscriptAmplification, TranscriptVariant, diff --git a/src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant.snap b/src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant.snap index 7258e66a..8f255518 100644 --- a/src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant.snap +++ b/src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant.snap @@ -6,8 +6,8 @@ allele: Alt: alternative: C consequences: - - MissenseVariant -putative_impact: Moderate + - missense_variant +putative_impact: MODERATE gene_symbol: BRCA1 gene_id: "HGNC:1100" feature_type: