// Minimal ClinVar variant information for use in Mehari.

syntax = "proto3";

package annonars.clinvar.v1.minimal;

// Enumeration for variant type.
enum VariantType {
    // deletion
    DELETION = 0;
    // duplication
    DUPLICATION = 1;
    // indel
    INDEL = 2;
    // insertion
    INSERTION = 3;
    // inversion
    INVERSION = 4;
    // single nucleotide variant
    SNV = 5;
}

// Enumeration for ClinVar pathogenicity.
enum ClinicalSignificance {
    // Pathogenic.
    PATHOGENIC = 0;
    // Likely pathogenic.
    LIKELY_PATHOGENIC = 1;
    // Uncertain significance.
    UNCERTAIN_SIGNIFICANCE = 2;
    // Likely benign.
    LIKELY_BENIGN = 3;
    // Benign.
    BENIGN = 4;
}

/// Enumeration for ClinVar review status.
enum ReviewStatus {
    // "practice guideline"
    PRACTICE_GUIDELINE = 0;
    // "reviewed by expert panel"
    REVIEWED_BY_EXPERT_PANEL = 1;
    // "criteria provided, multiple submitters, no conflicts"
    CRITERIA_PROVIDED_MULTIPLE_SUBMITTERS_NO_CONFLICTS = 2;
    // "criteria provided, single submitter"
    CRITERIA_PROVIDED_SINGLE_SUBMITTER = 3;
    // "criteria provided, conflicting interpretations"
    CRITERIA_PROVIDED_CONFLICTING_INTERPRETATIONS = 4;
    // "no assertion criteria provided"
    NO_ASSERTION_CRITERIA_PROVIDED = 5;
    // "no assertion provided"
    NO_ASSERTION_PROVIDED = 6;
}

// Record for storing information about a reference clinvar assertion.
message ReferenceAssertion {
    // RCV accession identifier.
    string rcv = 1;
    // Title of the reference assertion, includes phenotype / disease.
    string title = 2;
    // Clinical significance for variant.
    ClinicalSignificance clinical_significance = 3;
    // Review status.
    ReviewStatus review_status = 4;
}

// Record for storing minimal information on ClinVar for Mehari.
message Record {
    // Genome release.
    string release = 1;
    // Chromosome name.
    string chromosome = 2;
    // 1-based start position.
    uint32 start = 3;
    // 1-based end position.
    uint32 stop = 4;
    // Reference allele bases in VCF notation.
    string reference = 5;
    // Alternative allele bases in VCF notation.
    string alternative = 6;
    // VCV accession identifier.
    string vcv = 7;
    // The reference assertions, sorted by (ClinicalSignificance, ReviewStatus).
    repeated ReferenceAssertion reference_assertions = 8;
}
