Skip to content

Commit

Permalink
feat: proper serde renames for Consequence and PutativeImpact (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Oct 13, 2023
1 parent cc61a66 commit 02286fa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/annotate/seqvars/ann.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use strum::IntoEnumIterator;
strum::EnumIter,
)]
#[display(style = "UPPERCASE")]
#[serde(rename_all = "UPPERCASE")]
pub enum PutativeImpact {
High,
Moderate,
Expand All @@ -53,6 +54,7 @@ pub enum PutativeImpact {
strum::EnumIter,
)]
#[display(style = "snake_case")]
#[serde(rename_all = "snake_case")]
pub enum Consequence {
// high impact
ChromosomeNumberVariation,
Expand All @@ -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,
Expand All @@ -78,18 +82,22 @@ 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,
StopRetainedVariant,
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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 02286fa

Please sign in to comment.