From fca2ec0aab8c1d73e412b4d816bed331417c4a8a Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Tue, 30 Jan 2024 15:38:28 +0100 Subject: [PATCH] feat: adding more protobuf files and generated code (#49) --- Makefile | 20 +- protos/annonars/cons/base.proto | 29 + protos/annonars/dbsnp/base.proto | 17 + protos/annonars/functional/base.proto | 0 protos/annonars/functional/refseq.proto | 101 + protos/annonars/gnomad/exac_cnv.proto | 52 + protos/annonars/gnomad/gnomad2.proto | 253 +++ protos/annonars/gnomad/gnomad3.proto | 257 +++ protos/annonars/gnomad/gnomad4.proto | 130 ++ protos/annonars/gnomad/gnomad_cnv4.proto | 111 + protos/annonars/gnomad/gnomad_sv2.proto | 205 ++ protos/annonars/gnomad/gnomad_sv4.proto | 187 ++ protos/annonars/gnomad/mtdna.proto | 238 ++ protos/annonars/gnomad/vep_common.proto | 21 + protos/annonars/gnomad/vep_gnomad2.proto | 149 ++ protos/annonars/gnomad/vep_gnomad3.proto | 102 + protos/annonars/gnomad/vep_gnomad4.proto | 103 + protos/annonars/helixmtdb/base.proto | 26 + protos/annonars/regions/clingen.proto | 25 + .../SeqvarScoresCard/SeqvarScoresCard.vue | 940 ++++++++ .../VariantScoresCard.spec.ts | 42 + src/pbs/annonars/cons/base.ts | 259 +++ src/pbs/annonars/dbsnp/base.ts | 140 ++ src/pbs/annonars/functional/refseq.ts | 483 ++++ src/pbs/annonars/gnomad/exac_cnv.ts | 236 ++ src/pbs/annonars/gnomad/gnomad2.ts | 1995 +++++++++++++++++ src/pbs/annonars/gnomad/gnomad3.ts | 1940 ++++++++++++++++ src/pbs/annonars/gnomad/gnomad4.ts | 1100 +++++++++ src/pbs/annonars/gnomad/gnomad_cnv4.ts | 807 +++++++ src/pbs/annonars/gnomad/gnomad_sv2.ts | 1069 +++++++++ src/pbs/annonars/gnomad/gnomad_sv4.ts | 1057 +++++++++ src/pbs/annonars/gnomad/mtdna.ts | 1856 +++++++++++++++ src/pbs/annonars/gnomad/vep_common.ts | 193 ++ src/pbs/annonars/gnomad/vep_gnomad2.ts | 971 ++++++++ src/pbs/annonars/gnomad/vep_gnomad3.ts | 691 ++++++ src/pbs/annonars/gnomad/vep_gnomad4.ts | 686 ++++++ src/pbs/annonars/helixmtdb/base.ts | 193 ++ src/pbs/annonars/regions/clingen.ts | 197 ++ 38 files changed, 16879 insertions(+), 2 deletions(-) create mode 100644 protos/annonars/cons/base.proto create mode 100644 protos/annonars/dbsnp/base.proto create mode 100644 protos/annonars/functional/base.proto create mode 100644 protos/annonars/functional/refseq.proto create mode 100644 protos/annonars/gnomad/exac_cnv.proto create mode 100644 protos/annonars/gnomad/gnomad2.proto create mode 100644 protos/annonars/gnomad/gnomad3.proto create mode 100644 protos/annonars/gnomad/gnomad4.proto create mode 100644 protos/annonars/gnomad/gnomad_cnv4.proto create mode 100644 protos/annonars/gnomad/gnomad_sv2.proto create mode 100644 protos/annonars/gnomad/gnomad_sv4.proto create mode 100644 protos/annonars/gnomad/mtdna.proto create mode 100644 protos/annonars/gnomad/vep_common.proto create mode 100644 protos/annonars/gnomad/vep_gnomad2.proto create mode 100644 protos/annonars/gnomad/vep_gnomad3.proto create mode 100644 protos/annonars/gnomad/vep_gnomad4.proto create mode 100644 protos/annonars/helixmtdb/base.proto create mode 100644 protos/annonars/regions/clingen.proto create mode 100644 src/components/SeqvarScoresCard/SeqvarScoresCard.vue create mode 100644 src/components/SeqvarScoresCard/VariantScoresCard.spec.ts create mode 100644 src/pbs/annonars/cons/base.ts create mode 100644 src/pbs/annonars/dbsnp/base.ts create mode 100644 src/pbs/annonars/functional/refseq.ts create mode 100644 src/pbs/annonars/gnomad/exac_cnv.ts create mode 100644 src/pbs/annonars/gnomad/gnomad2.ts create mode 100644 src/pbs/annonars/gnomad/gnomad3.ts create mode 100644 src/pbs/annonars/gnomad/gnomad4.ts create mode 100644 src/pbs/annonars/gnomad/gnomad_cnv4.ts create mode 100644 src/pbs/annonars/gnomad/gnomad_sv2.ts create mode 100644 src/pbs/annonars/gnomad/gnomad_sv4.ts create mode 100644 src/pbs/annonars/gnomad/mtdna.ts create mode 100644 src/pbs/annonars/gnomad/vep_common.ts create mode 100644 src/pbs/annonars/gnomad/vep_gnomad2.ts create mode 100644 src/pbs/annonars/gnomad/vep_gnomad3.ts create mode 100644 src/pbs/annonars/gnomad/vep_gnomad4.ts create mode 100644 src/pbs/annonars/helixmtdb/base.ts create mode 100644 src/pbs/annonars/regions/clingen.ts diff --git a/Makefile b/Makefile index 1d2a603..6f75ff6 100644 --- a/Makefile +++ b/Makefile @@ -69,11 +69,27 @@ PROTO_BASE := https://raw.githubusercontent.com/varfish-org/annonars/main .PHONY: proto-fetch proto-fetch: - mkdir -p protos/annonars/{genes,clinvar} - wget -O protos/annonars/genes/base.proto $(PROTO_BASE)/protos/annonars/genes/base.proto + mkdir -p protos/annonars/{clinvar,cons,dbsnp,functional,genes,gnomad,helixmtdb,regions} wget -O protos/annonars/clinvar/minimal.proto $(PROTO_BASE)/protos/annonars/clinvar/minimal.proto wget -O protos/annonars/clinvar/per_gene.proto $(PROTO_BASE)/protos/annonars/clinvar/per_gene.proto wget -O protos/annonars/clinvar/sv.proto $(PROTO_BASE)/protos/annonars/clinvar/sv.proto + wget -O protos/annonars/cons/base.proto $(PROTO_BASE)/protos/annonars/cons/base.proto + wget -O protos/annonars/dbsnp/base.proto $(PROTO_BASE)/protos/annonars/dbsnp/base.proto + wget -O protos/annonars/functional/refseq.proto $(PROTO_BASE)/protos/annonars/functional/refseq.proto + wget -O protos/annonars/gnomad/exac_cnv.proto $(PROTO_BASE)/protos/annonars/gnomad/exac_cnv.proto + wget -O protos/annonars/gnomad/gnomad2.proto $(PROTO_BASE)/protos/annonars/gnomad/gnomad2.proto + wget -O protos/annonars/gnomad/gnomad3.proto $(PROTO_BASE)/protos/annonars/gnomad/gnomad3.proto + wget -O protos/annonars/gnomad/gnomad4.proto $(PROTO_BASE)/protos/annonars/gnomad/gnomad4.proto + wget -O protos/annonars/gnomad/gnomad_cnv4.proto $(PROTO_BASE)/protos/annonars/gnomad/gnomad_cnv4.proto + wget -O protos/annonars/gnomad/gnomad_sv2.proto $(PROTO_BASE)/protos/annonars/gnomad/gnomad_sv2.proto + wget -O protos/annonars/gnomad/gnomad_sv4.proto $(PROTO_BASE)/protos/annonars/gnomad/gnomad_sv4.proto + wget -O protos/annonars/gnomad/mtdna.proto $(PROTO_BASE)/protos/annonars/gnomad/mtdna.proto + wget -O protos/annonars/gnomad/vep_common.proto $(PROTO_BASE)/protos/annonars/gnomad/vep_common.proto + wget -O protos/annonars/gnomad/vep_gnomad2.proto $(PROTO_BASE)/protos/annonars/gnomad/vep_gnomad2.proto + wget -O protos/annonars/gnomad/vep_gnomad3.proto $(PROTO_BASE)/protos/annonars/gnomad/vep_gnomad3.proto + wget -O protos/annonars/gnomad/vep_gnomad4.proto $(PROTO_BASE)/protos/annonars/gnomad/vep_gnomad4.proto + wget -O protos/annonars/helixmtdb/base.proto $(PROTO_BASE)/protos/annonars/helixmtdb/base.proto + wget -O protos/annonars/regions/clingen.proto $(PROTO_BASE)/protos/annonars/regions/clingen.proto .PHONY: proto-ts proto-ts: diff --git a/protos/annonars/cons/base.proto b/protos/annonars/cons/base.proto new file mode 100644 index 0000000..1ed6a95 --- /dev/null +++ b/protos/annonars/cons/base.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package annonars.cons.base; + +// List of `Record`s. +message RecordList { + // The records in the list. + repeated Record records = 1; +} + +// Protocol buffer for the UCSC conservation record. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based, inclusive start position. + int32 start = 2; + // 1-based, inclusive stop position. + int32 stop = 3; + // HGNC identifier. + string hgnc_id = 4; + // ENST identifier. + string enst_id = 5; + // Exon number (1-based). + int32 exon_num = 6; + // Exon count. + int32 exon_count = 7; + // Alignment. + string alignment = 8; +} diff --git a/protos/annonars/dbsnp/base.proto b/protos/annonars/dbsnp/base.proto new file mode 100644 index 0000000..7df58e7 --- /dev/null +++ b/protos/annonars/dbsnp/base.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package annonars.dbsnp.base; + +// Protocol buffer for the dbSNP VCF record. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 pos = 2; + // Reference allele. + string ref_allele = 3; + /// Alternate allele. + string alt_allele = 4; + /// The rs ID. + int32 rs_id = 5; +} diff --git a/protos/annonars/functional/base.proto b/protos/annonars/functional/base.proto new file mode 100644 index 0000000..e69de29 diff --git a/protos/annonars/functional/refseq.proto b/protos/annonars/functional/refseq.proto new file mode 100644 index 0000000..5fb6645 --- /dev/null +++ b/protos/annonars/functional/refseq.proto @@ -0,0 +1,101 @@ +// Protocolbuffers definition for RefSeq functional elements. + +syntax = "proto3"; + +package annonars.functional.refseq; + +// Enumeration for `gbkey` field. +enum Category { + // unknown + CATEGORY_UNKNOWN = 0; + // Miscaellaneous feature. + CATEGORY_MISC_FEATURE = 1; + // Miscaellaneous recombination feature. + CATEGORY_MISC_RECOMB = 2; + // Miscaellaneous structure. + CATEGORY_MISC_STRUCTURE = 3; + // Mobile element. + CATEGORY_MOBILE_ELEMENT = 4; + // Protein binding annotation. + CATEGORY_PROTEIN_BIND = 5; + // Region. + CATEGORY_REGION = 6; + // Regulatory element. + CATEGORY_REGULATORY = 7; + // Repeat region + CATEGORY_REPEAT_REGION = 8; + // Replication origin. + CATEGORY_REP_ORIGIN = 9; +} + +// Enumeration for `regulatory_class` field. +enum RegulatoryClass { + // unknown + REGULATORY_UNKNOWN = 0; + // CCAAT signal. + REGULATORY_CLASS_CAAT_SIGNAL = 1; + // DNase I hypersensitive site. + REGULATORY_CLASS_DNASE_I_HYPERSENSITIVE_SITE = 2; + // Enhancer. + REGULATORY_CLASS_ENHANCER = 3; + // Enhancer blocking element. + REGULATORY_CLASS_ENHANCER_BLOCKING_ELEMENT = 4; + // Epigenetically modified region. + REGULATORY_CLASS_EPIGENETICALLY_MODIFIED_REGION = 5; + // GC signal. + REGULATORY_CLASS_GC_SIGNAL = 6; + // Imprinting control region. + REGULATORY_CLASS_IMPRINTING_CONTROL_REGION = 7; + // Insulator. + REGULATORY_CLASS_INSULATOR = 8; + // Locus control region. + REGULATORY_CLASS_LOCUS_CONTROL_REGION = 9; + // Matrix attachment region. + REGULATORY_CLASS_MATRIX_ATTACHMENT_REGION = 10; + // Micrococcal nuclease hypersensitive site. + REGULATORY_CLASS_MICROCOCCAL_NUCLEASE_HYPERSENSITIVE_SITE = 11; + // Promoter. + REGULATORY_CLASS_PROMOTER = 12; + // Replication regulatory region. + REGULATORY_CLASS_REPLICATION_REGULATORY_REGION = 13; + // Response element. + REGULATORY_CLASS_RESPONSE_ELEMENT = 14; + // Silencer. + REGULATORY_CLASS_SILENCER = 15; + // TATA box. + REGULATORY_CLASS_TATA_BOX = 16; + // Transcriptional cis regulatory region. + REGULATORY_CLASS_TRANSCRIPTIONAL_CIS_REGULATORY_REGION = 17; +} + +// Message for storing a RefSeq regulatory element. +message Record { + // Chromosome + string chromosome = 1; + // Start position (1-based) + int32 start = 2; + // Stop position (1-based) + int32 stop = 3; + + // ID + string id = 4; + // Dbxref + string dbxref = 5; + + // Category of record. + Category category = 6; + // Regulatory class of record. + optional RegulatoryClass regulatory_class = 7; + // note + optional string note = 8; + // experiment + optional string experiment = 9; + // function + optional string function = 10; +} + +// Message for storing multiple Gbxref IDs. +message DbxrefList { + // Dbxref IDs. + repeated string dbxref = 1; +} diff --git a/protos/annonars/gnomad/exac_cnv.proto b/protos/annonars/gnomad/exac_cnv.proto new file mode 100644 index 0000000..32248d5 --- /dev/null +++ b/protos/annonars/gnomad/exac_cnv.proto @@ -0,0 +1,52 @@ +// Protocol buffers for representing ExAC CNV data. + +syntax = "proto3"; + +package annonars.gnomad.exac_cnv; + +// Enumeration for the CNV type. +enum CnvType { + // unknown + CNV_TYPE_UNKNOWN = 0; + // Deletion. + CNV_TYPE_DEL = 1; + // Duplication. + CNV_TYPE_DUP = 2; +} + +// ExAC population. +enum Population { + // unknown + POPULATION_UNKNOWN = 0; + // African + POPULATION_AFR = 1; + // Ad Mixed American + POPULATION_AMR = 2; + // East Asian + POPULATION_EAS = 3; + // Finnish + POPULATION_FIN = 4; + // Non-Finnish European + POPULATION_NFE = 5; + // South Asian + POPULATION_SAS = 6; + // Other, + POPULATION_OTHER = 7; +} + +// Protocol buffer for the ExAC CNV data. +// +// The more specialized fields from the INFO column are stored in separate, optional fields such +// that we don't end up with a humongous message. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 start = 2; + // 1-based stop position. + int32 stop = 3; + /// The type of the variant. + CnvType sv_type = 4; + /// The population. + Population population = 5; +} diff --git a/protos/annonars/gnomad/gnomad2.proto b/protos/annonars/gnomad/gnomad2.proto new file mode 100644 index 0000000..2e58182 --- /dev/null +++ b/protos/annonars/gnomad/gnomad2.proto @@ -0,0 +1,253 @@ +syntax = "proto3"; + +package annonars.gnomad.gnomad2; + +import "annonars/gnomad/vep_gnomad2.proto"; + +// Protocol buffer enum for site-level filters. +enum Filter { + // unknown + FILTER_UNKNOWN = 0; + // Allele count is zero after filtering out low-confidence genotypes (GQ < 20; DP < 10; and AB < + // 0.2 for het calls). + FILTER_ALLELE_COUNT_IS_ZERO = 1; + // InbreedingCoeff < -0.3. + FILTER_INBREEDING_COEFF = 2; + // Passed all variant filters + FILTER_PASS = 3; + // Failed random forest filtering thresholds of 0.055272738028512555, 0.20641025579497013 + // (probabilities of being a true positive variant) for SNPs, indels + FILTER_RANDOM_FOREST = 4; +} + +// Store the relevant allele counts and frequencies in a given sub cohort. +message AlleleCounts { + // Number of alternate alleles in sub cohort. + int32 ac = 1; + // Total number of alleles in the sub cohort. + int32 an = 2; + // Number of homozygous alternate alleles in the sub cohort. + int32 nhomalt = 3; + // Alternate allele frequency in the sub cohort. + float af = 4; +} + +// Store the allele counts for the given sub cohort and sub cohort factored by sex. +message AlleleCountsBySex { + // Overall allele counts in the sub cohort. + AlleleCounts overall = 1; + // Allele counts in female/XX karyotype individuals of sub cohort. + optional AlleleCounts xx = 2; + // Allele counts in male/XY karyotype individuals of sub cohort. + optional AlleleCounts xy = 3; +} + +// Store the allele counts for the given population. +message PopulationAlleleCounts { + // Name of the population. + string population = 1; + // The overall allele counts and the one by sex. + AlleleCountsBySex counts = 2; + + // The filtering allele frequency (using Poisson 95% CI). + optional float faf95 = 3; + // The filtering allele frequency (using Poisson 99% CI). + optional float faf99 = 4; +} + +// Store the allele counts for the given cohort. +message CohortAlleleCounts { + // Name of the cohort. + optional string cohort = 1; + // Allele counts for each population. + repeated PopulationAlleleCounts by_population = 2; + // Allele counts by sex. + AlleleCountsBySex by_sex = 3; + // Raw allele counts. + AlleleCounts raw = 4; + + // The population with maximum AF. + optional string popmax = 5; + // Maximum allele frequency across populations (excluding samples of Ashkenazi, Finnish, and + // indeterminate ancestry). + optional float af_popmax = 6; + // Allele count in population with maximum AF. + optional int32 ac_popmax = 7; + // Total number of alleles in population with maximum AF. + optional int32 an_popmax = 8; + // Total number of homozygous individuals in population with maximum AF. + optional int32 nhomalt_popmax = 9; +} + +// Encapsulate VCF INFO fields related to age. +message AgeInfo { + // Histogram of ages of individuals with a homoplasmic variant; bin edges are: [30.0, 35.0, + // 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0]. + repeated int32 age_hist_hom_bin_freq = 1; + // Count of age values falling below lowest histogram bin edge for individuals with a + // homoplasmic variant. + optional int32 age_hist_hom_n_smaller = 2; + // Count of age values falling above highest histogram bin edge for individuals with a + // homoplasmic variant. + optional int32 age_hist_hom_n_larger = 3; + // Histogram of ages of individuals with a heteroplasmic variant; bin edges are: [30.0, 35.0, + // 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0] + repeated int32 age_hist_het_bin_freq = 4; + // Count of age values falling below lowest histogram bin edge for individuals with a + // heteroplasmic variant. + optional int32 age_hist_het_n_smaller = 5; + // Count of age values falling above highest histogram bin edge for individuals with a + // heteroplasmic variant. + optional int32 age_hist_het_n_larger = 6; +} + +// Encapsulate VCF INFO fields related to depth. +message DepthInfo { + // Count of dp values falling above highest histogram bin edge for all individuals. + optional int32 dp_hist_all_n_larger = 1; + // Count of dp values falling above highest histogram bin edge for individuals with the + // alternative allele + optional int32 dp_hist_alt_n_larger = 2; + // Histogram of dp values for all individuals; bin edges are: [0.0, 200.0, 400.0, 600.0, 800.0, + // 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + repeated int32 dp_hist_all_bin_freq = 3; + // Histogram of dp values for individuals with the alternative allele; bin edges are: [0.0, + // 200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + repeated int32 dp_hist_alt_bin_freq = 4; +} + +// Encapsulate quality-related information. +message QualityInfo { + // Phred-scaled p-value of Fisher's exact test for strand bias. + optional float fs = 1; + // Inbreeding coefficient as estimated from the genotype likelihoods per-sample when compared + // against the Hardy-Weinberg expectation. + optional float inbreeding_coeff = 2; + // Root mean square of the mapping quality of reads across all samples. + optional float mq = 3; + // Z-score from Wilcoxon rank sum test of alternate vs. reference read mapping qualities. + optional float mq_rank_sum = 4; + // Variant call confidence normalized by depth of sample reads supporting a variant. + optional float qd = 5; + // Z-score from Wilcoxon rank sum test of alternate vs. reference read position bias. + optional float read_pos_rank_sum = 6; + // Variant was used to build the positive training set of high-quality variants for VQSR. + bool vqsr_positive_train_site = 7; + // Variant was used to build the negative training set of low-quality variants for VQSR. + bool vqsr_negative_train_site = 8; + // Z-score from Wilcoxon rank sum test of alternate vs. reference base qualities. + optional float base_q_rank_sum = 9; + // Z-score from Wilcoxon rank sum test of alternate vs. reference number of hard clipped bases. + optional float clipping_rank_sum = 10; + // Strand bias estimated by the symmetric odds ratio test + optional float sor = 11; + // Depth of informative coverage for each sample; reads with MQ=255 or with bad mates are + // filtered. + optional int32 dp = 12; + // Log-odds ratio of being a true variant versus being a false positive under the trained VQSR + // Gaussian mixture model. + optional float vqslod = 13; + // Allele-specific worst-performing annotation in the VQSR Gaussian mixture model + optional string vqsr_culprit = 14; + // Variant falls within a segmental duplication region + bool segdup = 15; + // Variant falls within a low complexity region. + bool lcr = 16; + // Variant falls within a reference decoy region. + bool decoy = 17; + // Variant was a callset-wide doubleton that was transmitted within a family (i.e., a singleton + // amongst unrelated sampes in cohort). + bool transmitted_singleton = 18; + // Maximum p-value over callset for binomial test of observed allele balance for a heterozygous + // genotype, given expectation of AB=0.5. + optional float pab_max = 19; +} + +// Random forest related information. +message RandomForestInfo { + // Random forest prediction probability for a site being a true variant. + float rf_tp_probability = 1; + // Variant was labelled as a positive example for training of random forest model. + bool rf_positive_label = 2; + // Variant was labelled as a negative example for training of random forest model. + bool rf_negative_label = 3; + // Random forest training label. + optional string rf_label = 4; + // Variant was used in training random forest model. + bool rf_train = 5; +} + +// Liftover related information. +message LiftoverInfo { + // The REF and the ALT alleles have been reverse complemented in liftover since the mapping from + // the previous reference to the current one was on the negative strand. + bool reverse_complemented_alleles = 1; + // The REF and the ALT alleles have been swapped in liftover due to changes in the reference. It + // is possible that not all INFO annotations reflect this swap, and in the genotypes, only the + // GT, PL, and AD fields have been modified. You should check the TAGS_TO_REVERSE parameter that + // was used during the LiftOver to be sure. + bool swapped_alleles = 2; + // A list of the original alleles (including REF) of the variant prior to liftover. If the + // alleles were not changed during liftover, this attribute will be omitted. + repeated string original_alleles = 3; + // The name of the source contig/chromosome prior to liftover. + optional string original_contig = 4; + // The position of the variant on the source contig prior to liftover. + optional string original_start = 5; +} + +// Variant type related information. +message VariantInfo { + // Variant type (snv, indel, multi-snv, multi-indel, or mixed). + string variant_type = 1; + // Allele type (snv, ins, del, or mixed). + string allele_type = 2; + // Total number of alternate alleles observed at variant locus. + int32 n_alt_alleles = 3; + // Variant type was mixed. + bool was_mixed = 4; + // Variant locus coincides with a spanning deletion (represented by a star) observed elsewhere + // in the callset. + bool has_star = 5; +} + +// Protocol buffer for the gnomAD v2 VCF record. +// +// The more specialized fields from the INFO column are stored in separate, optional fields such +// that we don't end up with a humongous message. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 pos = 2; + // Reference allele. + string ref_allele = 3; + // Alternate allele. + string alt_allele = 4; + + // Site-level filters. + repeated Filter filters = 5; + // VEP annotation records. + repeated annonars.gnomad.vep_gnomad2.Vep vep = 6; + + // Variant allele counts in the different cohorts and population. + // + // The populations in gnomAD v2/3 are: empty for global, "controls", "non_cancer", "non_neuro", + // and "non_topmed". + repeated CohortAlleleCounts allele_counts = 7; + // Variant (on sex chromosome) falls outside a pseudoautosomal region + bool nonpar = 8; + + // Information on lift-over from GRCh37 to GRCh38. + optional LiftoverInfo liftover_info = 9; + // Random forest related information. + optional RandomForestInfo rf_info = 10; + // Variant-related information details. + optional VariantInfo variant_info = 11; + // Summary information for variant quality interpretation. + optional QualityInfo quality_info = 12; + // Age-related information. + optional AgeInfo age_info = 13; + // Depth of coverage-related information. + optional DepthInfo depth_info = 14; +} diff --git a/protos/annonars/gnomad/gnomad3.proto b/protos/annonars/gnomad/gnomad3.proto new file mode 100644 index 0000000..cff006e --- /dev/null +++ b/protos/annonars/gnomad/gnomad3.proto @@ -0,0 +1,257 @@ +// Protobufs for gnomAD v3. +// +// In the case of smaller additions in **both exomes and genomes** in v4.0, +// we extended the protobufs here and re-used them. + +syntax = "proto3"; + +package annonars.gnomad.gnomad3; + +import "annonars/gnomad/vep_gnomad3.proto"; + +// Protocol buffer enum for site-level filters. +enum Filter { + // unknown + FILTER_UNKNOWN = 0; + // Allele count is zero after filtering out low-confidence genotypes (GQ < 20; DP < 10; and AB < + // 0.2 for het calls). + FILTER_ALLELE_COUNT_IS_ZERO = 1; + // Failed VQSR filtering thresholds of: + // + // gnomAD-genomes v3: -2.7739 for SNPs and -1.0606 for indels + // gnomAD-genomes v4: -2.502 for SNPs and -0.7156 for indels + // gnomAD-exomes v4: -1.4526 for SNPs and 0.0717 for indels + FILTER_AS_VSQR = 2; + // InbreedingCoeff < -0.3. + FILTER_INBREEDING_COEFF = 3; + // Passed all variant filters + FILTER_PASS = 4; +} + +// Store details on variant effect predictions. +message EffectInfo { + // PrimateAI's deleteriousness score from 0 (less deleterious) to 1 (more deleterious). + optional float primate_ai_score = 1; + // dbNSFP's Revel score from 0 to 1. Variants with higher scores are predicted to be + // more likely to be deleterious. + optional float revel_score = 2; + // Illumina's SpliceAI max delta score; interpreted as the probability of the variant + // being splice-altering. + optional float splice_ai_max_ds = 3; + // The consequence term associated with the max delta score in 'splice_ai_max_ds'. + optional string splice_ai_consequence = 4; + // Raw CADD scores are interpretable as the extent to which the annotation profile for a given variant suggests that the variant is likely to be 'observed' (negative values) vs 'simulated' (positive values). Larger values are more deleterious. + optional float cadd_raw = 5; + // Cadd Phred-like scores ('scaled C-scores') ranging from 1 to 99, based on the rank of each variant relative to all possible 8.6 billion substitutions in the human reference genome. Larger values are more deleterious. + optional float cadd_phred = 6; +} + +// Store the relevant allele counts and frequencies in a given sub cohort. +message AlleleCounts { + // Number of alternate alleles in sub cohort. + int32 ac = 1; + // Total number of alleles in the sub cohort. + int32 an = 2; + // Number of homozygous alternate alleles in the sub cohort. + int32 nhomalt = 3; + // Alternate allele frequency in the sub cohort. + float af = 4; +} + +// Store the allele counts for the given sub cohort and sub cohort factored by sex. +message AlleleCountsBySex { + // Overall allele counts in the sub cohort. + AlleleCounts overall = 1; + // Allele counts in female/XX karyotype individuals of sub cohort. + optional AlleleCounts xx = 2; + // Allele counts in male/XY karyotype individuals of sub cohort. + optional AlleleCounts xy = 3; +} + +// Store the allele counts for the given sub cohort in the given population. +message PopulationAlleleCounts { + // Name of the population. + string population = 1; + // The overall allele counts and the one by sex. + AlleleCountsBySex counts = 2; + + // The filtering allele frequency (using Poisson 95% CI). + optional float faf95 = 3; + // The filtering allele frequency (using Poisson 99% CI). + optional float faf99 = 4; + // The filtering allele frequency for XX samples (using Poisson 95% CI). + optional float faf95_xx = 5; + // The filtering allele frequency for XX samples (using Poisson 99% CI). + optional float faf99_xx = 6; + // The filtering allele frequency for XY samples (using Poisson 95% CI). + optional float faf95_xy = 7; + // The filtering allele frequency for XY samples (using Poisson 99% CI). + optional float faf99_xy = 8; +} + +// Store the allele counts for the given cohort. +message CohortAlleleCounts { + // Name of the cohort. + optional string cohort = 1; + // Allele counts for each population. + repeated PopulationAlleleCounts by_population = 2; + // Allele counts by sex. + AlleleCountsBySex by_sex = 3; + // Raw allele counts. + AlleleCounts raw = 4; + + // The population with maximum AF. + optional string popmax = 5; + // Maximum allele frequency across populations (excluding samples of Ashkenazi, Finnish, and + // indeterminate ancestry). + optional float af_popmax = 6; + // Allele count in population with maximum AF. + optional int32 ac_popmax = 7; + // Total number of alleles in population with maximum AF. + optional int32 an_popmax = 8; + // Total number of homozygous individuals in population with maximum AF. + optional int32 nhomalt_popmax = 9; +} + +// Encapsulate VCF INFO fields related to age. +message AgeInfo { + // Histogram of ages of individuals with a homoplasmic variant; bin edges are: [30.0, 35.0, + // 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0]. + repeated int32 age_hist_hom_bin_freq = 1; + // Count of age values falling below lowest histogram bin edge for individuals with a + // homoplasmic variant. + optional int32 age_hist_hom_n_smaller = 2; + // Count of age values falling above highest histogram bin edge for individuals with a + // homoplasmic variant. + optional int32 age_hist_hom_n_larger = 3; + // Histogram of ages of individuals with a heteroplasmic variant; bin edges are: [30.0, 35.0, + // 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0] + repeated int32 age_hist_het_bin_freq = 4; + // Count of age values falling below lowest histogram bin edge for individuals with a + // heteroplasmic variant. + optional int32 age_hist_het_n_smaller = 5; + // Count of age values falling above highest histogram bin edge for individuals with a + // heteroplasmic variant. + optional int32 age_hist_het_n_larger = 6; +} + +// Encapsulate VCF INFO fields related to depth. +message DepthInfo { + // Count of dp values falling above highest histogram bin edge for all individuals. + optional int32 dp_hist_all_n_larger = 1; + // Count of dp values falling above highest histogram bin edge for individuals with the + // alternative allele + optional int32 dp_hist_alt_n_larger = 2; + // Histogram of dp values for all individuals; bin edges are: [0.0, 200.0, 400.0, 600.0, 800.0, + // 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + repeated int32 dp_hist_all_bin_freq = 3; + // Histogram of dp values for individuals with the alternative allele; bin edges are: [0.0, + // 200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + repeated int32 dp_hist_alt_bin_freq = 4; +} + +// Encapsulate quality-related information. +message QualityInfo { + // Allele-specific phred-scaled p-value of Fisher's exact test for strand bias. + optional float as_fs = 1; + // Inbreeding coefficient as estimated from the genotype likelihoods per-sample when compared + // against the Hardy-Weinberg expectation. + optional float inbreeding_coeff = 2; + // Allele-specific root mean square of the mapping quality of reads across all samples + optional float as_mq = 3; + // Z-score from Wilcoxon rank sum test of alternate vs. reference read mapping qualities. + optional float mq_rank_sum = 4; + // Allele-specific z-score from Wilcoxon rank sum test of alternate vs. reference read + // mapping qualities. + optional float as_mq_rank_sum = 5; + // Allele-specific variant call confidence normalized by depth of sample reads supporting a + // variant. + optional float as_qd = 6; + // Z-score from Wilcoxon rank sum test of alternate vs. reference read position bias. + optional float read_pos_rank_sum = 7; + // Allele-specific z-score from Wilcoxon rank sum test of alternate vs. reference read position bias. + optional float as_read_pos_rank_sum = 8; + // Allele-specific strand bias estimated by the symmetric odds ratio test. + optional float as_sor = 9; + // Variant was used to build the positive training set of high-quality variants for VQSR. + bool positive_train_site = 10; + // Variant was used to build the negative training set of low-quality variants for VQSR. + bool negative_train_site = 11; + // Allele-specific log-odds ratio of being a true variant versus being a false positive under the trained VQSR Gaussian mixture model. + optional float as_vqslod = 12; + // Allele-specific worst-performing annotation in the VQSR Gaussian mixture model. + optional string as_culprit = 13; + // Variant falls within a segmental duplication region. + bool segdup = 14; + // Variant falls within a low complexity region. + bool lcr = 15; + // Variant was a callset-wide doubleton that was transmitted within a family (i.e., a singleton + // amongst unrelated sampes in cohort). + bool transmitted_singleton = 16; + // Maximum p-value over callset for binomial test of observed allele balance for a heterozygous genotype, given expectation of 0.5. + optional float as_pab_max = 17; + // Allele-specific sum of PL[0] values; used to approximate the QUAL score. + optional int32 as_qual_approx = 18; + // Allele-specific forward/reverse read counts for strand bias tests. + optional string as_sb_table = 19; + // Strand bias estimated by the symmetric odds ratio test (v4 only). + optional float sor = 20; +} + + +// Variant type related information. +message VariantInfo { + // Variant type (snv, indel, multi-snv, multi-indel, or mixed). + string variant_type = 1; + // Allele type (snv, ins, del, or mixed). + string allele_type = 2; + // Total number of alternate alleles observed at variant locus. + int32 n_alt_alleles = 3; + // Variant type was mixed. + bool was_mixed = 4; + // All samples are homozygous alternate for the variant. + bool monoallelic = 5; + // Depth over variant genotypes (does not include depth of reference samples). + int32 var_dp = 6; + // Allele-specific depth over variant genotypes (does not include depth of reference samples) (v4 only). + optional int32 as_vardp = 7; +} + +// Protocol buffer for the gnomAD-nuclear VCF record. +// +// The more specialized fields from the INFO column are stored in separate, optional fields such +// that we don't end up with a humongous message. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 pos = 2; + // Reference allele. + string ref_allele = 3; + // Alternate allele. + string alt_allele = 4; + + // Site-level filters. + repeated Filter filters = 5; + // VEP annotation records. + repeated annonars.gnomad.vep_gnomad3.Vep vep = 6; + + // Variant allele counts in the different cohorts and population. + // + // The populations in gnomAD v2/3 are: empty for global, "controls", "non_cancer", "non_neuro", + // and "non_topmed". + repeated CohortAlleleCounts allele_counts = 7; + // Variant (on sex chromosome) falls outside a pseudoautosomal region + bool nonpar = 8; + + // Information on variant scores. + optional EffectInfo effect_info = 9; + // Variant-related information details. + optional VariantInfo variant_info = 10; + // Summary information for variant quality interpretation. + optional QualityInfo quality_info = 11; + // Age-related information. + optional AgeInfo age_info = 12; + // Depth of coverage-related information. + optional DepthInfo depth_info = 13; +} diff --git a/protos/annonars/gnomad/gnomad4.proto b/protos/annonars/gnomad/gnomad4.proto new file mode 100644 index 0000000..4ba20d2 --- /dev/null +++ b/protos/annonars/gnomad/gnomad4.proto @@ -0,0 +1,130 @@ +syntax = "proto3"; + +package annonars.gnomad.gnomad4; + +import "annonars/gnomad/gnomad3.proto"; +import "annonars/gnomad/vep_gnomad4.proto"; + +// Store details on variant effect predictions. +message EffectInfo { + // Pangolin's largest delta score across 2 splicing consequences, which reflects the probability of the variant being splice-altering"> + optional float pangolin_largest_ds = 1; + // Base-wise conservation score across the 241 placental mammals in the Zoonomia project. Score ranges from -20 to 9.28, and reflects acceleration (faster evolution than expected under neutral drift, assigned negative scores) as well as conservation (slower than expected evolution, assigned positive scores)."> + optional float phylop = 2; + // Score that predicts the possible impact of an amino acid substitution on the structure and function of a human protein, ranging from 0.0 (tolerated) to 1.0 (deleterious). We prioritize max scores for MANE Select transcripts where possible and otherwise report a score for the canonical transcript."> + optional float polyphen_max = 3; + // The maximum REVEL score at a site's MANE Select or canonical transcript. It's an ensemble score for predicting the pathogenicity of missense variants (based on 13 other variant predictors). Scores ranges from 0 to 1. Variants with higher scores are predicted to be more likely to be deleterious."> + optional float revel_max = 4; + // Score reflecting the scaled probability of the amino acid substitution being tolerated, ranging from 0 to 1. Scores below 0.05 are predicted to impact protein function. We prioritize max scores for MANE Select transcripts where possible and otherwise report a score for the canonical transcript."> + optional float sift_max = 5; + // Illumina's SpliceAI max delta score; interpreted as the probability of the variant being splice-altering."> + optional float spliceai_ds_max = 6; + // Raw CADD scores are interpretable as the extent to which the annotation profile for a given variant suggests that the variant is likely to be 'observed' (negative values) vs 'simulated' (positive values). Larger values are more deleterious. + optional float cadd_raw = 7; + // Cadd Phred-like scores ('scaled C-scores') ranging from 1 to 99, based on the rank of each variant relative to all possible 8.6 billion substitutions in the human reference genome. Larger values are more deleterious. + optional float cadd_phred = 8; +} + +// Store the allele counts for the given sub cohort in the given ancestry group. +message AncestryGroupAlleleCounts { + // Name of the ancestry group. + string ancestry_group = 1; + // The overall allele counts and the one by sex. + annonars.gnomad.gnomad3.AlleleCountsBySex counts = 2; + + // The filtering allele frequency (using Poisson 95% CI). + optional float faf95 = 3; + // The filtering allele frequency (using Poisson 99% CI). + optional float faf99 = 4; + // The filtering allele frequency for XX samples (using Poisson 95% CI). + optional float faf95_xx = 5; + // The filtering allele frequency for XX samples (using Poisson 99% CI). + optional float faf99_xx = 6; + // The filtering allele frequency for XY samples (using Poisson 95% CI). + optional float faf95_xy = 7; + // The filtering allele frequency for XY samples (using Poisson 99% CI). + optional float faf99_xy = 8; +} + +// Store the allele counts for the given cohort. +message CohortAlleleCounts { + // Name of the cohort. + optional string cohort = 1; + // Allele counts for each population. + repeated AncestryGroupAlleleCounts by_ancestry_group = 2; + // Allele counts by sex. + annonars.gnomad.gnomad3.AlleleCountsBySex by_sex = 3; + // Raw allele counts. + annonars.gnomad.gnomad3.AlleleCounts raw = 4; + + // The ancestry group with maximum AF. + optional string grpmax = 5; + // Maximum allele frequency across ancestry groups. + optional float af_grpmax = 6; + // Allele count in ancestry group with maximum AF. + optional int32 ac_grpmax = 7; + // Total number of alleles in ancestry group with maximum AF. + optional int32 an_grpmax = 8; + // Total number of homozygous individuals in ancestry group with maximum AF. + optional int32 nhomalt_grpmax = 9; +} + +// VRS information +message VrsInfo { + // The computed identifiers for the GA4GH VRS Alleles corresponding to the values in the REF and ALT fields + repeated string allele_ids = 1; + // Interresidue coordinates used as the location ends for the GA4GH VRS Alleles corresponding to the values in the REF and ALT fields + repeated int32 ends = 2; + // Interresidue coordinates used as the location starts for the GA4GH VRS Alleles corresponding to the values in the REF and ALT fields + repeated int32 starts = 3; + // The literal sequence states used for the GA4GH VRS Alleles corresponding to the values in the REF and ALT fields + repeated string states = 4; +} + +// Protocol buffer for the gnomAD-nuclear VCF record. +// +// The more specialized fields from the INFO column are stored in separate, optional fields such +// that we don't end up with a humongous message. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 pos = 2; + // Reference allele. + string ref_allele = 3; + // Alternate allele. + string alt_allele = 4; + + // Site-level filters. + repeated annonars.gnomad.gnomad3.Filter filters = 5; + // VEP annotation records. + repeated annonars.gnomad.vep_gnomad4.Vep vep = 6; + + // Variant allele counts in the different cohorts and population. + // + // The populations in gnomAD v4 are: empty for global, "joint" for exome+genomes. + repeated CohortAlleleCounts allele_counts = 7; + // Variant (on sex chromosome) falls outside a pseudoautosomal region + bool nonpar = 8; + // All samples are heterozygous for the variant + bool only_het = 9; + // Variant falls outside of Broad exome capture regions (exomes only). + bool outside_broad_capture_region = 10; + // Variant falls outside of UK Biobank exome capture regions(exomes only). + bool outside_ukb_capture_region = 11; + // Variant was a callset-wide doubleton that was present only in two siblings (i.e., a singleton amongst unrelated samples in cohort) (exomes only). + bool sibling_singleton = 12; + + // Information on variant scores. + optional EffectInfo effect_info = 13; + // Variant-related information details. + optional annonars.gnomad.gnomad3.VariantInfo variant_info = 14; + // Summary information for variant quality interpretation. + optional annonars.gnomad.gnomad3.QualityInfo quality_info = 15; + // Age-related information. + optional annonars.gnomad.gnomad3.AgeInfo age_info = 16; + // Depth of coverage-related information. + optional annonars.gnomad.gnomad3.DepthInfo depth_info = 17; + // VRS infos. + optional VrsInfo vrs_info = 18; +} diff --git a/protos/annonars/gnomad/gnomad_cnv4.proto b/protos/annonars/gnomad/gnomad_cnv4.proto new file mode 100644 index 0000000..60d62eb --- /dev/null +++ b/protos/annonars/gnomad/gnomad_cnv4.proto @@ -0,0 +1,111 @@ +// Protocol buffers for representing gnomAD-CNV v4 data. + +syntax = "proto3"; + +package annonars.gnomad.gnomad_cnv4; + +import "annonars/gnomad/exac_cnv.proto"; + + +// Carrier counts +message CarrierCounts { + // Number of releaseable samples with a variant at this site. + int32 sc = 1; + // Proportion of releaseable samples (site frequency) with a variant at + // this site. + float sf = 2; + // Total number of releaseable samples considered at this site. + int32 sn = 3; +} + +// Store the carrier counts for the given sub cohort and sub cohort factored by sex. +message CarrierCountsBySex { + // Overall carrier counts in the sub cohort. + CarrierCounts overall = 1; + // Carrier counts in female/XX karyotype individuals of sub cohort. + optional CarrierCounts xx = 2; + // Carrier counts in male/XY karyotype individuals of sub cohort. + optional CarrierCounts xy = 3; +} + +// ExAC population. +enum Population { + // unknown + POPULATION_UNKNOWN = 0; + // African + POPULATION_AFR = 1; + // Ad Mixed American + POPULATION_AMR = 2; + // Ashkenazi Jewish + POPULATION_ASJ = 3; + // East Asian + POPULATION_EAS = 4; + // Finnish + POPULATION_FIN = 5; + // Middle Eastern + POPULATION_MID = 6; + // Non-Finnish European + POPULATION_NFE = 7; + // South Asian + POPULATION_SAS = 8; +} + +// Store the carrier counts for a population. +message PopulationCarrierCounts { + // The population. + Population population = 1; + // The overall allele counts and the one by sex. + CarrierCountsBySex counts = 2; +} + +// Store the allele counts for the given cohort. +message CohortCarrierCounts { + // Name of the cohort, empty for global. + optional string cohort = 1; + // The overall carrier counts and the one by sex. + CarrierCountsBySex by_sex = 2; + // Carrier counts for each population. + repeated PopulationCarrierCounts by_population = 3; +} + +// One record in the gnomAD-CNV v4 dataset. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 start = 2; + // 1-based stop position. + int32 stop = 3; + + // 1-based inner start position. + int32 inner_start = 4; + // 1-based inner stop position. + int32 inner_stop = 5; + // 1-based outer start position. + int32 outer_start = 6; + // 1-based inner stop position. + int32 outer_stop = 7; + + // Unique identifier for the variant. + string id = 8; + + // Length of the SV. + int32 sv_len = 9; + // The type of the variant. + annonars.gnomad.exac_cnv.CnvType sv_type = 10; + + // Median number of callable exons spanned by variant passing QS + // threshold. + int32 n_exn_var = 11; + // Median number of callable intervals spanned by variant passing + // QS threshold. + int32 n_int_var = 12; + // Symbols of genes predicted to be impacted by variant + repeated string genes = 13; + + // Carrier counts in the different population. + // + // The populations in gnomAD CNV v4 are: empty for global, "non_neuro", + // and "non_neuro_coontrols". + repeated CohortCarrierCounts carrier_counts = 14; +} diff --git a/protos/annonars/gnomad/gnomad_sv2.proto b/protos/annonars/gnomad/gnomad_sv2.proto new file mode 100644 index 0000000..cc3f6d0 --- /dev/null +++ b/protos/annonars/gnomad/gnomad_sv2.proto @@ -0,0 +1,205 @@ +// Protocol buffers for representing gnomAD-SV v2 data. +// +// Note that we don't attempt to parse everything out of gnomAD-SV yet, just +// the parts that are important for identifying SVs as potentially benign. + +syntax = "proto3"; + +package annonars.gnomad.gnomad_sv2; + +// Protocol buffer enum for site-level filters. +enum Filter { + // unknown + FILTER_UNKNOWN = 0; + // All filters passed. + FILTER_PASS = 1; + // Site does not meet minimum requirements for fraction of PCR- samples + // with non-null genotypes. Flags sites more prone to false discoveries. + FILTER_LOW_CALL_RATE = 2; + // Multiallelic site. + FILTER_MULTIALLELIC = 3; + // Site enriched for non-reference genotypes among PCR+ samples. Likely + // reflects technical batch effects. All PCR- samples have been assigned + // null GTs for these sites. + FILTER_PCRPLUS_ENRICHED = 4; + // Variant is unresolved. + FILTER_UNRESOLVED = 5; + // Allele frequency for this variant in PCR- samples is sensitive to + // choice of GQ filtering thresholds. All PCR- samples have been assigned + // null GTs for these sites. + FILTER_UNSTABLE_AF_PCRMINUS = 6; +} + +// The types of SV in gnomad-SV v2. +enum SvType { + // unknown + SV_TYPE_UNKNOWN = 0; + // Breakend. + SV_TYPE_BND = 1; + // Complex variant. + SV_TYPE_CPX = 2; + // Translocation. + SV_TYPE_CTX = 3; + // Deletion. + SV_TYPE_DEL = 4; + // Duplication. + SV_TYPE_DUP = 5; + // Insertion. + SV_TYPE_INS = 6; + // Inversion. + SV_TYPE_INV = 7; + // Copy number variable region. + SV_TYPE_MCNV = 8; +} + +// Further definition of CPX type. +enum CpxType { + // unknown + CPX_TYPE_UNKNOWN = 0; + // CCR: Complex chromosomal rearrangement, involving two or more + // chromosomes and multiple SV signatures. + CPX_TYPE_CCR = 1; + // INS_iDEL: Insertion with deletion at insertion site. + CPX_TYPE_INS_IDEL = 2; + // INVdel: Complex inversion with 3' flanking deletion. + CPX_TYPE_INV_DEL = 3; + // INVdup: Complex inversion with 3' flanking duplication. + CPX_TYPE_INV_DUP = 4; + // dDUP: Dispersed duplication. + CPX_TYPE_DDUP = 5; + // dDUP_iDEL: Dispersed duplication with deletion at insertion site. + CPX_TYPE_DDUP_IDEL = 6; + // delINVdel: Complex inversion with 5' and 3' flanking deletions. + CPX_TYPE_DEL_INV_DEL = 7; + // delINVdup: Complex inversion with 5' flanking deletion and 3' flanking + // duplication. + CPX_TYPE_DEL_INV_DUP = 8; + // delINV: Complex inversion with 5' flanking deletion. + CPX_TYPE_DEL_INV = 9; + // dupINVdel: Complex inversion with 5' flanking duplication and 3' + // flanking deletion. + CPX_TYPE_DUP_INV_DEL = 10; + // dupINVdup: Complex inversion with 5' and 3' flanking duplications. + CPX_TYPE_DUP_INV_DUP = 11; + // dupINV: Complex inversion with 5' flanking duplication. + CPX_TYPE_DUP_INV = 12; + // piDUP_FR: Palindromic inverted tandem duplication, forward-reverse + // orientation. + CPX_TYPE_PI_DUP_FR = 13; + // piDUP_RF: Palindromic inverted tandem duplication, reverse-forward + // orientation. + CPX_TYPE_PI_DUP_RF = 14; + // CTX_INV: new in gnomAD SV 4.0 but not documented yet + CPX_TYPE_CTX_INV = 15; + // CTX_PP/QQ: new in gnomAD SV 4.0 but not documented yet + CPX_TYPE_CTX_PP_QQ = 16; + // CTX_PQ/QP: new in gnomAD SV 4.0 but not documented yet + CPX_TYPE_CTX_PQ_QP = 17; +} + +// Store the relevant allele counts and frequencies in a given sub cohort. +message AlleleCounts { + // Total number of alleles genotyped (for biallelic sites) or individuals + // with copy-state estimates (for multiallelic sites). + int32 ac = 1; + // Number of non-reference alleles observed (for biallelic sites) or + // individuals at each copy state (for multiallelic sites). + int32 an = 2; + // Allele frequency (for biallelic sites) or copy-state frequency (for + // multiallelic sites). + float af = 3; + // Total number of individuals with complete genotypes (biallelic sites + // only). + int32 n_bi_genos = 4; + // Number of individuals with homozygous reference genotypes (biallelic + // sites only). + int32 n_homref = 5; + // Number of individuals with heterozygous genotypes (biallelic sites + // only). + int32 n_het = 6; + // Number of individuals with homozygous alternate genotypes (biallelic + // sites only). + int32 n_homalt = 7; + // Homozygous reference genotype frequency (biallelic sites only). + float freq_homref = 8; + // Heterozygous genotype frequency (biallelic sites only). + float freq_het = 9; + // Homozygous alternate genotype frequency (biallelic sites only). + float freq_homalt = 10; +} + +// Store the allele counts for the given sub cohort and sub cohort factored by sex. +message AlleleCountsBySex { + // Overall allele counts in the sub cohort. + AlleleCounts overall = 1; + // Allele counts in female/XX karyotype individuals of sub cohort. + AlleleCounts xx = 2; + // Allele counts in male/XY karyotype individuals of sub cohort. + AlleleCounts xy = 3; +} + +// gnomAD SV population. +enum Population { + // unknown + POPULATION_UNKNOWN = 0; + // African + POPULATION_AFR = 1; + // Ad Mixed American + POPULATION_AMR = 2; + // East Asian + POPULATION_EAS = 3; + // European. + POPULATION_EUR = 4; + // Other, + POPULATION_OTHER = 5; +} + +// Store the allele counts for the given sub cohort in the given population. +message PopulationAlleleCounts { + // Name of the population. + Population population = 1; + // The overall allele counts and the one by sex. + AlleleCountsBySex counts = 2; +} + +// Store the allele counts for the given cohort. +message CohortAlleleCounts { + // Name of the cohort, empty for global. + optional string cohort = 1; + // The overall allele counts and the one by sex. + AlleleCountsBySex by_sex = 2; + // Allele counts for each population. + repeated PopulationAlleleCounts by_population = 3; +} + +// Protocol buffer for the gnomAD-SV v2 VCF record. +// +// The more specialized fields from the INFO column are stored in separate, optional fields such +// that we don't end up with a humongous message. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 pos = 2; + // End position of the structural variant + optional int32 end = 3; + // Chromosome of second breakpoint position. + optional string chrom2 = 4; + // End coordinate of second breakpoint position. + optional int32 end2 = 5; + // Identifier of the record. + string id = 6; + + // Site-level filters. + repeated Filter filters = 7; + // SV Type. + SvType sv_type = 8; + // Refined complex type. + optional CpxType cpx_type = 9; + + // Variant allele counts in the different cohorts and population. + // + // The populations in gnomAD v2/3 are: empty for global, "controls", "non_neuro", + // and "non_topmed". + repeated CohortAlleleCounts allele_counts = 10; +} diff --git a/protos/annonars/gnomad/gnomad_sv4.proto b/protos/annonars/gnomad/gnomad_sv4.proto new file mode 100644 index 0000000..652fc77 --- /dev/null +++ b/protos/annonars/gnomad/gnomad_sv4.proto @@ -0,0 +1,187 @@ +// Protocol buffers for representing gnomAD-SV v4 data. + +syntax = "proto3"; + +package annonars.gnomad.gnomad_sv4; + +import "annonars/gnomad/gnomad_sv2.proto"; + +// Enumeration for filters. +enum Filter { + // unknown + FILTER_UNKNOWN = 0; + // All filters passed. + FILTER_PASS = 1; + // Low-quality variant that did not pass manual review of supporting + // evidence. + FILTER_FAIL_MANUAL_REVIEW = 2; + // Unacceptably high rate of no-call GTs + FILTER_HIGH_NCR = 3; + // SVs that are overlapped by over 50% by IGH or MHC regions, these + // variants are of low confidence. + FILTER_IGH_MHC_OVERLAP = 4; + // Deletions under 1 kbp that are uniquely from wham and have SR-only + // support. + FILTER_LOWQUAL_WHAM_SR_DEL = 5; + // Multiallelic site + FILTER_MULTIALLELIC = 6; + // SVs that are enriched for non-reference genotypes in outlier samples, + // likely indicating noisy or unreliable genotypes. + FILTER_OUTLIER_SAMPLE_ENRICHED = 7; + // Multiple large CNVs called at the same locus likely indicates unreliable + // clustering and/or low-quality multiallelic locus. + FILTER_REDUNDANT_LG_CNV = 8; + // Likely reference artifact sites that are homozygous alternative in over + // 99% of the samples. + FILTER_REFERENCE_ARTIFACT = 9; + // Variant is unresolved + FILTER_UNRESOLVED = 10; + // Generic failure. + FILTER_FAIL = 11; +} + +// The types of SV in gnomad-SV v2. +enum SvType { + // unknown + SV_TYPE_UNKNOWN = 0; + // Breakend. + SV_TYPE_BND = 1; + // Copy number variable region. + SV_TYPE_CNV = 2; + // Complex variant. + SV_TYPE_CPX = 3; + // Translocation. + SV_TYPE_CTX = 4; + // Deletion. + SV_TYPE_DEL = 5; + // Duplication. + SV_TYPE_DUP = 6; + // Insertion. + SV_TYPE_INS = 7; + // Inversion. + SV_TYPE_INV = 8; +} + +// Store the relevant allele counts and frequencies in a given sub cohort. +message AlleleCounts { + // Total number of alleles genotyped (for biallelic sites) or individuals + // with copy-state estimates (for multiallelic sites). + int32 ac = 1; + // Allele frequency (for biallelic sites) or copy-state frequency (for + // multiallelic sites). + float af = 2; + // Number of non-reference alleles observed (for biallelic sites) or + // individuals at each copy state (for multiallelic sites). + int32 an = 3; + + // Hemizygous alternate genotype frequency (biallelic sites only). + float freq_hemialt = 4; + // Hemizygous reference genotype frequency (biallelic sites only). + float freq_hemiref = 5; + // Heterozygous genotype frequency (biallelic sites only). + float freq_het = 6; + // Homozygous alternate genotype frequency (biallelic sites only). + float freq_homalt = 7; + // Homozygous reference genotype frequency (biallelic sites only). + float freq_homref = 8; + + // Total number of individuals with complete genotypes (biallelic sites + // only). + int32 n_bi_genos = 9; + + // Number of individuals with hemizygous alternate genotypes (biallelic + // sites only). + int32 n_hemialt = 10; + // Number of individuals with hemizygous reference genotypes (biallelic + // sites only). + int32 n_hemiref = 11; + // Number of individuals with heterozygous genotypes (biallelic sites + // only). + int32 n_het = 12; + // Number of individuals with homozygous alternate genotypes (biallelic + // sites only). + int32 n_homalt = 13; + // Number of individuals with homozygous reference genotypes (biallelic + // sites only). + int32 n_homref = 14; +} + +// Store the allele counts for the given sub cohort and sub cohort factored by sex. +message AlleleCountsBySex { + // Overall allele counts in the sub cohort. + AlleleCounts overall = 1; + // Allele counts in female/XX karyotype individuals of sub cohort. + AlleleCounts xx = 2; + // Allele counts in male/XY karyotype individuals of sub cohort. + AlleleCounts xy = 3; +} + +// gnomAD SV population. +enum Population { + // unknown + POPULATION_UNKNOWN = 0; + // African + POPULATION_AFR = 1; + // Amish + POPULATION_AMI = 2; + // Admixed American + POPULATION_AMR = 3; + // Ashkenazi Jewish + POPULATION_ASJ = 4; + // East Asian + POPULATION_EAS = 5; + // Finnish + POPULATION_FIN = 6; + // Middle Eastern + POPULATION_MID = 7; + // Non-Finnish European + POPULATION_NFE = 8; + // South Asian + POPULATION_SAS = 9; + // Other + POPULATION_OTHER = 10; +} + +// Store the allele counts for the given sub cohort in the given population. +message PopulationAlleleCounts { + // Name of the population. + Population population = 1; + // The overall allele counts and the one by sex. + AlleleCountsBySex counts = 2; +} + +// Store the allele counts for the given cohort. +message CohortAlleleCounts { + // Name of the cohort, empty for global. + optional string cohort = 1; + // The overall allele counts and the one by sex. + AlleleCountsBySex by_sex = 2; + // Allele counts for each population. + repeated PopulationAlleleCounts by_population = 3; +} + +// Protocol buffer for the gnomAD-SV v4 VCF record. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 pos = 2; + // End position of the structural variant + optional int32 end = 3; + // Chromosome of second breakpoint position. + optional string chrom2 = 4; + // End coordinate of second breakpoint position. + optional int32 end2 = 5; + // Identifier of the record. + string id = 6; + + // Site-level filters. + repeated Filter filters = 7; + // SV Type. + SvType sv_type = 8; + // Refined complex type. + optional annonars.gnomad.gnomad_sv2.CpxType cpx_type = 9; + + // Variant allele counts in the different cohorts and population. + repeated CohortAlleleCounts allele_counts = 10; +} diff --git a/protos/annonars/gnomad/mtdna.proto b/protos/annonars/gnomad/mtdna.proto new file mode 100644 index 0000000..b495235 --- /dev/null +++ b/protos/annonars/gnomad/mtdna.proto @@ -0,0 +1,238 @@ +syntax = "proto3"; + +package annonars.gnomad.mtdna; + +import "annonars/gnomad/vep_gnomad3.proto"; + +// Protocol buffer enum for site-level filters. +enum Filter { + // unknown + FILTER_UNKNOWN = 0; + // Variant overlaps site that is commonly reported in literature to be artifact prone. + FILTER_ARTIFACT_PRONE_SITE = 1; + // Allele where all samples with the variant call had at least 2 different heteroplasmic indels + // called at the position. + FILTER_INDEL_STACK = 2; + // No-pass-genotypes site (no individuals were PASS for the variant). + FILTER_NO_PASS_GENOTYPE = 3; +} + +// Encapsulate VCF INFO fields related to quality. +message QualityInfo { + // Mean depth across all individuals for the site. + optional float dp_mean = 1; + // Mean MMQ (median mapping quality) across individuals with a variant for the site. + optional float mq_mean = 2; + // Mean TLOD (Log 10 likelihood ratio score of variant existing versus not existing) across + // individuals with a variant for the site. + optional float tlod_mean = 3; +} + +// Encapsulate VCF INFO fields related to heteroplasmy levels. +message HeteroplasmyInfo { + // Histogram of number of individuals with a heteroplasmy level below 0.1, bin edges are: [0.0, + // 0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, + // 1.0] + repeated int32 heteroplasmy_below_min_het_threshold_hist = 1; + // Histogram of heteroplasmy levels; bin edges are: [0.0, 0.1, 0.2, 0.30000000000000004, 0.4, + // 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0]. + repeated int32 hl_hist = 2; + // Present if variant is found at an overall frequency of .001 across all samples with a + // heteroplasmy level > 0 and < 0.50 (includes variants <0.01 heteroplasmy which are + // subsequently filtered) + bool common_low_heteroplasmy = 3; + // Maximum heteroplasmy level observed among all samples for that variant. + float max_hl = 4; +} + +// Encapsulate VCF INFO fields related to filter failure histograms. +message FilterHistograms { + // Histogram of number of individuals failing the base_qual filter (alternate allele median base + // quality) across heteroplasmy levels, bin edges are: [0.0, 0.1, 0.2, 0.30000000000000004, 0.4, + // 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0] + repeated int32 base_qual_hist = 1; + // Histogram of number of individuals failing the position filter (median distance of alternate + // variants from end of reads) across heteroplasmy levels, bin edges are: [0.0, 0.1, 0.2, 0. + // 30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0] + repeated int32 position_hist = 2; + // Histogram of number of individuals failing the strand_bias filter (evidence for alternate + // allele comes from one read direction only) across heteroplasmy levels, bin edges are: [0.0, + // 0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, + // 1.0] + repeated int32 strand_bias_hist = 3; + // Histogram of number of individuals failing the weak_evidence filter (mutation does not meet + // likelihood threshold) across heteroplasmy levels, bin edges are: [0.0, 0.1, 0.2, + // 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0] + repeated int32 weak_evidence_hist = 4; + // Histogram of number of individuals failing the contamination filter across heteroplasmy + // levels, bin edges are: [0.0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, + // 0.7000000000000001, 0.8, 0.9, 1.0] + repeated int32 contamination_hist = 5; +} + +// Encapsulate VCF INFO fields related to populations. +message PopulationInfo { + // List of overall allele number for each population, population order: ['afr', 'ami', 'amr', + // 'asj', 'eas', 'fin', 'nfe', 'oth', 'sas', 'mid'] + repeated int32 pop_an = 1; + // List of AC_het for each population, population order: ['afr', 'ami', 'amr', 'asj', 'eas', + // 'fin', 'nfe', 'oth', 'sas', 'mid'] + repeated int32 pop_ac_het = 2; + // List of AC_hom for each population, population order: ['afr', 'ami', 'amr', 'asj', 'eas', + // 'fin', 'nfe', 'oth', 'sas', 'mid'] + repeated int32 pop_ac_hom = 3; + // List of AF_hom for each population, population order: ['afr', 'ami', 'amr', 'asj', 'eas', + // 'fin', 'nfe', 'oth', 'sas', 'mid'] + repeated float pop_af_hom = 4; + // List of AF_het for each population, population order: ['afr', 'ami', 'amr', 'asj', 'eas', + // 'fin', 'nfe', 'oth', 'sas', 'mid'] + repeated float pop_af_het = 5; + // Histogram of heteroplasmy levels for each population; bin edges are: [0.0, 0.1, 0.2, + // 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0], + // population order: ['afr', 'ami', 'amr', 'asj', 'eas', 'fin', 'nfe', 'oth', 'sas', 'mid'] + // + // Note that we encode this by concatenating all lists here because of limitations in + // protocolbuffers (no native nested repeated fields). + repeated int32 pop_hl_hist = 6; +} + +// Encapsulate VCF INFO fields related to haplogroups. +message HaplogroupInfo { + // Present if variant is present as a haplogroup defining variant in PhyloTree build 17. + bool hap_defining_variant = 1; + // List of overall allele number for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', + // 'E', 'F', 'G', 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', + // 'R', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] + repeated int32 hap_an = 2; + // List of AC_het for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', + // 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', + // 'V', 'W', 'X', 'Y', 'Z'] + repeated int32 hap_ac_het = 3; + // List of AC_hom for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', + // 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', + // 'V', 'W', 'X', 'Y', 'Z'] + repeated int32 hap_ac_hom = 4; + // List of AF_het for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', + // 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', + // 'V', 'W', 'X', 'Y', 'Z'] + repeated float hap_af_het = 5; + // List of AF_hom for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', + // 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', + // 'V', 'W', 'X', 'Y', 'Z'] + repeated float hap_af_hom = 6; + // Histogram of heteroplasmy levels for each haplogroup; bin edges are: [0.0, 0.1, 0.2, + // 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0], + // haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', + // 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] + // + // Note that we encode this by concatenating all lists here because of limitations in + // protocolbuffers (no native nested repeated fields). + repeated int32 hap_hl_hist = 7; + // List of filtering allele frequency for each haplogroup restricted to homoplasmic variants, + // haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', + // 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] + repeated float hap_faf_hom = 8; + // Haplogroup with maximum AF_hom. + optional string hapmax_af_hom = 9; + // Haplogroup with maximum AF_het. + optional string hapmax_af_het = 10; + // Maximum filtering allele frequency across haplogroups restricted to homoplasmic variants. + optional float faf_hapmax_hom = 11; +} + +// Encapsulate VCF INFO fields related to age. +message AgeInfo { + // Histogram of ages of individuals with a homoplasmic variant; bin edges are: [30.0, 35.0, + // 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0]. + repeated int32 age_hist_hom_bin_freq = 1; + // Count of age values falling below lowest histogram bin edge for individuals with a + // homoplasmic variant. + optional int32 age_hist_hom_n_smaller = 2; + // Count of age values falling above highest histogram bin edge for individuals with a + // homoplasmic variant. + optional int32 age_hist_hom_n_larger = 3; + // Histogram of ages of individuals with a heteroplasmic variant; bin edges are: [30.0, 35.0, + // 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0] + repeated int32 age_hist_het_bin_freq = 4; + // Count of age values falling below lowest histogram bin edge for individuals with a + // heteroplasmic variant. + optional int32 age_hist_het_n_smaller = 5; + // Count of age values falling above highest histogram bin edge for individuals with a + // heteroplasmic variant. + optional int32 age_hist_het_n_larger = 6; +} + +// Encapsulate VCF INFO fields related to depth. +message DepthInfo { + // Count of dp values falling above highest histogram bin edge for all individuals. + optional int32 dp_hist_all_n_larger = 1; + // Count of dp values falling above highest histogram bin edge for individuals with the + // alternative allele + optional int32 dp_hist_alt_n_larger = 2; + // Histogram of dp values for all individuals; bin edges are: [0.0, 200.0, 400.0, 600.0, 800.0, + // 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + repeated int32 dp_hist_all_bin_freq = 3; + // Histogram of dp values for individuals with the alternative allele; bin edges are: [0.0, + // 200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + repeated int32 dp_hist_alt_bin_freq = 4; +} + +// Protocol buffer for the gnomAD-mtDNA VCF record. +// +// The more specialized fields from the INFO column are stored in separate, optional fields such +// that we don't end up with a humongous message. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 pos = 2; + // Reference allele. + string ref_allele = 3; + // Alternate allele. + string alt_allele = 4; + + // Variant in format of RefPosAlt + string variant_collapsed = 5; + + // Excluded allele count (number of individuals in which the variant was filtered out). + int32 excluded_ac = 6; + // Overall allele number (number of samples with non-missing genotype). + int32 an = 7; + // Allele count restricted to variants with a heteroplasmy level >= 0.95. + int32 ac_hom = 8; + // Allele count restricted to variants with a heteroplasmy level >= 0.10 and < 0.95. + int32 ac_het = 9; + // Allele frequency restricted to variants with a heteroplasmy level >= 0.95. + float af_hom = 10; + // Allele frequency restricted to variants with a heteroplasmy level >= 0.10 and < 0.95. + float af_het = 11; + + // Site-level filters. + repeated Filter filters = 12; + + // MitoTip raw score + optional float mitotip_score = 13; + // MitoTip score interpretation + optional string mitotip_trna_prediction = 14; + // tRNA pathogenicity classification from PON-mt-tRNA + optional string pon_mt_trna_prediction = 15; + // tRNA ML_probability_of_pathogenicity from PON-mt-tRNA + optional string pon_ml_probability_of_pathogenicity = 16; + + // VEP v3 annotation records. + repeated annonars.gnomad.vep_gnomad3.Vep vep = 17; + // Summary information for variant quality interpretation. + optional QualityInfo quality_info = 18; + // Information related to heteroplasmy levels. + optional HeteroplasmyInfo heteroplasmy_info = 19; + // Histograms related to variant quality filters. + optional FilterHistograms filter_histograms = 20; + // Population-related information. + optional PopulationInfo population_info = 21; + // Haplogroup-related information. + optional HaplogroupInfo haplogroup_info = 22; + // Age-related information. + optional AgeInfo age_info = 23; + // Depth of coverage-related information. + optional DepthInfo depth_info = 24; +} diff --git a/protos/annonars/gnomad/vep_common.proto b/protos/annonars/gnomad/vep_common.proto new file mode 100644 index 0000000..a629ea3 --- /dev/null +++ b/protos/annonars/gnomad/vep_common.proto @@ -0,0 +1,21 @@ +// Common protocol buffer definitions for VEP records. + +syntax = "proto3"; + +package annonars.gnomad.vep_common; + +// Protocol buffer for `Vep.domains` +message Domain { + // Domain ID. + string id = 1; + // Domain source. + string source = 2; +} + +// Protocol buffer for `Vep.sift` and `Vep.polyphen`. +message Prediction { + // Prediction. + string prediction = 1; + // Score. + float score = 2; +} diff --git a/protos/annonars/gnomad/vep_gnomad2.proto b/protos/annonars/gnomad/vep_gnomad2.proto new file mode 100644 index 0000000..966ac83 --- /dev/null +++ b/protos/annonars/gnomad/vep_gnomad2.proto @@ -0,0 +1,149 @@ +// Protocol buffer definitions for gnomAD v2 VEP records. + +syntax = "proto3"; + +package annonars.gnomad.vep_gnomad2; + +import "annonars/gnomad/vep_common.proto"; + +// Protocol buffer for the gnomAD-mtDNA VEP predictions. +message Vep { + // Allele of record. + string allele = 1; + // Consequence, e.g., `"missense_variant"`. + string consequence = 2; + // Impact, e.g., `"MODERATE"`. + string impact = 3; + // Gene symbol, e.g., `"PCSK9"`. + string symbol = 4; + // Gene ID, `e.g., "ENSG00000169174"`. + string gene = 5; + // Feature type, e.g., `"Transcript"`. + string feature_type = 6; + // Feature ID, e.g., `"ENST00000302118"`. + string feature = 7; + // Feature biotype, e.g., `"protein_coding"`. + string feature_biotype = 8; + // Ranked exon number, e.g., `"1/4"`. + optional string exon = 9; + // Ranked intron number, e.g., `"1/4"`. + optional string intron = 10; + // cDNA position, e.g., `"ENST00000302118.5:c.89C>G"`. + optional string hgvsc = 11; + // Protein position, e.g., `"ENSP00000302118.5:p.Thr30Arg"`. + optional string hgvsp = 12; + // cDNA position, e.g., `"89/1863"`. + optional string cdna_position = 13; + // CDS position, e.g., `"89/1863"`. + optional string cds_position = 14; + // Protein position, e.g., `"30/620"`. + optional string protein_position = 15; + // Amino acids, e.g., `"T/R"`. + optional string amino_acids = 16; + // Codons, e.g., `"gCg/gGg"`. + optional string codons = 17; + // Existing variation info. + optional string existing_variation = 18; + // dbSNP ID, e.g., `"rs28942080"`. + optional string dbsnp_id = 19; + // Distance output of VEP. + optional string distance = 20; + // Strand, e.g., `"1"`. + optional string strand = 21; + // Flags, e.g., `"cds_end_NF"`. + optional string flags = 22; + // Variant class, e.g., `"SNV"`. + optional string variant_class = 23; + // Minimised output of VEP. + optional string minimised = 24; + // Symbol source, e.g., `"HGNC"`. + optional string symbol_source = 25; + // HGNC ID, e.g., `"HGNC:8706"`. + optional string hgnc_id = 26; + // Whether this is the canonical transcript. + bool canonical = 27; + // Transcript support level, e.g., `"1"`. + optional int32 tsl = 28; + // APPRIS annotation, e.g. `"P1"`. + optional string appris = 29; + // CCDS ID, e.g., `"CCDS30547.1"`. + optional string ccds = 30; + // Ensembl protein ID, e.g., `"ENSP00000302118"`. + optional string ensp = 31; + // SwissProt ID, e.g., `"P04114"`. + optional string swissprot = 32; + // TREMBL ID, e.g., `"Q5T4W7"`. + optional string trembl = 33; + // UniParc ID, e.g., `"UPI000002D4B2"`. + optional string uniparc = 34; + // Gene phenotype from VEP. + optional string gene_pheno = 35; + // SIFT prediction, e.g., `"tolerated(0.06)"`. + optional annonars.gnomad.vep_common.Prediction sift = 36; + // PolyPhen prediction, e.g., `"benign(0.001)"`. + optional annonars.gnomad.vep_common.Prediction polyphen = 37; + // Protein domains, e.g., `[["2p4e", "ENSP_mappings"], ["2qtw", "ENSP_mappings"]]`. + repeated annonars.gnomad.vep_common.Domain domains = 38; + // HGVS offset. + optional string hgvs_offset = 39; + + // Overall minor allele frequency. + optional float gmaf = 40; + // Minor allele frequency in AFR population. + optional float afr_maf = 41; + // Minor allele frequency in AMR population. + optional float amr_maf = 42; + // Minor allele frequency in EAS population. + optional float eas_maf = 43; + // Minor allele frequency in EUR population. + optional float eur_maf = 44; + // Minor allele frequency in SAS population. + optional float sas_maf = 45; + // Minor allele frequency in AA population. + optional float aa_maf = 46; + // Minor allele frequency in EA population. + optional float ea_maf = 47; + // Minor allele frequency in ExAC. + optional float exac_maf = 48; + // Minor allele frequency EXAC ADJ population. + optional float exac_adj_maf = 49; + // Minor allele frequency in ExAC AFR population. + optional float exac_afr_maf = 50; + // Minor allele frequency in ExAC AMR population. + optional float exac_amr_maf = 51; + // Minor allele frequency in ExAC EAS population. + optional float exac_eas_maf = 52; + // Minor allele frequency in ExAC FIN population. + optional float exac_fin_maf = 53; + // Minor allele frequency in ExAC NFE population. + optional float exac_nfe_maf = 54; + // Minor allele frequency in ExAC OTH population. + optional float exac_oth_maf = 55; + // Minor allele frequency in ExAC SAS population. + optional float exac_sas_maf = 56; + + // Clinical significance. + optional string clin_sig = 57; + // Whether the variant is somatic. + optional string somatic = 58; + // Phenotype. + optional string pheno = 59; + // Pubmed ID. + optional string pubmed = 60; + // Motif name. + optional string motif_name = 61; + // Motif pos. + optional string motif_pos = 62; + // "high inf pos" from VEP. + optional string high_inf_pos = 63; + // Motif score change. + optional string motif_score_change = 64; + // Loss of function prediction. + optional string lof = 65; + // Loss of function filter. + optional string lof_filter = 66; + // Loss of function flags. + optional string lof_flags = 67; + // Loss of function info. + optional string lof_info = 68; +} diff --git a/protos/annonars/gnomad/vep_gnomad3.proto b/protos/annonars/gnomad/vep_gnomad3.proto new file mode 100644 index 0000000..e245370 --- /dev/null +++ b/protos/annonars/gnomad/vep_gnomad3.proto @@ -0,0 +1,102 @@ +// Protocol buffer definitions for gnomAD v3 VEP records. + +syntax = "proto3"; + +package annonars.gnomad.vep_gnomad3; + +import "annonars/gnomad/vep_common.proto"; + +// Protocol buffer for the gnomAD-nuclear VEP predictions. +message Vep { + // Allele of record. + string allele = 1; + // Consequence, e.g., `"missense_variant"`. + string consequence = 2; + // Impact, e.g., `"MODERATE"`. + string impact = 3; + // Gene symbol, e.g., `"PCSK9"`. + string symbol = 4; + // Gene ID, `e.g., "ENSG00000169174"`. + string gene = 5; + // Feature type, e.g., `"Transcript"`. + string feature_type = 6; + // Feature ID, e.g., `"ENST00000302118"`. + string feature = 7; + // Feature biotype, e.g., `"protein_coding"`. + string feature_biotype = 8; + // Ranked exon number, e.g., `"1/4"`. + optional string exon = 9; + // Ranked intron number, e.g., `"1/4"`. + optional string intron = 10; + // cDNA position, e.g., `"ENST00000302118.5:c.89C>G"`. + optional string hgvsc = 11; + // Protein position, e.g., `"ENSP00000302118.5:p.Thr30Arg"`. + optional string hgvsp = 12; + // cDNA position, e.g., `"89/1863"`. + optional string cdna_position = 13; + // CDS position, e.g., `"89/1863"`. + optional string cds_position = 14; + // Protein position, e.g., `"30/620"`. + optional string protein_position = 15; + // Amino acids, e.g., `"T/R"`. + optional string amino_acids = 16; + // Codons, e.g., `"gCg/gGg"`. + optional string codons = 17; + // TODO: actually is optional int32 allele_num = 18; + // dbSNP ID, e.g., `"rs28942080"`. + optional string dbsnp_id = 18; + // Distance output of VEP. + optional string distance = 19; + // Strand, e.g., `"1"`. + optional string strand = 20; + // Variant class, e.g., `"SNV"`. + optional string variant_class = 21; + // Minimised output of VEP. + optional string minimised = 22; + // Symbol source, e.g., `"HGNC"`. + optional string symbol_source = 23; + // HGNC ID, e.g., `"HGNC:8706"`. + optional string hgnc_id = 24; + // Whether this is the canonical transcript. + optional bool canonical = 25; + // Transcript support level, e.g., `"1"`. + optional int32 tsl = 26; + // APPRIS annotation, e.g. `"P1"`. + optional string appris = 27; + // CCDS ID, e.g., `"CCDS30547.1"`. + optional string ccds = 28; + // Ensembl protein ID, e.g., `"ENSP00000302118"`. + optional string ensp = 29; + // SwissProt ID, e.g., `"P04114"`. + optional string swissprot = 30; + // TREMBL ID, e.g., `"Q5T4W7"`. + optional string trembl = 31; + // UniParc ID, e.g., `"UPI000002D4B2"`. + optional string uniparc = 32; + // Gene phenotype from VEP. + optional string gene_pheno = 33; + // SIFT prediction, e.g., `"tolerated(0.06)"`. + optional annonars.gnomad.vep_common.Prediction sift = 34; + // PolyPhen prediction, e.g., `"benign(0.001)"`. + optional annonars.gnomad.vep_common.Prediction polyphen = 35; + // Protein domains, e.g., `[["2p4e", "ENSP_mappings"], ["2qtw", "ENSP_mappings"]]`. + repeated annonars.gnomad.vep_common.Domain domains = 36; + // HGVS offset. + optional string hgvs_offset = 37; + // Motif name. + optional string motif_name = 38; + // Motif name. + optional string motif_pos = 39; + // "high inf pos" from VEP. + optional string high_inf_pos = 40; + // Motif score change. + optional string motif_score_change = 41; + // Loss of function prediction. + optional string lof = 42; + // Loss of function filter. + optional string lof_filter = 43; + // Loss of function flags. + optional string lof_flags = 44; + // Loss of function info. + optional string lof_info = 45; +} diff --git a/protos/annonars/gnomad/vep_gnomad4.proto b/protos/annonars/gnomad/vep_gnomad4.proto new file mode 100644 index 0000000..2f51177 --- /dev/null +++ b/protos/annonars/gnomad/vep_gnomad4.proto @@ -0,0 +1,103 @@ +// Protocol buffer definitions for gnomAD v4 VEP records. + +syntax = "proto3"; + +package annonars.gnomad.vep_gnomad4; + +import "annonars/gnomad/vep_common.proto"; + +// Protocol buffer for the gnomAD-nuclear VEP predictions. +message Vep { + // Allele of record. + string allele = 1; + // Consequence, e.g., `"missense_variant"`. + string consequence = 2; + // Impact, e.g., `"MODERATE"`. + string impact = 3; + // Gene symbol, e.g., `"PCSK9"`. + string symbol = 4; + // Gene ID, `e.g., "ENSG00000169174"`. + string gene = 5; + // Feature type, e.g., `"Transcript"`. + string feature_type = 6; + // Feature ID, e.g., `"ENST00000302118"`. + string feature = 7; + // Feature biotype, e.g., `"protein_coding"`. + string feature_biotype = 8; + // Ranked exon number, e.g., `"1/4"`. + optional string exon = 9; + // Ranked intron number, e.g., `"1/4"`. + optional string intron = 10; + // cDNA position, e.g., `"ENST00000302118.5:c.89C>G"`. + optional string hgvsc = 11; + // Protein position, e.g., `"ENSP00000302118.5:p.Thr30Arg"`. + optional string hgvsp = 12; + // cDNA position, e.g., `"89/1863"`. + optional string cdna_position = 13; + // CDS position, e.g., `"89/1863"`. + optional string cds_position = 14; + // Protein position, e.g., `"30/620"`. + optional string protein_position = 15; + // Amino acids, e.g., `"T/R"`. + optional string amino_acids = 16; + // Codons, e.g., `"gCg/gGg"`. + optional string codons = 17; + // Allele count. + optional int32 allele_num = 18; + // Distance output of VEP. + optional string distance = 19; + // Strand, e.g., `"1"`. + optional string strand = 20; + // Flags + optional string flags = 21; + // Variant class, e.g., `"SNV"`. + optional string variant_class = 22; + // Symbol source, e.g., `"HGNC"`. + optional string symbol_source = 23; + // HGNC ID, e.g., `"HGNC:8706"`. + optional string hgnc_id = 24; + // Whether this is the canonical transcript. + optional bool canonical = 25; + // Presence in MANE Select + optional bool mane_select = 26; + // Presence in MANE Plus Clinical + optional bool mane_plus_clinical = 27; + // Transcript support level, e.g., `"1"`. + optional int32 tsl = 28; + // APPRIS annotation, e.g. `"P1"`. + optional string appris = 29; + // CCDS ID, e.g., `"CCDS30547.1"`. + optional string ccds = 30; + // Ensembl protein ID, e.g., `"ENSP00000302118"`. + optional string ensp = 31; + // Uniprot isoform. + optional string uniprot_isoform = 32; + // Value of VEP "SOURCE" field. + optional string source = 33; + // Protein domains, e.g., `[["2p4e", "ENSP_mappings"], ["2qtw", "ENSP_mappings"]]`. + repeated annonars.gnomad.vep_common.Domain domains = 34; + // miRNA information. + optional string mirna = 35; + // HGVS offset. + optional string hgvs_offset = 36; + // PubMed IDs + optional string pubmed = 37; + // Motif name. + optional string motif_name = 38; + // Motif name. + optional string motif_pos = 39; + // "high inf pos" from VEP. + optional string high_inf_pos = 40; + // Motif score change. + optional string motif_score_change = 41; + // Transcription factors. + optional string transcription_factors = 42; + // Loss of function prediction. + optional string lof = 43; + // Loss of function filter. + optional string lof_filter = 44; + // Loss of function flags. + optional string lof_flags = 45; + // Loss of function info. + optional string lof_info = 46; +} diff --git a/protos/annonars/helixmtdb/base.proto b/protos/annonars/helixmtdb/base.proto new file mode 100644 index 0000000..8c6a84f --- /dev/null +++ b/protos/annonars/helixmtdb/base.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package annonars.helixmtdb.base; + +// Protocol buffer for the HelixMtDb VCF record. +message Record { + // Chromosome name. + string chrom = 1; + // 1-based start position. + int32 pos = 2; + // Reference allele. + string ref_allele = 3; + /// Alternate allele. + string alt_allele = 4; + + // Total number of individuals. + int32 num_total = 5; + // Number of homoplasmic carriers. + int32 num_het = 6; + // Number of heteroplasmic carriers. + int32 num_hom = 7; + // Feature type. + string feature_type = 8; + // Gene name. + string gene_name = 9; +} diff --git a/protos/annonars/regions/clingen.proto b/protos/annonars/regions/clingen.proto new file mode 100644 index 0000000..c953092 --- /dev/null +++ b/protos/annonars/regions/clingen.proto @@ -0,0 +1,25 @@ +// Genomic region annotation with ClinGen information. + +syntax = "proto3"; + +package annonars.regions.clingen; + +import "annonars/genes/base.proto"; + +// Dosage pathogenicity region annotation. +message Region { + // ISCA ID + string isca_id = 1; + // ISCA Region Name + string isca_region_name = 2; + // Genomic locaion. + string genomic_location = 3; + // Haploinsufficiency score. + annonars.genes.base.ClingenDosageScore haploinsufficiency_score = 4; + // Triplosensitivity score. + annonars.genes.base.ClingenDosageScore triplosensitivity_score = 5; + // Haploinsufficiency Disease ID. + optional string haploinsufficiency_disease_id = 6; + // Haploinsufficiency Disease ID. + optional string triplosensitivity_disease_id = 7; +} diff --git a/src/components/SeqvarScoresCard/SeqvarScoresCard.vue b/src/components/SeqvarScoresCard/SeqvarScoresCard.vue new file mode 100644 index 0000000..808d390 --- /dev/null +++ b/src/components/SeqvarScoresCard/SeqvarScoresCard.vue @@ -0,0 +1,940 @@ + + + + + diff --git a/src/components/SeqvarScoresCard/VariantScoresCard.spec.ts b/src/components/SeqvarScoresCard/VariantScoresCard.spec.ts new file mode 100644 index 0000000..719b7e8 --- /dev/null +++ b/src/components/SeqvarScoresCard/VariantScoresCard.spec.ts @@ -0,0 +1,42 @@ +import { describe, expect, it } from 'vitest' + +import * as BRCA1VariantInfo from '@/assets/__tests__/BRCA1VariantInfo.json' +import VariantTools from '@/components/SeqvarDetails/VariantScoresCard.vue' +import { setupMountedComponents } from '@/lib/testUtils' + +describe.concurrent('VariantTools', async () => { + it('renders the Variant Tools info', async () => { + // arrange: + const { wrapper } = await setupMountedComponents( + { component: VariantTools }, + { + props: { + varAnnos: BRCA1VariantInfo['result'] + } + } + ) + + // act: nothing, only test rendering + + // assert: + expect(wrapper.text()).toContain('Scoring Method') + expect(wrapper.text()).toContain('BayesDel') + }) + + it('renders the Variant Tools info with empty variance information', async () => { + // arrange: + const { wrapper } = await setupMountedComponents( + { component: VariantTools }, + { + props: { + varAnnos: undefined + } + } + ) + + // act: nothing, only test rendering + + // assert: + expect(wrapper.text()).toContain('No UCSC conservation data available.') + }) +}) diff --git a/src/pbs/annonars/cons/base.ts b/src/pbs/annonars/cons/base.ts new file mode 100644 index 0000000..c35b307 --- /dev/null +++ b/src/pbs/annonars/cons/base.ts @@ -0,0 +1,259 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/cons/base.proto" (package "annonars.cons.base", syntax proto3) +// tslint:disable +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +/** + * List of `Record`s. + * + * @generated from protobuf message annonars.cons.base.RecordList + */ +export interface RecordList { + /** + * The records in the list. + * + * @generated from protobuf field: repeated annonars.cons.base.Record records = 1; + */ + records: Record[] +} +/** + * Protocol buffer for the UCSC conservation record. + * + * @generated from protobuf message annonars.cons.base.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based, inclusive start position. + * + * @generated from protobuf field: int32 start = 2; + */ + start: number + /** + * 1-based, inclusive stop position. + * + * @generated from protobuf field: int32 stop = 3; + */ + stop: number + /** + * HGNC identifier. + * + * @generated from protobuf field: string hgnc_id = 4; + */ + hgncId: string + /** + * ENST identifier. + * + * @generated from protobuf field: string enst_id = 5; + */ + enstId: string + /** + * Exon number (1-based). + * + * @generated from protobuf field: int32 exon_num = 6; + */ + exonNum: number + /** + * Exon count. + * + * @generated from protobuf field: int32 exon_count = 7; + */ + exonCount: number + /** + * Alignment. + * + * @generated from protobuf field: string alignment = 8; + */ + alignment: string +} +// @generated message type with reflection information, may provide speed optimized methods +class RecordList$Type extends MessageType { + constructor() { + super('annonars.cons.base.RecordList', [ + { no: 1, name: 'records', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Record } + ]) + } + create(value?: PartialMessage): RecordList { + const message = globalThis.Object.create(this.messagePrototype!) + message.records = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RecordList + ): RecordList { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* repeated annonars.cons.base.Record records */ 1: + message.records.push(Record.internalBinaryRead(reader, reader.uint32(), options)) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: RecordList, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* repeated annonars.cons.base.Record records = 1; */ + for (let i = 0; i < message.records.length; i++) + Record.internalBinaryWrite( + message.records[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.cons.base.RecordList + */ +export const RecordList = new RecordList$Type() +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.cons.base.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'start', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'stop', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'hgnc_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'enst_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: 'exon_num', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 7, name: 'exon_count', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: 'alignment', kind: 'scalar', T: 9 /*ScalarType.STRING*/ } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.start = 0 + message.stop = 0 + message.hgncId = '' + message.enstId = '' + message.exonNum = 0 + message.exonCount = 0 + message.alignment = '' + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 start */ 2: + message.start = reader.int32() + break + case /* int32 stop */ 3: + message.stop = reader.int32() + break + case /* string hgnc_id */ 4: + message.hgncId = reader.string() + break + case /* string enst_id */ 5: + message.enstId = reader.string() + break + case /* int32 exon_num */ 6: + message.exonNum = reader.int32() + break + case /* int32 exon_count */ 7: + message.exonCount = reader.int32() + break + case /* string alignment */ 8: + message.alignment = reader.string() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 start = 2; */ + if (message.start !== 0) writer.tag(2, WireType.Varint).int32(message.start) + /* int32 stop = 3; */ + if (message.stop !== 0) writer.tag(3, WireType.Varint).int32(message.stop) + /* string hgnc_id = 4; */ + if (message.hgncId !== '') writer.tag(4, WireType.LengthDelimited).string(message.hgncId) + /* string enst_id = 5; */ + if (message.enstId !== '') writer.tag(5, WireType.LengthDelimited).string(message.enstId) + /* int32 exon_num = 6; */ + if (message.exonNum !== 0) writer.tag(6, WireType.Varint).int32(message.exonNum) + /* int32 exon_count = 7; */ + if (message.exonCount !== 0) writer.tag(7, WireType.Varint).int32(message.exonCount) + /* string alignment = 8; */ + if (message.alignment !== '') writer.tag(8, WireType.LengthDelimited).string(message.alignment) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.cons.base.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/dbsnp/base.ts b/src/pbs/annonars/dbsnp/base.ts new file mode 100644 index 0000000..13aef95 --- /dev/null +++ b/src/pbs/annonars/dbsnp/base.ts @@ -0,0 +1,140 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/dbsnp/base.proto" (package "annonars.dbsnp.base", syntax proto3) +// tslint:disable +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +/** + * Protocol buffer for the dbSNP VCF record. + * + * @generated from protobuf message annonars.dbsnp.base.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 pos = 2; + */ + pos: number + /** + * Reference allele. + * + * @generated from protobuf field: string ref_allele = 3; + */ + refAllele: string + /** + * / Alternate allele. + * + * @generated from protobuf field: string alt_allele = 4; + */ + altAllele: string + /** + * / The rs ID. + * + * @generated from protobuf field: int32 rs_id = 5; + */ + rsId: number +} +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.dbsnp.base.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'pos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'ref_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'alt_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'rs_id', kind: 'scalar', T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.pos = 0 + message.refAllele = '' + message.altAllele = '' + message.rsId = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 pos */ 2: + message.pos = reader.int32() + break + case /* string ref_allele */ 3: + message.refAllele = reader.string() + break + case /* string alt_allele */ 4: + message.altAllele = reader.string() + break + case /* int32 rs_id */ 5: + message.rsId = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 pos = 2; */ + if (message.pos !== 0) writer.tag(2, WireType.Varint).int32(message.pos) + /* string ref_allele = 3; */ + if (message.refAllele !== '') writer.tag(3, WireType.LengthDelimited).string(message.refAllele) + /* string alt_allele = 4; */ + if (message.altAllele !== '') writer.tag(4, WireType.LengthDelimited).string(message.altAllele) + /* int32 rs_id = 5; */ + if (message.rsId !== 0) writer.tag(5, WireType.Varint).int32(message.rsId) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.dbsnp.base.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/functional/refseq.ts b/src/pbs/annonars/functional/refseq.ts new file mode 100644 index 0000000..5f09e6b --- /dev/null +++ b/src/pbs/annonars/functional/refseq.ts @@ -0,0 +1,483 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/functional/refseq.proto" (package "annonars.functional.refseq", syntax proto3) +// tslint:disable +// +// Protocolbuffers definition for RefSeq functional elements. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +/** + * Message for storing a RefSeq regulatory element. + * + * @generated from protobuf message annonars.functional.refseq.Record + */ +export interface Record { + /** + * Chromosome + * + * @generated from protobuf field: string chromosome = 1; + */ + chromosome: string + /** + * Start position (1-based) + * + * @generated from protobuf field: int32 start = 2; + */ + start: number + /** + * Stop position (1-based) + * + * @generated from protobuf field: int32 stop = 3; + */ + stop: number + /** + * ID + * + * @generated from protobuf field: string id = 4; + */ + id: string + /** + * Dbxref + * + * @generated from protobuf field: string dbxref = 5; + */ + dbxref: string + /** + * Category of record. + * + * @generated from protobuf field: annonars.functional.refseq.Category category = 6; + */ + category: Category + /** + * Regulatory class of record. + * + * @generated from protobuf field: optional annonars.functional.refseq.RegulatoryClass regulatory_class = 7; + */ + regulatoryClass?: RegulatoryClass + /** + * note + * + * @generated from protobuf field: optional string note = 8; + */ + note?: string + /** + * experiment + * + * @generated from protobuf field: optional string experiment = 9; + */ + experiment?: string + /** + * function + * + * @generated from protobuf field: optional string function = 10; + */ + function?: string +} +/** + * Message for storing multiple Gbxref IDs. + * + * @generated from protobuf message annonars.functional.refseq.DbxrefList + */ +export interface DbxrefList { + /** + * Dbxref IDs. + * + * @generated from protobuf field: repeated string dbxref = 1; + */ + dbxref: string[] +} +/** + * Enumeration for `gbkey` field. + * + * @generated from protobuf enum annonars.functional.refseq.Category + */ +export enum Category { + /** + * unknown + * + * @generated from protobuf enum value: CATEGORY_UNKNOWN = 0; + */ + CATEGORY_UNKNOWN = 0, + /** + * Miscaellaneous feature. + * + * @generated from protobuf enum value: CATEGORY_MISC_FEATURE = 1; + */ + CATEGORY_MISC_FEATURE = 1, + /** + * Miscaellaneous recombination feature. + * + * @generated from protobuf enum value: CATEGORY_MISC_RECOMB = 2; + */ + CATEGORY_MISC_RECOMB = 2, + /** + * Miscaellaneous structure. + * + * @generated from protobuf enum value: CATEGORY_MISC_STRUCTURE = 3; + */ + CATEGORY_MISC_STRUCTURE = 3, + /** + * Mobile element. + * + * @generated from protobuf enum value: CATEGORY_MOBILE_ELEMENT = 4; + */ + CATEGORY_MOBILE_ELEMENT = 4, + /** + * Protein binding annotation. + * + * @generated from protobuf enum value: CATEGORY_PROTEIN_BIND = 5; + */ + CATEGORY_PROTEIN_BIND = 5, + /** + * Region. + * + * @generated from protobuf enum value: CATEGORY_REGION = 6; + */ + CATEGORY_REGION = 6, + /** + * Regulatory element. + * + * @generated from protobuf enum value: CATEGORY_REGULATORY = 7; + */ + CATEGORY_REGULATORY = 7, + /** + * Repeat region + * + * @generated from protobuf enum value: CATEGORY_REPEAT_REGION = 8; + */ + CATEGORY_REPEAT_REGION = 8, + /** + * Replication origin. + * + * @generated from protobuf enum value: CATEGORY_REP_ORIGIN = 9; + */ + CATEGORY_REP_ORIGIN = 9 +} +/** + * Enumeration for `regulatory_class` field. + * + * @generated from protobuf enum annonars.functional.refseq.RegulatoryClass + */ +export enum RegulatoryClass { + /** + * unknown + * + * @generated from protobuf enum value: REGULATORY_UNKNOWN = 0; + */ + REGULATORY_UNKNOWN = 0, + /** + * CCAAT signal. + * + * @generated from protobuf enum value: REGULATORY_CLASS_CAAT_SIGNAL = 1; + */ + REGULATORY_CLASS_CAAT_SIGNAL = 1, + /** + * DNase I hypersensitive site. + * + * @generated from protobuf enum value: REGULATORY_CLASS_DNASE_I_HYPERSENSITIVE_SITE = 2; + */ + REGULATORY_CLASS_DNASE_I_HYPERSENSITIVE_SITE = 2, + /** + * Enhancer. + * + * @generated from protobuf enum value: REGULATORY_CLASS_ENHANCER = 3; + */ + REGULATORY_CLASS_ENHANCER = 3, + /** + * Enhancer blocking element. + * + * @generated from protobuf enum value: REGULATORY_CLASS_ENHANCER_BLOCKING_ELEMENT = 4; + */ + REGULATORY_CLASS_ENHANCER_BLOCKING_ELEMENT = 4, + /** + * Epigenetically modified region. + * + * @generated from protobuf enum value: REGULATORY_CLASS_EPIGENETICALLY_MODIFIED_REGION = 5; + */ + REGULATORY_CLASS_EPIGENETICALLY_MODIFIED_REGION = 5, + /** + * GC signal. + * + * @generated from protobuf enum value: REGULATORY_CLASS_GC_SIGNAL = 6; + */ + REGULATORY_CLASS_GC_SIGNAL = 6, + /** + * Imprinting control region. + * + * @generated from protobuf enum value: REGULATORY_CLASS_IMPRINTING_CONTROL_REGION = 7; + */ + REGULATORY_CLASS_IMPRINTING_CONTROL_REGION = 7, + /** + * Insulator. + * + * @generated from protobuf enum value: REGULATORY_CLASS_INSULATOR = 8; + */ + REGULATORY_CLASS_INSULATOR = 8, + /** + * Locus control region. + * + * @generated from protobuf enum value: REGULATORY_CLASS_LOCUS_CONTROL_REGION = 9; + */ + REGULATORY_CLASS_LOCUS_CONTROL_REGION = 9, + /** + * Matrix attachment region. + * + * @generated from protobuf enum value: REGULATORY_CLASS_MATRIX_ATTACHMENT_REGION = 10; + */ + REGULATORY_CLASS_MATRIX_ATTACHMENT_REGION = 10, + /** + * Micrococcal nuclease hypersensitive site. + * + * @generated from protobuf enum value: REGULATORY_CLASS_MICROCOCCAL_NUCLEASE_HYPERSENSITIVE_SITE = 11; + */ + REGULATORY_CLASS_MICROCOCCAL_NUCLEASE_HYPERSENSITIVE_SITE = 11, + /** + * Promoter. + * + * @generated from protobuf enum value: REGULATORY_CLASS_PROMOTER = 12; + */ + REGULATORY_CLASS_PROMOTER = 12, + /** + * Replication regulatory region. + * + * @generated from protobuf enum value: REGULATORY_CLASS_REPLICATION_REGULATORY_REGION = 13; + */ + REGULATORY_CLASS_REPLICATION_REGULATORY_REGION = 13, + /** + * Response element. + * + * @generated from protobuf enum value: REGULATORY_CLASS_RESPONSE_ELEMENT = 14; + */ + REGULATORY_CLASS_RESPONSE_ELEMENT = 14, + /** + * Silencer. + * + * @generated from protobuf enum value: REGULATORY_CLASS_SILENCER = 15; + */ + REGULATORY_CLASS_SILENCER = 15, + /** + * TATA box. + * + * @generated from protobuf enum value: REGULATORY_CLASS_TATA_BOX = 16; + */ + REGULATORY_CLASS_TATA_BOX = 16, + /** + * Transcriptional cis regulatory region. + * + * @generated from protobuf enum value: REGULATORY_CLASS_TRANSCRIPTIONAL_CIS_REGULATORY_REGION = 17; + */ + REGULATORY_CLASS_TRANSCRIPTIONAL_CIS_REGULATORY_REGION = 17 +} +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.functional.refseq.Record', [ + { no: 1, name: 'chromosome', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'start', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'stop', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'dbxref', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { + no: 6, + name: 'category', + kind: 'enum', + T: () => ['annonars.functional.refseq.Category', Category] + }, + { + no: 7, + name: 'regulatory_class', + kind: 'enum', + opt: true, + T: () => ['annonars.functional.refseq.RegulatoryClass', RegulatoryClass] + }, + { no: 8, name: 'note', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: 'experiment', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: 'function', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chromosome = '' + message.start = 0 + message.stop = 0 + message.id = '' + message.dbxref = '' + message.category = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chromosome */ 1: + message.chromosome = reader.string() + break + case /* int32 start */ 2: + message.start = reader.int32() + break + case /* int32 stop */ 3: + message.stop = reader.int32() + break + case /* string id */ 4: + message.id = reader.string() + break + case /* string dbxref */ 5: + message.dbxref = reader.string() + break + case /* annonars.functional.refseq.Category category */ 6: + message.category = reader.int32() + break + case /* optional annonars.functional.refseq.RegulatoryClass regulatory_class */ 7: + message.regulatoryClass = reader.int32() + break + case /* optional string note */ 8: + message.note = reader.string() + break + case /* optional string experiment */ 9: + message.experiment = reader.string() + break + case /* optional string function */ 10: + message.function = reader.string() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chromosome = 1; */ + if (message.chromosome !== '') + writer.tag(1, WireType.LengthDelimited).string(message.chromosome) + /* int32 start = 2; */ + if (message.start !== 0) writer.tag(2, WireType.Varint).int32(message.start) + /* int32 stop = 3; */ + if (message.stop !== 0) writer.tag(3, WireType.Varint).int32(message.stop) + /* string id = 4; */ + if (message.id !== '') writer.tag(4, WireType.LengthDelimited).string(message.id) + /* string dbxref = 5; */ + if (message.dbxref !== '') writer.tag(5, WireType.LengthDelimited).string(message.dbxref) + /* annonars.functional.refseq.Category category = 6; */ + if (message.category !== 0) writer.tag(6, WireType.Varint).int32(message.category) + /* optional annonars.functional.refseq.RegulatoryClass regulatory_class = 7; */ + if (message.regulatoryClass !== undefined) + writer.tag(7, WireType.Varint).int32(message.regulatoryClass) + /* optional string note = 8; */ + if (message.note !== undefined) writer.tag(8, WireType.LengthDelimited).string(message.note) + /* optional string experiment = 9; */ + if (message.experiment !== undefined) + writer.tag(9, WireType.LengthDelimited).string(message.experiment) + /* optional string function = 10; */ + if (message.function !== undefined) + writer.tag(10, WireType.LengthDelimited).string(message.function) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.functional.refseq.Record + */ +export const Record = new Record$Type() +// @generated message type with reflection information, may provide speed optimized methods +class DbxrefList$Type extends MessageType { + constructor() { + super('annonars.functional.refseq.DbxrefList', [ + { + no: 1, + name: 'dbxref', + kind: 'scalar', + repeat: 2 /*RepeatType.UNPACKED*/, + T: 9 /*ScalarType.STRING*/ + } + ]) + } + create(value?: PartialMessage): DbxrefList { + const message = globalThis.Object.create(this.messagePrototype!) + message.dbxref = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DbxrefList + ): DbxrefList { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* repeated string dbxref */ 1: + message.dbxref.push(reader.string()) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: DbxrefList, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* repeated string dbxref = 1; */ + for (let i = 0; i < message.dbxref.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.dbxref[i]) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.functional.refseq.DbxrefList + */ +export const DbxrefList = new DbxrefList$Type() diff --git a/src/pbs/annonars/gnomad/exac_cnv.ts b/src/pbs/annonars/gnomad/exac_cnv.ts new file mode 100644 index 0000000..9221fb8 --- /dev/null +++ b/src/pbs/annonars/gnomad/exac_cnv.ts @@ -0,0 +1,236 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/exac_cnv.proto" (package "annonars.gnomad.exac_cnv", syntax proto3) +// tslint:disable +// +// Protocol buffers for representing ExAC CNV data. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +/** + * Protocol buffer for the ExAC CNV data. + * + * The more specialized fields from the INFO column are stored in separate, optional fields such + * that we don't end up with a humongous message. + * + * @generated from protobuf message annonars.gnomad.exac_cnv.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 start = 2; + */ + start: number + /** + * 1-based stop position. + * + * @generated from protobuf field: int32 stop = 3; + */ + stop: number + /** + * / The type of the variant. + * + * @generated from protobuf field: annonars.gnomad.exac_cnv.CnvType sv_type = 4; + */ + svType: CnvType + /** + * / The population. + * + * @generated from protobuf field: annonars.gnomad.exac_cnv.Population population = 5; + */ + population: Population +} +/** + * Enumeration for the CNV type. + * + * @generated from protobuf enum annonars.gnomad.exac_cnv.CnvType + */ +export enum CnvType { + /** + * unknown + * + * @generated from protobuf enum value: CNV_TYPE_UNKNOWN = 0; + */ + CNV_TYPE_UNKNOWN = 0, + /** + * Deletion. + * + * @generated from protobuf enum value: CNV_TYPE_DEL = 1; + */ + CNV_TYPE_DEL = 1, + /** + * Duplication. + * + * @generated from protobuf enum value: CNV_TYPE_DUP = 2; + */ + CNV_TYPE_DUP = 2 +} +/** + * ExAC population. + * + * @generated from protobuf enum annonars.gnomad.exac_cnv.Population + */ +export enum Population { + /** + * unknown + * + * @generated from protobuf enum value: POPULATION_UNKNOWN = 0; + */ + POPULATION_UNKNOWN = 0, + /** + * African + * + * @generated from protobuf enum value: POPULATION_AFR = 1; + */ + POPULATION_AFR = 1, + /** + * Ad Mixed American + * + * @generated from protobuf enum value: POPULATION_AMR = 2; + */ + POPULATION_AMR = 2, + /** + * East Asian + * + * @generated from protobuf enum value: POPULATION_EAS = 3; + */ + POPULATION_EAS = 3, + /** + * Finnish + * + * @generated from protobuf enum value: POPULATION_FIN = 4; + */ + POPULATION_FIN = 4, + /** + * Non-Finnish European + * + * @generated from protobuf enum value: POPULATION_NFE = 5; + */ + POPULATION_NFE = 5, + /** + * South Asian + * + * @generated from protobuf enum value: POPULATION_SAS = 6; + */ + POPULATION_SAS = 6, + /** + * Other, + * + * @generated from protobuf enum value: POPULATION_OTHER = 7; + */ + POPULATION_OTHER = 7 +} +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.gnomad.exac_cnv.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'start', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'stop', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { + no: 4, + name: 'sv_type', + kind: 'enum', + T: () => ['annonars.gnomad.exac_cnv.CnvType', CnvType] + }, + { + no: 5, + name: 'population', + kind: 'enum', + T: () => ['annonars.gnomad.exac_cnv.Population', Population] + } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.start = 0 + message.stop = 0 + message.svType = 0 + message.population = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 start */ 2: + message.start = reader.int32() + break + case /* int32 stop */ 3: + message.stop = reader.int32() + break + case /* annonars.gnomad.exac_cnv.CnvType sv_type */ 4: + message.svType = reader.int32() + break + case /* annonars.gnomad.exac_cnv.Population population */ 5: + message.population = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 start = 2; */ + if (message.start !== 0) writer.tag(2, WireType.Varint).int32(message.start) + /* int32 stop = 3; */ + if (message.stop !== 0) writer.tag(3, WireType.Varint).int32(message.stop) + /* annonars.gnomad.exac_cnv.CnvType sv_type = 4; */ + if (message.svType !== 0) writer.tag(4, WireType.Varint).int32(message.svType) + /* annonars.gnomad.exac_cnv.Population population = 5; */ + if (message.population !== 0) writer.tag(5, WireType.Varint).int32(message.population) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.exac_cnv.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/gnomad/gnomad2.ts b/src/pbs/annonars/gnomad/gnomad2.ts new file mode 100644 index 0000000..f77250b --- /dev/null +++ b/src/pbs/annonars/gnomad/gnomad2.ts @@ -0,0 +1,1995 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/gnomad2.proto" (package "annonars.gnomad.gnomad2", syntax proto3) +// tslint:disable +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { Vep } from './vep_gnomad2' + +/** + * Store the relevant allele counts and frequencies in a given sub cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad2.AlleleCounts + */ +export interface AlleleCounts { + /** + * Number of alternate alleles in sub cohort. + * + * @generated from protobuf field: int32 ac = 1; + */ + ac: number + /** + * Total number of alleles in the sub cohort. + * + * @generated from protobuf field: int32 an = 2; + */ + an: number + /** + * Number of homozygous alternate alleles in the sub cohort. + * + * @generated from protobuf field: int32 nhomalt = 3; + */ + nhomalt: number + /** + * Alternate allele frequency in the sub cohort. + * + * @generated from protobuf field: float af = 4; + */ + af: number +} +/** + * Store the allele counts for the given sub cohort and sub cohort factored by sex. + * + * @generated from protobuf message annonars.gnomad.gnomad2.AlleleCountsBySex + */ +export interface AlleleCountsBySex { + /** + * Overall allele counts in the sub cohort. + * + * @generated from protobuf field: annonars.gnomad.gnomad2.AlleleCounts overall = 1; + */ + overall?: AlleleCounts + /** + * Allele counts in female/XX karyotype individuals of sub cohort. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad2.AlleleCounts xx = 2; + */ + xx?: AlleleCounts + /** + * Allele counts in male/XY karyotype individuals of sub cohort. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad2.AlleleCounts xy = 3; + */ + xy?: AlleleCounts +} +/** + * Store the allele counts for the given population. + * + * @generated from protobuf message annonars.gnomad.gnomad2.PopulationAlleleCounts + */ +export interface PopulationAlleleCounts { + /** + * Name of the population. + * + * @generated from protobuf field: string population = 1; + */ + population: string + /** + * The overall allele counts and the one by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad2.AlleleCountsBySex counts = 2; + */ + counts?: AlleleCountsBySex + /** + * The filtering allele frequency (using Poisson 95% CI). + * + * @generated from protobuf field: optional float faf95 = 3; + */ + faf95?: number + /** + * The filtering allele frequency (using Poisson 99% CI). + * + * @generated from protobuf field: optional float faf99 = 4; + */ + faf99?: number +} +/** + * Store the allele counts for the given cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad2.CohortAlleleCounts + */ +export interface CohortAlleleCounts { + /** + * Name of the cohort. + * + * @generated from protobuf field: optional string cohort = 1; + */ + cohort?: string + /** + * Allele counts for each population. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad2.PopulationAlleleCounts by_population = 2; + */ + byPopulation: PopulationAlleleCounts[] + /** + * Allele counts by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad2.AlleleCountsBySex by_sex = 3; + */ + bySex?: AlleleCountsBySex + /** + * Raw allele counts. + * + * @generated from protobuf field: annonars.gnomad.gnomad2.AlleleCounts raw = 4; + */ + raw?: AlleleCounts + /** + * The population with maximum AF. + * + * @generated from protobuf field: optional string popmax = 5; + */ + popmax?: string + /** + * Maximum allele frequency across populations (excluding samples of Ashkenazi, Finnish, and + * indeterminate ancestry). + * + * @generated from protobuf field: optional float af_popmax = 6; + */ + afPopmax?: number + /** + * Allele count in population with maximum AF. + * + * @generated from protobuf field: optional int32 ac_popmax = 7; + */ + acPopmax?: number + /** + * Total number of alleles in population with maximum AF. + * + * @generated from protobuf field: optional int32 an_popmax = 8; + */ + anPopmax?: number + /** + * Total number of homozygous individuals in population with maximum AF. + * + * @generated from protobuf field: optional int32 nhomalt_popmax = 9; + */ + nhomaltPopmax?: number +} +/** + * Encapsulate VCF INFO fields related to age. + * + * @generated from protobuf message annonars.gnomad.gnomad2.AgeInfo + */ +export interface AgeInfo { + /** + * Histogram of ages of individuals with a homoplasmic variant; bin edges are: [30.0, 35.0, + * 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0]. + * + * @generated from protobuf field: repeated int32 age_hist_hom_bin_freq = 1; + */ + ageHistHomBinFreq: number[] + /** + * Count of age values falling below lowest histogram bin edge for individuals with a + * homoplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_hom_n_smaller = 2; + */ + ageHistHomNSmaller?: number + /** + * Count of age values falling above highest histogram bin edge for individuals with a + * homoplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_hom_n_larger = 3; + */ + ageHistHomNLarger?: number + /** + * Histogram of ages of individuals with a heteroplasmic variant; bin edges are: [30.0, 35.0, + * 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0] + * + * @generated from protobuf field: repeated int32 age_hist_het_bin_freq = 4; + */ + ageHistHetBinFreq: number[] + /** + * Count of age values falling below lowest histogram bin edge for individuals with a + * heteroplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_het_n_smaller = 5; + */ + ageHistHetNSmaller?: number + /** + * Count of age values falling above highest histogram bin edge for individuals with a + * heteroplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_het_n_larger = 6; + */ + ageHistHetNLarger?: number +} +/** + * Encapsulate VCF INFO fields related to depth. + * + * @generated from protobuf message annonars.gnomad.gnomad2.DepthInfo + */ +export interface DepthInfo { + /** + * Count of dp values falling above highest histogram bin edge for all individuals. + * + * @generated from protobuf field: optional int32 dp_hist_all_n_larger = 1; + */ + dpHistAllNLarger?: number + /** + * Count of dp values falling above highest histogram bin edge for individuals with the + * alternative allele + * + * @generated from protobuf field: optional int32 dp_hist_alt_n_larger = 2; + */ + dpHistAltNLarger?: number + /** + * Histogram of dp values for all individuals; bin edges are: [0.0, 200.0, 400.0, 600.0, 800.0, + * 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + * + * @generated from protobuf field: repeated int32 dp_hist_all_bin_freq = 3; + */ + dpHistAllBinFreq: number[] + /** + * Histogram of dp values for individuals with the alternative allele; bin edges are: [0.0, + * 200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + * + * @generated from protobuf field: repeated int32 dp_hist_alt_bin_freq = 4; + */ + dpHistAltBinFreq: number[] +} +/** + * Encapsulate quality-related information. + * + * @generated from protobuf message annonars.gnomad.gnomad2.QualityInfo + */ +export interface QualityInfo { + /** + * Phred-scaled p-value of Fisher's exact test for strand bias. + * + * @generated from protobuf field: optional float fs = 1; + */ + fs?: number + /** + * Inbreeding coefficient as estimated from the genotype likelihoods per-sample when compared + * against the Hardy-Weinberg expectation. + * + * @generated from protobuf field: optional float inbreeding_coeff = 2; + */ + inbreedingCoeff?: number + /** + * Root mean square of the mapping quality of reads across all samples. + * + * @generated from protobuf field: optional float mq = 3; + */ + mq?: number + /** + * Z-score from Wilcoxon rank sum test of alternate vs. reference read mapping qualities. + * + * @generated from protobuf field: optional float mq_rank_sum = 4; + */ + mqRankSum?: number + /** + * Variant call confidence normalized by depth of sample reads supporting a variant. + * + * @generated from protobuf field: optional float qd = 5; + */ + qd?: number + /** + * Z-score from Wilcoxon rank sum test of alternate vs. reference read position bias. + * + * @generated from protobuf field: optional float read_pos_rank_sum = 6; + */ + readPosRankSum?: number + /** + * Variant was used to build the positive training set of high-quality variants for VQSR. + * + * @generated from protobuf field: bool vqsr_positive_train_site = 7; + */ + vqsrPositiveTrainSite: boolean + /** + * Variant was used to build the negative training set of low-quality variants for VQSR. + * + * @generated from protobuf field: bool vqsr_negative_train_site = 8; + */ + vqsrNegativeTrainSite: boolean + /** + * Z-score from Wilcoxon rank sum test of alternate vs. reference base qualities. + * + * @generated from protobuf field: optional float base_q_rank_sum = 9; + */ + baseQRankSum?: number + /** + * Z-score from Wilcoxon rank sum test of alternate vs. reference number of hard clipped bases. + * + * @generated from protobuf field: optional float clipping_rank_sum = 10; + */ + clippingRankSum?: number + /** + * Strand bias estimated by the symmetric odds ratio test + * + * @generated from protobuf field: optional float sor = 11; + */ + sor?: number + /** + * Depth of informative coverage for each sample; reads with MQ=255 or with bad mates are + * filtered. + * + * @generated from protobuf field: optional int32 dp = 12; + */ + dp?: number + /** + * Log-odds ratio of being a true variant versus being a false positive under the trained VQSR + * Gaussian mixture model. + * + * @generated from protobuf field: optional float vqslod = 13; + */ + vqslod?: number + /** + * Allele-specific worst-performing annotation in the VQSR Gaussian mixture model + * + * @generated from protobuf field: optional string vqsr_culprit = 14; + */ + vqsrCulprit?: string + /** + * Variant falls within a segmental duplication region + * + * @generated from protobuf field: bool segdup = 15; + */ + segdup: boolean + /** + * Variant falls within a low complexity region. + * + * @generated from protobuf field: bool lcr = 16; + */ + lcr: boolean + /** + * Variant falls within a reference decoy region. + * + * @generated from protobuf field: bool decoy = 17; + */ + decoy: boolean + /** + * Variant was a callset-wide doubleton that was transmitted within a family (i.e., a singleton + * amongst unrelated sampes in cohort). + * + * @generated from protobuf field: bool transmitted_singleton = 18; + */ + transmittedSingleton: boolean + /** + * Maximum p-value over callset for binomial test of observed allele balance for a heterozygous + * genotype, given expectation of AB=0.5. + * + * @generated from protobuf field: optional float pab_max = 19; + */ + pabMax?: number +} +/** + * Random forest related information. + * + * @generated from protobuf message annonars.gnomad.gnomad2.RandomForestInfo + */ +export interface RandomForestInfo { + /** + * Random forest prediction probability for a site being a true variant. + * + * @generated from protobuf field: float rf_tp_probability = 1; + */ + rfTpProbability: number + /** + * Variant was labelled as a positive example for training of random forest model. + * + * @generated from protobuf field: bool rf_positive_label = 2; + */ + rfPositiveLabel: boolean + /** + * Variant was labelled as a negative example for training of random forest model. + * + * @generated from protobuf field: bool rf_negative_label = 3; + */ + rfNegativeLabel: boolean + /** + * Random forest training label. + * + * @generated from protobuf field: optional string rf_label = 4; + */ + rfLabel?: string + /** + * Variant was used in training random forest model. + * + * @generated from protobuf field: bool rf_train = 5; + */ + rfTrain: boolean +} +/** + * Liftover related information. + * + * @generated from protobuf message annonars.gnomad.gnomad2.LiftoverInfo + */ +export interface LiftoverInfo { + /** + * The REF and the ALT alleles have been reverse complemented in liftover since the mapping from + * the previous reference to the current one was on the negative strand. + * + * @generated from protobuf field: bool reverse_complemented_alleles = 1; + */ + reverseComplementedAlleles: boolean + /** + * The REF and the ALT alleles have been swapped in liftover due to changes in the reference. It + * is possible that not all INFO annotations reflect this swap, and in the genotypes, only the + * GT, PL, and AD fields have been modified. You should check the TAGS_TO_REVERSE parameter that + * was used during the LiftOver to be sure. + * + * @generated from protobuf field: bool swapped_alleles = 2; + */ + swappedAlleles: boolean + /** + * A list of the original alleles (including REF) of the variant prior to liftover. If the + * alleles were not changed during liftover, this attribute will be omitted. + * + * @generated from protobuf field: repeated string original_alleles = 3; + */ + originalAlleles: string[] + /** + * The name of the source contig/chromosome prior to liftover. + * + * @generated from protobuf field: optional string original_contig = 4; + */ + originalContig?: string + /** + * The position of the variant on the source contig prior to liftover. + * + * @generated from protobuf field: optional string original_start = 5; + */ + originalStart?: string +} +/** + * Variant type related information. + * + * @generated from protobuf message annonars.gnomad.gnomad2.VariantInfo + */ +export interface VariantInfo { + /** + * Variant type (snv, indel, multi-snv, multi-indel, or mixed). + * + * @generated from protobuf field: string variant_type = 1; + */ + variantType: string + /** + * Allele type (snv, ins, del, or mixed). + * + * @generated from protobuf field: string allele_type = 2; + */ + alleleType: string + /** + * Total number of alternate alleles observed at variant locus. + * + * @generated from protobuf field: int32 n_alt_alleles = 3; + */ + nAltAlleles: number + /** + * Variant type was mixed. + * + * @generated from protobuf field: bool was_mixed = 4; + */ + wasMixed: boolean + /** + * Variant locus coincides with a spanning deletion (represented by a star) observed elsewhere + * in the callset. + * + * @generated from protobuf field: bool has_star = 5; + */ + hasStar: boolean +} +/** + * Protocol buffer for the gnomAD v2 VCF record. + * + * The more specialized fields from the INFO column are stored in separate, optional fields such + * that we don't end up with a humongous message. + * + * @generated from protobuf message annonars.gnomad.gnomad2.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 pos = 2; + */ + pos: number + /** + * Reference allele. + * + * @generated from protobuf field: string ref_allele = 3; + */ + refAllele: string + /** + * Alternate allele. + * + * @generated from protobuf field: string alt_allele = 4; + */ + altAllele: string + /** + * Site-level filters. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad2.Filter filters = 5; + */ + filters: Filter[] + /** + * VEP annotation records. + * + * @generated from protobuf field: repeated annonars.gnomad.vep_gnomad2.Vep vep = 6; + */ + vep: Vep[] + /** + * Variant allele counts in the different cohorts and population. + * + * The populations in gnomAD v2/3 are: empty for global, "controls", "non_cancer", "non_neuro", + * and "non_topmed". + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad2.CohortAlleleCounts allele_counts = 7; + */ + alleleCounts: CohortAlleleCounts[] + /** + * Variant (on sex chromosome) falls outside a pseudoautosomal region + * + * @generated from protobuf field: bool nonpar = 8; + */ + nonpar: boolean + /** + * Information on lift-over from GRCh37 to GRCh38. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad2.LiftoverInfo liftover_info = 9; + */ + liftoverInfo?: LiftoverInfo + /** + * Random forest related information. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad2.RandomForestInfo rf_info = 10; + */ + rfInfo?: RandomForestInfo + /** + * Variant-related information details. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad2.VariantInfo variant_info = 11; + */ + variantInfo?: VariantInfo + /** + * Summary information for variant quality interpretation. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad2.QualityInfo quality_info = 12; + */ + qualityInfo?: QualityInfo + /** + * Age-related information. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad2.AgeInfo age_info = 13; + */ + ageInfo?: AgeInfo + /** + * Depth of coverage-related information. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad2.DepthInfo depth_info = 14; + */ + depthInfo?: DepthInfo +} +/** + * Protocol buffer enum for site-level filters. + * + * @generated from protobuf enum annonars.gnomad.gnomad2.Filter + */ +export enum Filter { + /** + * unknown + * + * @generated from protobuf enum value: FILTER_UNKNOWN = 0; + */ + FILTER_UNKNOWN = 0, + /** + * Allele count is zero after filtering out low-confidence genotypes (GQ < 20; DP < 10; and AB < + * 0.2 for het calls). + * + * @generated from protobuf enum value: FILTER_ALLELE_COUNT_IS_ZERO = 1; + */ + FILTER_ALLELE_COUNT_IS_ZERO = 1, + /** + * InbreedingCoeff < -0.3. + * + * @generated from protobuf enum value: FILTER_INBREEDING_COEFF = 2; + */ + FILTER_INBREEDING_COEFF = 2, + /** + * Passed all variant filters + * + * @generated from protobuf enum value: FILTER_PASS = 3; + */ + FILTER_PASS = 3, + /** + * Failed random forest filtering thresholds of 0.055272738028512555, 0.20641025579497013 + * (probabilities of being a true positive variant) for SNPs, indels + * + * @generated from protobuf enum value: FILTER_RANDOM_FOREST = 4; + */ + FILTER_RANDOM_FOREST = 4 +} +// @generated message type with reflection information, may provide speed optimized methods +class AlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.AlleleCounts', [ + { no: 1, name: 'ac', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: 'an', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'nhomalt', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'af', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): AlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.ac = 0 + message.an = 0 + message.nhomalt = 0 + message.af = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AlleleCounts + ): AlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* int32 ac */ 1: + message.ac = reader.int32() + break + case /* int32 an */ 2: + message.an = reader.int32() + break + case /* int32 nhomalt */ 3: + message.nhomalt = reader.int32() + break + case /* float af */ 4: + message.af = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* int32 ac = 1; */ + if (message.ac !== 0) writer.tag(1, WireType.Varint).int32(message.ac) + /* int32 an = 2; */ + if (message.an !== 0) writer.tag(2, WireType.Varint).int32(message.an) + /* int32 nhomalt = 3; */ + if (message.nhomalt !== 0) writer.tag(3, WireType.Varint).int32(message.nhomalt) + /* float af = 4; */ + if (message.af !== 0) writer.tag(4, WireType.Bit32).float(message.af) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.AlleleCounts + */ +export const AlleleCounts = new AlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class AlleleCountsBySex$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.AlleleCountsBySex', [ + { no: 1, name: 'overall', kind: 'message', T: () => AlleleCounts }, + { no: 2, name: 'xx', kind: 'message', T: () => AlleleCounts }, + { no: 3, name: 'xy', kind: 'message', T: () => AlleleCounts } + ]) + } + create(value?: PartialMessage): AlleleCountsBySex { + const message = globalThis.Object.create(this.messagePrototype!) + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AlleleCountsBySex + ): AlleleCountsBySex { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* annonars.gnomad.gnomad2.AlleleCounts overall */ 1: + message.overall = AlleleCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.overall + ) + break + case /* optional annonars.gnomad.gnomad2.AlleleCounts xx */ 2: + message.xx = AlleleCounts.internalBinaryRead(reader, reader.uint32(), options, message.xx) + break + case /* optional annonars.gnomad.gnomad2.AlleleCounts xy */ 3: + message.xy = AlleleCounts.internalBinaryRead(reader, reader.uint32(), options, message.xy) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AlleleCountsBySex, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* annonars.gnomad.gnomad2.AlleleCounts overall = 1; */ + if (message.overall) + AlleleCounts.internalBinaryWrite( + message.overall, + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad2.AlleleCounts xx = 2; */ + if (message.xx) + AlleleCounts.internalBinaryWrite( + message.xx, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad2.AlleleCounts xy = 3; */ + if (message.xy) + AlleleCounts.internalBinaryWrite( + message.xy, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.AlleleCountsBySex + */ +export const AlleleCountsBySex = new AlleleCountsBySex$Type() +// @generated message type with reflection information, may provide speed optimized methods +class PopulationAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.PopulationAlleleCounts', [ + { no: 1, name: 'population', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'counts', kind: 'message', T: () => AlleleCountsBySex }, + { no: 3, name: 'faf95', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: 'faf99', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): PopulationAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.population = '' + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: PopulationAlleleCounts + ): PopulationAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string population */ 1: + message.population = reader.string() + break + case /* annonars.gnomad.gnomad2.AlleleCountsBySex counts */ 2: + message.counts = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.counts + ) + break + case /* optional float faf95 */ 3: + message.faf95 = reader.float() + break + case /* optional float faf99 */ 4: + message.faf99 = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: PopulationAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string population = 1; */ + if (message.population !== '') + writer.tag(1, WireType.LengthDelimited).string(message.population) + /* annonars.gnomad.gnomad2.AlleleCountsBySex counts = 2; */ + if (message.counts) + AlleleCountsBySex.internalBinaryWrite( + message.counts, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* optional float faf95 = 3; */ + if (message.faf95 !== undefined) writer.tag(3, WireType.Bit32).float(message.faf95) + /* optional float faf99 = 4; */ + if (message.faf99 !== undefined) writer.tag(4, WireType.Bit32).float(message.faf99) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.PopulationAlleleCounts + */ +export const PopulationAlleleCounts = new PopulationAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class CohortAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.CohortAlleleCounts', [ + { no: 1, name: 'cohort', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { + no: 2, + name: 'by_population', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => PopulationAlleleCounts + }, + { no: 3, name: 'by_sex', kind: 'message', T: () => AlleleCountsBySex }, + { no: 4, name: 'raw', kind: 'message', T: () => AlleleCounts }, + { no: 5, name: 'popmax', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: 'af_popmax', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: 'ac_popmax', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: 'an_popmax', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 9, name: 'nhomalt_popmax', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): CohortAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.byPopulation = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CohortAlleleCounts + ): CohortAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional string cohort */ 1: + message.cohort = reader.string() + break + case /* repeated annonars.gnomad.gnomad2.PopulationAlleleCounts by_population */ 2: + message.byPopulation.push( + PopulationAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + case /* annonars.gnomad.gnomad2.AlleleCountsBySex by_sex */ 3: + message.bySex = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.bySex + ) + break + case /* annonars.gnomad.gnomad2.AlleleCounts raw */ 4: + message.raw = AlleleCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.raw + ) + break + case /* optional string popmax */ 5: + message.popmax = reader.string() + break + case /* optional float af_popmax */ 6: + message.afPopmax = reader.float() + break + case /* optional int32 ac_popmax */ 7: + message.acPopmax = reader.int32() + break + case /* optional int32 an_popmax */ 8: + message.anPopmax = reader.int32() + break + case /* optional int32 nhomalt_popmax */ 9: + message.nhomaltPopmax = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: CohortAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional string cohort = 1; */ + if (message.cohort !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.cohort) + /* repeated annonars.gnomad.gnomad2.PopulationAlleleCounts by_population = 2; */ + for (let i = 0; i < message.byPopulation.length; i++) + PopulationAlleleCounts.internalBinaryWrite( + message.byPopulation[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad2.AlleleCountsBySex by_sex = 3; */ + if (message.bySex) + AlleleCountsBySex.internalBinaryWrite( + message.bySex, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad2.AlleleCounts raw = 4; */ + if (message.raw) + AlleleCounts.internalBinaryWrite( + message.raw, + writer.tag(4, WireType.LengthDelimited).fork(), + options + ).join() + /* optional string popmax = 5; */ + if (message.popmax !== undefined) writer.tag(5, WireType.LengthDelimited).string(message.popmax) + /* optional float af_popmax = 6; */ + if (message.afPopmax !== undefined) writer.tag(6, WireType.Bit32).float(message.afPopmax) + /* optional int32 ac_popmax = 7; */ + if (message.acPopmax !== undefined) writer.tag(7, WireType.Varint).int32(message.acPopmax) + /* optional int32 an_popmax = 8; */ + if (message.anPopmax !== undefined) writer.tag(8, WireType.Varint).int32(message.anPopmax) + /* optional int32 nhomalt_popmax = 9; */ + if (message.nhomaltPopmax !== undefined) + writer.tag(9, WireType.Varint).int32(message.nhomaltPopmax) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.CohortAlleleCounts + */ +export const CohortAlleleCounts = new CohortAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class AgeInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.AgeInfo', [ + { + no: 1, + name: 'age_hist_hom_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 2, + name: 'age_hist_hom_n_smaller', + kind: 'scalar', + opt: true, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 3, + name: 'age_hist_hom_n_larger', + kind: 'scalar', + opt: true, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'age_hist_het_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 5, + name: 'age_hist_het_n_smaller', + kind: 'scalar', + opt: true, + T: 5 /*ScalarType.INT32*/ + }, + { no: 6, name: 'age_hist_het_n_larger', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): AgeInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.ageHistHomBinFreq = [] + message.ageHistHetBinFreq = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AgeInfo + ): AgeInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* repeated int32 age_hist_hom_bin_freq */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.ageHistHomBinFreq.push(reader.int32()) + else message.ageHistHomBinFreq.push(reader.int32()) + break + case /* optional int32 age_hist_hom_n_smaller */ 2: + message.ageHistHomNSmaller = reader.int32() + break + case /* optional int32 age_hist_hom_n_larger */ 3: + message.ageHistHomNLarger = reader.int32() + break + case /* repeated int32 age_hist_het_bin_freq */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.ageHistHetBinFreq.push(reader.int32()) + else message.ageHistHetBinFreq.push(reader.int32()) + break + case /* optional int32 age_hist_het_n_smaller */ 5: + message.ageHistHetNSmaller = reader.int32() + break + case /* optional int32 age_hist_het_n_larger */ 6: + message.ageHistHetNLarger = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AgeInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* repeated int32 age_hist_hom_bin_freq = 1; */ + if (message.ageHistHomBinFreq.length) { + writer.tag(1, WireType.LengthDelimited).fork() + for (let i = 0; i < message.ageHistHomBinFreq.length; i++) + writer.int32(message.ageHistHomBinFreq[i]) + writer.join() + } + /* optional int32 age_hist_hom_n_smaller = 2; */ + if (message.ageHistHomNSmaller !== undefined) + writer.tag(2, WireType.Varint).int32(message.ageHistHomNSmaller) + /* optional int32 age_hist_hom_n_larger = 3; */ + if (message.ageHistHomNLarger !== undefined) + writer.tag(3, WireType.Varint).int32(message.ageHistHomNLarger) + /* repeated int32 age_hist_het_bin_freq = 4; */ + if (message.ageHistHetBinFreq.length) { + writer.tag(4, WireType.LengthDelimited).fork() + for (let i = 0; i < message.ageHistHetBinFreq.length; i++) + writer.int32(message.ageHistHetBinFreq[i]) + writer.join() + } + /* optional int32 age_hist_het_n_smaller = 5; */ + if (message.ageHistHetNSmaller !== undefined) + writer.tag(5, WireType.Varint).int32(message.ageHistHetNSmaller) + /* optional int32 age_hist_het_n_larger = 6; */ + if (message.ageHistHetNLarger !== undefined) + writer.tag(6, WireType.Varint).int32(message.ageHistHetNLarger) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.AgeInfo + */ +export const AgeInfo = new AgeInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class DepthInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.DepthInfo', [ + { no: 1, name: 'dp_hist_all_n_larger', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: 'dp_hist_alt_n_larger', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { + no: 3, + name: 'dp_hist_all_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'dp_hist_alt_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + } + ]) + } + create(value?: PartialMessage): DepthInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.dpHistAllBinFreq = [] + message.dpHistAltBinFreq = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DepthInfo + ): DepthInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional int32 dp_hist_all_n_larger */ 1: + message.dpHistAllNLarger = reader.int32() + break + case /* optional int32 dp_hist_alt_n_larger */ 2: + message.dpHistAltNLarger = reader.int32() + break + case /* repeated int32 dp_hist_all_bin_freq */ 3: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.dpHistAllBinFreq.push(reader.int32()) + else message.dpHistAllBinFreq.push(reader.int32()) + break + case /* repeated int32 dp_hist_alt_bin_freq */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.dpHistAltBinFreq.push(reader.int32()) + else message.dpHistAltBinFreq.push(reader.int32()) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: DepthInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional int32 dp_hist_all_n_larger = 1; */ + if (message.dpHistAllNLarger !== undefined) + writer.tag(1, WireType.Varint).int32(message.dpHistAllNLarger) + /* optional int32 dp_hist_alt_n_larger = 2; */ + if (message.dpHistAltNLarger !== undefined) + writer.tag(2, WireType.Varint).int32(message.dpHistAltNLarger) + /* repeated int32 dp_hist_all_bin_freq = 3; */ + if (message.dpHistAllBinFreq.length) { + writer.tag(3, WireType.LengthDelimited).fork() + for (let i = 0; i < message.dpHistAllBinFreq.length; i++) + writer.int32(message.dpHistAllBinFreq[i]) + writer.join() + } + /* repeated int32 dp_hist_alt_bin_freq = 4; */ + if (message.dpHistAltBinFreq.length) { + writer.tag(4, WireType.LengthDelimited).fork() + for (let i = 0; i < message.dpHistAltBinFreq.length; i++) + writer.int32(message.dpHistAltBinFreq[i]) + writer.join() + } + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.DepthInfo + */ +export const DepthInfo = new DepthInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class QualityInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.QualityInfo', [ + { no: 1, name: 'fs', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: 'inbreeding_coeff', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 3, name: 'mq', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: 'mq_rank_sum', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 5, name: 'qd', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 6, name: 'read_pos_rank_sum', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: 'vqsr_positive_train_site', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 8, name: 'vqsr_negative_train_site', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: 'base_q_rank_sum', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 10, name: 'clipping_rank_sum', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 11, name: 'sor', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 12, name: 'dp', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 13, name: 'vqslod', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 14, name: 'vqsr_culprit', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 15, name: 'segdup', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 16, name: 'lcr', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 17, name: 'decoy', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 18, name: 'transmitted_singleton', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 19, name: 'pab_max', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): QualityInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.vqsrPositiveTrainSite = false + message.vqsrNegativeTrainSite = false + message.segdup = false + message.lcr = false + message.decoy = false + message.transmittedSingleton = false + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: QualityInfo + ): QualityInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional float fs */ 1: + message.fs = reader.float() + break + case /* optional float inbreeding_coeff */ 2: + message.inbreedingCoeff = reader.float() + break + case /* optional float mq */ 3: + message.mq = reader.float() + break + case /* optional float mq_rank_sum */ 4: + message.mqRankSum = reader.float() + break + case /* optional float qd */ 5: + message.qd = reader.float() + break + case /* optional float read_pos_rank_sum */ 6: + message.readPosRankSum = reader.float() + break + case /* bool vqsr_positive_train_site */ 7: + message.vqsrPositiveTrainSite = reader.bool() + break + case /* bool vqsr_negative_train_site */ 8: + message.vqsrNegativeTrainSite = reader.bool() + break + case /* optional float base_q_rank_sum */ 9: + message.baseQRankSum = reader.float() + break + case /* optional float clipping_rank_sum */ 10: + message.clippingRankSum = reader.float() + break + case /* optional float sor */ 11: + message.sor = reader.float() + break + case /* optional int32 dp */ 12: + message.dp = reader.int32() + break + case /* optional float vqslod */ 13: + message.vqslod = reader.float() + break + case /* optional string vqsr_culprit */ 14: + message.vqsrCulprit = reader.string() + break + case /* bool segdup */ 15: + message.segdup = reader.bool() + break + case /* bool lcr */ 16: + message.lcr = reader.bool() + break + case /* bool decoy */ 17: + message.decoy = reader.bool() + break + case /* bool transmitted_singleton */ 18: + message.transmittedSingleton = reader.bool() + break + case /* optional float pab_max */ 19: + message.pabMax = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: QualityInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional float fs = 1; */ + if (message.fs !== undefined) writer.tag(1, WireType.Bit32).float(message.fs) + /* optional float inbreeding_coeff = 2; */ + if (message.inbreedingCoeff !== undefined) + writer.tag(2, WireType.Bit32).float(message.inbreedingCoeff) + /* optional float mq = 3; */ + if (message.mq !== undefined) writer.tag(3, WireType.Bit32).float(message.mq) + /* optional float mq_rank_sum = 4; */ + if (message.mqRankSum !== undefined) writer.tag(4, WireType.Bit32).float(message.mqRankSum) + /* optional float qd = 5; */ + if (message.qd !== undefined) writer.tag(5, WireType.Bit32).float(message.qd) + /* optional float read_pos_rank_sum = 6; */ + if (message.readPosRankSum !== undefined) + writer.tag(6, WireType.Bit32).float(message.readPosRankSum) + /* bool vqsr_positive_train_site = 7; */ + if (message.vqsrPositiveTrainSite !== false) + writer.tag(7, WireType.Varint).bool(message.vqsrPositiveTrainSite) + /* bool vqsr_negative_train_site = 8; */ + if (message.vqsrNegativeTrainSite !== false) + writer.tag(8, WireType.Varint).bool(message.vqsrNegativeTrainSite) + /* optional float base_q_rank_sum = 9; */ + if (message.baseQRankSum !== undefined) + writer.tag(9, WireType.Bit32).float(message.baseQRankSum) + /* optional float clipping_rank_sum = 10; */ + if (message.clippingRankSum !== undefined) + writer.tag(10, WireType.Bit32).float(message.clippingRankSum) + /* optional float sor = 11; */ + if (message.sor !== undefined) writer.tag(11, WireType.Bit32).float(message.sor) + /* optional int32 dp = 12; */ + if (message.dp !== undefined) writer.tag(12, WireType.Varint).int32(message.dp) + /* optional float vqslod = 13; */ + if (message.vqslod !== undefined) writer.tag(13, WireType.Bit32).float(message.vqslod) + /* optional string vqsr_culprit = 14; */ + if (message.vqsrCulprit !== undefined) + writer.tag(14, WireType.LengthDelimited).string(message.vqsrCulprit) + /* bool segdup = 15; */ + if (message.segdup !== false) writer.tag(15, WireType.Varint).bool(message.segdup) + /* bool lcr = 16; */ + if (message.lcr !== false) writer.tag(16, WireType.Varint).bool(message.lcr) + /* bool decoy = 17; */ + if (message.decoy !== false) writer.tag(17, WireType.Varint).bool(message.decoy) + /* bool transmitted_singleton = 18; */ + if (message.transmittedSingleton !== false) + writer.tag(18, WireType.Varint).bool(message.transmittedSingleton) + /* optional float pab_max = 19; */ + if (message.pabMax !== undefined) writer.tag(19, WireType.Bit32).float(message.pabMax) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.QualityInfo + */ +export const QualityInfo = new QualityInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class RandomForestInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.RandomForestInfo', [ + { no: 1, name: 'rf_tp_probability', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: 'rf_positive_label', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: 'rf_negative_label', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: 'rf_label', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'rf_train', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ } + ]) + } + create(value?: PartialMessage): RandomForestInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.rfTpProbability = 0 + message.rfPositiveLabel = false + message.rfNegativeLabel = false + message.rfTrain = false + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RandomForestInfo + ): RandomForestInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* float rf_tp_probability */ 1: + message.rfTpProbability = reader.float() + break + case /* bool rf_positive_label */ 2: + message.rfPositiveLabel = reader.bool() + break + case /* bool rf_negative_label */ 3: + message.rfNegativeLabel = reader.bool() + break + case /* optional string rf_label */ 4: + message.rfLabel = reader.string() + break + case /* bool rf_train */ 5: + message.rfTrain = reader.bool() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: RandomForestInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* float rf_tp_probability = 1; */ + if (message.rfTpProbability !== 0) writer.tag(1, WireType.Bit32).float(message.rfTpProbability) + /* bool rf_positive_label = 2; */ + if (message.rfPositiveLabel !== false) + writer.tag(2, WireType.Varint).bool(message.rfPositiveLabel) + /* bool rf_negative_label = 3; */ + if (message.rfNegativeLabel !== false) + writer.tag(3, WireType.Varint).bool(message.rfNegativeLabel) + /* optional string rf_label = 4; */ + if (message.rfLabel !== undefined) + writer.tag(4, WireType.LengthDelimited).string(message.rfLabel) + /* bool rf_train = 5; */ + if (message.rfTrain !== false) writer.tag(5, WireType.Varint).bool(message.rfTrain) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.RandomForestInfo + */ +export const RandomForestInfo = new RandomForestInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class LiftoverInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.LiftoverInfo', [ + { no: 1, name: 'reverse_complemented_alleles', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: 'swapped_alleles', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { + no: 3, + name: 'original_alleles', + kind: 'scalar', + repeat: 2 /*RepeatType.UNPACKED*/, + T: 9 /*ScalarType.STRING*/ + }, + { no: 4, name: 'original_contig', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'original_start', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ } + ]) + } + create(value?: PartialMessage): LiftoverInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.reverseComplementedAlleles = false + message.swappedAlleles = false + message.originalAlleles = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LiftoverInfo + ): LiftoverInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* bool reverse_complemented_alleles */ 1: + message.reverseComplementedAlleles = reader.bool() + break + case /* bool swapped_alleles */ 2: + message.swappedAlleles = reader.bool() + break + case /* repeated string original_alleles */ 3: + message.originalAlleles.push(reader.string()) + break + case /* optional string original_contig */ 4: + message.originalContig = reader.string() + break + case /* optional string original_start */ 5: + message.originalStart = reader.string() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: LiftoverInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* bool reverse_complemented_alleles = 1; */ + if (message.reverseComplementedAlleles !== false) + writer.tag(1, WireType.Varint).bool(message.reverseComplementedAlleles) + /* bool swapped_alleles = 2; */ + if (message.swappedAlleles !== false) + writer.tag(2, WireType.Varint).bool(message.swappedAlleles) + /* repeated string original_alleles = 3; */ + for (let i = 0; i < message.originalAlleles.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.originalAlleles[i]) + /* optional string original_contig = 4; */ + if (message.originalContig !== undefined) + writer.tag(4, WireType.LengthDelimited).string(message.originalContig) + /* optional string original_start = 5; */ + if (message.originalStart !== undefined) + writer.tag(5, WireType.LengthDelimited).string(message.originalStart) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.LiftoverInfo + */ +export const LiftoverInfo = new LiftoverInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class VariantInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.VariantInfo', [ + { no: 1, name: 'variant_type', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'allele_type', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: 'n_alt_alleles', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'was_mixed', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: 'has_star', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ } + ]) + } + create(value?: PartialMessage): VariantInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.variantType = '' + message.alleleType = '' + message.nAltAlleles = 0 + message.wasMixed = false + message.hasStar = false + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: VariantInfo + ): VariantInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string variant_type */ 1: + message.variantType = reader.string() + break + case /* string allele_type */ 2: + message.alleleType = reader.string() + break + case /* int32 n_alt_alleles */ 3: + message.nAltAlleles = reader.int32() + break + case /* bool was_mixed */ 4: + message.wasMixed = reader.bool() + break + case /* bool has_star */ 5: + message.hasStar = reader.bool() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: VariantInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string variant_type = 1; */ + if (message.variantType !== '') + writer.tag(1, WireType.LengthDelimited).string(message.variantType) + /* string allele_type = 2; */ + if (message.alleleType !== '') + writer.tag(2, WireType.LengthDelimited).string(message.alleleType) + /* int32 n_alt_alleles = 3; */ + if (message.nAltAlleles !== 0) writer.tag(3, WireType.Varint).int32(message.nAltAlleles) + /* bool was_mixed = 4; */ + if (message.wasMixed !== false) writer.tag(4, WireType.Varint).bool(message.wasMixed) + /* bool has_star = 5; */ + if (message.hasStar !== false) writer.tag(5, WireType.Varint).bool(message.hasStar) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.VariantInfo + */ +export const VariantInfo = new VariantInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad2.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'pos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'ref_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'alt_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { + no: 5, + name: 'filters', + kind: 'enum', + repeat: 1 /*RepeatType.PACKED*/, + T: () => ['annonars.gnomad.gnomad2.Filter', Filter] + }, + { no: 6, name: 'vep', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Vep }, + { + no: 7, + name: 'allele_counts', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => CohortAlleleCounts + }, + { no: 8, name: 'nonpar', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: 'liftover_info', kind: 'message', T: () => LiftoverInfo }, + { no: 10, name: 'rf_info', kind: 'message', T: () => RandomForestInfo }, + { no: 11, name: 'variant_info', kind: 'message', T: () => VariantInfo }, + { no: 12, name: 'quality_info', kind: 'message', T: () => QualityInfo }, + { no: 13, name: 'age_info', kind: 'message', T: () => AgeInfo }, + { no: 14, name: 'depth_info', kind: 'message', T: () => DepthInfo } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.pos = 0 + message.refAllele = '' + message.altAllele = '' + message.filters = [] + message.vep = [] + message.alleleCounts = [] + message.nonpar = false + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 pos */ 2: + message.pos = reader.int32() + break + case /* string ref_allele */ 3: + message.refAllele = reader.string() + break + case /* string alt_allele */ 4: + message.altAllele = reader.string() + break + case /* repeated annonars.gnomad.gnomad2.Filter filters */ 5: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.filters.push(reader.int32()) + else message.filters.push(reader.int32()) + break + case /* repeated annonars.gnomad.vep_gnomad2.Vep vep */ 6: + message.vep.push(Vep.internalBinaryRead(reader, reader.uint32(), options)) + break + case /* repeated annonars.gnomad.gnomad2.CohortAlleleCounts allele_counts */ 7: + message.alleleCounts.push( + CohortAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + case /* bool nonpar */ 8: + message.nonpar = reader.bool() + break + case /* optional annonars.gnomad.gnomad2.LiftoverInfo liftover_info */ 9: + message.liftoverInfo = LiftoverInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.liftoverInfo + ) + break + case /* optional annonars.gnomad.gnomad2.RandomForestInfo rf_info */ 10: + message.rfInfo = RandomForestInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.rfInfo + ) + break + case /* optional annonars.gnomad.gnomad2.VariantInfo variant_info */ 11: + message.variantInfo = VariantInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.variantInfo + ) + break + case /* optional annonars.gnomad.gnomad2.QualityInfo quality_info */ 12: + message.qualityInfo = QualityInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.qualityInfo + ) + break + case /* optional annonars.gnomad.gnomad2.AgeInfo age_info */ 13: + message.ageInfo = AgeInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.ageInfo + ) + break + case /* optional annonars.gnomad.gnomad2.DepthInfo depth_info */ 14: + message.depthInfo = DepthInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.depthInfo + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 pos = 2; */ + if (message.pos !== 0) writer.tag(2, WireType.Varint).int32(message.pos) + /* string ref_allele = 3; */ + if (message.refAllele !== '') writer.tag(3, WireType.LengthDelimited).string(message.refAllele) + /* string alt_allele = 4; */ + if (message.altAllele !== '') writer.tag(4, WireType.LengthDelimited).string(message.altAllele) + /* repeated annonars.gnomad.gnomad2.Filter filters = 5; */ + if (message.filters.length) { + writer.tag(5, WireType.LengthDelimited).fork() + for (let i = 0; i < message.filters.length; i++) writer.int32(message.filters[i]) + writer.join() + } + /* repeated annonars.gnomad.vep_gnomad2.Vep vep = 6; */ + for (let i = 0; i < message.vep.length; i++) + Vep.internalBinaryWrite( + message.vep[i], + writer.tag(6, WireType.LengthDelimited).fork(), + options + ).join() + /* repeated annonars.gnomad.gnomad2.CohortAlleleCounts allele_counts = 7; */ + for (let i = 0; i < message.alleleCounts.length; i++) + CohortAlleleCounts.internalBinaryWrite( + message.alleleCounts[i], + writer.tag(7, WireType.LengthDelimited).fork(), + options + ).join() + /* bool nonpar = 8; */ + if (message.nonpar !== false) writer.tag(8, WireType.Varint).bool(message.nonpar) + /* optional annonars.gnomad.gnomad2.LiftoverInfo liftover_info = 9; */ + if (message.liftoverInfo) + LiftoverInfo.internalBinaryWrite( + message.liftoverInfo, + writer.tag(9, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad2.RandomForestInfo rf_info = 10; */ + if (message.rfInfo) + RandomForestInfo.internalBinaryWrite( + message.rfInfo, + writer.tag(10, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad2.VariantInfo variant_info = 11; */ + if (message.variantInfo) + VariantInfo.internalBinaryWrite( + message.variantInfo, + writer.tag(11, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad2.QualityInfo quality_info = 12; */ + if (message.qualityInfo) + QualityInfo.internalBinaryWrite( + message.qualityInfo, + writer.tag(12, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad2.AgeInfo age_info = 13; */ + if (message.ageInfo) + AgeInfo.internalBinaryWrite( + message.ageInfo, + writer.tag(13, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad2.DepthInfo depth_info = 14; */ + if (message.depthInfo) + DepthInfo.internalBinaryWrite( + message.depthInfo, + writer.tag(14, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad2.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/gnomad/gnomad3.ts b/src/pbs/annonars/gnomad/gnomad3.ts new file mode 100644 index 0000000..3ccb892 --- /dev/null +++ b/src/pbs/annonars/gnomad/gnomad3.ts @@ -0,0 +1,1940 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/gnomad3.proto" (package "annonars.gnomad.gnomad3", syntax proto3) +// tslint:disable +// +// Protobufs for gnomAD v3. +// +// In the case of smaller additions in **both exomes and genomes** in v4.0, +// we extended the protobufs here and re-used them. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { Vep } from './vep_gnomad3' + +/** + * Store details on variant effect predictions. + * + * @generated from protobuf message annonars.gnomad.gnomad3.EffectInfo + */ +export interface EffectInfo { + /** + * PrimateAI's deleteriousness score from 0 (less deleterious) to 1 (more deleterious). + * + * @generated from protobuf field: optional float primate_ai_score = 1; + */ + primateAiScore?: number + /** + * dbNSFP's Revel score from 0 to 1. Variants with higher scores are predicted to be + * more likely to be deleterious. + * + * @generated from protobuf field: optional float revel_score = 2; + */ + revelScore?: number + /** + * Illumina's SpliceAI max delta score; interpreted as the probability of the variant + * being splice-altering. + * + * @generated from protobuf field: optional float splice_ai_max_ds = 3; + */ + spliceAiMaxDs?: number + /** + * The consequence term associated with the max delta score in 'splice_ai_max_ds'. + * + * @generated from protobuf field: optional string splice_ai_consequence = 4; + */ + spliceAiConsequence?: string + /** + * Raw CADD scores are interpretable as the extent to which the annotation profile for a given variant suggests that the variant is likely to be 'observed' (negative values) vs 'simulated' (positive values). Larger values are more deleterious. + * + * @generated from protobuf field: optional float cadd_raw = 5; + */ + caddRaw?: number + /** + * Cadd Phred-like scores ('scaled C-scores') ranging from 1 to 99, based on the rank of each variant relative to all possible 8.6 billion substitutions in the human reference genome. Larger values are more deleterious. + * + * @generated from protobuf field: optional float cadd_phred = 6; + */ + caddPhred?: number +} +/** + * Store the relevant allele counts and frequencies in a given sub cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad3.AlleleCounts + */ +export interface AlleleCounts { + /** + * Number of alternate alleles in sub cohort. + * + * @generated from protobuf field: int32 ac = 1; + */ + ac: number + /** + * Total number of alleles in the sub cohort. + * + * @generated from protobuf field: int32 an = 2; + */ + an: number + /** + * Number of homozygous alternate alleles in the sub cohort. + * + * @generated from protobuf field: int32 nhomalt = 3; + */ + nhomalt: number + /** + * Alternate allele frequency in the sub cohort. + * + * @generated from protobuf field: float af = 4; + */ + af: number +} +/** + * Store the allele counts for the given sub cohort and sub cohort factored by sex. + * + * @generated from protobuf message annonars.gnomad.gnomad3.AlleleCountsBySex + */ +export interface AlleleCountsBySex { + /** + * Overall allele counts in the sub cohort. + * + * @generated from protobuf field: annonars.gnomad.gnomad3.AlleleCounts overall = 1; + */ + overall?: AlleleCounts + /** + * Allele counts in female/XX karyotype individuals of sub cohort. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.AlleleCounts xx = 2; + */ + xx?: AlleleCounts + /** + * Allele counts in male/XY karyotype individuals of sub cohort. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.AlleleCounts xy = 3; + */ + xy?: AlleleCounts +} +/** + * Store the allele counts for the given sub cohort in the given population. + * + * @generated from protobuf message annonars.gnomad.gnomad3.PopulationAlleleCounts + */ +export interface PopulationAlleleCounts { + /** + * Name of the population. + * + * @generated from protobuf field: string population = 1; + */ + population: string + /** + * The overall allele counts and the one by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad3.AlleleCountsBySex counts = 2; + */ + counts?: AlleleCountsBySex + /** + * The filtering allele frequency (using Poisson 95% CI). + * + * @generated from protobuf field: optional float faf95 = 3; + */ + faf95?: number + /** + * The filtering allele frequency (using Poisson 99% CI). + * + * @generated from protobuf field: optional float faf99 = 4; + */ + faf99?: number + /** + * The filtering allele frequency for XX samples (using Poisson 95% CI). + * + * @generated from protobuf field: optional float faf95_xx = 5; + */ + faf95Xx?: number + /** + * The filtering allele frequency for XX samples (using Poisson 99% CI). + * + * @generated from protobuf field: optional float faf99_xx = 6; + */ + faf99Xx?: number + /** + * The filtering allele frequency for XY samples (using Poisson 95% CI). + * + * @generated from protobuf field: optional float faf95_xy = 7; + */ + faf95Xy?: number + /** + * The filtering allele frequency for XY samples (using Poisson 99% CI). + * + * @generated from protobuf field: optional float faf99_xy = 8; + */ + faf99Xy?: number +} +/** + * Store the allele counts for the given cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad3.CohortAlleleCounts + */ +export interface CohortAlleleCounts { + /** + * Name of the cohort. + * + * @generated from protobuf field: optional string cohort = 1; + */ + cohort?: string + /** + * Allele counts for each population. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad3.PopulationAlleleCounts by_population = 2; + */ + byPopulation: PopulationAlleleCounts[] + /** + * Allele counts by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad3.AlleleCountsBySex by_sex = 3; + */ + bySex?: AlleleCountsBySex + /** + * Raw allele counts. + * + * @generated from protobuf field: annonars.gnomad.gnomad3.AlleleCounts raw = 4; + */ + raw?: AlleleCounts + /** + * The population with maximum AF. + * + * @generated from protobuf field: optional string popmax = 5; + */ + popmax?: string + /** + * Maximum allele frequency across populations (excluding samples of Ashkenazi, Finnish, and + * indeterminate ancestry). + * + * @generated from protobuf field: optional float af_popmax = 6; + */ + afPopmax?: number + /** + * Allele count in population with maximum AF. + * + * @generated from protobuf field: optional int32 ac_popmax = 7; + */ + acPopmax?: number + /** + * Total number of alleles in population with maximum AF. + * + * @generated from protobuf field: optional int32 an_popmax = 8; + */ + anPopmax?: number + /** + * Total number of homozygous individuals in population with maximum AF. + * + * @generated from protobuf field: optional int32 nhomalt_popmax = 9; + */ + nhomaltPopmax?: number +} +/** + * Encapsulate VCF INFO fields related to age. + * + * @generated from protobuf message annonars.gnomad.gnomad3.AgeInfo + */ +export interface AgeInfo { + /** + * Histogram of ages of individuals with a homoplasmic variant; bin edges are: [30.0, 35.0, + * 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0]. + * + * @generated from protobuf field: repeated int32 age_hist_hom_bin_freq = 1; + */ + ageHistHomBinFreq: number[] + /** + * Count of age values falling below lowest histogram bin edge for individuals with a + * homoplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_hom_n_smaller = 2; + */ + ageHistHomNSmaller?: number + /** + * Count of age values falling above highest histogram bin edge for individuals with a + * homoplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_hom_n_larger = 3; + */ + ageHistHomNLarger?: number + /** + * Histogram of ages of individuals with a heteroplasmic variant; bin edges are: [30.0, 35.0, + * 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0] + * + * @generated from protobuf field: repeated int32 age_hist_het_bin_freq = 4; + */ + ageHistHetBinFreq: number[] + /** + * Count of age values falling below lowest histogram bin edge for individuals with a + * heteroplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_het_n_smaller = 5; + */ + ageHistHetNSmaller?: number + /** + * Count of age values falling above highest histogram bin edge for individuals with a + * heteroplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_het_n_larger = 6; + */ + ageHistHetNLarger?: number +} +/** + * Encapsulate VCF INFO fields related to depth. + * + * @generated from protobuf message annonars.gnomad.gnomad3.DepthInfo + */ +export interface DepthInfo { + /** + * Count of dp values falling above highest histogram bin edge for all individuals. + * + * @generated from protobuf field: optional int32 dp_hist_all_n_larger = 1; + */ + dpHistAllNLarger?: number + /** + * Count of dp values falling above highest histogram bin edge for individuals with the + * alternative allele + * + * @generated from protobuf field: optional int32 dp_hist_alt_n_larger = 2; + */ + dpHistAltNLarger?: number + /** + * Histogram of dp values for all individuals; bin edges are: [0.0, 200.0, 400.0, 600.0, 800.0, + * 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + * + * @generated from protobuf field: repeated int32 dp_hist_all_bin_freq = 3; + */ + dpHistAllBinFreq: number[] + /** + * Histogram of dp values for individuals with the alternative allele; bin edges are: [0.0, + * 200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + * + * @generated from protobuf field: repeated int32 dp_hist_alt_bin_freq = 4; + */ + dpHistAltBinFreq: number[] +} +/** + * Encapsulate quality-related information. + * + * @generated from protobuf message annonars.gnomad.gnomad3.QualityInfo + */ +export interface QualityInfo { + /** + * Allele-specific phred-scaled p-value of Fisher's exact test for strand bias. + * + * @generated from protobuf field: optional float as_fs = 1; + */ + asFs?: number + /** + * Inbreeding coefficient as estimated from the genotype likelihoods per-sample when compared + * against the Hardy-Weinberg expectation. + * + * @generated from protobuf field: optional float inbreeding_coeff = 2; + */ + inbreedingCoeff?: number + /** + * Allele-specific root mean square of the mapping quality of reads across all samples + * + * @generated from protobuf field: optional float as_mq = 3; + */ + asMq?: number + /** + * Z-score from Wilcoxon rank sum test of alternate vs. reference read mapping qualities. + * + * @generated from protobuf field: optional float mq_rank_sum = 4; + */ + mqRankSum?: number + /** + * Allele-specific z-score from Wilcoxon rank sum test of alternate vs. reference read + * mapping qualities. + * + * @generated from protobuf field: optional float as_mq_rank_sum = 5; + */ + asMqRankSum?: number + /** + * Allele-specific variant call confidence normalized by depth of sample reads supporting a + * variant. + * + * @generated from protobuf field: optional float as_qd = 6; + */ + asQd?: number + /** + * Z-score from Wilcoxon rank sum test of alternate vs. reference read position bias. + * + * @generated from protobuf field: optional float read_pos_rank_sum = 7; + */ + readPosRankSum?: number + /** + * Allele-specific z-score from Wilcoxon rank sum test of alternate vs. reference read position bias. + * + * @generated from protobuf field: optional float as_read_pos_rank_sum = 8; + */ + asReadPosRankSum?: number + /** + * Allele-specific strand bias estimated by the symmetric odds ratio test. + * + * @generated from protobuf field: optional float as_sor = 9; + */ + asSor?: number + /** + * Variant was used to build the positive training set of high-quality variants for VQSR. + * + * @generated from protobuf field: bool positive_train_site = 10; + */ + positiveTrainSite: boolean + /** + * Variant was used to build the negative training set of low-quality variants for VQSR. + * + * @generated from protobuf field: bool negative_train_site = 11; + */ + negativeTrainSite: boolean + /** + * Allele-specific log-odds ratio of being a true variant versus being a false positive under the trained VQSR Gaussian mixture model. + * + * @generated from protobuf field: optional float as_vqslod = 12; + */ + asVqslod?: number + /** + * Allele-specific worst-performing annotation in the VQSR Gaussian mixture model. + * + * @generated from protobuf field: optional string as_culprit = 13; + */ + asCulprit?: string + /** + * Variant falls within a segmental duplication region. + * + * @generated from protobuf field: bool segdup = 14; + */ + segdup: boolean + /** + * Variant falls within a low complexity region. + * + * @generated from protobuf field: bool lcr = 15; + */ + lcr: boolean + /** + * Variant was a callset-wide doubleton that was transmitted within a family (i.e., a singleton + * amongst unrelated sampes in cohort). + * + * @generated from protobuf field: bool transmitted_singleton = 16; + */ + transmittedSingleton: boolean + /** + * Maximum p-value over callset for binomial test of observed allele balance for a heterozygous genotype, given expectation of 0.5. + * + * @generated from protobuf field: optional float as_pab_max = 17; + */ + asPabMax?: number + /** + * Allele-specific sum of PL[0] values; used to approximate the QUAL score. + * + * @generated from protobuf field: optional int32 as_qual_approx = 18; + */ + asQualApprox?: number + /** + * Allele-specific forward/reverse read counts for strand bias tests. + * + * @generated from protobuf field: optional string as_sb_table = 19; + */ + asSbTable?: string + /** + * Strand bias estimated by the symmetric odds ratio test (v4 only). + * + * @generated from protobuf field: optional float sor = 20; + */ + sor?: number +} +/** + * Variant type related information. + * + * @generated from protobuf message annonars.gnomad.gnomad3.VariantInfo + */ +export interface VariantInfo { + /** + * Variant type (snv, indel, multi-snv, multi-indel, or mixed). + * + * @generated from protobuf field: string variant_type = 1; + */ + variantType: string + /** + * Allele type (snv, ins, del, or mixed). + * + * @generated from protobuf field: string allele_type = 2; + */ + alleleType: string + /** + * Total number of alternate alleles observed at variant locus. + * + * @generated from protobuf field: int32 n_alt_alleles = 3; + */ + nAltAlleles: number + /** + * Variant type was mixed. + * + * @generated from protobuf field: bool was_mixed = 4; + */ + wasMixed: boolean + /** + * All samples are homozygous alternate for the variant. + * + * @generated from protobuf field: bool monoallelic = 5; + */ + monoallelic: boolean + /** + * Depth over variant genotypes (does not include depth of reference samples). + * + * @generated from protobuf field: int32 var_dp = 6; + */ + varDp: number + /** + * Allele-specific depth over variant genotypes (does not include depth of reference samples) (v4 only). + * + * @generated from protobuf field: optional int32 as_vardp = 7; + */ + asVardp?: number +} +/** + * Protocol buffer for the gnomAD-nuclear VCF record. + * + * The more specialized fields from the INFO column are stored in separate, optional fields such + * that we don't end up with a humongous message. + * + * @generated from protobuf message annonars.gnomad.gnomad3.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 pos = 2; + */ + pos: number + /** + * Reference allele. + * + * @generated from protobuf field: string ref_allele = 3; + */ + refAllele: string + /** + * Alternate allele. + * + * @generated from protobuf field: string alt_allele = 4; + */ + altAllele: string + /** + * Site-level filters. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad3.Filter filters = 5; + */ + filters: Filter[] + /** + * VEP annotation records. + * + * @generated from protobuf field: repeated annonars.gnomad.vep_gnomad3.Vep vep = 6; + */ + vep: Vep[] + /** + * Variant allele counts in the different cohorts and population. + * + * The populations in gnomAD v2/3 are: empty for global, "controls", "non_cancer", "non_neuro", + * and "non_topmed". + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad3.CohortAlleleCounts allele_counts = 7; + */ + alleleCounts: CohortAlleleCounts[] + /** + * Variant (on sex chromosome) falls outside a pseudoautosomal region + * + * @generated from protobuf field: bool nonpar = 8; + */ + nonpar: boolean + /** + * Information on variant scores. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.EffectInfo effect_info = 9; + */ + effectInfo?: EffectInfo + /** + * Variant-related information details. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.VariantInfo variant_info = 10; + */ + variantInfo?: VariantInfo + /** + * Summary information for variant quality interpretation. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.QualityInfo quality_info = 11; + */ + qualityInfo?: QualityInfo + /** + * Age-related information. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.AgeInfo age_info = 12; + */ + ageInfo?: AgeInfo + /** + * Depth of coverage-related information. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.DepthInfo depth_info = 13; + */ + depthInfo?: DepthInfo +} +/** + * Protocol buffer enum for site-level filters. + * + * @generated from protobuf enum annonars.gnomad.gnomad3.Filter + */ +export enum Filter { + /** + * unknown + * + * @generated from protobuf enum value: FILTER_UNKNOWN = 0; + */ + FILTER_UNKNOWN = 0, + /** + * Allele count is zero after filtering out low-confidence genotypes (GQ < 20; DP < 10; and AB < + * 0.2 for het calls). + * + * @generated from protobuf enum value: FILTER_ALLELE_COUNT_IS_ZERO = 1; + */ + FILTER_ALLELE_COUNT_IS_ZERO = 1, + /** + * Failed VQSR filtering thresholds of: + * + * gnomAD-genomes v3: -2.7739 for SNPs and -1.0606 for indels + * gnomAD-genomes v4: -2.502 for SNPs and -0.7156 for indels + * gnomAD-exomes v4: -1.4526 for SNPs and 0.0717 for indels + * + * @generated from protobuf enum value: FILTER_AS_VSQR = 2; + */ + FILTER_AS_VSQR = 2, + /** + * InbreedingCoeff < -0.3. + * + * @generated from protobuf enum value: FILTER_INBREEDING_COEFF = 3; + */ + FILTER_INBREEDING_COEFF = 3, + /** + * Passed all variant filters + * + * @generated from protobuf enum value: FILTER_PASS = 4; + */ + FILTER_PASS = 4 +} +// @generated message type with reflection information, may provide speed optimized methods +class EffectInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.EffectInfo', [ + { no: 1, name: 'primate_ai_score', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: 'revel_score', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 3, name: 'splice_ai_max_ds', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { + no: 4, + name: 'splice_ai_consequence', + kind: 'scalar', + opt: true, + T: 9 /*ScalarType.STRING*/ + }, + { no: 5, name: 'cadd_raw', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 6, name: 'cadd_phred', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): EffectInfo { + const message = globalThis.Object.create(this.messagePrototype!) + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EffectInfo + ): EffectInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional float primate_ai_score */ 1: + message.primateAiScore = reader.float() + break + case /* optional float revel_score */ 2: + message.revelScore = reader.float() + break + case /* optional float splice_ai_max_ds */ 3: + message.spliceAiMaxDs = reader.float() + break + case /* optional string splice_ai_consequence */ 4: + message.spliceAiConsequence = reader.string() + break + case /* optional float cadd_raw */ 5: + message.caddRaw = reader.float() + break + case /* optional float cadd_phred */ 6: + message.caddPhred = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: EffectInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional float primate_ai_score = 1; */ + if (message.primateAiScore !== undefined) + writer.tag(1, WireType.Bit32).float(message.primateAiScore) + /* optional float revel_score = 2; */ + if (message.revelScore !== undefined) writer.tag(2, WireType.Bit32).float(message.revelScore) + /* optional float splice_ai_max_ds = 3; */ + if (message.spliceAiMaxDs !== undefined) + writer.tag(3, WireType.Bit32).float(message.spliceAiMaxDs) + /* optional string splice_ai_consequence = 4; */ + if (message.spliceAiConsequence !== undefined) + writer.tag(4, WireType.LengthDelimited).string(message.spliceAiConsequence) + /* optional float cadd_raw = 5; */ + if (message.caddRaw !== undefined) writer.tag(5, WireType.Bit32).float(message.caddRaw) + /* optional float cadd_phred = 6; */ + if (message.caddPhred !== undefined) writer.tag(6, WireType.Bit32).float(message.caddPhred) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.EffectInfo + */ +export const EffectInfo = new EffectInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class AlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.AlleleCounts', [ + { no: 1, name: 'ac', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: 'an', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'nhomalt', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'af', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): AlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.ac = 0 + message.an = 0 + message.nhomalt = 0 + message.af = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AlleleCounts + ): AlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* int32 ac */ 1: + message.ac = reader.int32() + break + case /* int32 an */ 2: + message.an = reader.int32() + break + case /* int32 nhomalt */ 3: + message.nhomalt = reader.int32() + break + case /* float af */ 4: + message.af = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* int32 ac = 1; */ + if (message.ac !== 0) writer.tag(1, WireType.Varint).int32(message.ac) + /* int32 an = 2; */ + if (message.an !== 0) writer.tag(2, WireType.Varint).int32(message.an) + /* int32 nhomalt = 3; */ + if (message.nhomalt !== 0) writer.tag(3, WireType.Varint).int32(message.nhomalt) + /* float af = 4; */ + if (message.af !== 0) writer.tag(4, WireType.Bit32).float(message.af) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.AlleleCounts + */ +export const AlleleCounts = new AlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class AlleleCountsBySex$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.AlleleCountsBySex', [ + { no: 1, name: 'overall', kind: 'message', T: () => AlleleCounts }, + { no: 2, name: 'xx', kind: 'message', T: () => AlleleCounts }, + { no: 3, name: 'xy', kind: 'message', T: () => AlleleCounts } + ]) + } + create(value?: PartialMessage): AlleleCountsBySex { + const message = globalThis.Object.create(this.messagePrototype!) + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AlleleCountsBySex + ): AlleleCountsBySex { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* annonars.gnomad.gnomad3.AlleleCounts overall */ 1: + message.overall = AlleleCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.overall + ) + break + case /* optional annonars.gnomad.gnomad3.AlleleCounts xx */ 2: + message.xx = AlleleCounts.internalBinaryRead(reader, reader.uint32(), options, message.xx) + break + case /* optional annonars.gnomad.gnomad3.AlleleCounts xy */ 3: + message.xy = AlleleCounts.internalBinaryRead(reader, reader.uint32(), options, message.xy) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AlleleCountsBySex, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* annonars.gnomad.gnomad3.AlleleCounts overall = 1; */ + if (message.overall) + AlleleCounts.internalBinaryWrite( + message.overall, + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.AlleleCounts xx = 2; */ + if (message.xx) + AlleleCounts.internalBinaryWrite( + message.xx, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.AlleleCounts xy = 3; */ + if (message.xy) + AlleleCounts.internalBinaryWrite( + message.xy, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.AlleleCountsBySex + */ +export const AlleleCountsBySex = new AlleleCountsBySex$Type() +// @generated message type with reflection information, may provide speed optimized methods +class PopulationAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.PopulationAlleleCounts', [ + { no: 1, name: 'population', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'counts', kind: 'message', T: () => AlleleCountsBySex }, + { no: 3, name: 'faf95', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: 'faf99', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 5, name: 'faf95_xx', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 6, name: 'faf99_xx', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: 'faf95_xy', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 8, name: 'faf99_xy', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): PopulationAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.population = '' + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: PopulationAlleleCounts + ): PopulationAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string population */ 1: + message.population = reader.string() + break + case /* annonars.gnomad.gnomad3.AlleleCountsBySex counts */ 2: + message.counts = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.counts + ) + break + case /* optional float faf95 */ 3: + message.faf95 = reader.float() + break + case /* optional float faf99 */ 4: + message.faf99 = reader.float() + break + case /* optional float faf95_xx */ 5: + message.faf95Xx = reader.float() + break + case /* optional float faf99_xx */ 6: + message.faf99Xx = reader.float() + break + case /* optional float faf95_xy */ 7: + message.faf95Xy = reader.float() + break + case /* optional float faf99_xy */ 8: + message.faf99Xy = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: PopulationAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string population = 1; */ + if (message.population !== '') + writer.tag(1, WireType.LengthDelimited).string(message.population) + /* annonars.gnomad.gnomad3.AlleleCountsBySex counts = 2; */ + if (message.counts) + AlleleCountsBySex.internalBinaryWrite( + message.counts, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* optional float faf95 = 3; */ + if (message.faf95 !== undefined) writer.tag(3, WireType.Bit32).float(message.faf95) + /* optional float faf99 = 4; */ + if (message.faf99 !== undefined) writer.tag(4, WireType.Bit32).float(message.faf99) + /* optional float faf95_xx = 5; */ + if (message.faf95Xx !== undefined) writer.tag(5, WireType.Bit32).float(message.faf95Xx) + /* optional float faf99_xx = 6; */ + if (message.faf99Xx !== undefined) writer.tag(6, WireType.Bit32).float(message.faf99Xx) + /* optional float faf95_xy = 7; */ + if (message.faf95Xy !== undefined) writer.tag(7, WireType.Bit32).float(message.faf95Xy) + /* optional float faf99_xy = 8; */ + if (message.faf99Xy !== undefined) writer.tag(8, WireType.Bit32).float(message.faf99Xy) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.PopulationAlleleCounts + */ +export const PopulationAlleleCounts = new PopulationAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class CohortAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.CohortAlleleCounts', [ + { no: 1, name: 'cohort', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { + no: 2, + name: 'by_population', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => PopulationAlleleCounts + }, + { no: 3, name: 'by_sex', kind: 'message', T: () => AlleleCountsBySex }, + { no: 4, name: 'raw', kind: 'message', T: () => AlleleCounts }, + { no: 5, name: 'popmax', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: 'af_popmax', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: 'ac_popmax', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: 'an_popmax', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 9, name: 'nhomalt_popmax', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): CohortAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.byPopulation = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CohortAlleleCounts + ): CohortAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional string cohort */ 1: + message.cohort = reader.string() + break + case /* repeated annonars.gnomad.gnomad3.PopulationAlleleCounts by_population */ 2: + message.byPopulation.push( + PopulationAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + case /* annonars.gnomad.gnomad3.AlleleCountsBySex by_sex */ 3: + message.bySex = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.bySex + ) + break + case /* annonars.gnomad.gnomad3.AlleleCounts raw */ 4: + message.raw = AlleleCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.raw + ) + break + case /* optional string popmax */ 5: + message.popmax = reader.string() + break + case /* optional float af_popmax */ 6: + message.afPopmax = reader.float() + break + case /* optional int32 ac_popmax */ 7: + message.acPopmax = reader.int32() + break + case /* optional int32 an_popmax */ 8: + message.anPopmax = reader.int32() + break + case /* optional int32 nhomalt_popmax */ 9: + message.nhomaltPopmax = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: CohortAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional string cohort = 1; */ + if (message.cohort !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.cohort) + /* repeated annonars.gnomad.gnomad3.PopulationAlleleCounts by_population = 2; */ + for (let i = 0; i < message.byPopulation.length; i++) + PopulationAlleleCounts.internalBinaryWrite( + message.byPopulation[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad3.AlleleCountsBySex by_sex = 3; */ + if (message.bySex) + AlleleCountsBySex.internalBinaryWrite( + message.bySex, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad3.AlleleCounts raw = 4; */ + if (message.raw) + AlleleCounts.internalBinaryWrite( + message.raw, + writer.tag(4, WireType.LengthDelimited).fork(), + options + ).join() + /* optional string popmax = 5; */ + if (message.popmax !== undefined) writer.tag(5, WireType.LengthDelimited).string(message.popmax) + /* optional float af_popmax = 6; */ + if (message.afPopmax !== undefined) writer.tag(6, WireType.Bit32).float(message.afPopmax) + /* optional int32 ac_popmax = 7; */ + if (message.acPopmax !== undefined) writer.tag(7, WireType.Varint).int32(message.acPopmax) + /* optional int32 an_popmax = 8; */ + if (message.anPopmax !== undefined) writer.tag(8, WireType.Varint).int32(message.anPopmax) + /* optional int32 nhomalt_popmax = 9; */ + if (message.nhomaltPopmax !== undefined) + writer.tag(9, WireType.Varint).int32(message.nhomaltPopmax) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.CohortAlleleCounts + */ +export const CohortAlleleCounts = new CohortAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class AgeInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.AgeInfo', [ + { + no: 1, + name: 'age_hist_hom_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 2, + name: 'age_hist_hom_n_smaller', + kind: 'scalar', + opt: true, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 3, + name: 'age_hist_hom_n_larger', + kind: 'scalar', + opt: true, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'age_hist_het_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 5, + name: 'age_hist_het_n_smaller', + kind: 'scalar', + opt: true, + T: 5 /*ScalarType.INT32*/ + }, + { no: 6, name: 'age_hist_het_n_larger', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): AgeInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.ageHistHomBinFreq = [] + message.ageHistHetBinFreq = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AgeInfo + ): AgeInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* repeated int32 age_hist_hom_bin_freq */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.ageHistHomBinFreq.push(reader.int32()) + else message.ageHistHomBinFreq.push(reader.int32()) + break + case /* optional int32 age_hist_hom_n_smaller */ 2: + message.ageHistHomNSmaller = reader.int32() + break + case /* optional int32 age_hist_hom_n_larger */ 3: + message.ageHistHomNLarger = reader.int32() + break + case /* repeated int32 age_hist_het_bin_freq */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.ageHistHetBinFreq.push(reader.int32()) + else message.ageHistHetBinFreq.push(reader.int32()) + break + case /* optional int32 age_hist_het_n_smaller */ 5: + message.ageHistHetNSmaller = reader.int32() + break + case /* optional int32 age_hist_het_n_larger */ 6: + message.ageHistHetNLarger = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AgeInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* repeated int32 age_hist_hom_bin_freq = 1; */ + if (message.ageHistHomBinFreq.length) { + writer.tag(1, WireType.LengthDelimited).fork() + for (let i = 0; i < message.ageHistHomBinFreq.length; i++) + writer.int32(message.ageHistHomBinFreq[i]) + writer.join() + } + /* optional int32 age_hist_hom_n_smaller = 2; */ + if (message.ageHistHomNSmaller !== undefined) + writer.tag(2, WireType.Varint).int32(message.ageHistHomNSmaller) + /* optional int32 age_hist_hom_n_larger = 3; */ + if (message.ageHistHomNLarger !== undefined) + writer.tag(3, WireType.Varint).int32(message.ageHistHomNLarger) + /* repeated int32 age_hist_het_bin_freq = 4; */ + if (message.ageHistHetBinFreq.length) { + writer.tag(4, WireType.LengthDelimited).fork() + for (let i = 0; i < message.ageHistHetBinFreq.length; i++) + writer.int32(message.ageHistHetBinFreq[i]) + writer.join() + } + /* optional int32 age_hist_het_n_smaller = 5; */ + if (message.ageHistHetNSmaller !== undefined) + writer.tag(5, WireType.Varint).int32(message.ageHistHetNSmaller) + /* optional int32 age_hist_het_n_larger = 6; */ + if (message.ageHistHetNLarger !== undefined) + writer.tag(6, WireType.Varint).int32(message.ageHistHetNLarger) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.AgeInfo + */ +export const AgeInfo = new AgeInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class DepthInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.DepthInfo', [ + { no: 1, name: 'dp_hist_all_n_larger', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: 'dp_hist_alt_n_larger', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { + no: 3, + name: 'dp_hist_all_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'dp_hist_alt_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + } + ]) + } + create(value?: PartialMessage): DepthInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.dpHistAllBinFreq = [] + message.dpHistAltBinFreq = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DepthInfo + ): DepthInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional int32 dp_hist_all_n_larger */ 1: + message.dpHistAllNLarger = reader.int32() + break + case /* optional int32 dp_hist_alt_n_larger */ 2: + message.dpHistAltNLarger = reader.int32() + break + case /* repeated int32 dp_hist_all_bin_freq */ 3: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.dpHistAllBinFreq.push(reader.int32()) + else message.dpHistAllBinFreq.push(reader.int32()) + break + case /* repeated int32 dp_hist_alt_bin_freq */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.dpHistAltBinFreq.push(reader.int32()) + else message.dpHistAltBinFreq.push(reader.int32()) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: DepthInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional int32 dp_hist_all_n_larger = 1; */ + if (message.dpHistAllNLarger !== undefined) + writer.tag(1, WireType.Varint).int32(message.dpHistAllNLarger) + /* optional int32 dp_hist_alt_n_larger = 2; */ + if (message.dpHistAltNLarger !== undefined) + writer.tag(2, WireType.Varint).int32(message.dpHistAltNLarger) + /* repeated int32 dp_hist_all_bin_freq = 3; */ + if (message.dpHistAllBinFreq.length) { + writer.tag(3, WireType.LengthDelimited).fork() + for (let i = 0; i < message.dpHistAllBinFreq.length; i++) + writer.int32(message.dpHistAllBinFreq[i]) + writer.join() + } + /* repeated int32 dp_hist_alt_bin_freq = 4; */ + if (message.dpHistAltBinFreq.length) { + writer.tag(4, WireType.LengthDelimited).fork() + for (let i = 0; i < message.dpHistAltBinFreq.length; i++) + writer.int32(message.dpHistAltBinFreq[i]) + writer.join() + } + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.DepthInfo + */ +export const DepthInfo = new DepthInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class QualityInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.QualityInfo', [ + { no: 1, name: 'as_fs', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: 'inbreeding_coeff', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 3, name: 'as_mq', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: 'mq_rank_sum', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 5, name: 'as_mq_rank_sum', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 6, name: 'as_qd', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: 'read_pos_rank_sum', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 8, name: 'as_read_pos_rank_sum', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 9, name: 'as_sor', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 10, name: 'positive_train_site', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 11, name: 'negative_train_site', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 12, name: 'as_vqslod', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 13, name: 'as_culprit', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 14, name: 'segdup', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 15, name: 'lcr', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 16, name: 'transmitted_singleton', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 17, name: 'as_pab_max', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 18, name: 'as_qual_approx', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 19, name: 'as_sb_table', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 20, name: 'sor', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): QualityInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.positiveTrainSite = false + message.negativeTrainSite = false + message.segdup = false + message.lcr = false + message.transmittedSingleton = false + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: QualityInfo + ): QualityInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional float as_fs */ 1: + message.asFs = reader.float() + break + case /* optional float inbreeding_coeff */ 2: + message.inbreedingCoeff = reader.float() + break + case /* optional float as_mq */ 3: + message.asMq = reader.float() + break + case /* optional float mq_rank_sum */ 4: + message.mqRankSum = reader.float() + break + case /* optional float as_mq_rank_sum */ 5: + message.asMqRankSum = reader.float() + break + case /* optional float as_qd */ 6: + message.asQd = reader.float() + break + case /* optional float read_pos_rank_sum */ 7: + message.readPosRankSum = reader.float() + break + case /* optional float as_read_pos_rank_sum */ 8: + message.asReadPosRankSum = reader.float() + break + case /* optional float as_sor */ 9: + message.asSor = reader.float() + break + case /* bool positive_train_site */ 10: + message.positiveTrainSite = reader.bool() + break + case /* bool negative_train_site */ 11: + message.negativeTrainSite = reader.bool() + break + case /* optional float as_vqslod */ 12: + message.asVqslod = reader.float() + break + case /* optional string as_culprit */ 13: + message.asCulprit = reader.string() + break + case /* bool segdup */ 14: + message.segdup = reader.bool() + break + case /* bool lcr */ 15: + message.lcr = reader.bool() + break + case /* bool transmitted_singleton */ 16: + message.transmittedSingleton = reader.bool() + break + case /* optional float as_pab_max */ 17: + message.asPabMax = reader.float() + break + case /* optional int32 as_qual_approx */ 18: + message.asQualApprox = reader.int32() + break + case /* optional string as_sb_table */ 19: + message.asSbTable = reader.string() + break + case /* optional float sor */ 20: + message.sor = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: QualityInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional float as_fs = 1; */ + if (message.asFs !== undefined) writer.tag(1, WireType.Bit32).float(message.asFs) + /* optional float inbreeding_coeff = 2; */ + if (message.inbreedingCoeff !== undefined) + writer.tag(2, WireType.Bit32).float(message.inbreedingCoeff) + /* optional float as_mq = 3; */ + if (message.asMq !== undefined) writer.tag(3, WireType.Bit32).float(message.asMq) + /* optional float mq_rank_sum = 4; */ + if (message.mqRankSum !== undefined) writer.tag(4, WireType.Bit32).float(message.mqRankSum) + /* optional float as_mq_rank_sum = 5; */ + if (message.asMqRankSum !== undefined) writer.tag(5, WireType.Bit32).float(message.asMqRankSum) + /* optional float as_qd = 6; */ + if (message.asQd !== undefined) writer.tag(6, WireType.Bit32).float(message.asQd) + /* optional float read_pos_rank_sum = 7; */ + if (message.readPosRankSum !== undefined) + writer.tag(7, WireType.Bit32).float(message.readPosRankSum) + /* optional float as_read_pos_rank_sum = 8; */ + if (message.asReadPosRankSum !== undefined) + writer.tag(8, WireType.Bit32).float(message.asReadPosRankSum) + /* optional float as_sor = 9; */ + if (message.asSor !== undefined) writer.tag(9, WireType.Bit32).float(message.asSor) + /* bool positive_train_site = 10; */ + if (message.positiveTrainSite !== false) + writer.tag(10, WireType.Varint).bool(message.positiveTrainSite) + /* bool negative_train_site = 11; */ + if (message.negativeTrainSite !== false) + writer.tag(11, WireType.Varint).bool(message.negativeTrainSite) + /* optional float as_vqslod = 12; */ + if (message.asVqslod !== undefined) writer.tag(12, WireType.Bit32).float(message.asVqslod) + /* optional string as_culprit = 13; */ + if (message.asCulprit !== undefined) + writer.tag(13, WireType.LengthDelimited).string(message.asCulprit) + /* bool segdup = 14; */ + if (message.segdup !== false) writer.tag(14, WireType.Varint).bool(message.segdup) + /* bool lcr = 15; */ + if (message.lcr !== false) writer.tag(15, WireType.Varint).bool(message.lcr) + /* bool transmitted_singleton = 16; */ + if (message.transmittedSingleton !== false) + writer.tag(16, WireType.Varint).bool(message.transmittedSingleton) + /* optional float as_pab_max = 17; */ + if (message.asPabMax !== undefined) writer.tag(17, WireType.Bit32).float(message.asPabMax) + /* optional int32 as_qual_approx = 18; */ + if (message.asQualApprox !== undefined) + writer.tag(18, WireType.Varint).int32(message.asQualApprox) + /* optional string as_sb_table = 19; */ + if (message.asSbTable !== undefined) + writer.tag(19, WireType.LengthDelimited).string(message.asSbTable) + /* optional float sor = 20; */ + if (message.sor !== undefined) writer.tag(20, WireType.Bit32).float(message.sor) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.QualityInfo + */ +export const QualityInfo = new QualityInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class VariantInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.VariantInfo', [ + { no: 1, name: 'variant_type', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'allele_type', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: 'n_alt_alleles', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'was_mixed', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: 'monoallelic', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: 'var_dp', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 7, name: 'as_vardp', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): VariantInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.variantType = '' + message.alleleType = '' + message.nAltAlleles = 0 + message.wasMixed = false + message.monoallelic = false + message.varDp = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: VariantInfo + ): VariantInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string variant_type */ 1: + message.variantType = reader.string() + break + case /* string allele_type */ 2: + message.alleleType = reader.string() + break + case /* int32 n_alt_alleles */ 3: + message.nAltAlleles = reader.int32() + break + case /* bool was_mixed */ 4: + message.wasMixed = reader.bool() + break + case /* bool monoallelic */ 5: + message.monoallelic = reader.bool() + break + case /* int32 var_dp */ 6: + message.varDp = reader.int32() + break + case /* optional int32 as_vardp */ 7: + message.asVardp = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: VariantInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string variant_type = 1; */ + if (message.variantType !== '') + writer.tag(1, WireType.LengthDelimited).string(message.variantType) + /* string allele_type = 2; */ + if (message.alleleType !== '') + writer.tag(2, WireType.LengthDelimited).string(message.alleleType) + /* int32 n_alt_alleles = 3; */ + if (message.nAltAlleles !== 0) writer.tag(3, WireType.Varint).int32(message.nAltAlleles) + /* bool was_mixed = 4; */ + if (message.wasMixed !== false) writer.tag(4, WireType.Varint).bool(message.wasMixed) + /* bool monoallelic = 5; */ + if (message.monoallelic !== false) writer.tag(5, WireType.Varint).bool(message.monoallelic) + /* int32 var_dp = 6; */ + if (message.varDp !== 0) writer.tag(6, WireType.Varint).int32(message.varDp) + /* optional int32 as_vardp = 7; */ + if (message.asVardp !== undefined) writer.tag(7, WireType.Varint).int32(message.asVardp) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.VariantInfo + */ +export const VariantInfo = new VariantInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad3.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'pos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'ref_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'alt_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { + no: 5, + name: 'filters', + kind: 'enum', + repeat: 1 /*RepeatType.PACKED*/, + T: () => ['annonars.gnomad.gnomad3.Filter', Filter] + }, + { no: 6, name: 'vep', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Vep }, + { + no: 7, + name: 'allele_counts', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => CohortAlleleCounts + }, + { no: 8, name: 'nonpar', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: 'effect_info', kind: 'message', T: () => EffectInfo }, + { no: 10, name: 'variant_info', kind: 'message', T: () => VariantInfo }, + { no: 11, name: 'quality_info', kind: 'message', T: () => QualityInfo }, + { no: 12, name: 'age_info', kind: 'message', T: () => AgeInfo }, + { no: 13, name: 'depth_info', kind: 'message', T: () => DepthInfo } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.pos = 0 + message.refAllele = '' + message.altAllele = '' + message.filters = [] + message.vep = [] + message.alleleCounts = [] + message.nonpar = false + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 pos */ 2: + message.pos = reader.int32() + break + case /* string ref_allele */ 3: + message.refAllele = reader.string() + break + case /* string alt_allele */ 4: + message.altAllele = reader.string() + break + case /* repeated annonars.gnomad.gnomad3.Filter filters */ 5: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.filters.push(reader.int32()) + else message.filters.push(reader.int32()) + break + case /* repeated annonars.gnomad.vep_gnomad3.Vep vep */ 6: + message.vep.push(Vep.internalBinaryRead(reader, reader.uint32(), options)) + break + case /* repeated annonars.gnomad.gnomad3.CohortAlleleCounts allele_counts */ 7: + message.alleleCounts.push( + CohortAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + case /* bool nonpar */ 8: + message.nonpar = reader.bool() + break + case /* optional annonars.gnomad.gnomad3.EffectInfo effect_info */ 9: + message.effectInfo = EffectInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.effectInfo + ) + break + case /* optional annonars.gnomad.gnomad3.VariantInfo variant_info */ 10: + message.variantInfo = VariantInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.variantInfo + ) + break + case /* optional annonars.gnomad.gnomad3.QualityInfo quality_info */ 11: + message.qualityInfo = QualityInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.qualityInfo + ) + break + case /* optional annonars.gnomad.gnomad3.AgeInfo age_info */ 12: + message.ageInfo = AgeInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.ageInfo + ) + break + case /* optional annonars.gnomad.gnomad3.DepthInfo depth_info */ 13: + message.depthInfo = DepthInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.depthInfo + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 pos = 2; */ + if (message.pos !== 0) writer.tag(2, WireType.Varint).int32(message.pos) + /* string ref_allele = 3; */ + if (message.refAllele !== '') writer.tag(3, WireType.LengthDelimited).string(message.refAllele) + /* string alt_allele = 4; */ + if (message.altAllele !== '') writer.tag(4, WireType.LengthDelimited).string(message.altAllele) + /* repeated annonars.gnomad.gnomad3.Filter filters = 5; */ + if (message.filters.length) { + writer.tag(5, WireType.LengthDelimited).fork() + for (let i = 0; i < message.filters.length; i++) writer.int32(message.filters[i]) + writer.join() + } + /* repeated annonars.gnomad.vep_gnomad3.Vep vep = 6; */ + for (let i = 0; i < message.vep.length; i++) + Vep.internalBinaryWrite( + message.vep[i], + writer.tag(6, WireType.LengthDelimited).fork(), + options + ).join() + /* repeated annonars.gnomad.gnomad3.CohortAlleleCounts allele_counts = 7; */ + for (let i = 0; i < message.alleleCounts.length; i++) + CohortAlleleCounts.internalBinaryWrite( + message.alleleCounts[i], + writer.tag(7, WireType.LengthDelimited).fork(), + options + ).join() + /* bool nonpar = 8; */ + if (message.nonpar !== false) writer.tag(8, WireType.Varint).bool(message.nonpar) + /* optional annonars.gnomad.gnomad3.EffectInfo effect_info = 9; */ + if (message.effectInfo) + EffectInfo.internalBinaryWrite( + message.effectInfo, + writer.tag(9, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.VariantInfo variant_info = 10; */ + if (message.variantInfo) + VariantInfo.internalBinaryWrite( + message.variantInfo, + writer.tag(10, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.QualityInfo quality_info = 11; */ + if (message.qualityInfo) + QualityInfo.internalBinaryWrite( + message.qualityInfo, + writer.tag(11, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.AgeInfo age_info = 12; */ + if (message.ageInfo) + AgeInfo.internalBinaryWrite( + message.ageInfo, + writer.tag(12, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.DepthInfo depth_info = 13; */ + if (message.depthInfo) + DepthInfo.internalBinaryWrite( + message.depthInfo, + writer.tag(13, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad3.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/gnomad/gnomad4.ts b/src/pbs/annonars/gnomad/gnomad4.ts new file mode 100644 index 0000000..85d4fae --- /dev/null +++ b/src/pbs/annonars/gnomad/gnomad4.ts @@ -0,0 +1,1100 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/gnomad4.proto" (package "annonars.gnomad.gnomad4", syntax proto3) +// tslint:disable +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { DepthInfo } from './gnomad3' +import { AgeInfo } from './gnomad3' +import { QualityInfo } from './gnomad3' +import { VariantInfo } from './gnomad3' +import { Filter } from './gnomad3' +import { AlleleCounts } from './gnomad3' +import { AlleleCountsBySex } from './gnomad3' +import { Vep } from './vep_gnomad4' + +/** + * Store details on variant effect predictions. + * + * @generated from protobuf message annonars.gnomad.gnomad4.EffectInfo + */ +export interface EffectInfo { + /** + * Pangolin's largest delta score across 2 splicing consequences, which reflects the probability of the variant being splice-altering"> + * + * @generated from protobuf field: optional float pangolin_largest_ds = 1; + */ + pangolinLargestDs?: number + /** + * Base-wise conservation score across the 241 placental mammals in the Zoonomia project. Score ranges from -20 to 9.28, and reflects acceleration (faster evolution than expected under neutral drift, assigned negative scores) as well as conservation (slower than expected evolution, assigned positive scores)."> + * + * @generated from protobuf field: optional float phylop = 2; + */ + phylop?: number + /** + * Score that predicts the possible impact of an amino acid substitution on the structure and function of a human protein, ranging from 0.0 (tolerated) to 1.0 (deleterious). We prioritize max scores for MANE Select transcripts where possible and otherwise report a score for the canonical transcript."> + * + * @generated from protobuf field: optional float polyphen_max = 3; + */ + polyphenMax?: number + /** + * The maximum REVEL score at a site's MANE Select or canonical transcript. It's an ensemble score for predicting the pathogenicity of missense variants (based on 13 other variant predictors). Scores ranges from 0 to 1. Variants with higher scores are predicted to be more likely to be deleterious."> + * + * @generated from protobuf field: optional float revel_max = 4; + */ + revelMax?: number + /** + * Score reflecting the scaled probability of the amino acid substitution being tolerated, ranging from 0 to 1. Scores below 0.05 are predicted to impact protein function. We prioritize max scores for MANE Select transcripts where possible and otherwise report a score for the canonical transcript."> + * + * @generated from protobuf field: optional float sift_max = 5; + */ + siftMax?: number + /** + * Illumina's SpliceAI max delta score; interpreted as the probability of the variant being splice-altering."> + * + * @generated from protobuf field: optional float spliceai_ds_max = 6; + */ + spliceaiDsMax?: number + /** + * Raw CADD scores are interpretable as the extent to which the annotation profile for a given variant suggests that the variant is likely to be 'observed' (negative values) vs 'simulated' (positive values). Larger values are more deleterious. + * + * @generated from protobuf field: optional float cadd_raw = 7; + */ + caddRaw?: number + /** + * Cadd Phred-like scores ('scaled C-scores') ranging from 1 to 99, based on the rank of each variant relative to all possible 8.6 billion substitutions in the human reference genome. Larger values are more deleterious. + * + * @generated from protobuf field: optional float cadd_phred = 8; + */ + caddPhred?: number +} +/** + * Store the allele counts for the given sub cohort in the given ancestry group. + * + * @generated from protobuf message annonars.gnomad.gnomad4.AncestryGroupAlleleCounts + */ +export interface AncestryGroupAlleleCounts { + /** + * Name of the ancestry group. + * + * @generated from protobuf field: string ancestry_group = 1; + */ + ancestryGroup: string + /** + * The overall allele counts and the one by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad3.AlleleCountsBySex counts = 2; + */ + counts?: AlleleCountsBySex + /** + * The filtering allele frequency (using Poisson 95% CI). + * + * @generated from protobuf field: optional float faf95 = 3; + */ + faf95?: number + /** + * The filtering allele frequency (using Poisson 99% CI). + * + * @generated from protobuf field: optional float faf99 = 4; + */ + faf99?: number + /** + * The filtering allele frequency for XX samples (using Poisson 95% CI). + * + * @generated from protobuf field: optional float faf95_xx = 5; + */ + faf95Xx?: number + /** + * The filtering allele frequency for XX samples (using Poisson 99% CI). + * + * @generated from protobuf field: optional float faf99_xx = 6; + */ + faf99Xx?: number + /** + * The filtering allele frequency for XY samples (using Poisson 95% CI). + * + * @generated from protobuf field: optional float faf95_xy = 7; + */ + faf95Xy?: number + /** + * The filtering allele frequency for XY samples (using Poisson 99% CI). + * + * @generated from protobuf field: optional float faf99_xy = 8; + */ + faf99Xy?: number +} +/** + * Store the allele counts for the given cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad4.CohortAlleleCounts + */ +export interface CohortAlleleCounts { + /** + * Name of the cohort. + * + * @generated from protobuf field: optional string cohort = 1; + */ + cohort?: string + /** + * Allele counts for each population. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad4.AncestryGroupAlleleCounts by_ancestry_group = 2; + */ + byAncestryGroup: AncestryGroupAlleleCounts[] + /** + * Allele counts by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad3.AlleleCountsBySex by_sex = 3; + */ + bySex?: AlleleCountsBySex + /** + * Raw allele counts. + * + * @generated from protobuf field: annonars.gnomad.gnomad3.AlleleCounts raw = 4; + */ + raw?: AlleleCounts + /** + * The ancestry group with maximum AF. + * + * @generated from protobuf field: optional string grpmax = 5; + */ + grpmax?: string + /** + * Maximum allele frequency across ancestry groups. + * + * @generated from protobuf field: optional float af_grpmax = 6; + */ + afGrpmax?: number + /** + * Allele count in ancestry group with maximum AF. + * + * @generated from protobuf field: optional int32 ac_grpmax = 7; + */ + acGrpmax?: number + /** + * Total number of alleles in ancestry group with maximum AF. + * + * @generated from protobuf field: optional int32 an_grpmax = 8; + */ + anGrpmax?: number + /** + * Total number of homozygous individuals in ancestry group with maximum AF. + * + * @generated from protobuf field: optional int32 nhomalt_grpmax = 9; + */ + nhomaltGrpmax?: number +} +/** + * VRS information + * + * @generated from protobuf message annonars.gnomad.gnomad4.VrsInfo + */ +export interface VrsInfo { + /** + * The computed identifiers for the GA4GH VRS Alleles corresponding to the values in the REF and ALT fields + * + * @generated from protobuf field: repeated string allele_ids = 1; + */ + alleleIds: string[] + /** + * Interresidue coordinates used as the location ends for the GA4GH VRS Alleles corresponding to the values in the REF and ALT fields + * + * @generated from protobuf field: repeated int32 ends = 2; + */ + ends: number[] + /** + * Interresidue coordinates used as the location starts for the GA4GH VRS Alleles corresponding to the values in the REF and ALT fields + * + * @generated from protobuf field: repeated int32 starts = 3; + */ + starts: number[] + /** + * The literal sequence states used for the GA4GH VRS Alleles corresponding to the values in the REF and ALT fields + * + * @generated from protobuf field: repeated string states = 4; + */ + states: string[] +} +/** + * Protocol buffer for the gnomAD-nuclear VCF record. + * + * The more specialized fields from the INFO column are stored in separate, optional fields such + * that we don't end up with a humongous message. + * + * @generated from protobuf message annonars.gnomad.gnomad4.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 pos = 2; + */ + pos: number + /** + * Reference allele. + * + * @generated from protobuf field: string ref_allele = 3; + */ + refAllele: string + /** + * Alternate allele. + * + * @generated from protobuf field: string alt_allele = 4; + */ + altAllele: string + /** + * Site-level filters. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad3.Filter filters = 5; + */ + filters: Filter[] + /** + * VEP annotation records. + * + * @generated from protobuf field: repeated annonars.gnomad.vep_gnomad4.Vep vep = 6; + */ + vep: Vep[] + /** + * Variant allele counts in the different cohorts and population. + * + * The populations in gnomAD v4 are: empty for global, "joint" for exome+genomes. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad4.CohortAlleleCounts allele_counts = 7; + */ + alleleCounts: CohortAlleleCounts[] + /** + * Variant (on sex chromosome) falls outside a pseudoautosomal region + * + * @generated from protobuf field: bool nonpar = 8; + */ + nonpar: boolean + /** + * All samples are heterozygous for the variant + * + * @generated from protobuf field: bool only_het = 9; + */ + onlyHet: boolean + /** + * Variant falls outside of Broad exome capture regions (exomes only). + * + * @generated from protobuf field: bool outside_broad_capture_region = 10; + */ + outsideBroadCaptureRegion: boolean + /** + * Variant falls outside of UK Biobank exome capture regions(exomes only). + * + * @generated from protobuf field: bool outside_ukb_capture_region = 11; + */ + outsideUkbCaptureRegion: boolean + /** + * Variant was a callset-wide doubleton that was present only in two siblings (i.e., a singleton amongst unrelated samples in cohort) (exomes only). + * + * @generated from protobuf field: bool sibling_singleton = 12; + */ + siblingSingleton: boolean + /** + * Information on variant scores. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad4.EffectInfo effect_info = 13; + */ + effectInfo?: EffectInfo + /** + * Variant-related information details. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.VariantInfo variant_info = 14; + */ + variantInfo?: VariantInfo + /** + * Summary information for variant quality interpretation. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.QualityInfo quality_info = 15; + */ + qualityInfo?: QualityInfo + /** + * Age-related information. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.AgeInfo age_info = 16; + */ + ageInfo?: AgeInfo + /** + * Depth of coverage-related information. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad3.DepthInfo depth_info = 17; + */ + depthInfo?: DepthInfo + /** + * VRS infos. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad4.VrsInfo vrs_info = 18; + */ + vrsInfo?: VrsInfo +} +// @generated message type with reflection information, may provide speed optimized methods +class EffectInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad4.EffectInfo', [ + { no: 1, name: 'pangolin_largest_ds', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: 'phylop', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 3, name: 'polyphen_max', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: 'revel_max', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 5, name: 'sift_max', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 6, name: 'spliceai_ds_max', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: 'cadd_raw', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 8, name: 'cadd_phred', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): EffectInfo { + const message = globalThis.Object.create(this.messagePrototype!) + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EffectInfo + ): EffectInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional float pangolin_largest_ds */ 1: + message.pangolinLargestDs = reader.float() + break + case /* optional float phylop */ 2: + message.phylop = reader.float() + break + case /* optional float polyphen_max */ 3: + message.polyphenMax = reader.float() + break + case /* optional float revel_max */ 4: + message.revelMax = reader.float() + break + case /* optional float sift_max */ 5: + message.siftMax = reader.float() + break + case /* optional float spliceai_ds_max */ 6: + message.spliceaiDsMax = reader.float() + break + case /* optional float cadd_raw */ 7: + message.caddRaw = reader.float() + break + case /* optional float cadd_phred */ 8: + message.caddPhred = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: EffectInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional float pangolin_largest_ds = 1; */ + if (message.pangolinLargestDs !== undefined) + writer.tag(1, WireType.Bit32).float(message.pangolinLargestDs) + /* optional float phylop = 2; */ + if (message.phylop !== undefined) writer.tag(2, WireType.Bit32).float(message.phylop) + /* optional float polyphen_max = 3; */ + if (message.polyphenMax !== undefined) writer.tag(3, WireType.Bit32).float(message.polyphenMax) + /* optional float revel_max = 4; */ + if (message.revelMax !== undefined) writer.tag(4, WireType.Bit32).float(message.revelMax) + /* optional float sift_max = 5; */ + if (message.siftMax !== undefined) writer.tag(5, WireType.Bit32).float(message.siftMax) + /* optional float spliceai_ds_max = 6; */ + if (message.spliceaiDsMax !== undefined) + writer.tag(6, WireType.Bit32).float(message.spliceaiDsMax) + /* optional float cadd_raw = 7; */ + if (message.caddRaw !== undefined) writer.tag(7, WireType.Bit32).float(message.caddRaw) + /* optional float cadd_phred = 8; */ + if (message.caddPhred !== undefined) writer.tag(8, WireType.Bit32).float(message.caddPhred) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad4.EffectInfo + */ +export const EffectInfo = new EffectInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class AncestryGroupAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad4.AncestryGroupAlleleCounts', [ + { no: 1, name: 'ancestry_group', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'counts', kind: 'message', T: () => AlleleCountsBySex }, + { no: 3, name: 'faf95', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: 'faf99', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 5, name: 'faf95_xx', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 6, name: 'faf99_xx', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: 'faf95_xy', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 8, name: 'faf99_xy', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): AncestryGroupAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.ancestryGroup = '' + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AncestryGroupAlleleCounts + ): AncestryGroupAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string ancestry_group */ 1: + message.ancestryGroup = reader.string() + break + case /* annonars.gnomad.gnomad3.AlleleCountsBySex counts */ 2: + message.counts = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.counts + ) + break + case /* optional float faf95 */ 3: + message.faf95 = reader.float() + break + case /* optional float faf99 */ 4: + message.faf99 = reader.float() + break + case /* optional float faf95_xx */ 5: + message.faf95Xx = reader.float() + break + case /* optional float faf99_xx */ 6: + message.faf99Xx = reader.float() + break + case /* optional float faf95_xy */ 7: + message.faf95Xy = reader.float() + break + case /* optional float faf99_xy */ 8: + message.faf99Xy = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AncestryGroupAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string ancestry_group = 1; */ + if (message.ancestryGroup !== '') + writer.tag(1, WireType.LengthDelimited).string(message.ancestryGroup) + /* annonars.gnomad.gnomad3.AlleleCountsBySex counts = 2; */ + if (message.counts) + AlleleCountsBySex.internalBinaryWrite( + message.counts, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* optional float faf95 = 3; */ + if (message.faf95 !== undefined) writer.tag(3, WireType.Bit32).float(message.faf95) + /* optional float faf99 = 4; */ + if (message.faf99 !== undefined) writer.tag(4, WireType.Bit32).float(message.faf99) + /* optional float faf95_xx = 5; */ + if (message.faf95Xx !== undefined) writer.tag(5, WireType.Bit32).float(message.faf95Xx) + /* optional float faf99_xx = 6; */ + if (message.faf99Xx !== undefined) writer.tag(6, WireType.Bit32).float(message.faf99Xx) + /* optional float faf95_xy = 7; */ + if (message.faf95Xy !== undefined) writer.tag(7, WireType.Bit32).float(message.faf95Xy) + /* optional float faf99_xy = 8; */ + if (message.faf99Xy !== undefined) writer.tag(8, WireType.Bit32).float(message.faf99Xy) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad4.AncestryGroupAlleleCounts + */ +export const AncestryGroupAlleleCounts = new AncestryGroupAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class CohortAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad4.CohortAlleleCounts', [ + { no: 1, name: 'cohort', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { + no: 2, + name: 'by_ancestry_group', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => AncestryGroupAlleleCounts + }, + { no: 3, name: 'by_sex', kind: 'message', T: () => AlleleCountsBySex }, + { no: 4, name: 'raw', kind: 'message', T: () => AlleleCounts }, + { no: 5, name: 'grpmax', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: 'af_grpmax', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: 'ac_grpmax', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: 'an_grpmax', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 9, name: 'nhomalt_grpmax', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): CohortAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.byAncestryGroup = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CohortAlleleCounts + ): CohortAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional string cohort */ 1: + message.cohort = reader.string() + break + case /* repeated annonars.gnomad.gnomad4.AncestryGroupAlleleCounts by_ancestry_group */ 2: + message.byAncestryGroup.push( + AncestryGroupAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + case /* annonars.gnomad.gnomad3.AlleleCountsBySex by_sex */ 3: + message.bySex = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.bySex + ) + break + case /* annonars.gnomad.gnomad3.AlleleCounts raw */ 4: + message.raw = AlleleCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.raw + ) + break + case /* optional string grpmax */ 5: + message.grpmax = reader.string() + break + case /* optional float af_grpmax */ 6: + message.afGrpmax = reader.float() + break + case /* optional int32 ac_grpmax */ 7: + message.acGrpmax = reader.int32() + break + case /* optional int32 an_grpmax */ 8: + message.anGrpmax = reader.int32() + break + case /* optional int32 nhomalt_grpmax */ 9: + message.nhomaltGrpmax = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: CohortAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional string cohort = 1; */ + if (message.cohort !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.cohort) + /* repeated annonars.gnomad.gnomad4.AncestryGroupAlleleCounts by_ancestry_group = 2; */ + for (let i = 0; i < message.byAncestryGroup.length; i++) + AncestryGroupAlleleCounts.internalBinaryWrite( + message.byAncestryGroup[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad3.AlleleCountsBySex by_sex = 3; */ + if (message.bySex) + AlleleCountsBySex.internalBinaryWrite( + message.bySex, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad3.AlleleCounts raw = 4; */ + if (message.raw) + AlleleCounts.internalBinaryWrite( + message.raw, + writer.tag(4, WireType.LengthDelimited).fork(), + options + ).join() + /* optional string grpmax = 5; */ + if (message.grpmax !== undefined) writer.tag(5, WireType.LengthDelimited).string(message.grpmax) + /* optional float af_grpmax = 6; */ + if (message.afGrpmax !== undefined) writer.tag(6, WireType.Bit32).float(message.afGrpmax) + /* optional int32 ac_grpmax = 7; */ + if (message.acGrpmax !== undefined) writer.tag(7, WireType.Varint).int32(message.acGrpmax) + /* optional int32 an_grpmax = 8; */ + if (message.anGrpmax !== undefined) writer.tag(8, WireType.Varint).int32(message.anGrpmax) + /* optional int32 nhomalt_grpmax = 9; */ + if (message.nhomaltGrpmax !== undefined) + writer.tag(9, WireType.Varint).int32(message.nhomaltGrpmax) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad4.CohortAlleleCounts + */ +export const CohortAlleleCounts = new CohortAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class VrsInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad4.VrsInfo', [ + { + no: 1, + name: 'allele_ids', + kind: 'scalar', + repeat: 2 /*RepeatType.UNPACKED*/, + T: 9 /*ScalarType.STRING*/ + }, + { + no: 2, + name: 'ends', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 3, + name: 'starts', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'states', + kind: 'scalar', + repeat: 2 /*RepeatType.UNPACKED*/, + T: 9 /*ScalarType.STRING*/ + } + ]) + } + create(value?: PartialMessage): VrsInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.alleleIds = [] + message.ends = [] + message.starts = [] + message.states = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: VrsInfo + ): VrsInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* repeated string allele_ids */ 1: + message.alleleIds.push(reader.string()) + break + case /* repeated int32 ends */ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.ends.push(reader.int32()) + else message.ends.push(reader.int32()) + break + case /* repeated int32 starts */ 3: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.starts.push(reader.int32()) + else message.starts.push(reader.int32()) + break + case /* repeated string states */ 4: + message.states.push(reader.string()) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: VrsInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* repeated string allele_ids = 1; */ + for (let i = 0; i < message.alleleIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.alleleIds[i]) + /* repeated int32 ends = 2; */ + if (message.ends.length) { + writer.tag(2, WireType.LengthDelimited).fork() + for (let i = 0; i < message.ends.length; i++) writer.int32(message.ends[i]) + writer.join() + } + /* repeated int32 starts = 3; */ + if (message.starts.length) { + writer.tag(3, WireType.LengthDelimited).fork() + for (let i = 0; i < message.starts.length; i++) writer.int32(message.starts[i]) + writer.join() + } + /* repeated string states = 4; */ + for (let i = 0; i < message.states.length; i++) + writer.tag(4, WireType.LengthDelimited).string(message.states[i]) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad4.VrsInfo + */ +export const VrsInfo = new VrsInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad4.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'pos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'ref_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'alt_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { + no: 5, + name: 'filters', + kind: 'enum', + repeat: 1 /*RepeatType.PACKED*/, + T: () => ['annonars.gnomad.gnomad3.Filter', Filter] + }, + { no: 6, name: 'vep', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Vep }, + { + no: 7, + name: 'allele_counts', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => CohortAlleleCounts + }, + { no: 8, name: 'nonpar', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: 'only_het', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 10, name: 'outside_broad_capture_region', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 11, name: 'outside_ukb_capture_region', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 12, name: 'sibling_singleton', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 13, name: 'effect_info', kind: 'message', T: () => EffectInfo }, + { no: 14, name: 'variant_info', kind: 'message', T: () => VariantInfo }, + { no: 15, name: 'quality_info', kind: 'message', T: () => QualityInfo }, + { no: 16, name: 'age_info', kind: 'message', T: () => AgeInfo }, + { no: 17, name: 'depth_info', kind: 'message', T: () => DepthInfo }, + { no: 18, name: 'vrs_info', kind: 'message', T: () => VrsInfo } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.pos = 0 + message.refAllele = '' + message.altAllele = '' + message.filters = [] + message.vep = [] + message.alleleCounts = [] + message.nonpar = false + message.onlyHet = false + message.outsideBroadCaptureRegion = false + message.outsideUkbCaptureRegion = false + message.siblingSingleton = false + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 pos */ 2: + message.pos = reader.int32() + break + case /* string ref_allele */ 3: + message.refAllele = reader.string() + break + case /* string alt_allele */ 4: + message.altAllele = reader.string() + break + case /* repeated annonars.gnomad.gnomad3.Filter filters */ 5: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.filters.push(reader.int32()) + else message.filters.push(reader.int32()) + break + case /* repeated annonars.gnomad.vep_gnomad4.Vep vep */ 6: + message.vep.push(Vep.internalBinaryRead(reader, reader.uint32(), options)) + break + case /* repeated annonars.gnomad.gnomad4.CohortAlleleCounts allele_counts */ 7: + message.alleleCounts.push( + CohortAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + case /* bool nonpar */ 8: + message.nonpar = reader.bool() + break + case /* bool only_het */ 9: + message.onlyHet = reader.bool() + break + case /* bool outside_broad_capture_region */ 10: + message.outsideBroadCaptureRegion = reader.bool() + break + case /* bool outside_ukb_capture_region */ 11: + message.outsideUkbCaptureRegion = reader.bool() + break + case /* bool sibling_singleton */ 12: + message.siblingSingleton = reader.bool() + break + case /* optional annonars.gnomad.gnomad4.EffectInfo effect_info */ 13: + message.effectInfo = EffectInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.effectInfo + ) + break + case /* optional annonars.gnomad.gnomad3.VariantInfo variant_info */ 14: + message.variantInfo = VariantInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.variantInfo + ) + break + case /* optional annonars.gnomad.gnomad3.QualityInfo quality_info */ 15: + message.qualityInfo = QualityInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.qualityInfo + ) + break + case /* optional annonars.gnomad.gnomad3.AgeInfo age_info */ 16: + message.ageInfo = AgeInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.ageInfo + ) + break + case /* optional annonars.gnomad.gnomad3.DepthInfo depth_info */ 17: + message.depthInfo = DepthInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.depthInfo + ) + break + case /* optional annonars.gnomad.gnomad4.VrsInfo vrs_info */ 18: + message.vrsInfo = VrsInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.vrsInfo + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 pos = 2; */ + if (message.pos !== 0) writer.tag(2, WireType.Varint).int32(message.pos) + /* string ref_allele = 3; */ + if (message.refAllele !== '') writer.tag(3, WireType.LengthDelimited).string(message.refAllele) + /* string alt_allele = 4; */ + if (message.altAllele !== '') writer.tag(4, WireType.LengthDelimited).string(message.altAllele) + /* repeated annonars.gnomad.gnomad3.Filter filters = 5; */ + if (message.filters.length) { + writer.tag(5, WireType.LengthDelimited).fork() + for (let i = 0; i < message.filters.length; i++) writer.int32(message.filters[i]) + writer.join() + } + /* repeated annonars.gnomad.vep_gnomad4.Vep vep = 6; */ + for (let i = 0; i < message.vep.length; i++) + Vep.internalBinaryWrite( + message.vep[i], + writer.tag(6, WireType.LengthDelimited).fork(), + options + ).join() + /* repeated annonars.gnomad.gnomad4.CohortAlleleCounts allele_counts = 7; */ + for (let i = 0; i < message.alleleCounts.length; i++) + CohortAlleleCounts.internalBinaryWrite( + message.alleleCounts[i], + writer.tag(7, WireType.LengthDelimited).fork(), + options + ).join() + /* bool nonpar = 8; */ + if (message.nonpar !== false) writer.tag(8, WireType.Varint).bool(message.nonpar) + /* bool only_het = 9; */ + if (message.onlyHet !== false) writer.tag(9, WireType.Varint).bool(message.onlyHet) + /* bool outside_broad_capture_region = 10; */ + if (message.outsideBroadCaptureRegion !== false) + writer.tag(10, WireType.Varint).bool(message.outsideBroadCaptureRegion) + /* bool outside_ukb_capture_region = 11; */ + if (message.outsideUkbCaptureRegion !== false) + writer.tag(11, WireType.Varint).bool(message.outsideUkbCaptureRegion) + /* bool sibling_singleton = 12; */ + if (message.siblingSingleton !== false) + writer.tag(12, WireType.Varint).bool(message.siblingSingleton) + /* optional annonars.gnomad.gnomad4.EffectInfo effect_info = 13; */ + if (message.effectInfo) + EffectInfo.internalBinaryWrite( + message.effectInfo, + writer.tag(13, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.VariantInfo variant_info = 14; */ + if (message.variantInfo) + VariantInfo.internalBinaryWrite( + message.variantInfo, + writer.tag(14, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.QualityInfo quality_info = 15; */ + if (message.qualityInfo) + QualityInfo.internalBinaryWrite( + message.qualityInfo, + writer.tag(15, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.AgeInfo age_info = 16; */ + if (message.ageInfo) + AgeInfo.internalBinaryWrite( + message.ageInfo, + writer.tag(16, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad3.DepthInfo depth_info = 17; */ + if (message.depthInfo) + DepthInfo.internalBinaryWrite( + message.depthInfo, + writer.tag(17, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad4.VrsInfo vrs_info = 18; */ + if (message.vrsInfo) + VrsInfo.internalBinaryWrite( + message.vrsInfo, + writer.tag(18, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad4.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/gnomad/gnomad_cnv4.ts b/src/pbs/annonars/gnomad/gnomad_cnv4.ts new file mode 100644 index 0000000..9795a2c --- /dev/null +++ b/src/pbs/annonars/gnomad/gnomad_cnv4.ts @@ -0,0 +1,807 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/gnomad_cnv4.proto" (package "annonars.gnomad.gnomad_cnv4", syntax proto3) +// tslint:disable +// +// Protocol buffers for representing gnomAD-CNV v4 data. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { CnvType } from './exac_cnv' + +/** + * Carrier counts + * + * @generated from protobuf message annonars.gnomad.gnomad_cnv4.CarrierCounts + */ +export interface CarrierCounts { + /** + * Number of releaseable samples with a variant at this site. + * + * @generated from protobuf field: int32 sc = 1; + */ + sc: number + /** + * Proportion of releaseable samples (site frequency) with a variant at + * this site. + * + * @generated from protobuf field: float sf = 2; + */ + sf: number + /** + * Total number of releaseable samples considered at this site. + * + * @generated from protobuf field: int32 sn = 3; + */ + sn: number +} +/** + * Store the carrier counts for the given sub cohort and sub cohort factored by sex. + * + * @generated from protobuf message annonars.gnomad.gnomad_cnv4.CarrierCountsBySex + */ +export interface CarrierCountsBySex { + /** + * Overall carrier counts in the sub cohort. + * + * @generated from protobuf field: annonars.gnomad.gnomad_cnv4.CarrierCounts overall = 1; + */ + overall?: CarrierCounts + /** + * Carrier counts in female/XX karyotype individuals of sub cohort. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad_cnv4.CarrierCounts xx = 2; + */ + xx?: CarrierCounts + /** + * Carrier counts in male/XY karyotype individuals of sub cohort. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad_cnv4.CarrierCounts xy = 3; + */ + xy?: CarrierCounts +} +/** + * Store the carrier counts for a population. + * + * @generated from protobuf message annonars.gnomad.gnomad_cnv4.PopulationCarrierCounts + */ +export interface PopulationCarrierCounts { + /** + * The population. + * + * @generated from protobuf field: annonars.gnomad.gnomad_cnv4.Population population = 1; + */ + population: Population + /** + * The overall allele counts and the one by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad_cnv4.CarrierCountsBySex counts = 2; + */ + counts?: CarrierCountsBySex +} +/** + * Store the allele counts for the given cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad_cnv4.CohortCarrierCounts + */ +export interface CohortCarrierCounts { + /** + * Name of the cohort, empty for global. + * + * @generated from protobuf field: optional string cohort = 1; + */ + cohort?: string + /** + * The overall carrier counts and the one by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad_cnv4.CarrierCountsBySex by_sex = 2; + */ + bySex?: CarrierCountsBySex + /** + * Carrier counts for each population. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad_cnv4.PopulationCarrierCounts by_population = 3; + */ + byPopulation: PopulationCarrierCounts[] +} +/** + * One record in the gnomAD-CNV v4 dataset. + * + * @generated from protobuf message annonars.gnomad.gnomad_cnv4.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 start = 2; + */ + start: number + /** + * 1-based stop position. + * + * @generated from protobuf field: int32 stop = 3; + */ + stop: number + /** + * 1-based inner start position. + * + * @generated from protobuf field: int32 inner_start = 4; + */ + innerStart: number + /** + * 1-based inner stop position. + * + * @generated from protobuf field: int32 inner_stop = 5; + */ + innerStop: number + /** + * 1-based outer start position. + * + * @generated from protobuf field: int32 outer_start = 6; + */ + outerStart: number + /** + * 1-based inner stop position. + * + * @generated from protobuf field: int32 outer_stop = 7; + */ + outerStop: number + /** + * Unique identifier for the variant. + * + * @generated from protobuf field: string id = 8; + */ + id: string + /** + * Length of the SV. + * + * @generated from protobuf field: int32 sv_len = 9; + */ + svLen: number + /** + * The type of the variant. + * + * @generated from protobuf field: annonars.gnomad.exac_cnv.CnvType sv_type = 10; + */ + svType: CnvType + /** + * Median number of callable exons spanned by variant passing QS + * threshold. + * + * @generated from protobuf field: int32 n_exn_var = 11; + */ + nExnVar: number + /** + * Median number of callable intervals spanned by variant passing + * QS threshold. + * + * @generated from protobuf field: int32 n_int_var = 12; + */ + nIntVar: number + /** + * Symbols of genes predicted to be impacted by variant + * + * @generated from protobuf field: repeated string genes = 13; + */ + genes: string[] + /** + * Carrier counts in the different population. + * + * The populations in gnomAD CNV v4 are: empty for global, "non_neuro", + * and "non_neuro_coontrols". + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad_cnv4.CohortCarrierCounts carrier_counts = 14; + */ + carrierCounts: CohortCarrierCounts[] +} +/** + * ExAC population. + * + * @generated from protobuf enum annonars.gnomad.gnomad_cnv4.Population + */ +export enum Population { + /** + * unknown + * + * @generated from protobuf enum value: POPULATION_UNKNOWN = 0; + */ + POPULATION_UNKNOWN = 0, + /** + * African + * + * @generated from protobuf enum value: POPULATION_AFR = 1; + */ + POPULATION_AFR = 1, + /** + * Ad Mixed American + * + * @generated from protobuf enum value: POPULATION_AMR = 2; + */ + POPULATION_AMR = 2, + /** + * Ashkenazi Jewish + * + * @generated from protobuf enum value: POPULATION_ASJ = 3; + */ + POPULATION_ASJ = 3, + /** + * East Asian + * + * @generated from protobuf enum value: POPULATION_EAS = 4; + */ + POPULATION_EAS = 4, + /** + * Finnish + * + * @generated from protobuf enum value: POPULATION_FIN = 5; + */ + POPULATION_FIN = 5, + /** + * Middle Eastern + * + * @generated from protobuf enum value: POPULATION_MID = 6; + */ + POPULATION_MID = 6, + /** + * Non-Finnish European + * + * @generated from protobuf enum value: POPULATION_NFE = 7; + */ + POPULATION_NFE = 7, + /** + * South Asian + * + * @generated from protobuf enum value: POPULATION_SAS = 8; + */ + POPULATION_SAS = 8 +} +// @generated message type with reflection information, may provide speed optimized methods +class CarrierCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_cnv4.CarrierCounts', [ + { no: 1, name: 'sc', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: 'sf', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 3, name: 'sn', kind: 'scalar', T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): CarrierCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.sc = 0 + message.sf = 0 + message.sn = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CarrierCounts + ): CarrierCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* int32 sc */ 1: + message.sc = reader.int32() + break + case /* float sf */ 2: + message.sf = reader.float() + break + case /* int32 sn */ 3: + message.sn = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: CarrierCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* int32 sc = 1; */ + if (message.sc !== 0) writer.tag(1, WireType.Varint).int32(message.sc) + /* float sf = 2; */ + if (message.sf !== 0) writer.tag(2, WireType.Bit32).float(message.sf) + /* int32 sn = 3; */ + if (message.sn !== 0) writer.tag(3, WireType.Varint).int32(message.sn) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_cnv4.CarrierCounts + */ +export const CarrierCounts = new CarrierCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class CarrierCountsBySex$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_cnv4.CarrierCountsBySex', [ + { no: 1, name: 'overall', kind: 'message', T: () => CarrierCounts }, + { no: 2, name: 'xx', kind: 'message', T: () => CarrierCounts }, + { no: 3, name: 'xy', kind: 'message', T: () => CarrierCounts } + ]) + } + create(value?: PartialMessage): CarrierCountsBySex { + const message = globalThis.Object.create(this.messagePrototype!) + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CarrierCountsBySex + ): CarrierCountsBySex { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* annonars.gnomad.gnomad_cnv4.CarrierCounts overall */ 1: + message.overall = CarrierCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.overall + ) + break + case /* optional annonars.gnomad.gnomad_cnv4.CarrierCounts xx */ 2: + message.xx = CarrierCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.xx + ) + break + case /* optional annonars.gnomad.gnomad_cnv4.CarrierCounts xy */ 3: + message.xy = CarrierCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.xy + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: CarrierCountsBySex, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* annonars.gnomad.gnomad_cnv4.CarrierCounts overall = 1; */ + if (message.overall) + CarrierCounts.internalBinaryWrite( + message.overall, + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad_cnv4.CarrierCounts xx = 2; */ + if (message.xx) + CarrierCounts.internalBinaryWrite( + message.xx, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.gnomad_cnv4.CarrierCounts xy = 3; */ + if (message.xy) + CarrierCounts.internalBinaryWrite( + message.xy, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_cnv4.CarrierCountsBySex + */ +export const CarrierCountsBySex = new CarrierCountsBySex$Type() +// @generated message type with reflection information, may provide speed optimized methods +class PopulationCarrierCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_cnv4.PopulationCarrierCounts', [ + { + no: 1, + name: 'population', + kind: 'enum', + T: () => ['annonars.gnomad.gnomad_cnv4.Population', Population] + }, + { no: 2, name: 'counts', kind: 'message', T: () => CarrierCountsBySex } + ]) + } + create(value?: PartialMessage): PopulationCarrierCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.population = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: PopulationCarrierCounts + ): PopulationCarrierCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* annonars.gnomad.gnomad_cnv4.Population population */ 1: + message.population = reader.int32() + break + case /* annonars.gnomad.gnomad_cnv4.CarrierCountsBySex counts */ 2: + message.counts = CarrierCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.counts + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: PopulationCarrierCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* annonars.gnomad.gnomad_cnv4.Population population = 1; */ + if (message.population !== 0) writer.tag(1, WireType.Varint).int32(message.population) + /* annonars.gnomad.gnomad_cnv4.CarrierCountsBySex counts = 2; */ + if (message.counts) + CarrierCountsBySex.internalBinaryWrite( + message.counts, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_cnv4.PopulationCarrierCounts + */ +export const PopulationCarrierCounts = new PopulationCarrierCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class CohortCarrierCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_cnv4.CohortCarrierCounts', [ + { no: 1, name: 'cohort', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'by_sex', kind: 'message', T: () => CarrierCountsBySex }, + { + no: 3, + name: 'by_population', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => PopulationCarrierCounts + } + ]) + } + create(value?: PartialMessage): CohortCarrierCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.byPopulation = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CohortCarrierCounts + ): CohortCarrierCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional string cohort */ 1: + message.cohort = reader.string() + break + case /* annonars.gnomad.gnomad_cnv4.CarrierCountsBySex by_sex */ 2: + message.bySex = CarrierCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.bySex + ) + break + case /* repeated annonars.gnomad.gnomad_cnv4.PopulationCarrierCounts by_population */ 3: + message.byPopulation.push( + PopulationCarrierCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: CohortCarrierCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional string cohort = 1; */ + if (message.cohort !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.cohort) + /* annonars.gnomad.gnomad_cnv4.CarrierCountsBySex by_sex = 2; */ + if (message.bySex) + CarrierCountsBySex.internalBinaryWrite( + message.bySex, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* repeated annonars.gnomad.gnomad_cnv4.PopulationCarrierCounts by_population = 3; */ + for (let i = 0; i < message.byPopulation.length; i++) + PopulationCarrierCounts.internalBinaryWrite( + message.byPopulation[i], + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_cnv4.CohortCarrierCounts + */ +export const CohortCarrierCounts = new CohortCarrierCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_cnv4.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'start', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'stop', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'inner_start', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 5, name: 'inner_stop', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 6, name: 'outer_start', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 7, name: 'outer_stop', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: 'id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: 'sv_len', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { + no: 10, + name: 'sv_type', + kind: 'enum', + T: () => ['annonars.gnomad.exac_cnv.CnvType', CnvType] + }, + { no: 11, name: 'n_exn_var', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 12, name: 'n_int_var', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { + no: 13, + name: 'genes', + kind: 'scalar', + repeat: 2 /*RepeatType.UNPACKED*/, + T: 9 /*ScalarType.STRING*/ + }, + { + no: 14, + name: 'carrier_counts', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => CohortCarrierCounts + } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.start = 0 + message.stop = 0 + message.innerStart = 0 + message.innerStop = 0 + message.outerStart = 0 + message.outerStop = 0 + message.id = '' + message.svLen = 0 + message.svType = 0 + message.nExnVar = 0 + message.nIntVar = 0 + message.genes = [] + message.carrierCounts = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 start */ 2: + message.start = reader.int32() + break + case /* int32 stop */ 3: + message.stop = reader.int32() + break + case /* int32 inner_start */ 4: + message.innerStart = reader.int32() + break + case /* int32 inner_stop */ 5: + message.innerStop = reader.int32() + break + case /* int32 outer_start */ 6: + message.outerStart = reader.int32() + break + case /* int32 outer_stop */ 7: + message.outerStop = reader.int32() + break + case /* string id */ 8: + message.id = reader.string() + break + case /* int32 sv_len */ 9: + message.svLen = reader.int32() + break + case /* annonars.gnomad.exac_cnv.CnvType sv_type */ 10: + message.svType = reader.int32() + break + case /* int32 n_exn_var */ 11: + message.nExnVar = reader.int32() + break + case /* int32 n_int_var */ 12: + message.nIntVar = reader.int32() + break + case /* repeated string genes */ 13: + message.genes.push(reader.string()) + break + case /* repeated annonars.gnomad.gnomad_cnv4.CohortCarrierCounts carrier_counts */ 14: + message.carrierCounts.push( + CohortCarrierCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 start = 2; */ + if (message.start !== 0) writer.tag(2, WireType.Varint).int32(message.start) + /* int32 stop = 3; */ + if (message.stop !== 0) writer.tag(3, WireType.Varint).int32(message.stop) + /* int32 inner_start = 4; */ + if (message.innerStart !== 0) writer.tag(4, WireType.Varint).int32(message.innerStart) + /* int32 inner_stop = 5; */ + if (message.innerStop !== 0) writer.tag(5, WireType.Varint).int32(message.innerStop) + /* int32 outer_start = 6; */ + if (message.outerStart !== 0) writer.tag(6, WireType.Varint).int32(message.outerStart) + /* int32 outer_stop = 7; */ + if (message.outerStop !== 0) writer.tag(7, WireType.Varint).int32(message.outerStop) + /* string id = 8; */ + if (message.id !== '') writer.tag(8, WireType.LengthDelimited).string(message.id) + /* int32 sv_len = 9; */ + if (message.svLen !== 0) writer.tag(9, WireType.Varint).int32(message.svLen) + /* annonars.gnomad.exac_cnv.CnvType sv_type = 10; */ + if (message.svType !== 0) writer.tag(10, WireType.Varint).int32(message.svType) + /* int32 n_exn_var = 11; */ + if (message.nExnVar !== 0) writer.tag(11, WireType.Varint).int32(message.nExnVar) + /* int32 n_int_var = 12; */ + if (message.nIntVar !== 0) writer.tag(12, WireType.Varint).int32(message.nIntVar) + /* repeated string genes = 13; */ + for (let i = 0; i < message.genes.length; i++) + writer.tag(13, WireType.LengthDelimited).string(message.genes[i]) + /* repeated annonars.gnomad.gnomad_cnv4.CohortCarrierCounts carrier_counts = 14; */ + for (let i = 0; i < message.carrierCounts.length; i++) + CohortCarrierCounts.internalBinaryWrite( + message.carrierCounts[i], + writer.tag(14, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_cnv4.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/gnomad/gnomad_sv2.ts b/src/pbs/annonars/gnomad/gnomad_sv2.ts new file mode 100644 index 0000000..8c16053 --- /dev/null +++ b/src/pbs/annonars/gnomad/gnomad_sv2.ts @@ -0,0 +1,1069 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/gnomad_sv2.proto" (package "annonars.gnomad.gnomad_sv2", syntax proto3) +// tslint:disable +// +// Protocol buffers for representing gnomAD-SV v2 data. +// +// Note that we don't attempt to parse everything out of gnomAD-SV yet, just +// the parts that are important for identifying SVs as potentially benign. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +/** + * Store the relevant allele counts and frequencies in a given sub cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv2.AlleleCounts + */ +export interface AlleleCounts { + /** + * Total number of alleles genotyped (for biallelic sites) or individuals + * with copy-state estimates (for multiallelic sites). + * + * @generated from protobuf field: int32 ac = 1; + */ + ac: number + /** + * Number of non-reference alleles observed (for biallelic sites) or + * individuals at each copy state (for multiallelic sites). + * + * @generated from protobuf field: int32 an = 2; + */ + an: number + /** + * Allele frequency (for biallelic sites) or copy-state frequency (for + * multiallelic sites). + * + * @generated from protobuf field: float af = 3; + */ + af: number + /** + * Total number of individuals with complete genotypes (biallelic sites + * only). + * + * @generated from protobuf field: int32 n_bi_genos = 4; + */ + nBiGenos: number + /** + * Number of individuals with homozygous reference genotypes (biallelic + * sites only). + * + * @generated from protobuf field: int32 n_homref = 5; + */ + nHomref: number + /** + * Number of individuals with heterozygous genotypes (biallelic sites + * only). + * + * @generated from protobuf field: int32 n_het = 6; + */ + nHet: number + /** + * Number of individuals with homozygous alternate genotypes (biallelic + * sites only). + * + * @generated from protobuf field: int32 n_homalt = 7; + */ + nHomalt: number + /** + * Homozygous reference genotype frequency (biallelic sites only). + * + * @generated from protobuf field: float freq_homref = 8; + */ + freqHomref: number + /** + * Heterozygous genotype frequency (biallelic sites only). + * + * @generated from protobuf field: float freq_het = 9; + */ + freqHet: number + /** + * Homozygous alternate genotype frequency (biallelic sites only). + * + * @generated from protobuf field: float freq_homalt = 10; + */ + freqHomalt: number +} +/** + * Store the allele counts for the given sub cohort and sub cohort factored by sex. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv2.AlleleCountsBySex + */ +export interface AlleleCountsBySex { + /** + * Overall allele counts in the sub cohort. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv2.AlleleCounts overall = 1; + */ + overall?: AlleleCounts + /** + * Allele counts in female/XX karyotype individuals of sub cohort. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv2.AlleleCounts xx = 2; + */ + xx?: AlleleCounts + /** + * Allele counts in male/XY karyotype individuals of sub cohort. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv2.AlleleCounts xy = 3; + */ + xy?: AlleleCounts +} +/** + * Store the allele counts for the given sub cohort in the given population. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv2.PopulationAlleleCounts + */ +export interface PopulationAlleleCounts { + /** + * Name of the population. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv2.Population population = 1; + */ + population: Population + /** + * The overall allele counts and the one by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv2.AlleleCountsBySex counts = 2; + */ + counts?: AlleleCountsBySex +} +/** + * Store the allele counts for the given cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv2.CohortAlleleCounts + */ +export interface CohortAlleleCounts { + /** + * Name of the cohort, empty for global. + * + * @generated from protobuf field: optional string cohort = 1; + */ + cohort?: string + /** + * The overall allele counts and the one by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv2.AlleleCountsBySex by_sex = 2; + */ + bySex?: AlleleCountsBySex + /** + * Allele counts for each population. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad_sv2.PopulationAlleleCounts by_population = 3; + */ + byPopulation: PopulationAlleleCounts[] +} +/** + * Protocol buffer for the gnomAD-SV v2 VCF record. + * + * The more specialized fields from the INFO column are stored in separate, optional fields such + * that we don't end up with a humongous message. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv2.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 pos = 2; + */ + pos: number + /** + * End position of the structural variant + * + * @generated from protobuf field: optional int32 end = 3; + */ + end?: number + /** + * Chromosome of second breakpoint position. + * + * @generated from protobuf field: optional string chrom2 = 4; + */ + chrom2?: string + /** + * End coordinate of second breakpoint position. + * + * @generated from protobuf field: optional int32 end2 = 5; + */ + end2?: number + /** + * Identifier of the record. + * + * @generated from protobuf field: string id = 6; + */ + id: string + /** + * Site-level filters. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad_sv2.Filter filters = 7; + */ + filters: Filter[] + /** + * SV Type. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv2.SvType sv_type = 8; + */ + svType: SvType + /** + * Refined complex type. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad_sv2.CpxType cpx_type = 9; + */ + cpxType?: CpxType + /** + * Variant allele counts in the different cohorts and population. + * + * The populations in gnomAD v2/3 are: empty for global, "controls", "non_neuro", + * and "non_topmed". + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad_sv2.CohortAlleleCounts allele_counts = 10; + */ + alleleCounts: CohortAlleleCounts[] +} +/** + * Protocol buffer enum for site-level filters. + * + * @generated from protobuf enum annonars.gnomad.gnomad_sv2.Filter + */ +export enum Filter { + /** + * unknown + * + * @generated from protobuf enum value: FILTER_UNKNOWN = 0; + */ + FILTER_UNKNOWN = 0, + /** + * All filters passed. + * + * @generated from protobuf enum value: FILTER_PASS = 1; + */ + FILTER_PASS = 1, + /** + * Site does not meet minimum requirements for fraction of PCR- samples + * with non-null genotypes. Flags sites more prone to false discoveries. + * + * @generated from protobuf enum value: FILTER_LOW_CALL_RATE = 2; + */ + FILTER_LOW_CALL_RATE = 2, + /** + * Multiallelic site. + * + * @generated from protobuf enum value: FILTER_MULTIALLELIC = 3; + */ + FILTER_MULTIALLELIC = 3, + /** + * Site enriched for non-reference genotypes among PCR+ samples. Likely + * reflects technical batch effects. All PCR- samples have been assigned + * null GTs for these sites. + * + * @generated from protobuf enum value: FILTER_PCRPLUS_ENRICHED = 4; + */ + FILTER_PCRPLUS_ENRICHED = 4, + /** + * Variant is unresolved. + * + * @generated from protobuf enum value: FILTER_UNRESOLVED = 5; + */ + FILTER_UNRESOLVED = 5, + /** + * Allele frequency for this variant in PCR- samples is sensitive to + * choice of GQ filtering thresholds. All PCR- samples have been assigned + * null GTs for these sites. + * + * @generated from protobuf enum value: FILTER_UNSTABLE_AF_PCRMINUS = 6; + */ + FILTER_UNSTABLE_AF_PCRMINUS = 6 +} +/** + * The types of SV in gnomad-SV v2. + * + * @generated from protobuf enum annonars.gnomad.gnomad_sv2.SvType + */ +export enum SvType { + /** + * unknown + * + * @generated from protobuf enum value: SV_TYPE_UNKNOWN = 0; + */ + SV_TYPE_UNKNOWN = 0, + /** + * Breakend. + * + * @generated from protobuf enum value: SV_TYPE_BND = 1; + */ + SV_TYPE_BND = 1, + /** + * Complex variant. + * + * @generated from protobuf enum value: SV_TYPE_CPX = 2; + */ + SV_TYPE_CPX = 2, + /** + * Translocation. + * + * @generated from protobuf enum value: SV_TYPE_CTX = 3; + */ + SV_TYPE_CTX = 3, + /** + * Deletion. + * + * @generated from protobuf enum value: SV_TYPE_DEL = 4; + */ + SV_TYPE_DEL = 4, + /** + * Duplication. + * + * @generated from protobuf enum value: SV_TYPE_DUP = 5; + */ + SV_TYPE_DUP = 5, + /** + * Insertion. + * + * @generated from protobuf enum value: SV_TYPE_INS = 6; + */ + SV_TYPE_INS = 6, + /** + * Inversion. + * + * @generated from protobuf enum value: SV_TYPE_INV = 7; + */ + SV_TYPE_INV = 7, + /** + * Copy number variable region. + * + * @generated from protobuf enum value: SV_TYPE_MCNV = 8; + */ + SV_TYPE_MCNV = 8 +} +/** + * Further definition of CPX type. + * + * @generated from protobuf enum annonars.gnomad.gnomad_sv2.CpxType + */ +export enum CpxType { + /** + * unknown + * + * @generated from protobuf enum value: CPX_TYPE_UNKNOWN = 0; + */ + CPX_TYPE_UNKNOWN = 0, + /** + * CCR: Complex chromosomal rearrangement, involving two or more + * chromosomes and multiple SV signatures. + * + * @generated from protobuf enum value: CPX_TYPE_CCR = 1; + */ + CPX_TYPE_CCR = 1, + /** + * INS_iDEL: Insertion with deletion at insertion site. + * + * @generated from protobuf enum value: CPX_TYPE_INS_IDEL = 2; + */ + CPX_TYPE_INS_IDEL = 2, + /** + * INVdel: Complex inversion with 3' flanking deletion. + * + * @generated from protobuf enum value: CPX_TYPE_INV_DEL = 3; + */ + CPX_TYPE_INV_DEL = 3, + /** + * INVdup: Complex inversion with 3' flanking duplication. + * + * @generated from protobuf enum value: CPX_TYPE_INV_DUP = 4; + */ + CPX_TYPE_INV_DUP = 4, + /** + * dDUP: Dispersed duplication. + * + * @generated from protobuf enum value: CPX_TYPE_DDUP = 5; + */ + CPX_TYPE_DDUP = 5, + /** + * dDUP_iDEL: Dispersed duplication with deletion at insertion site. + * + * @generated from protobuf enum value: CPX_TYPE_DDUP_IDEL = 6; + */ + CPX_TYPE_DDUP_IDEL = 6, + /** + * delINVdel: Complex inversion with 5' and 3' flanking deletions. + * + * @generated from protobuf enum value: CPX_TYPE_DEL_INV_DEL = 7; + */ + CPX_TYPE_DEL_INV_DEL = 7, + /** + * delINVdup: Complex inversion with 5' flanking deletion and 3' flanking + * duplication. + * + * @generated from protobuf enum value: CPX_TYPE_DEL_INV_DUP = 8; + */ + CPX_TYPE_DEL_INV_DUP = 8, + /** + * delINV: Complex inversion with 5' flanking deletion. + * + * @generated from protobuf enum value: CPX_TYPE_DEL_INV = 9; + */ + CPX_TYPE_DEL_INV = 9, + /** + * dupINVdel: Complex inversion with 5' flanking duplication and 3' + * flanking deletion. + * + * @generated from protobuf enum value: CPX_TYPE_DUP_INV_DEL = 10; + */ + CPX_TYPE_DUP_INV_DEL = 10, + /** + * dupINVdup: Complex inversion with 5' and 3' flanking duplications. + * + * @generated from protobuf enum value: CPX_TYPE_DUP_INV_DUP = 11; + */ + CPX_TYPE_DUP_INV_DUP = 11, + /** + * dupINV: Complex inversion with 5' flanking duplication. + * + * @generated from protobuf enum value: CPX_TYPE_DUP_INV = 12; + */ + CPX_TYPE_DUP_INV = 12, + /** + * piDUP_FR: Palindromic inverted tandem duplication, forward-reverse + * orientation. + * + * @generated from protobuf enum value: CPX_TYPE_PI_DUP_FR = 13; + */ + CPX_TYPE_PI_DUP_FR = 13, + /** + * piDUP_RF: Palindromic inverted tandem duplication, reverse-forward + * orientation. + * + * @generated from protobuf enum value: CPX_TYPE_PI_DUP_RF = 14; + */ + CPX_TYPE_PI_DUP_RF = 14, + /** + * CTX_INV: new in gnomAD SV 4.0 but not documented yet + * + * @generated from protobuf enum value: CPX_TYPE_CTX_INV = 15; + */ + CPX_TYPE_CTX_INV = 15, + /** + * CTX_PP/QQ: new in gnomAD SV 4.0 but not documented yet + * + * @generated from protobuf enum value: CPX_TYPE_CTX_PP_QQ = 16; + */ + CPX_TYPE_CTX_PP_QQ = 16, + /** + * CTX_PQ/QP: new in gnomAD SV 4.0 but not documented yet + * + * @generated from protobuf enum value: CPX_TYPE_CTX_PQ_QP = 17; + */ + CPX_TYPE_CTX_PQ_QP = 17 +} +/** + * gnomAD SV population. + * + * @generated from protobuf enum annonars.gnomad.gnomad_sv2.Population + */ +export enum Population { + /** + * unknown + * + * @generated from protobuf enum value: POPULATION_UNKNOWN = 0; + */ + POPULATION_UNKNOWN = 0, + /** + * African + * + * @generated from protobuf enum value: POPULATION_AFR = 1; + */ + POPULATION_AFR = 1, + /** + * Ad Mixed American + * + * @generated from protobuf enum value: POPULATION_AMR = 2; + */ + POPULATION_AMR = 2, + /** + * East Asian + * + * @generated from protobuf enum value: POPULATION_EAS = 3; + */ + POPULATION_EAS = 3, + /** + * European. + * + * @generated from protobuf enum value: POPULATION_EUR = 4; + */ + POPULATION_EUR = 4, + /** + * Other, + * + * @generated from protobuf enum value: POPULATION_OTHER = 5; + */ + POPULATION_OTHER = 5 +} +// @generated message type with reflection information, may provide speed optimized methods +class AlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv2.AlleleCounts', [ + { no: 1, name: 'ac', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: 'an', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'af', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: 'n_bi_genos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 5, name: 'n_homref', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 6, name: 'n_het', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 7, name: 'n_homalt', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: 'freq_homref', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 9, name: 'freq_het', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 10, name: 'freq_homalt', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): AlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.ac = 0 + message.an = 0 + message.af = 0 + message.nBiGenos = 0 + message.nHomref = 0 + message.nHet = 0 + message.nHomalt = 0 + message.freqHomref = 0 + message.freqHet = 0 + message.freqHomalt = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AlleleCounts + ): AlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* int32 ac */ 1: + message.ac = reader.int32() + break + case /* int32 an */ 2: + message.an = reader.int32() + break + case /* float af */ 3: + message.af = reader.float() + break + case /* int32 n_bi_genos */ 4: + message.nBiGenos = reader.int32() + break + case /* int32 n_homref */ 5: + message.nHomref = reader.int32() + break + case /* int32 n_het */ 6: + message.nHet = reader.int32() + break + case /* int32 n_homalt */ 7: + message.nHomalt = reader.int32() + break + case /* float freq_homref */ 8: + message.freqHomref = reader.float() + break + case /* float freq_het */ 9: + message.freqHet = reader.float() + break + case /* float freq_homalt */ 10: + message.freqHomalt = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* int32 ac = 1; */ + if (message.ac !== 0) writer.tag(1, WireType.Varint).int32(message.ac) + /* int32 an = 2; */ + if (message.an !== 0) writer.tag(2, WireType.Varint).int32(message.an) + /* float af = 3; */ + if (message.af !== 0) writer.tag(3, WireType.Bit32).float(message.af) + /* int32 n_bi_genos = 4; */ + if (message.nBiGenos !== 0) writer.tag(4, WireType.Varint).int32(message.nBiGenos) + /* int32 n_homref = 5; */ + if (message.nHomref !== 0) writer.tag(5, WireType.Varint).int32(message.nHomref) + /* int32 n_het = 6; */ + if (message.nHet !== 0) writer.tag(6, WireType.Varint).int32(message.nHet) + /* int32 n_homalt = 7; */ + if (message.nHomalt !== 0) writer.tag(7, WireType.Varint).int32(message.nHomalt) + /* float freq_homref = 8; */ + if (message.freqHomref !== 0) writer.tag(8, WireType.Bit32).float(message.freqHomref) + /* float freq_het = 9; */ + if (message.freqHet !== 0) writer.tag(9, WireType.Bit32).float(message.freqHet) + /* float freq_homalt = 10; */ + if (message.freqHomalt !== 0) writer.tag(10, WireType.Bit32).float(message.freqHomalt) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv2.AlleleCounts + */ +export const AlleleCounts = new AlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class AlleleCountsBySex$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv2.AlleleCountsBySex', [ + { no: 1, name: 'overall', kind: 'message', T: () => AlleleCounts }, + { no: 2, name: 'xx', kind: 'message', T: () => AlleleCounts }, + { no: 3, name: 'xy', kind: 'message', T: () => AlleleCounts } + ]) + } + create(value?: PartialMessage): AlleleCountsBySex { + const message = globalThis.Object.create(this.messagePrototype!) + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AlleleCountsBySex + ): AlleleCountsBySex { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* annonars.gnomad.gnomad_sv2.AlleleCounts overall */ 1: + message.overall = AlleleCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.overall + ) + break + case /* annonars.gnomad.gnomad_sv2.AlleleCounts xx */ 2: + message.xx = AlleleCounts.internalBinaryRead(reader, reader.uint32(), options, message.xx) + break + case /* annonars.gnomad.gnomad_sv2.AlleleCounts xy */ 3: + message.xy = AlleleCounts.internalBinaryRead(reader, reader.uint32(), options, message.xy) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AlleleCountsBySex, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* annonars.gnomad.gnomad_sv2.AlleleCounts overall = 1; */ + if (message.overall) + AlleleCounts.internalBinaryWrite( + message.overall, + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad_sv2.AlleleCounts xx = 2; */ + if (message.xx) + AlleleCounts.internalBinaryWrite( + message.xx, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad_sv2.AlleleCounts xy = 3; */ + if (message.xy) + AlleleCounts.internalBinaryWrite( + message.xy, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv2.AlleleCountsBySex + */ +export const AlleleCountsBySex = new AlleleCountsBySex$Type() +// @generated message type with reflection information, may provide speed optimized methods +class PopulationAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv2.PopulationAlleleCounts', [ + { + no: 1, + name: 'population', + kind: 'enum', + T: () => ['annonars.gnomad.gnomad_sv2.Population', Population] + }, + { no: 2, name: 'counts', kind: 'message', T: () => AlleleCountsBySex } + ]) + } + create(value?: PartialMessage): PopulationAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.population = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: PopulationAlleleCounts + ): PopulationAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* annonars.gnomad.gnomad_sv2.Population population */ 1: + message.population = reader.int32() + break + case /* annonars.gnomad.gnomad_sv2.AlleleCountsBySex counts */ 2: + message.counts = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.counts + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: PopulationAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* annonars.gnomad.gnomad_sv2.Population population = 1; */ + if (message.population !== 0) writer.tag(1, WireType.Varint).int32(message.population) + /* annonars.gnomad.gnomad_sv2.AlleleCountsBySex counts = 2; */ + if (message.counts) + AlleleCountsBySex.internalBinaryWrite( + message.counts, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv2.PopulationAlleleCounts + */ +export const PopulationAlleleCounts = new PopulationAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class CohortAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv2.CohortAlleleCounts', [ + { no: 1, name: 'cohort', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'by_sex', kind: 'message', T: () => AlleleCountsBySex }, + { + no: 3, + name: 'by_population', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => PopulationAlleleCounts + } + ]) + } + create(value?: PartialMessage): CohortAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.byPopulation = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CohortAlleleCounts + ): CohortAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional string cohort */ 1: + message.cohort = reader.string() + break + case /* annonars.gnomad.gnomad_sv2.AlleleCountsBySex by_sex */ 2: + message.bySex = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.bySex + ) + break + case /* repeated annonars.gnomad.gnomad_sv2.PopulationAlleleCounts by_population */ 3: + message.byPopulation.push( + PopulationAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: CohortAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional string cohort = 1; */ + if (message.cohort !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.cohort) + /* annonars.gnomad.gnomad_sv2.AlleleCountsBySex by_sex = 2; */ + if (message.bySex) + AlleleCountsBySex.internalBinaryWrite( + message.bySex, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* repeated annonars.gnomad.gnomad_sv2.PopulationAlleleCounts by_population = 3; */ + for (let i = 0; i < message.byPopulation.length; i++) + PopulationAlleleCounts.internalBinaryWrite( + message.byPopulation[i], + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv2.CohortAlleleCounts + */ +export const CohortAlleleCounts = new CohortAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv2.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'pos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'end', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'chrom2', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'end2', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 6, name: 'id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { + no: 7, + name: 'filters', + kind: 'enum', + repeat: 1 /*RepeatType.PACKED*/, + T: () => ['annonars.gnomad.gnomad_sv2.Filter', Filter] + }, + { + no: 8, + name: 'sv_type', + kind: 'enum', + T: () => ['annonars.gnomad.gnomad_sv2.SvType', SvType] + }, + { + no: 9, + name: 'cpx_type', + kind: 'enum', + opt: true, + T: () => ['annonars.gnomad.gnomad_sv2.CpxType', CpxType] + }, + { + no: 10, + name: 'allele_counts', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => CohortAlleleCounts + } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.pos = 0 + message.id = '' + message.filters = [] + message.svType = 0 + message.alleleCounts = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 pos */ 2: + message.pos = reader.int32() + break + case /* optional int32 end */ 3: + message.end = reader.int32() + break + case /* optional string chrom2 */ 4: + message.chrom2 = reader.string() + break + case /* optional int32 end2 */ 5: + message.end2 = reader.int32() + break + case /* string id */ 6: + message.id = reader.string() + break + case /* repeated annonars.gnomad.gnomad_sv2.Filter filters */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.filters.push(reader.int32()) + else message.filters.push(reader.int32()) + break + case /* annonars.gnomad.gnomad_sv2.SvType sv_type */ 8: + message.svType = reader.int32() + break + case /* optional annonars.gnomad.gnomad_sv2.CpxType cpx_type */ 9: + message.cpxType = reader.int32() + break + case /* repeated annonars.gnomad.gnomad_sv2.CohortAlleleCounts allele_counts */ 10: + message.alleleCounts.push( + CohortAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 pos = 2; */ + if (message.pos !== 0) writer.tag(2, WireType.Varint).int32(message.pos) + /* optional int32 end = 3; */ + if (message.end !== undefined) writer.tag(3, WireType.Varint).int32(message.end) + /* optional string chrom2 = 4; */ + if (message.chrom2 !== undefined) writer.tag(4, WireType.LengthDelimited).string(message.chrom2) + /* optional int32 end2 = 5; */ + if (message.end2 !== undefined) writer.tag(5, WireType.Varint).int32(message.end2) + /* string id = 6; */ + if (message.id !== '') writer.tag(6, WireType.LengthDelimited).string(message.id) + /* repeated annonars.gnomad.gnomad_sv2.Filter filters = 7; */ + if (message.filters.length) { + writer.tag(7, WireType.LengthDelimited).fork() + for (let i = 0; i < message.filters.length; i++) writer.int32(message.filters[i]) + writer.join() + } + /* annonars.gnomad.gnomad_sv2.SvType sv_type = 8; */ + if (message.svType !== 0) writer.tag(8, WireType.Varint).int32(message.svType) + /* optional annonars.gnomad.gnomad_sv2.CpxType cpx_type = 9; */ + if (message.cpxType !== undefined) writer.tag(9, WireType.Varint).int32(message.cpxType) + /* repeated annonars.gnomad.gnomad_sv2.CohortAlleleCounts allele_counts = 10; */ + for (let i = 0; i < message.alleleCounts.length; i++) + CohortAlleleCounts.internalBinaryWrite( + message.alleleCounts[i], + writer.tag(10, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv2.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/gnomad/gnomad_sv4.ts b/src/pbs/annonars/gnomad/gnomad_sv4.ts new file mode 100644 index 0000000..e212270 --- /dev/null +++ b/src/pbs/annonars/gnomad/gnomad_sv4.ts @@ -0,0 +1,1057 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/gnomad_sv4.proto" (package "annonars.gnomad.gnomad_sv4", syntax proto3) +// tslint:disable +// +// Protocol buffers for representing gnomAD-SV v4 data. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { CpxType } from './gnomad_sv2' + +/** + * Store the relevant allele counts and frequencies in a given sub cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv4.AlleleCounts + */ +export interface AlleleCounts { + /** + * Total number of alleles genotyped (for biallelic sites) or individuals + * with copy-state estimates (for multiallelic sites). + * + * @generated from protobuf field: int32 ac = 1; + */ + ac: number + /** + * Allele frequency (for biallelic sites) or copy-state frequency (for + * multiallelic sites). + * + * @generated from protobuf field: float af = 2; + */ + af: number + /** + * Number of non-reference alleles observed (for biallelic sites) or + * individuals at each copy state (for multiallelic sites). + * + * @generated from protobuf field: int32 an = 3; + */ + an: number + /** + * Hemizygous alternate genotype frequency (biallelic sites only). + * + * @generated from protobuf field: float freq_hemialt = 4; + */ + freqHemialt: number + /** + * Hemizygous reference genotype frequency (biallelic sites only). + * + * @generated from protobuf field: float freq_hemiref = 5; + */ + freqHemiref: number + /** + * Heterozygous genotype frequency (biallelic sites only). + * + * @generated from protobuf field: float freq_het = 6; + */ + freqHet: number + /** + * Homozygous alternate genotype frequency (biallelic sites only). + * + * @generated from protobuf field: float freq_homalt = 7; + */ + freqHomalt: number + /** + * Homozygous reference genotype frequency (biallelic sites only). + * + * @generated from protobuf field: float freq_homref = 8; + */ + freqHomref: number + /** + * Total number of individuals with complete genotypes (biallelic sites + * only). + * + * @generated from protobuf field: int32 n_bi_genos = 9; + */ + nBiGenos: number + /** + * Number of individuals with hemizygous alternate genotypes (biallelic + * sites only). + * + * @generated from protobuf field: int32 n_hemialt = 10; + */ + nHemialt: number + /** + * Number of individuals with hemizygous reference genotypes (biallelic + * sites only). + * + * @generated from protobuf field: int32 n_hemiref = 11; + */ + nHemiref: number + /** + * Number of individuals with heterozygous genotypes (biallelic sites + * only). + * + * @generated from protobuf field: int32 n_het = 12; + */ + nHet: number + /** + * Number of individuals with homozygous alternate genotypes (biallelic + * sites only). + * + * @generated from protobuf field: int32 n_homalt = 13; + */ + nHomalt: number + /** + * Number of individuals with homozygous reference genotypes (biallelic + * sites only). + * + * @generated from protobuf field: int32 n_homref = 14; + */ + nHomref: number +} +/** + * Store the allele counts for the given sub cohort and sub cohort factored by sex. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv4.AlleleCountsBySex + */ +export interface AlleleCountsBySex { + /** + * Overall allele counts in the sub cohort. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv4.AlleleCounts overall = 1; + */ + overall?: AlleleCounts + /** + * Allele counts in female/XX karyotype individuals of sub cohort. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv4.AlleleCounts xx = 2; + */ + xx?: AlleleCounts + /** + * Allele counts in male/XY karyotype individuals of sub cohort. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv4.AlleleCounts xy = 3; + */ + xy?: AlleleCounts +} +/** + * Store the allele counts for the given sub cohort in the given population. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv4.PopulationAlleleCounts + */ +export interface PopulationAlleleCounts { + /** + * Name of the population. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv4.Population population = 1; + */ + population: Population + /** + * The overall allele counts and the one by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv4.AlleleCountsBySex counts = 2; + */ + counts?: AlleleCountsBySex +} +/** + * Store the allele counts for the given cohort. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv4.CohortAlleleCounts + */ +export interface CohortAlleleCounts { + /** + * Name of the cohort, empty for global. + * + * @generated from protobuf field: optional string cohort = 1; + */ + cohort?: string + /** + * The overall allele counts and the one by sex. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv4.AlleleCountsBySex by_sex = 2; + */ + bySex?: AlleleCountsBySex + /** + * Allele counts for each population. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad_sv4.PopulationAlleleCounts by_population = 3; + */ + byPopulation: PopulationAlleleCounts[] +} +/** + * Protocol buffer for the gnomAD-SV v4 VCF record. + * + * @generated from protobuf message annonars.gnomad.gnomad_sv4.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 pos = 2; + */ + pos: number + /** + * End position of the structural variant + * + * @generated from protobuf field: optional int32 end = 3; + */ + end?: number + /** + * Chromosome of second breakpoint position. + * + * @generated from protobuf field: optional string chrom2 = 4; + */ + chrom2?: string + /** + * End coordinate of second breakpoint position. + * + * @generated from protobuf field: optional int32 end2 = 5; + */ + end2?: number + /** + * Identifier of the record. + * + * @generated from protobuf field: string id = 6; + */ + id: string + /** + * Site-level filters. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad_sv4.Filter filters = 7; + */ + filters: Filter[] + /** + * SV Type. + * + * @generated from protobuf field: annonars.gnomad.gnomad_sv4.SvType sv_type = 8; + */ + svType: SvType + /** + * Refined complex type. + * + * @generated from protobuf field: optional annonars.gnomad.gnomad_sv2.CpxType cpx_type = 9; + */ + cpxType?: CpxType + /** + * Variant allele counts in the different cohorts and population. + * + * @generated from protobuf field: repeated annonars.gnomad.gnomad_sv4.CohortAlleleCounts allele_counts = 10; + */ + alleleCounts: CohortAlleleCounts[] +} +/** + * Enumeration for filters. + * + * @generated from protobuf enum annonars.gnomad.gnomad_sv4.Filter + */ +export enum Filter { + /** + * unknown + * + * @generated from protobuf enum value: FILTER_UNKNOWN = 0; + */ + FILTER_UNKNOWN = 0, + /** + * All filters passed. + * + * @generated from protobuf enum value: FILTER_PASS = 1; + */ + FILTER_PASS = 1, + /** + * Low-quality variant that did not pass manual review of supporting + * evidence. + * + * @generated from protobuf enum value: FILTER_FAIL_MANUAL_REVIEW = 2; + */ + FILTER_FAIL_MANUAL_REVIEW = 2, + /** + * Unacceptably high rate of no-call GTs + * + * @generated from protobuf enum value: FILTER_HIGH_NCR = 3; + */ + FILTER_HIGH_NCR = 3, + /** + * SVs that are overlapped by over 50% by IGH or MHC regions, these + * variants are of low confidence. + * + * @generated from protobuf enum value: FILTER_IGH_MHC_OVERLAP = 4; + */ + FILTER_IGH_MHC_OVERLAP = 4, + /** + * Deletions under 1 kbp that are uniquely from wham and have SR-only + * support. + * + * @generated from protobuf enum value: FILTER_LOWQUAL_WHAM_SR_DEL = 5; + */ + FILTER_LOWQUAL_WHAM_SR_DEL = 5, + /** + * Multiallelic site + * + * @generated from protobuf enum value: FILTER_MULTIALLELIC = 6; + */ + FILTER_MULTIALLELIC = 6, + /** + * SVs that are enriched for non-reference genotypes in outlier samples, + * likely indicating noisy or unreliable genotypes. + * + * @generated from protobuf enum value: FILTER_OUTLIER_SAMPLE_ENRICHED = 7; + */ + FILTER_OUTLIER_SAMPLE_ENRICHED = 7, + /** + * Multiple large CNVs called at the same locus likely indicates unreliable + * clustering and/or low-quality multiallelic locus. + * + * @generated from protobuf enum value: FILTER_REDUNDANT_LG_CNV = 8; + */ + FILTER_REDUNDANT_LG_CNV = 8, + /** + * Likely reference artifact sites that are homozygous alternative in over + * 99% of the samples. + * + * @generated from protobuf enum value: FILTER_REFERENCE_ARTIFACT = 9; + */ + FILTER_REFERENCE_ARTIFACT = 9, + /** + * Variant is unresolved + * + * @generated from protobuf enum value: FILTER_UNRESOLVED = 10; + */ + FILTER_UNRESOLVED = 10, + /** + * Generic failure. + * + * @generated from protobuf enum value: FILTER_FAIL = 11; + */ + FILTER_FAIL = 11 +} +/** + * The types of SV in gnomad-SV v2. + * + * @generated from protobuf enum annonars.gnomad.gnomad_sv4.SvType + */ +export enum SvType { + /** + * unknown + * + * @generated from protobuf enum value: SV_TYPE_UNKNOWN = 0; + */ + SV_TYPE_UNKNOWN = 0, + /** + * Breakend. + * + * @generated from protobuf enum value: SV_TYPE_BND = 1; + */ + SV_TYPE_BND = 1, + /** + * Copy number variable region. + * + * @generated from protobuf enum value: SV_TYPE_CNV = 2; + */ + SV_TYPE_CNV = 2, + /** + * Complex variant. + * + * @generated from protobuf enum value: SV_TYPE_CPX = 3; + */ + SV_TYPE_CPX = 3, + /** + * Translocation. + * + * @generated from protobuf enum value: SV_TYPE_CTX = 4; + */ + SV_TYPE_CTX = 4, + /** + * Deletion. + * + * @generated from protobuf enum value: SV_TYPE_DEL = 5; + */ + SV_TYPE_DEL = 5, + /** + * Duplication. + * + * @generated from protobuf enum value: SV_TYPE_DUP = 6; + */ + SV_TYPE_DUP = 6, + /** + * Insertion. + * + * @generated from protobuf enum value: SV_TYPE_INS = 7; + */ + SV_TYPE_INS = 7, + /** + * Inversion. + * + * @generated from protobuf enum value: SV_TYPE_INV = 8; + */ + SV_TYPE_INV = 8 +} +/** + * gnomAD SV population. + * + * @generated from protobuf enum annonars.gnomad.gnomad_sv4.Population + */ +export enum Population { + /** + * unknown + * + * @generated from protobuf enum value: POPULATION_UNKNOWN = 0; + */ + POPULATION_UNKNOWN = 0, + /** + * African + * + * @generated from protobuf enum value: POPULATION_AFR = 1; + */ + POPULATION_AFR = 1, + /** + * Amish + * + * @generated from protobuf enum value: POPULATION_AMI = 2; + */ + POPULATION_AMI = 2, + /** + * Admixed American + * + * @generated from protobuf enum value: POPULATION_AMR = 3; + */ + POPULATION_AMR = 3, + /** + * Ashkenazi Jewish + * + * @generated from protobuf enum value: POPULATION_ASJ = 4; + */ + POPULATION_ASJ = 4, + /** + * East Asian + * + * @generated from protobuf enum value: POPULATION_EAS = 5; + */ + POPULATION_EAS = 5, + /** + * Finnish + * + * @generated from protobuf enum value: POPULATION_FIN = 6; + */ + POPULATION_FIN = 6, + /** + * Middle Eastern + * + * @generated from protobuf enum value: POPULATION_MID = 7; + */ + POPULATION_MID = 7, + /** + * Non-Finnish European + * + * @generated from protobuf enum value: POPULATION_NFE = 8; + */ + POPULATION_NFE = 8, + /** + * South Asian + * + * @generated from protobuf enum value: POPULATION_SAS = 9; + */ + POPULATION_SAS = 9, + /** + * Other + * + * @generated from protobuf enum value: POPULATION_OTHER = 10; + */ + POPULATION_OTHER = 10 +} +// @generated message type with reflection information, may provide speed optimized methods +class AlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv4.AlleleCounts', [ + { no: 1, name: 'ac', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: 'af', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 3, name: 'an', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'freq_hemialt', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 5, name: 'freq_hemiref', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 6, name: 'freq_het', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: 'freq_homalt', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 8, name: 'freq_homref', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 9, name: 'n_bi_genos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 10, name: 'n_hemialt', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 11, name: 'n_hemiref', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 12, name: 'n_het', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 13, name: 'n_homalt', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 14, name: 'n_homref', kind: 'scalar', T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): AlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.ac = 0 + message.af = 0 + message.an = 0 + message.freqHemialt = 0 + message.freqHemiref = 0 + message.freqHet = 0 + message.freqHomalt = 0 + message.freqHomref = 0 + message.nBiGenos = 0 + message.nHemialt = 0 + message.nHemiref = 0 + message.nHet = 0 + message.nHomalt = 0 + message.nHomref = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AlleleCounts + ): AlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* int32 ac */ 1: + message.ac = reader.int32() + break + case /* float af */ 2: + message.af = reader.float() + break + case /* int32 an */ 3: + message.an = reader.int32() + break + case /* float freq_hemialt */ 4: + message.freqHemialt = reader.float() + break + case /* float freq_hemiref */ 5: + message.freqHemiref = reader.float() + break + case /* float freq_het */ 6: + message.freqHet = reader.float() + break + case /* float freq_homalt */ 7: + message.freqHomalt = reader.float() + break + case /* float freq_homref */ 8: + message.freqHomref = reader.float() + break + case /* int32 n_bi_genos */ 9: + message.nBiGenos = reader.int32() + break + case /* int32 n_hemialt */ 10: + message.nHemialt = reader.int32() + break + case /* int32 n_hemiref */ 11: + message.nHemiref = reader.int32() + break + case /* int32 n_het */ 12: + message.nHet = reader.int32() + break + case /* int32 n_homalt */ 13: + message.nHomalt = reader.int32() + break + case /* int32 n_homref */ 14: + message.nHomref = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* int32 ac = 1; */ + if (message.ac !== 0) writer.tag(1, WireType.Varint).int32(message.ac) + /* float af = 2; */ + if (message.af !== 0) writer.tag(2, WireType.Bit32).float(message.af) + /* int32 an = 3; */ + if (message.an !== 0) writer.tag(3, WireType.Varint).int32(message.an) + /* float freq_hemialt = 4; */ + if (message.freqHemialt !== 0) writer.tag(4, WireType.Bit32).float(message.freqHemialt) + /* float freq_hemiref = 5; */ + if (message.freqHemiref !== 0) writer.tag(5, WireType.Bit32).float(message.freqHemiref) + /* float freq_het = 6; */ + if (message.freqHet !== 0) writer.tag(6, WireType.Bit32).float(message.freqHet) + /* float freq_homalt = 7; */ + if (message.freqHomalt !== 0) writer.tag(7, WireType.Bit32).float(message.freqHomalt) + /* float freq_homref = 8; */ + if (message.freqHomref !== 0) writer.tag(8, WireType.Bit32).float(message.freqHomref) + /* int32 n_bi_genos = 9; */ + if (message.nBiGenos !== 0) writer.tag(9, WireType.Varint).int32(message.nBiGenos) + /* int32 n_hemialt = 10; */ + if (message.nHemialt !== 0) writer.tag(10, WireType.Varint).int32(message.nHemialt) + /* int32 n_hemiref = 11; */ + if (message.nHemiref !== 0) writer.tag(11, WireType.Varint).int32(message.nHemiref) + /* int32 n_het = 12; */ + if (message.nHet !== 0) writer.tag(12, WireType.Varint).int32(message.nHet) + /* int32 n_homalt = 13; */ + if (message.nHomalt !== 0) writer.tag(13, WireType.Varint).int32(message.nHomalt) + /* int32 n_homref = 14; */ + if (message.nHomref !== 0) writer.tag(14, WireType.Varint).int32(message.nHomref) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv4.AlleleCounts + */ +export const AlleleCounts = new AlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class AlleleCountsBySex$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv4.AlleleCountsBySex', [ + { no: 1, name: 'overall', kind: 'message', T: () => AlleleCounts }, + { no: 2, name: 'xx', kind: 'message', T: () => AlleleCounts }, + { no: 3, name: 'xy', kind: 'message', T: () => AlleleCounts } + ]) + } + create(value?: PartialMessage): AlleleCountsBySex { + const message = globalThis.Object.create(this.messagePrototype!) + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AlleleCountsBySex + ): AlleleCountsBySex { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* annonars.gnomad.gnomad_sv4.AlleleCounts overall */ 1: + message.overall = AlleleCounts.internalBinaryRead( + reader, + reader.uint32(), + options, + message.overall + ) + break + case /* annonars.gnomad.gnomad_sv4.AlleleCounts xx */ 2: + message.xx = AlleleCounts.internalBinaryRead(reader, reader.uint32(), options, message.xx) + break + case /* annonars.gnomad.gnomad_sv4.AlleleCounts xy */ 3: + message.xy = AlleleCounts.internalBinaryRead(reader, reader.uint32(), options, message.xy) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AlleleCountsBySex, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* annonars.gnomad.gnomad_sv4.AlleleCounts overall = 1; */ + if (message.overall) + AlleleCounts.internalBinaryWrite( + message.overall, + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad_sv4.AlleleCounts xx = 2; */ + if (message.xx) + AlleleCounts.internalBinaryWrite( + message.xx, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* annonars.gnomad.gnomad_sv4.AlleleCounts xy = 3; */ + if (message.xy) + AlleleCounts.internalBinaryWrite( + message.xy, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv4.AlleleCountsBySex + */ +export const AlleleCountsBySex = new AlleleCountsBySex$Type() +// @generated message type with reflection information, may provide speed optimized methods +class PopulationAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv4.PopulationAlleleCounts', [ + { + no: 1, + name: 'population', + kind: 'enum', + T: () => ['annonars.gnomad.gnomad_sv4.Population', Population] + }, + { no: 2, name: 'counts', kind: 'message', T: () => AlleleCountsBySex } + ]) + } + create(value?: PartialMessage): PopulationAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.population = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: PopulationAlleleCounts + ): PopulationAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* annonars.gnomad.gnomad_sv4.Population population */ 1: + message.population = reader.int32() + break + case /* annonars.gnomad.gnomad_sv4.AlleleCountsBySex counts */ 2: + message.counts = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.counts + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: PopulationAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* annonars.gnomad.gnomad_sv4.Population population = 1; */ + if (message.population !== 0) writer.tag(1, WireType.Varint).int32(message.population) + /* annonars.gnomad.gnomad_sv4.AlleleCountsBySex counts = 2; */ + if (message.counts) + AlleleCountsBySex.internalBinaryWrite( + message.counts, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv4.PopulationAlleleCounts + */ +export const PopulationAlleleCounts = new PopulationAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class CohortAlleleCounts$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv4.CohortAlleleCounts', [ + { no: 1, name: 'cohort', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'by_sex', kind: 'message', T: () => AlleleCountsBySex }, + { + no: 3, + name: 'by_population', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => PopulationAlleleCounts + } + ]) + } + create(value?: PartialMessage): CohortAlleleCounts { + const message = globalThis.Object.create(this.messagePrototype!) + message.byPopulation = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CohortAlleleCounts + ): CohortAlleleCounts { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional string cohort */ 1: + message.cohort = reader.string() + break + case /* annonars.gnomad.gnomad_sv4.AlleleCountsBySex by_sex */ 2: + message.bySex = AlleleCountsBySex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.bySex + ) + break + case /* repeated annonars.gnomad.gnomad_sv4.PopulationAlleleCounts by_population */ 3: + message.byPopulation.push( + PopulationAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: CohortAlleleCounts, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional string cohort = 1; */ + if (message.cohort !== undefined) writer.tag(1, WireType.LengthDelimited).string(message.cohort) + /* annonars.gnomad.gnomad_sv4.AlleleCountsBySex by_sex = 2; */ + if (message.bySex) + AlleleCountsBySex.internalBinaryWrite( + message.bySex, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join() + /* repeated annonars.gnomad.gnomad_sv4.PopulationAlleleCounts by_population = 3; */ + for (let i = 0; i < message.byPopulation.length; i++) + PopulationAlleleCounts.internalBinaryWrite( + message.byPopulation[i], + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv4.CohortAlleleCounts + */ +export const CohortAlleleCounts = new CohortAlleleCounts$Type() +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.gnomad.gnomad_sv4.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'pos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'end', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: 'chrom2', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'end2', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 6, name: 'id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { + no: 7, + name: 'filters', + kind: 'enum', + repeat: 1 /*RepeatType.PACKED*/, + T: () => ['annonars.gnomad.gnomad_sv4.Filter', Filter] + }, + { + no: 8, + name: 'sv_type', + kind: 'enum', + T: () => ['annonars.gnomad.gnomad_sv4.SvType', SvType] + }, + { + no: 9, + name: 'cpx_type', + kind: 'enum', + opt: true, + T: () => ['annonars.gnomad.gnomad_sv2.CpxType', CpxType] + }, + { + no: 10, + name: 'allele_counts', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => CohortAlleleCounts + } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.pos = 0 + message.id = '' + message.filters = [] + message.svType = 0 + message.alleleCounts = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 pos */ 2: + message.pos = reader.int32() + break + case /* optional int32 end */ 3: + message.end = reader.int32() + break + case /* optional string chrom2 */ 4: + message.chrom2 = reader.string() + break + case /* optional int32 end2 */ 5: + message.end2 = reader.int32() + break + case /* string id */ 6: + message.id = reader.string() + break + case /* repeated annonars.gnomad.gnomad_sv4.Filter filters */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.filters.push(reader.int32()) + else message.filters.push(reader.int32()) + break + case /* annonars.gnomad.gnomad_sv4.SvType sv_type */ 8: + message.svType = reader.int32() + break + case /* optional annonars.gnomad.gnomad_sv2.CpxType cpx_type */ 9: + message.cpxType = reader.int32() + break + case /* repeated annonars.gnomad.gnomad_sv4.CohortAlleleCounts allele_counts */ 10: + message.alleleCounts.push( + CohortAlleleCounts.internalBinaryRead(reader, reader.uint32(), options) + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 pos = 2; */ + if (message.pos !== 0) writer.tag(2, WireType.Varint).int32(message.pos) + /* optional int32 end = 3; */ + if (message.end !== undefined) writer.tag(3, WireType.Varint).int32(message.end) + /* optional string chrom2 = 4; */ + if (message.chrom2 !== undefined) writer.tag(4, WireType.LengthDelimited).string(message.chrom2) + /* optional int32 end2 = 5; */ + if (message.end2 !== undefined) writer.tag(5, WireType.Varint).int32(message.end2) + /* string id = 6; */ + if (message.id !== '') writer.tag(6, WireType.LengthDelimited).string(message.id) + /* repeated annonars.gnomad.gnomad_sv4.Filter filters = 7; */ + if (message.filters.length) { + writer.tag(7, WireType.LengthDelimited).fork() + for (let i = 0; i < message.filters.length; i++) writer.int32(message.filters[i]) + writer.join() + } + /* annonars.gnomad.gnomad_sv4.SvType sv_type = 8; */ + if (message.svType !== 0) writer.tag(8, WireType.Varint).int32(message.svType) + /* optional annonars.gnomad.gnomad_sv2.CpxType cpx_type = 9; */ + if (message.cpxType !== undefined) writer.tag(9, WireType.Varint).int32(message.cpxType) + /* repeated annonars.gnomad.gnomad_sv4.CohortAlleleCounts allele_counts = 10; */ + for (let i = 0; i < message.alleleCounts.length; i++) + CohortAlleleCounts.internalBinaryWrite( + message.alleleCounts[i], + writer.tag(10, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.gnomad_sv4.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/gnomad/mtdna.ts b/src/pbs/annonars/gnomad/mtdna.ts new file mode 100644 index 0000000..e241d2c --- /dev/null +++ b/src/pbs/annonars/gnomad/mtdna.ts @@ -0,0 +1,1856 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/mtdna.proto" (package "annonars.gnomad.mtdna", syntax proto3) +// tslint:disable +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { Vep } from './vep_gnomad3' + +/** + * Encapsulate VCF INFO fields related to quality. + * + * @generated from protobuf message annonars.gnomad.mtdna.QualityInfo + */ +export interface QualityInfo { + /** + * Mean depth across all individuals for the site. + * + * @generated from protobuf field: optional float dp_mean = 1; + */ + dpMean?: number + /** + * Mean MMQ (median mapping quality) across individuals with a variant for the site. + * + * @generated from protobuf field: optional float mq_mean = 2; + */ + mqMean?: number + /** + * Mean TLOD (Log 10 likelihood ratio score of variant existing versus not existing) across + * individuals with a variant for the site. + * + * @generated from protobuf field: optional float tlod_mean = 3; + */ + tlodMean?: number +} +/** + * Encapsulate VCF INFO fields related to heteroplasmy levels. + * + * @generated from protobuf message annonars.gnomad.mtdna.HeteroplasmyInfo + */ +export interface HeteroplasmyInfo { + /** + * Histogram of number of individuals with a heteroplasmy level below 0.1, bin edges are: [0.0, + * 0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, + * 1.0] + * + * @generated from protobuf field: repeated int32 heteroplasmy_below_min_het_threshold_hist = 1; + */ + heteroplasmyBelowMinHetThresholdHist: number[] + /** + * Histogram of heteroplasmy levels; bin edges are: [0.0, 0.1, 0.2, 0.30000000000000004, 0.4, + * 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0]. + * + * @generated from protobuf field: repeated int32 hl_hist = 2; + */ + hlHist: number[] + /** + * Present if variant is found at an overall frequency of .001 across all samples with a + * heteroplasmy level > 0 and < 0.50 (includes variants <0.01 heteroplasmy which are + * subsequently filtered) + * + * @generated from protobuf field: bool common_low_heteroplasmy = 3; + */ + commonLowHeteroplasmy: boolean + /** + * Maximum heteroplasmy level observed among all samples for that variant. + * + * @generated from protobuf field: float max_hl = 4; + */ + maxHl: number +} +/** + * Encapsulate VCF INFO fields related to filter failure histograms. + * + * @generated from protobuf message annonars.gnomad.mtdna.FilterHistograms + */ +export interface FilterHistograms { + /** + * Histogram of number of individuals failing the base_qual filter (alternate allele median base + * quality) across heteroplasmy levels, bin edges are: [0.0, 0.1, 0.2, 0.30000000000000004, 0.4, + * 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0] + * + * @generated from protobuf field: repeated int32 base_qual_hist = 1; + */ + baseQualHist: number[] + /** + * Histogram of number of individuals failing the position filter (median distance of alternate + * variants from end of reads) across heteroplasmy levels, bin edges are: [0.0, 0.1, 0.2, 0. + * 30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0] + * + * @generated from protobuf field: repeated int32 position_hist = 2; + */ + positionHist: number[] + /** + * Histogram of number of individuals failing the strand_bias filter (evidence for alternate + * allele comes from one read direction only) across heteroplasmy levels, bin edges are: [0.0, + * 0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, + * 1.0] + * + * @generated from protobuf field: repeated int32 strand_bias_hist = 3; + */ + strandBiasHist: number[] + /** + * Histogram of number of individuals failing the weak_evidence filter (mutation does not meet + * likelihood threshold) across heteroplasmy levels, bin edges are: [0.0, 0.1, 0.2, + * 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0] + * + * @generated from protobuf field: repeated int32 weak_evidence_hist = 4; + */ + weakEvidenceHist: number[] + /** + * Histogram of number of individuals failing the contamination filter across heteroplasmy + * levels, bin edges are: [0.0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, + * 0.7000000000000001, 0.8, 0.9, 1.0] + * + * @generated from protobuf field: repeated int32 contamination_hist = 5; + */ + contaminationHist: number[] +} +/** + * Encapsulate VCF INFO fields related to populations. + * + * @generated from protobuf message annonars.gnomad.mtdna.PopulationInfo + */ +export interface PopulationInfo { + /** + * List of overall allele number for each population, population order: ['afr', 'ami', 'amr', + * 'asj', 'eas', 'fin', 'nfe', 'oth', 'sas', 'mid'] + * + * @generated from protobuf field: repeated int32 pop_an = 1; + */ + popAn: number[] + /** + * List of AC_het for each population, population order: ['afr', 'ami', 'amr', 'asj', 'eas', + * 'fin', 'nfe', 'oth', 'sas', 'mid'] + * + * @generated from protobuf field: repeated int32 pop_ac_het = 2; + */ + popAcHet: number[] + /** + * List of AC_hom for each population, population order: ['afr', 'ami', 'amr', 'asj', 'eas', + * 'fin', 'nfe', 'oth', 'sas', 'mid'] + * + * @generated from protobuf field: repeated int32 pop_ac_hom = 3; + */ + popAcHom: number[] + /** + * List of AF_hom for each population, population order: ['afr', 'ami', 'amr', 'asj', 'eas', + * 'fin', 'nfe', 'oth', 'sas', 'mid'] + * + * @generated from protobuf field: repeated float pop_af_hom = 4; + */ + popAfHom: number[] + /** + * List of AF_het for each population, population order: ['afr', 'ami', 'amr', 'asj', 'eas', + * 'fin', 'nfe', 'oth', 'sas', 'mid'] + * + * @generated from protobuf field: repeated float pop_af_het = 5; + */ + popAfHet: number[] + /** + * Histogram of heteroplasmy levels for each population; bin edges are: [0.0, 0.1, 0.2, + * 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0], + * population order: ['afr', 'ami', 'amr', 'asj', 'eas', 'fin', 'nfe', 'oth', 'sas', 'mid'] + * + * Note that we encode this by concatenating all lists here because of limitations in + * protocolbuffers (no native nested repeated fields). + * + * @generated from protobuf field: repeated int32 pop_hl_hist = 6; + */ + popHlHist: number[] +} +/** + * Encapsulate VCF INFO fields related to haplogroups. + * + * @generated from protobuf message annonars.gnomad.mtdna.HaplogroupInfo + */ +export interface HaplogroupInfo { + /** + * Present if variant is present as a haplogroup defining variant in PhyloTree build 17. + * + * @generated from protobuf field: bool hap_defining_variant = 1; + */ + hapDefiningVariant: boolean + /** + * List of overall allele number for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', + * 'E', 'F', 'G', 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', + * 'R', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] + * + * @generated from protobuf field: repeated int32 hap_an = 2; + */ + hapAn: number[] + /** + * List of AC_het for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', + * 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', + * 'V', 'W', 'X', 'Y', 'Z'] + * + * @generated from protobuf field: repeated int32 hap_ac_het = 3; + */ + hapAcHet: number[] + /** + * List of AC_hom for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', + * 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', + * 'V', 'W', 'X', 'Y', 'Z'] + * + * @generated from protobuf field: repeated int32 hap_ac_hom = 4; + */ + hapAcHom: number[] + /** + * List of AF_het for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', + * 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', + * 'V', 'W', 'X', 'Y', 'Z'] + * + * @generated from protobuf field: repeated float hap_af_het = 5; + */ + hapAfHet: number[] + /** + * List of AF_hom for each haplogroup, haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', + * 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', + * 'V', 'W', 'X', 'Y', 'Z'] + * + * @generated from protobuf field: repeated float hap_af_hom = 6; + */ + hapAfHom: number[] + /** + * Histogram of heteroplasmy levels for each haplogroup; bin edges are: [0.0, 0.1, 0.2, + * 0.30000000000000004, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.0], + * haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', + * 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] + * + * Note that we encode this by concatenating all lists here because of limitations in + * protocolbuffers (no native nested repeated fields). + * + * @generated from protobuf field: repeated int32 hap_hl_hist = 7; + */ + hapHlHist: number[] + /** + * List of filtering allele frequency for each haplogroup restricted to homoplasmic variants, + * haplogroup order: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'HV', 'I', 'J', 'K', 'L0', 'L1', + * 'L2', 'L3', 'L4', 'L5', 'M', 'N', 'P', 'R', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] + * + * @generated from protobuf field: repeated float hap_faf_hom = 8; + */ + hapFafHom: number[] + /** + * Haplogroup with maximum AF_hom. + * + * @generated from protobuf field: optional string hapmax_af_hom = 9; + */ + hapmaxAfHom?: string + /** + * Haplogroup with maximum AF_het. + * + * @generated from protobuf field: optional string hapmax_af_het = 10; + */ + hapmaxAfHet?: string + /** + * Maximum filtering allele frequency across haplogroups restricted to homoplasmic variants. + * + * @generated from protobuf field: optional float faf_hapmax_hom = 11; + */ + fafHapmaxHom?: number +} +/** + * Encapsulate VCF INFO fields related to age. + * + * @generated from protobuf message annonars.gnomad.mtdna.AgeInfo + */ +export interface AgeInfo { + /** + * Histogram of ages of individuals with a homoplasmic variant; bin edges are: [30.0, 35.0, + * 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0]. + * + * @generated from protobuf field: repeated int32 age_hist_hom_bin_freq = 1; + */ + ageHistHomBinFreq: number[] + /** + * Count of age values falling below lowest histogram bin edge for individuals with a + * homoplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_hom_n_smaller = 2; + */ + ageHistHomNSmaller?: number + /** + * Count of age values falling above highest histogram bin edge for individuals with a + * homoplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_hom_n_larger = 3; + */ + ageHistHomNLarger?: number + /** + * Histogram of ages of individuals with a heteroplasmic variant; bin edges are: [30.0, 35.0, + * 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0] + * + * @generated from protobuf field: repeated int32 age_hist_het_bin_freq = 4; + */ + ageHistHetBinFreq: number[] + /** + * Count of age values falling below lowest histogram bin edge for individuals with a + * heteroplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_het_n_smaller = 5; + */ + ageHistHetNSmaller?: number + /** + * Count of age values falling above highest histogram bin edge for individuals with a + * heteroplasmic variant. + * + * @generated from protobuf field: optional int32 age_hist_het_n_larger = 6; + */ + ageHistHetNLarger?: number +} +/** + * Encapsulate VCF INFO fields related to depth. + * + * @generated from protobuf message annonars.gnomad.mtdna.DepthInfo + */ +export interface DepthInfo { + /** + * Count of dp values falling above highest histogram bin edge for all individuals. + * + * @generated from protobuf field: optional int32 dp_hist_all_n_larger = 1; + */ + dpHistAllNLarger?: number + /** + * Count of dp values falling above highest histogram bin edge for individuals with the + * alternative allele + * + * @generated from protobuf field: optional int32 dp_hist_alt_n_larger = 2; + */ + dpHistAltNLarger?: number + /** + * Histogram of dp values for all individuals; bin edges are: [0.0, 200.0, 400.0, 600.0, 800.0, + * 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + * + * @generated from protobuf field: repeated int32 dp_hist_all_bin_freq = 3; + */ + dpHistAllBinFreq: number[] + /** + * Histogram of dp values for individuals with the alternative allele; bin edges are: [0.0, + * 200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0, 1400.0, 1600.0, 1800.0, 2000.0] + * + * @generated from protobuf field: repeated int32 dp_hist_alt_bin_freq = 4; + */ + dpHistAltBinFreq: number[] +} +/** + * Protocol buffer for the gnomAD-mtDNA VCF record. + * + * The more specialized fields from the INFO column are stored in separate, optional fields such + * that we don't end up with a humongous message. + * + * @generated from protobuf message annonars.gnomad.mtdna.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 pos = 2; + */ + pos: number + /** + * Reference allele. + * + * @generated from protobuf field: string ref_allele = 3; + */ + refAllele: string + /** + * Alternate allele. + * + * @generated from protobuf field: string alt_allele = 4; + */ + altAllele: string + /** + * Variant in format of RefPosAlt + * + * @generated from protobuf field: string variant_collapsed = 5; + */ + variantCollapsed: string + /** + * Excluded allele count (number of individuals in which the variant was filtered out). + * + * @generated from protobuf field: int32 excluded_ac = 6; + */ + excludedAc: number + /** + * Overall allele number (number of samples with non-missing genotype). + * + * @generated from protobuf field: int32 an = 7; + */ + an: number + /** + * Allele count restricted to variants with a heteroplasmy level >= 0.95. + * + * @generated from protobuf field: int32 ac_hom = 8; + */ + acHom: number + /** + * Allele count restricted to variants with a heteroplasmy level >= 0.10 and < 0.95. + * + * @generated from protobuf field: int32 ac_het = 9; + */ + acHet: number + /** + * Allele frequency restricted to variants with a heteroplasmy level >= 0.95. + * + * @generated from protobuf field: float af_hom = 10; + */ + afHom: number + /** + * Allele frequency restricted to variants with a heteroplasmy level >= 0.10 and < 0.95. + * + * @generated from protobuf field: float af_het = 11; + */ + afHet: number + /** + * Site-level filters. + * + * @generated from protobuf field: repeated annonars.gnomad.mtdna.Filter filters = 12; + */ + filters: Filter[] + /** + * MitoTip raw score + * + * @generated from protobuf field: optional float mitotip_score = 13; + */ + mitotipScore?: number + /** + * MitoTip score interpretation + * + * @generated from protobuf field: optional string mitotip_trna_prediction = 14; + */ + mitotipTrnaPrediction?: string + /** + * tRNA pathogenicity classification from PON-mt-tRNA + * + * @generated from protobuf field: optional string pon_mt_trna_prediction = 15; + */ + ponMtTrnaPrediction?: string + /** + * tRNA ML_probability_of_pathogenicity from PON-mt-tRNA + * + * @generated from protobuf field: optional string pon_ml_probability_of_pathogenicity = 16; + */ + ponMlProbabilityOfPathogenicity?: string + /** + * VEP v3 annotation records. + * + * @generated from protobuf field: repeated annonars.gnomad.vep_gnomad3.Vep vep = 17; + */ + vep: Vep[] + /** + * Summary information for variant quality interpretation. + * + * @generated from protobuf field: optional annonars.gnomad.mtdna.QualityInfo quality_info = 18; + */ + qualityInfo?: QualityInfo + /** + * Information related to heteroplasmy levels. + * + * @generated from protobuf field: optional annonars.gnomad.mtdna.HeteroplasmyInfo heteroplasmy_info = 19; + */ + heteroplasmyInfo?: HeteroplasmyInfo + /** + * Histograms related to variant quality filters. + * + * @generated from protobuf field: optional annonars.gnomad.mtdna.FilterHistograms filter_histograms = 20; + */ + filterHistograms?: FilterHistograms + /** + * Population-related information. + * + * @generated from protobuf field: optional annonars.gnomad.mtdna.PopulationInfo population_info = 21; + */ + populationInfo?: PopulationInfo + /** + * Haplogroup-related information. + * + * @generated from protobuf field: optional annonars.gnomad.mtdna.HaplogroupInfo haplogroup_info = 22; + */ + haplogroupInfo?: HaplogroupInfo + /** + * Age-related information. + * + * @generated from protobuf field: optional annonars.gnomad.mtdna.AgeInfo age_info = 23; + */ + ageInfo?: AgeInfo + /** + * Depth of coverage-related information. + * + * @generated from protobuf field: optional annonars.gnomad.mtdna.DepthInfo depth_info = 24; + */ + depthInfo?: DepthInfo +} +/** + * Protocol buffer enum for site-level filters. + * + * @generated from protobuf enum annonars.gnomad.mtdna.Filter + */ +export enum Filter { + /** + * unknown + * + * @generated from protobuf enum value: FILTER_UNKNOWN = 0; + */ + FILTER_UNKNOWN = 0, + /** + * Variant overlaps site that is commonly reported in literature to be artifact prone. + * + * @generated from protobuf enum value: FILTER_ARTIFACT_PRONE_SITE = 1; + */ + FILTER_ARTIFACT_PRONE_SITE = 1, + /** + * Allele where all samples with the variant call had at least 2 different heteroplasmic indels + * called at the position. + * + * @generated from protobuf enum value: FILTER_INDEL_STACK = 2; + */ + FILTER_INDEL_STACK = 2, + /** + * No-pass-genotypes site (no individuals were PASS for the variant). + * + * @generated from protobuf enum value: FILTER_NO_PASS_GENOTYPE = 3; + */ + FILTER_NO_PASS_GENOTYPE = 3 +} +// @generated message type with reflection information, may provide speed optimized methods +class QualityInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.mtdna.QualityInfo', [ + { no: 1, name: 'dp_mean', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: 'mq_mean', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 3, name: 'tlod_mean', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): QualityInfo { + const message = globalThis.Object.create(this.messagePrototype!) + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: QualityInfo + ): QualityInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional float dp_mean */ 1: + message.dpMean = reader.float() + break + case /* optional float mq_mean */ 2: + message.mqMean = reader.float() + break + case /* optional float tlod_mean */ 3: + message.tlodMean = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: QualityInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional float dp_mean = 1; */ + if (message.dpMean !== undefined) writer.tag(1, WireType.Bit32).float(message.dpMean) + /* optional float mq_mean = 2; */ + if (message.mqMean !== undefined) writer.tag(2, WireType.Bit32).float(message.mqMean) + /* optional float tlod_mean = 3; */ + if (message.tlodMean !== undefined) writer.tag(3, WireType.Bit32).float(message.tlodMean) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.mtdna.QualityInfo + */ +export const QualityInfo = new QualityInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class HeteroplasmyInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.mtdna.HeteroplasmyInfo', [ + { + no: 1, + name: 'heteroplasmy_below_min_het_threshold_hist', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 2, + name: 'hl_hist', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { no: 3, name: 'common_low_heteroplasmy', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: 'max_hl', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): HeteroplasmyInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.heteroplasmyBelowMinHetThresholdHist = [] + message.hlHist = [] + message.commonLowHeteroplasmy = false + message.maxHl = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: HeteroplasmyInfo + ): HeteroplasmyInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* repeated int32 heteroplasmy_below_min_het_threshold_hist */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.heteroplasmyBelowMinHetThresholdHist.push(reader.int32()) + else message.heteroplasmyBelowMinHetThresholdHist.push(reader.int32()) + break + case /* repeated int32 hl_hist */ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.hlHist.push(reader.int32()) + else message.hlHist.push(reader.int32()) + break + case /* bool common_low_heteroplasmy */ 3: + message.commonLowHeteroplasmy = reader.bool() + break + case /* float max_hl */ 4: + message.maxHl = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: HeteroplasmyInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* repeated int32 heteroplasmy_below_min_het_threshold_hist = 1; */ + if (message.heteroplasmyBelowMinHetThresholdHist.length) { + writer.tag(1, WireType.LengthDelimited).fork() + for (let i = 0; i < message.heteroplasmyBelowMinHetThresholdHist.length; i++) + writer.int32(message.heteroplasmyBelowMinHetThresholdHist[i]) + writer.join() + } + /* repeated int32 hl_hist = 2; */ + if (message.hlHist.length) { + writer.tag(2, WireType.LengthDelimited).fork() + for (let i = 0; i < message.hlHist.length; i++) writer.int32(message.hlHist[i]) + writer.join() + } + /* bool common_low_heteroplasmy = 3; */ + if (message.commonLowHeteroplasmy !== false) + writer.tag(3, WireType.Varint).bool(message.commonLowHeteroplasmy) + /* float max_hl = 4; */ + if (message.maxHl !== 0) writer.tag(4, WireType.Bit32).float(message.maxHl) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.mtdna.HeteroplasmyInfo + */ +export const HeteroplasmyInfo = new HeteroplasmyInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class FilterHistograms$Type extends MessageType { + constructor() { + super('annonars.gnomad.mtdna.FilterHistograms', [ + { + no: 1, + name: 'base_qual_hist', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 2, + name: 'position_hist', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 3, + name: 'strand_bias_hist', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'weak_evidence_hist', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 5, + name: 'contamination_hist', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + } + ]) + } + create(value?: PartialMessage): FilterHistograms { + const message = globalThis.Object.create(this.messagePrototype!) + message.baseQualHist = [] + message.positionHist = [] + message.strandBiasHist = [] + message.weakEvidenceHist = [] + message.contaminationHist = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FilterHistograms + ): FilterHistograms { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* repeated int32 base_qual_hist */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.baseQualHist.push(reader.int32()) + else message.baseQualHist.push(reader.int32()) + break + case /* repeated int32 position_hist */ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.positionHist.push(reader.int32()) + else message.positionHist.push(reader.int32()) + break + case /* repeated int32 strand_bias_hist */ 3: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.strandBiasHist.push(reader.int32()) + else message.strandBiasHist.push(reader.int32()) + break + case /* repeated int32 weak_evidence_hist */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.weakEvidenceHist.push(reader.int32()) + else message.weakEvidenceHist.push(reader.int32()) + break + case /* repeated int32 contamination_hist */ 5: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.contaminationHist.push(reader.int32()) + else message.contaminationHist.push(reader.int32()) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: FilterHistograms, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* repeated int32 base_qual_hist = 1; */ + if (message.baseQualHist.length) { + writer.tag(1, WireType.LengthDelimited).fork() + for (let i = 0; i < message.baseQualHist.length; i++) writer.int32(message.baseQualHist[i]) + writer.join() + } + /* repeated int32 position_hist = 2; */ + if (message.positionHist.length) { + writer.tag(2, WireType.LengthDelimited).fork() + for (let i = 0; i < message.positionHist.length; i++) writer.int32(message.positionHist[i]) + writer.join() + } + /* repeated int32 strand_bias_hist = 3; */ + if (message.strandBiasHist.length) { + writer.tag(3, WireType.LengthDelimited).fork() + for (let i = 0; i < message.strandBiasHist.length; i++) + writer.int32(message.strandBiasHist[i]) + writer.join() + } + /* repeated int32 weak_evidence_hist = 4; */ + if (message.weakEvidenceHist.length) { + writer.tag(4, WireType.LengthDelimited).fork() + for (let i = 0; i < message.weakEvidenceHist.length; i++) + writer.int32(message.weakEvidenceHist[i]) + writer.join() + } + /* repeated int32 contamination_hist = 5; */ + if (message.contaminationHist.length) { + writer.tag(5, WireType.LengthDelimited).fork() + for (let i = 0; i < message.contaminationHist.length; i++) + writer.int32(message.contaminationHist[i]) + writer.join() + } + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.mtdna.FilterHistograms + */ +export const FilterHistograms = new FilterHistograms$Type() +// @generated message type with reflection information, may provide speed optimized methods +class PopulationInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.mtdna.PopulationInfo', [ + { + no: 1, + name: 'pop_an', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 2, + name: 'pop_ac_het', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 3, + name: 'pop_ac_hom', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'pop_af_hom', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 2 /*ScalarType.FLOAT*/ + }, + { + no: 5, + name: 'pop_af_het', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 2 /*ScalarType.FLOAT*/ + }, + { + no: 6, + name: 'pop_hl_hist', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + } + ]) + } + create(value?: PartialMessage): PopulationInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.popAn = [] + message.popAcHet = [] + message.popAcHom = [] + message.popAfHom = [] + message.popAfHet = [] + message.popHlHist = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: PopulationInfo + ): PopulationInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* repeated int32 pop_an */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.popAn.push(reader.int32()) + else message.popAn.push(reader.int32()) + break + case /* repeated int32 pop_ac_het */ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.popAcHet.push(reader.int32()) + else message.popAcHet.push(reader.int32()) + break + case /* repeated int32 pop_ac_hom */ 3: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.popAcHom.push(reader.int32()) + else message.popAcHom.push(reader.int32()) + break + case /* repeated float pop_af_hom */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.popAfHom.push(reader.float()) + else message.popAfHom.push(reader.float()) + break + case /* repeated float pop_af_het */ 5: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.popAfHet.push(reader.float()) + else message.popAfHet.push(reader.float()) + break + case /* repeated int32 pop_hl_hist */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.popHlHist.push(reader.int32()) + else message.popHlHist.push(reader.int32()) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: PopulationInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* repeated int32 pop_an = 1; */ + if (message.popAn.length) { + writer.tag(1, WireType.LengthDelimited).fork() + for (let i = 0; i < message.popAn.length; i++) writer.int32(message.popAn[i]) + writer.join() + } + /* repeated int32 pop_ac_het = 2; */ + if (message.popAcHet.length) { + writer.tag(2, WireType.LengthDelimited).fork() + for (let i = 0; i < message.popAcHet.length; i++) writer.int32(message.popAcHet[i]) + writer.join() + } + /* repeated int32 pop_ac_hom = 3; */ + if (message.popAcHom.length) { + writer.tag(3, WireType.LengthDelimited).fork() + for (let i = 0; i < message.popAcHom.length; i++) writer.int32(message.popAcHom[i]) + writer.join() + } + /* repeated float pop_af_hom = 4; */ + if (message.popAfHom.length) { + writer.tag(4, WireType.LengthDelimited).fork() + for (let i = 0; i < message.popAfHom.length; i++) writer.float(message.popAfHom[i]) + writer.join() + } + /* repeated float pop_af_het = 5; */ + if (message.popAfHet.length) { + writer.tag(5, WireType.LengthDelimited).fork() + for (let i = 0; i < message.popAfHet.length; i++) writer.float(message.popAfHet[i]) + writer.join() + } + /* repeated int32 pop_hl_hist = 6; */ + if (message.popHlHist.length) { + writer.tag(6, WireType.LengthDelimited).fork() + for (let i = 0; i < message.popHlHist.length; i++) writer.int32(message.popHlHist[i]) + writer.join() + } + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.mtdna.PopulationInfo + */ +export const PopulationInfo = new PopulationInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class HaplogroupInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.mtdna.HaplogroupInfo', [ + { no: 1, name: 'hap_defining_variant', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { + no: 2, + name: 'hap_an', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 3, + name: 'hap_ac_het', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'hap_ac_hom', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 5, + name: 'hap_af_het', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 2 /*ScalarType.FLOAT*/ + }, + { + no: 6, + name: 'hap_af_hom', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 2 /*ScalarType.FLOAT*/ + }, + { + no: 7, + name: 'hap_hl_hist', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 8, + name: 'hap_faf_hom', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 2 /*ScalarType.FLOAT*/ + }, + { no: 9, name: 'hapmax_af_hom', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: 'hapmax_af_het', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: 'faf_hapmax_hom', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): HaplogroupInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.hapDefiningVariant = false + message.hapAn = [] + message.hapAcHet = [] + message.hapAcHom = [] + message.hapAfHet = [] + message.hapAfHom = [] + message.hapHlHist = [] + message.hapFafHom = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: HaplogroupInfo + ): HaplogroupInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* bool hap_defining_variant */ 1: + message.hapDefiningVariant = reader.bool() + break + case /* repeated int32 hap_an */ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.hapAn.push(reader.int32()) + else message.hapAn.push(reader.int32()) + break + case /* repeated int32 hap_ac_het */ 3: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.hapAcHet.push(reader.int32()) + else message.hapAcHet.push(reader.int32()) + break + case /* repeated int32 hap_ac_hom */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.hapAcHom.push(reader.int32()) + else message.hapAcHom.push(reader.int32()) + break + case /* repeated float hap_af_het */ 5: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.hapAfHet.push(reader.float()) + else message.hapAfHet.push(reader.float()) + break + case /* repeated float hap_af_hom */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.hapAfHom.push(reader.float()) + else message.hapAfHom.push(reader.float()) + break + case /* repeated int32 hap_hl_hist */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.hapHlHist.push(reader.int32()) + else message.hapHlHist.push(reader.int32()) + break + case /* repeated float hap_faf_hom */ 8: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.hapFafHom.push(reader.float()) + else message.hapFafHom.push(reader.float()) + break + case /* optional string hapmax_af_hom */ 9: + message.hapmaxAfHom = reader.string() + break + case /* optional string hapmax_af_het */ 10: + message.hapmaxAfHet = reader.string() + break + case /* optional float faf_hapmax_hom */ 11: + message.fafHapmaxHom = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: HaplogroupInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* bool hap_defining_variant = 1; */ + if (message.hapDefiningVariant !== false) + writer.tag(1, WireType.Varint).bool(message.hapDefiningVariant) + /* repeated int32 hap_an = 2; */ + if (message.hapAn.length) { + writer.tag(2, WireType.LengthDelimited).fork() + for (let i = 0; i < message.hapAn.length; i++) writer.int32(message.hapAn[i]) + writer.join() + } + /* repeated int32 hap_ac_het = 3; */ + if (message.hapAcHet.length) { + writer.tag(3, WireType.LengthDelimited).fork() + for (let i = 0; i < message.hapAcHet.length; i++) writer.int32(message.hapAcHet[i]) + writer.join() + } + /* repeated int32 hap_ac_hom = 4; */ + if (message.hapAcHom.length) { + writer.tag(4, WireType.LengthDelimited).fork() + for (let i = 0; i < message.hapAcHom.length; i++) writer.int32(message.hapAcHom[i]) + writer.join() + } + /* repeated float hap_af_het = 5; */ + if (message.hapAfHet.length) { + writer.tag(5, WireType.LengthDelimited).fork() + for (let i = 0; i < message.hapAfHet.length; i++) writer.float(message.hapAfHet[i]) + writer.join() + } + /* repeated float hap_af_hom = 6; */ + if (message.hapAfHom.length) { + writer.tag(6, WireType.LengthDelimited).fork() + for (let i = 0; i < message.hapAfHom.length; i++) writer.float(message.hapAfHom[i]) + writer.join() + } + /* repeated int32 hap_hl_hist = 7; */ + if (message.hapHlHist.length) { + writer.tag(7, WireType.LengthDelimited).fork() + for (let i = 0; i < message.hapHlHist.length; i++) writer.int32(message.hapHlHist[i]) + writer.join() + } + /* repeated float hap_faf_hom = 8; */ + if (message.hapFafHom.length) { + writer.tag(8, WireType.LengthDelimited).fork() + for (let i = 0; i < message.hapFafHom.length; i++) writer.float(message.hapFafHom[i]) + writer.join() + } + /* optional string hapmax_af_hom = 9; */ + if (message.hapmaxAfHom !== undefined) + writer.tag(9, WireType.LengthDelimited).string(message.hapmaxAfHom) + /* optional string hapmax_af_het = 10; */ + if (message.hapmaxAfHet !== undefined) + writer.tag(10, WireType.LengthDelimited).string(message.hapmaxAfHet) + /* optional float faf_hapmax_hom = 11; */ + if (message.fafHapmaxHom !== undefined) + writer.tag(11, WireType.Bit32).float(message.fafHapmaxHom) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.mtdna.HaplogroupInfo + */ +export const HaplogroupInfo = new HaplogroupInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class AgeInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.mtdna.AgeInfo', [ + { + no: 1, + name: 'age_hist_hom_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 2, + name: 'age_hist_hom_n_smaller', + kind: 'scalar', + opt: true, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 3, + name: 'age_hist_hom_n_larger', + kind: 'scalar', + opt: true, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'age_hist_het_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 5, + name: 'age_hist_het_n_smaller', + kind: 'scalar', + opt: true, + T: 5 /*ScalarType.INT32*/ + }, + { no: 6, name: 'age_hist_het_n_larger', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ } + ]) + } + create(value?: PartialMessage): AgeInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.ageHistHomBinFreq = [] + message.ageHistHetBinFreq = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AgeInfo + ): AgeInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* repeated int32 age_hist_hom_bin_freq */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.ageHistHomBinFreq.push(reader.int32()) + else message.ageHistHomBinFreq.push(reader.int32()) + break + case /* optional int32 age_hist_hom_n_smaller */ 2: + message.ageHistHomNSmaller = reader.int32() + break + case /* optional int32 age_hist_hom_n_larger */ 3: + message.ageHistHomNLarger = reader.int32() + break + case /* repeated int32 age_hist_het_bin_freq */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.ageHistHetBinFreq.push(reader.int32()) + else message.ageHistHetBinFreq.push(reader.int32()) + break + case /* optional int32 age_hist_het_n_smaller */ 5: + message.ageHistHetNSmaller = reader.int32() + break + case /* optional int32 age_hist_het_n_larger */ 6: + message.ageHistHetNLarger = reader.int32() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: AgeInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* repeated int32 age_hist_hom_bin_freq = 1; */ + if (message.ageHistHomBinFreq.length) { + writer.tag(1, WireType.LengthDelimited).fork() + for (let i = 0; i < message.ageHistHomBinFreq.length; i++) + writer.int32(message.ageHistHomBinFreq[i]) + writer.join() + } + /* optional int32 age_hist_hom_n_smaller = 2; */ + if (message.ageHistHomNSmaller !== undefined) + writer.tag(2, WireType.Varint).int32(message.ageHistHomNSmaller) + /* optional int32 age_hist_hom_n_larger = 3; */ + if (message.ageHistHomNLarger !== undefined) + writer.tag(3, WireType.Varint).int32(message.ageHistHomNLarger) + /* repeated int32 age_hist_het_bin_freq = 4; */ + if (message.ageHistHetBinFreq.length) { + writer.tag(4, WireType.LengthDelimited).fork() + for (let i = 0; i < message.ageHistHetBinFreq.length; i++) + writer.int32(message.ageHistHetBinFreq[i]) + writer.join() + } + /* optional int32 age_hist_het_n_smaller = 5; */ + if (message.ageHistHetNSmaller !== undefined) + writer.tag(5, WireType.Varint).int32(message.ageHistHetNSmaller) + /* optional int32 age_hist_het_n_larger = 6; */ + if (message.ageHistHetNLarger !== undefined) + writer.tag(6, WireType.Varint).int32(message.ageHistHetNLarger) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.mtdna.AgeInfo + */ +export const AgeInfo = new AgeInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class DepthInfo$Type extends MessageType { + constructor() { + super('annonars.gnomad.mtdna.DepthInfo', [ + { no: 1, name: 'dp_hist_all_n_larger', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: 'dp_hist_alt_n_larger', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { + no: 3, + name: 'dp_hist_all_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + }, + { + no: 4, + name: 'dp_hist_alt_bin_freq', + kind: 'scalar', + repeat: 1 /*RepeatType.PACKED*/, + T: 5 /*ScalarType.INT32*/ + } + ]) + } + create(value?: PartialMessage): DepthInfo { + const message = globalThis.Object.create(this.messagePrototype!) + message.dpHistAllBinFreq = [] + message.dpHistAltBinFreq = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DepthInfo + ): DepthInfo { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* optional int32 dp_hist_all_n_larger */ 1: + message.dpHistAllNLarger = reader.int32() + break + case /* optional int32 dp_hist_alt_n_larger */ 2: + message.dpHistAltNLarger = reader.int32() + break + case /* repeated int32 dp_hist_all_bin_freq */ 3: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.dpHistAllBinFreq.push(reader.int32()) + else message.dpHistAllBinFreq.push(reader.int32()) + break + case /* repeated int32 dp_hist_alt_bin_freq */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.dpHistAltBinFreq.push(reader.int32()) + else message.dpHistAltBinFreq.push(reader.int32()) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: DepthInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* optional int32 dp_hist_all_n_larger = 1; */ + if (message.dpHistAllNLarger !== undefined) + writer.tag(1, WireType.Varint).int32(message.dpHistAllNLarger) + /* optional int32 dp_hist_alt_n_larger = 2; */ + if (message.dpHistAltNLarger !== undefined) + writer.tag(2, WireType.Varint).int32(message.dpHistAltNLarger) + /* repeated int32 dp_hist_all_bin_freq = 3; */ + if (message.dpHistAllBinFreq.length) { + writer.tag(3, WireType.LengthDelimited).fork() + for (let i = 0; i < message.dpHistAllBinFreq.length; i++) + writer.int32(message.dpHistAllBinFreq[i]) + writer.join() + } + /* repeated int32 dp_hist_alt_bin_freq = 4; */ + if (message.dpHistAltBinFreq.length) { + writer.tag(4, WireType.LengthDelimited).fork() + for (let i = 0; i < message.dpHistAltBinFreq.length; i++) + writer.int32(message.dpHistAltBinFreq[i]) + writer.join() + } + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.mtdna.DepthInfo + */ +export const DepthInfo = new DepthInfo$Type() +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.gnomad.mtdna.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'pos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'ref_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'alt_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'variant_collapsed', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: 'excluded_ac', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 7, name: 'an', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: 'ac_hom', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 9, name: 'ac_het', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 10, name: 'af_hom', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { no: 11, name: 'af_het', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ }, + { + no: 12, + name: 'filters', + kind: 'enum', + repeat: 1 /*RepeatType.PACKED*/, + T: () => ['annonars.gnomad.mtdna.Filter', Filter] + }, + { no: 13, name: 'mitotip_score', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { + no: 14, + name: 'mitotip_trna_prediction', + kind: 'scalar', + opt: true, + T: 9 /*ScalarType.STRING*/ + }, + { + no: 15, + name: 'pon_mt_trna_prediction', + kind: 'scalar', + opt: true, + T: 9 /*ScalarType.STRING*/ + }, + { + no: 16, + name: 'pon_ml_probability_of_pathogenicity', + kind: 'scalar', + opt: true, + T: 9 /*ScalarType.STRING*/ + }, + { no: 17, name: 'vep', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Vep }, + { no: 18, name: 'quality_info', kind: 'message', T: () => QualityInfo }, + { no: 19, name: 'heteroplasmy_info', kind: 'message', T: () => HeteroplasmyInfo }, + { no: 20, name: 'filter_histograms', kind: 'message', T: () => FilterHistograms }, + { no: 21, name: 'population_info', kind: 'message', T: () => PopulationInfo }, + { no: 22, name: 'haplogroup_info', kind: 'message', T: () => HaplogroupInfo }, + { no: 23, name: 'age_info', kind: 'message', T: () => AgeInfo }, + { no: 24, name: 'depth_info', kind: 'message', T: () => DepthInfo } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.pos = 0 + message.refAllele = '' + message.altAllele = '' + message.variantCollapsed = '' + message.excludedAc = 0 + message.an = 0 + message.acHom = 0 + message.acHet = 0 + message.afHom = 0 + message.afHet = 0 + message.filters = [] + message.vep = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 pos */ 2: + message.pos = reader.int32() + break + case /* string ref_allele */ 3: + message.refAllele = reader.string() + break + case /* string alt_allele */ 4: + message.altAllele = reader.string() + break + case /* string variant_collapsed */ 5: + message.variantCollapsed = reader.string() + break + case /* int32 excluded_ac */ 6: + message.excludedAc = reader.int32() + break + case /* int32 an */ 7: + message.an = reader.int32() + break + case /* int32 ac_hom */ 8: + message.acHom = reader.int32() + break + case /* int32 ac_het */ 9: + message.acHet = reader.int32() + break + case /* float af_hom */ 10: + message.afHom = reader.float() + break + case /* float af_het */ 11: + message.afHet = reader.float() + break + case /* repeated annonars.gnomad.mtdna.Filter filters */ 12: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.filters.push(reader.int32()) + else message.filters.push(reader.int32()) + break + case /* optional float mitotip_score */ 13: + message.mitotipScore = reader.float() + break + case /* optional string mitotip_trna_prediction */ 14: + message.mitotipTrnaPrediction = reader.string() + break + case /* optional string pon_mt_trna_prediction */ 15: + message.ponMtTrnaPrediction = reader.string() + break + case /* optional string pon_ml_probability_of_pathogenicity */ 16: + message.ponMlProbabilityOfPathogenicity = reader.string() + break + case /* repeated annonars.gnomad.vep_gnomad3.Vep vep */ 17: + message.vep.push(Vep.internalBinaryRead(reader, reader.uint32(), options)) + break + case /* optional annonars.gnomad.mtdna.QualityInfo quality_info */ 18: + message.qualityInfo = QualityInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.qualityInfo + ) + break + case /* optional annonars.gnomad.mtdna.HeteroplasmyInfo heteroplasmy_info */ 19: + message.heteroplasmyInfo = HeteroplasmyInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.heteroplasmyInfo + ) + break + case /* optional annonars.gnomad.mtdna.FilterHistograms filter_histograms */ 20: + message.filterHistograms = FilterHistograms.internalBinaryRead( + reader, + reader.uint32(), + options, + message.filterHistograms + ) + break + case /* optional annonars.gnomad.mtdna.PopulationInfo population_info */ 21: + message.populationInfo = PopulationInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.populationInfo + ) + break + case /* optional annonars.gnomad.mtdna.HaplogroupInfo haplogroup_info */ 22: + message.haplogroupInfo = HaplogroupInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.haplogroupInfo + ) + break + case /* optional annonars.gnomad.mtdna.AgeInfo age_info */ 23: + message.ageInfo = AgeInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.ageInfo + ) + break + case /* optional annonars.gnomad.mtdna.DepthInfo depth_info */ 24: + message.depthInfo = DepthInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.depthInfo + ) + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 pos = 2; */ + if (message.pos !== 0) writer.tag(2, WireType.Varint).int32(message.pos) + /* string ref_allele = 3; */ + if (message.refAllele !== '') writer.tag(3, WireType.LengthDelimited).string(message.refAllele) + /* string alt_allele = 4; */ + if (message.altAllele !== '') writer.tag(4, WireType.LengthDelimited).string(message.altAllele) + /* string variant_collapsed = 5; */ + if (message.variantCollapsed !== '') + writer.tag(5, WireType.LengthDelimited).string(message.variantCollapsed) + /* int32 excluded_ac = 6; */ + if (message.excludedAc !== 0) writer.tag(6, WireType.Varint).int32(message.excludedAc) + /* int32 an = 7; */ + if (message.an !== 0) writer.tag(7, WireType.Varint).int32(message.an) + /* int32 ac_hom = 8; */ + if (message.acHom !== 0) writer.tag(8, WireType.Varint).int32(message.acHom) + /* int32 ac_het = 9; */ + if (message.acHet !== 0) writer.tag(9, WireType.Varint).int32(message.acHet) + /* float af_hom = 10; */ + if (message.afHom !== 0) writer.tag(10, WireType.Bit32).float(message.afHom) + /* float af_het = 11; */ + if (message.afHet !== 0) writer.tag(11, WireType.Bit32).float(message.afHet) + /* repeated annonars.gnomad.mtdna.Filter filters = 12; */ + if (message.filters.length) { + writer.tag(12, WireType.LengthDelimited).fork() + for (let i = 0; i < message.filters.length; i++) writer.int32(message.filters[i]) + writer.join() + } + /* optional float mitotip_score = 13; */ + if (message.mitotipScore !== undefined) + writer.tag(13, WireType.Bit32).float(message.mitotipScore) + /* optional string mitotip_trna_prediction = 14; */ + if (message.mitotipTrnaPrediction !== undefined) + writer.tag(14, WireType.LengthDelimited).string(message.mitotipTrnaPrediction) + /* optional string pon_mt_trna_prediction = 15; */ + if (message.ponMtTrnaPrediction !== undefined) + writer.tag(15, WireType.LengthDelimited).string(message.ponMtTrnaPrediction) + /* optional string pon_ml_probability_of_pathogenicity = 16; */ + if (message.ponMlProbabilityOfPathogenicity !== undefined) + writer.tag(16, WireType.LengthDelimited).string(message.ponMlProbabilityOfPathogenicity) + /* repeated annonars.gnomad.vep_gnomad3.Vep vep = 17; */ + for (let i = 0; i < message.vep.length; i++) + Vep.internalBinaryWrite( + message.vep[i], + writer.tag(17, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.mtdna.QualityInfo quality_info = 18; */ + if (message.qualityInfo) + QualityInfo.internalBinaryWrite( + message.qualityInfo, + writer.tag(18, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.mtdna.HeteroplasmyInfo heteroplasmy_info = 19; */ + if (message.heteroplasmyInfo) + HeteroplasmyInfo.internalBinaryWrite( + message.heteroplasmyInfo, + writer.tag(19, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.mtdna.FilterHistograms filter_histograms = 20; */ + if (message.filterHistograms) + FilterHistograms.internalBinaryWrite( + message.filterHistograms, + writer.tag(20, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.mtdna.PopulationInfo population_info = 21; */ + if (message.populationInfo) + PopulationInfo.internalBinaryWrite( + message.populationInfo, + writer.tag(21, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.mtdna.HaplogroupInfo haplogroup_info = 22; */ + if (message.haplogroupInfo) + HaplogroupInfo.internalBinaryWrite( + message.haplogroupInfo, + writer.tag(22, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.mtdna.AgeInfo age_info = 23; */ + if (message.ageInfo) + AgeInfo.internalBinaryWrite( + message.ageInfo, + writer.tag(23, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.mtdna.DepthInfo depth_info = 24; */ + if (message.depthInfo) + DepthInfo.internalBinaryWrite( + message.depthInfo, + writer.tag(24, WireType.LengthDelimited).fork(), + options + ).join() + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.mtdna.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/gnomad/vep_common.ts b/src/pbs/annonars/gnomad/vep_common.ts new file mode 100644 index 0000000..e169df4 --- /dev/null +++ b/src/pbs/annonars/gnomad/vep_common.ts @@ -0,0 +1,193 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/vep_common.proto" (package "annonars.gnomad.vep_common", syntax proto3) +// tslint:disable +// +// Common protocol buffer definitions for VEP records. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +/** + * Protocol buffer for `Vep.domains` + * + * @generated from protobuf message annonars.gnomad.vep_common.Domain + */ +export interface Domain { + /** + * Domain ID. + * + * @generated from protobuf field: string id = 1; + */ + id: string + /** + * Domain source. + * + * @generated from protobuf field: string source = 2; + */ + source: string +} +/** + * Protocol buffer for `Vep.sift` and `Vep.polyphen`. + * + * @generated from protobuf message annonars.gnomad.vep_common.Prediction + */ +export interface Prediction { + /** + * Prediction. + * + * @generated from protobuf field: string prediction = 1; + */ + prediction: string + /** + * Score. + * + * @generated from protobuf field: float score = 2; + */ + score: number +} +// @generated message type with reflection information, may provide speed optimized methods +class Domain$Type extends MessageType { + constructor() { + super('annonars.gnomad.vep_common.Domain', [ + { no: 1, name: 'id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'source', kind: 'scalar', T: 9 /*ScalarType.STRING*/ } + ]) + } + create(value?: PartialMessage): Domain { + const message = globalThis.Object.create(this.messagePrototype!) + message.id = '' + message.source = '' + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Domain + ): Domain { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string() + break + case /* string source */ 2: + message.source = reader.string() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Domain, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string id = 1; */ + if (message.id !== '') writer.tag(1, WireType.LengthDelimited).string(message.id) + /* string source = 2; */ + if (message.source !== '') writer.tag(2, WireType.LengthDelimited).string(message.source) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.vep_common.Domain + */ +export const Domain = new Domain$Type() +// @generated message type with reflection information, may provide speed optimized methods +class Prediction$Type extends MessageType { + constructor() { + super('annonars.gnomad.vep_common.Prediction', [ + { no: 1, name: 'prediction', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'score', kind: 'scalar', T: 2 /*ScalarType.FLOAT*/ } + ]) + } + create(value?: PartialMessage): Prediction { + const message = globalThis.Object.create(this.messagePrototype!) + message.prediction = '' + message.score = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Prediction + ): Prediction { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string prediction */ 1: + message.prediction = reader.string() + break + case /* float score */ 2: + message.score = reader.float() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Prediction, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string prediction = 1; */ + if (message.prediction !== '') + writer.tag(1, WireType.LengthDelimited).string(message.prediction) + /* float score = 2; */ + if (message.score !== 0) writer.tag(2, WireType.Bit32).float(message.score) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.vep_common.Prediction + */ +export const Prediction = new Prediction$Type() diff --git a/src/pbs/annonars/gnomad/vep_gnomad2.ts b/src/pbs/annonars/gnomad/vep_gnomad2.ts new file mode 100644 index 0000000..24a5499 --- /dev/null +++ b/src/pbs/annonars/gnomad/vep_gnomad2.ts @@ -0,0 +1,971 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/vep_gnomad2.proto" (package "annonars.gnomad.vep_gnomad2", syntax proto3) +// tslint:disable +// +// Protocol buffer definitions for gnomAD v2 VEP records. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { Domain } from './vep_common' +import { Prediction } from './vep_common' + +/** + * Protocol buffer for the gnomAD-mtDNA VEP predictions. + * + * @generated from protobuf message annonars.gnomad.vep_gnomad2.Vep + */ +export interface Vep { + /** + * Allele of record. + * + * @generated from protobuf field: string allele = 1; + */ + allele: string + /** + * Consequence, e.g., `"missense_variant"`. + * + * @generated from protobuf field: string consequence = 2; + */ + consequence: string + /** + * Impact, e.g., `"MODERATE"`. + * + * @generated from protobuf field: string impact = 3; + */ + impact: string + /** + * Gene symbol, e.g., `"PCSK9"`. + * + * @generated from protobuf field: string symbol = 4; + */ + symbol: string + /** + * Gene ID, `e.g., "ENSG00000169174"`. + * + * @generated from protobuf field: string gene = 5; + */ + gene: string + /** + * Feature type, e.g., `"Transcript"`. + * + * @generated from protobuf field: string feature_type = 6; + */ + featureType: string + /** + * Feature ID, e.g., `"ENST00000302118"`. + * + * @generated from protobuf field: string feature = 7; + */ + feature: string + /** + * Feature biotype, e.g., `"protein_coding"`. + * + * @generated from protobuf field: string feature_biotype = 8; + */ + featureBiotype: string + /** + * Ranked exon number, e.g., `"1/4"`. + * + * @generated from protobuf field: optional string exon = 9; + */ + exon?: string + /** + * Ranked intron number, e.g., `"1/4"`. + * + * @generated from protobuf field: optional string intron = 10; + */ + intron?: string + /** + * cDNA position, e.g., `"ENST00000302118.5:c.89C>G"`. + * + * @generated from protobuf field: optional string hgvsc = 11; + */ + hgvsc?: string + /** + * Protein position, e.g., `"ENSP00000302118.5:p.Thr30Arg"`. + * + * @generated from protobuf field: optional string hgvsp = 12; + */ + hgvsp?: string + /** + * cDNA position, e.g., `"89/1863"`. + * + * @generated from protobuf field: optional string cdna_position = 13; + */ + cdnaPosition?: string + /** + * CDS position, e.g., `"89/1863"`. + * + * @generated from protobuf field: optional string cds_position = 14; + */ + cdsPosition?: string + /** + * Protein position, e.g., `"30/620"`. + * + * @generated from protobuf field: optional string protein_position = 15; + */ + proteinPosition?: string + /** + * Amino acids, e.g., `"T/R"`. + * + * @generated from protobuf field: optional string amino_acids = 16; + */ + aminoAcids?: string + /** + * Codons, e.g., `"gCg/gGg"`. + * + * @generated from protobuf field: optional string codons = 17; + */ + codons?: string + /** + * Existing variation info. + * + * @generated from protobuf field: optional string existing_variation = 18; + */ + existingVariation?: string + /** + * dbSNP ID, e.g., `"rs28942080"`. + * + * @generated from protobuf field: optional string dbsnp_id = 19; + */ + dbsnpId?: string + /** + * Distance output of VEP. + * + * @generated from protobuf field: optional string distance = 20; + */ + distance?: string + /** + * Strand, e.g., `"1"`. + * + * @generated from protobuf field: optional string strand = 21; + */ + strand?: string + /** + * Flags, e.g., `"cds_end_NF"`. + * + * @generated from protobuf field: optional string flags = 22; + */ + flags?: string + /** + * Variant class, e.g., `"SNV"`. + * + * @generated from protobuf field: optional string variant_class = 23; + */ + variantClass?: string + /** + * Minimised output of VEP. + * + * @generated from protobuf field: optional string minimised = 24; + */ + minimised?: string + /** + * Symbol source, e.g., `"HGNC"`. + * + * @generated from protobuf field: optional string symbol_source = 25; + */ + symbolSource?: string + /** + * HGNC ID, e.g., `"HGNC:8706"`. + * + * @generated from protobuf field: optional string hgnc_id = 26; + */ + hgncId?: string + /** + * Whether this is the canonical transcript. + * + * @generated from protobuf field: bool canonical = 27; + */ + canonical: boolean + /** + * Transcript support level, e.g., `"1"`. + * + * @generated from protobuf field: optional int32 tsl = 28; + */ + tsl?: number + /** + * APPRIS annotation, e.g. `"P1"`. + * + * @generated from protobuf field: optional string appris = 29; + */ + appris?: string + /** + * CCDS ID, e.g., `"CCDS30547.1"`. + * + * @generated from protobuf field: optional string ccds = 30; + */ + ccds?: string + /** + * Ensembl protein ID, e.g., `"ENSP00000302118"`. + * + * @generated from protobuf field: optional string ensp = 31; + */ + ensp?: string + /** + * SwissProt ID, e.g., `"P04114"`. + * + * @generated from protobuf field: optional string swissprot = 32; + */ + swissprot?: string + /** + * TREMBL ID, e.g., `"Q5T4W7"`. + * + * @generated from protobuf field: optional string trembl = 33; + */ + trembl?: string + /** + * UniParc ID, e.g., `"UPI000002D4B2"`. + * + * @generated from protobuf field: optional string uniparc = 34; + */ + uniparc?: string + /** + * Gene phenotype from VEP. + * + * @generated from protobuf field: optional string gene_pheno = 35; + */ + genePheno?: string + /** + * SIFT prediction, e.g., `"tolerated(0.06)"`. + * + * @generated from protobuf field: optional annonars.gnomad.vep_common.Prediction sift = 36; + */ + sift?: Prediction + /** + * PolyPhen prediction, e.g., `"benign(0.001)"`. + * + * @generated from protobuf field: optional annonars.gnomad.vep_common.Prediction polyphen = 37; + */ + polyphen?: Prediction + /** + * Protein domains, e.g., `[["2p4e", "ENSP_mappings"], ["2qtw", "ENSP_mappings"]]`. + * + * @generated from protobuf field: repeated annonars.gnomad.vep_common.Domain domains = 38; + */ + domains: Domain[] + /** + * HGVS offset. + * + * @generated from protobuf field: optional string hgvs_offset = 39; + */ + hgvsOffset?: string + /** + * Overall minor allele frequency. + * + * @generated from protobuf field: optional float gmaf = 40; + */ + gmaf?: number + /** + * Minor allele frequency in AFR population. + * + * @generated from protobuf field: optional float afr_maf = 41; + */ + afrMaf?: number + /** + * Minor allele frequency in AMR population. + * + * @generated from protobuf field: optional float amr_maf = 42; + */ + amrMaf?: number + /** + * Minor allele frequency in EAS population. + * + * @generated from protobuf field: optional float eas_maf = 43; + */ + easMaf?: number + /** + * Minor allele frequency in EUR population. + * + * @generated from protobuf field: optional float eur_maf = 44; + */ + eurMaf?: number + /** + * Minor allele frequency in SAS population. + * + * @generated from protobuf field: optional float sas_maf = 45; + */ + sasMaf?: number + /** + * Minor allele frequency in AA population. + * + * @generated from protobuf field: optional float aa_maf = 46; + */ + aaMaf?: number + /** + * Minor allele frequency in EA population. + * + * @generated from protobuf field: optional float ea_maf = 47; + */ + eaMaf?: number + /** + * Minor allele frequency in ExAC. + * + * @generated from protobuf field: optional float exac_maf = 48; + */ + exacMaf?: number + /** + * Minor allele frequency EXAC ADJ population. + * + * @generated from protobuf field: optional float exac_adj_maf = 49; + */ + exacAdjMaf?: number + /** + * Minor allele frequency in ExAC AFR population. + * + * @generated from protobuf field: optional float exac_afr_maf = 50; + */ + exacAfrMaf?: number + /** + * Minor allele frequency in ExAC AMR population. + * + * @generated from protobuf field: optional float exac_amr_maf = 51; + */ + exacAmrMaf?: number + /** + * Minor allele frequency in ExAC EAS population. + * + * @generated from protobuf field: optional float exac_eas_maf = 52; + */ + exacEasMaf?: number + /** + * Minor allele frequency in ExAC FIN population. + * + * @generated from protobuf field: optional float exac_fin_maf = 53; + */ + exacFinMaf?: number + /** + * Minor allele frequency in ExAC NFE population. + * + * @generated from protobuf field: optional float exac_nfe_maf = 54; + */ + exacNfeMaf?: number + /** + * Minor allele frequency in ExAC OTH population. + * + * @generated from protobuf field: optional float exac_oth_maf = 55; + */ + exacOthMaf?: number + /** + * Minor allele frequency in ExAC SAS population. + * + * @generated from protobuf field: optional float exac_sas_maf = 56; + */ + exacSasMaf?: number + /** + * Clinical significance. + * + * @generated from protobuf field: optional string clin_sig = 57; + */ + clinSig?: string + /** + * Whether the variant is somatic. + * + * @generated from protobuf field: optional string somatic = 58; + */ + somatic?: string + /** + * Phenotype. + * + * @generated from protobuf field: optional string pheno = 59; + */ + pheno?: string + /** + * Pubmed ID. + * + * @generated from protobuf field: optional string pubmed = 60; + */ + pubmed?: string + /** + * Motif name. + * + * @generated from protobuf field: optional string motif_name = 61; + */ + motifName?: string + /** + * Motif pos. + * + * @generated from protobuf field: optional string motif_pos = 62; + */ + motifPos?: string + /** + * "high inf pos" from VEP. + * + * @generated from protobuf field: optional string high_inf_pos = 63; + */ + highInfPos?: string + /** + * Motif score change. + * + * @generated from protobuf field: optional string motif_score_change = 64; + */ + motifScoreChange?: string + /** + * Loss of function prediction. + * + * @generated from protobuf field: optional string lof = 65; + */ + lof?: string + /** + * Loss of function filter. + * + * @generated from protobuf field: optional string lof_filter = 66; + */ + lofFilter?: string + /** + * Loss of function flags. + * + * @generated from protobuf field: optional string lof_flags = 67; + */ + lofFlags?: string + /** + * Loss of function info. + * + * @generated from protobuf field: optional string lof_info = 68; + */ + lofInfo?: string +} +// @generated message type with reflection information, may provide speed optimized methods +class Vep$Type extends MessageType { + constructor() { + super('annonars.gnomad.vep_gnomad2.Vep', [ + { no: 1, name: 'allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'consequence', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: 'impact', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'symbol', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'gene', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: 'feature_type', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: 'feature', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: 'feature_biotype', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: 'exon', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: 'intron', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: 'hgvsc', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: 'hgvsp', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: 'cdna_position', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 14, name: 'cds_position', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 15, name: 'protein_position', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 16, name: 'amino_acids', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 17, name: 'codons', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 18, name: 'existing_variation', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 19, name: 'dbsnp_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 20, name: 'distance', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 21, name: 'strand', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 22, name: 'flags', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 23, name: 'variant_class', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 24, name: 'minimised', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 25, name: 'symbol_source', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 26, name: 'hgnc_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 27, name: 'canonical', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ }, + { no: 28, name: 'tsl', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 29, name: 'appris', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 30, name: 'ccds', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 31, name: 'ensp', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 32, name: 'swissprot', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 33, name: 'trembl', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 34, name: 'uniparc', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 35, name: 'gene_pheno', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 36, name: 'sift', kind: 'message', T: () => Prediction }, + { no: 37, name: 'polyphen', kind: 'message', T: () => Prediction }, + { + no: 38, + name: 'domains', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => Domain + }, + { no: 39, name: 'hgvs_offset', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 40, name: 'gmaf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 41, name: 'afr_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 42, name: 'amr_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 43, name: 'eas_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 44, name: 'eur_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 45, name: 'sas_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 46, name: 'aa_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 47, name: 'ea_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 48, name: 'exac_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 49, name: 'exac_adj_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 50, name: 'exac_afr_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 51, name: 'exac_amr_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 52, name: 'exac_eas_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 53, name: 'exac_fin_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 54, name: 'exac_nfe_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 55, name: 'exac_oth_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 56, name: 'exac_sas_maf', kind: 'scalar', opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 57, name: 'clin_sig', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 58, name: 'somatic', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 59, name: 'pheno', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 60, name: 'pubmed', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 61, name: 'motif_name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 62, name: 'motif_pos', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 63, name: 'high_inf_pos', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 64, name: 'motif_score_change', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 65, name: 'lof', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 66, name: 'lof_filter', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 67, name: 'lof_flags', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 68, name: 'lof_info', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ } + ]) + } + create(value?: PartialMessage): Vep { + const message = globalThis.Object.create(this.messagePrototype!) + message.allele = '' + message.consequence = '' + message.impact = '' + message.symbol = '' + message.gene = '' + message.featureType = '' + message.feature = '' + message.featureBiotype = '' + message.canonical = false + message.domains = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Vep + ): Vep { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string allele */ 1: + message.allele = reader.string() + break + case /* string consequence */ 2: + message.consequence = reader.string() + break + case /* string impact */ 3: + message.impact = reader.string() + break + case /* string symbol */ 4: + message.symbol = reader.string() + break + case /* string gene */ 5: + message.gene = reader.string() + break + case /* string feature_type */ 6: + message.featureType = reader.string() + break + case /* string feature */ 7: + message.feature = reader.string() + break + case /* string feature_biotype */ 8: + message.featureBiotype = reader.string() + break + case /* optional string exon */ 9: + message.exon = reader.string() + break + case /* optional string intron */ 10: + message.intron = reader.string() + break + case /* optional string hgvsc */ 11: + message.hgvsc = reader.string() + break + case /* optional string hgvsp */ 12: + message.hgvsp = reader.string() + break + case /* optional string cdna_position */ 13: + message.cdnaPosition = reader.string() + break + case /* optional string cds_position */ 14: + message.cdsPosition = reader.string() + break + case /* optional string protein_position */ 15: + message.proteinPosition = reader.string() + break + case /* optional string amino_acids */ 16: + message.aminoAcids = reader.string() + break + case /* optional string codons */ 17: + message.codons = reader.string() + break + case /* optional string existing_variation */ 18: + message.existingVariation = reader.string() + break + case /* optional string dbsnp_id */ 19: + message.dbsnpId = reader.string() + break + case /* optional string distance */ 20: + message.distance = reader.string() + break + case /* optional string strand */ 21: + message.strand = reader.string() + break + case /* optional string flags */ 22: + message.flags = reader.string() + break + case /* optional string variant_class */ 23: + message.variantClass = reader.string() + break + case /* optional string minimised */ 24: + message.minimised = reader.string() + break + case /* optional string symbol_source */ 25: + message.symbolSource = reader.string() + break + case /* optional string hgnc_id */ 26: + message.hgncId = reader.string() + break + case /* bool canonical */ 27: + message.canonical = reader.bool() + break + case /* optional int32 tsl */ 28: + message.tsl = reader.int32() + break + case /* optional string appris */ 29: + message.appris = reader.string() + break + case /* optional string ccds */ 30: + message.ccds = reader.string() + break + case /* optional string ensp */ 31: + message.ensp = reader.string() + break + case /* optional string swissprot */ 32: + message.swissprot = reader.string() + break + case /* optional string trembl */ 33: + message.trembl = reader.string() + break + case /* optional string uniparc */ 34: + message.uniparc = reader.string() + break + case /* optional string gene_pheno */ 35: + message.genePheno = reader.string() + break + case /* optional annonars.gnomad.vep_common.Prediction sift */ 36: + message.sift = Prediction.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sift + ) + break + case /* optional annonars.gnomad.vep_common.Prediction polyphen */ 37: + message.polyphen = Prediction.internalBinaryRead( + reader, + reader.uint32(), + options, + message.polyphen + ) + break + case /* repeated annonars.gnomad.vep_common.Domain domains */ 38: + message.domains.push(Domain.internalBinaryRead(reader, reader.uint32(), options)) + break + case /* optional string hgvs_offset */ 39: + message.hgvsOffset = reader.string() + break + case /* optional float gmaf */ 40: + message.gmaf = reader.float() + break + case /* optional float afr_maf */ 41: + message.afrMaf = reader.float() + break + case /* optional float amr_maf */ 42: + message.amrMaf = reader.float() + break + case /* optional float eas_maf */ 43: + message.easMaf = reader.float() + break + case /* optional float eur_maf */ 44: + message.eurMaf = reader.float() + break + case /* optional float sas_maf */ 45: + message.sasMaf = reader.float() + break + case /* optional float aa_maf */ 46: + message.aaMaf = reader.float() + break + case /* optional float ea_maf */ 47: + message.eaMaf = reader.float() + break + case /* optional float exac_maf */ 48: + message.exacMaf = reader.float() + break + case /* optional float exac_adj_maf */ 49: + message.exacAdjMaf = reader.float() + break + case /* optional float exac_afr_maf */ 50: + message.exacAfrMaf = reader.float() + break + case /* optional float exac_amr_maf */ 51: + message.exacAmrMaf = reader.float() + break + case /* optional float exac_eas_maf */ 52: + message.exacEasMaf = reader.float() + break + case /* optional float exac_fin_maf */ 53: + message.exacFinMaf = reader.float() + break + case /* optional float exac_nfe_maf */ 54: + message.exacNfeMaf = reader.float() + break + case /* optional float exac_oth_maf */ 55: + message.exacOthMaf = reader.float() + break + case /* optional float exac_sas_maf */ 56: + message.exacSasMaf = reader.float() + break + case /* optional string clin_sig */ 57: + message.clinSig = reader.string() + break + case /* optional string somatic */ 58: + message.somatic = reader.string() + break + case /* optional string pheno */ 59: + message.pheno = reader.string() + break + case /* optional string pubmed */ 60: + message.pubmed = reader.string() + break + case /* optional string motif_name */ 61: + message.motifName = reader.string() + break + case /* optional string motif_pos */ 62: + message.motifPos = reader.string() + break + case /* optional string high_inf_pos */ 63: + message.highInfPos = reader.string() + break + case /* optional string motif_score_change */ 64: + message.motifScoreChange = reader.string() + break + case /* optional string lof */ 65: + message.lof = reader.string() + break + case /* optional string lof_filter */ 66: + message.lofFilter = reader.string() + break + case /* optional string lof_flags */ 67: + message.lofFlags = reader.string() + break + case /* optional string lof_info */ 68: + message.lofInfo = reader.string() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Vep, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string allele = 1; */ + if (message.allele !== '') writer.tag(1, WireType.LengthDelimited).string(message.allele) + /* string consequence = 2; */ + if (message.consequence !== '') + writer.tag(2, WireType.LengthDelimited).string(message.consequence) + /* string impact = 3; */ + if (message.impact !== '') writer.tag(3, WireType.LengthDelimited).string(message.impact) + /* string symbol = 4; */ + if (message.symbol !== '') writer.tag(4, WireType.LengthDelimited).string(message.symbol) + /* string gene = 5; */ + if (message.gene !== '') writer.tag(5, WireType.LengthDelimited).string(message.gene) + /* string feature_type = 6; */ + if (message.featureType !== '') + writer.tag(6, WireType.LengthDelimited).string(message.featureType) + /* string feature = 7; */ + if (message.feature !== '') writer.tag(7, WireType.LengthDelimited).string(message.feature) + /* string feature_biotype = 8; */ + if (message.featureBiotype !== '') + writer.tag(8, WireType.LengthDelimited).string(message.featureBiotype) + /* optional string exon = 9; */ + if (message.exon !== undefined) writer.tag(9, WireType.LengthDelimited).string(message.exon) + /* optional string intron = 10; */ + if (message.intron !== undefined) + writer.tag(10, WireType.LengthDelimited).string(message.intron) + /* optional string hgvsc = 11; */ + if (message.hgvsc !== undefined) writer.tag(11, WireType.LengthDelimited).string(message.hgvsc) + /* optional string hgvsp = 12; */ + if (message.hgvsp !== undefined) writer.tag(12, WireType.LengthDelimited).string(message.hgvsp) + /* optional string cdna_position = 13; */ + if (message.cdnaPosition !== undefined) + writer.tag(13, WireType.LengthDelimited).string(message.cdnaPosition) + /* optional string cds_position = 14; */ + if (message.cdsPosition !== undefined) + writer.tag(14, WireType.LengthDelimited).string(message.cdsPosition) + /* optional string protein_position = 15; */ + if (message.proteinPosition !== undefined) + writer.tag(15, WireType.LengthDelimited).string(message.proteinPosition) + /* optional string amino_acids = 16; */ + if (message.aminoAcids !== undefined) + writer.tag(16, WireType.LengthDelimited).string(message.aminoAcids) + /* optional string codons = 17; */ + if (message.codons !== undefined) + writer.tag(17, WireType.LengthDelimited).string(message.codons) + /* optional string existing_variation = 18; */ + if (message.existingVariation !== undefined) + writer.tag(18, WireType.LengthDelimited).string(message.existingVariation) + /* optional string dbsnp_id = 19; */ + if (message.dbsnpId !== undefined) + writer.tag(19, WireType.LengthDelimited).string(message.dbsnpId) + /* optional string distance = 20; */ + if (message.distance !== undefined) + writer.tag(20, WireType.LengthDelimited).string(message.distance) + /* optional string strand = 21; */ + if (message.strand !== undefined) + writer.tag(21, WireType.LengthDelimited).string(message.strand) + /* optional string flags = 22; */ + if (message.flags !== undefined) writer.tag(22, WireType.LengthDelimited).string(message.flags) + /* optional string variant_class = 23; */ + if (message.variantClass !== undefined) + writer.tag(23, WireType.LengthDelimited).string(message.variantClass) + /* optional string minimised = 24; */ + if (message.minimised !== undefined) + writer.tag(24, WireType.LengthDelimited).string(message.minimised) + /* optional string symbol_source = 25; */ + if (message.symbolSource !== undefined) + writer.tag(25, WireType.LengthDelimited).string(message.symbolSource) + /* optional string hgnc_id = 26; */ + if (message.hgncId !== undefined) + writer.tag(26, WireType.LengthDelimited).string(message.hgncId) + /* bool canonical = 27; */ + if (message.canonical !== false) writer.tag(27, WireType.Varint).bool(message.canonical) + /* optional int32 tsl = 28; */ + if (message.tsl !== undefined) writer.tag(28, WireType.Varint).int32(message.tsl) + /* optional string appris = 29; */ + if (message.appris !== undefined) + writer.tag(29, WireType.LengthDelimited).string(message.appris) + /* optional string ccds = 30; */ + if (message.ccds !== undefined) writer.tag(30, WireType.LengthDelimited).string(message.ccds) + /* optional string ensp = 31; */ + if (message.ensp !== undefined) writer.tag(31, WireType.LengthDelimited).string(message.ensp) + /* optional string swissprot = 32; */ + if (message.swissprot !== undefined) + writer.tag(32, WireType.LengthDelimited).string(message.swissprot) + /* optional string trembl = 33; */ + if (message.trembl !== undefined) + writer.tag(33, WireType.LengthDelimited).string(message.trembl) + /* optional string uniparc = 34; */ + if (message.uniparc !== undefined) + writer.tag(34, WireType.LengthDelimited).string(message.uniparc) + /* optional string gene_pheno = 35; */ + if (message.genePheno !== undefined) + writer.tag(35, WireType.LengthDelimited).string(message.genePheno) + /* optional annonars.gnomad.vep_common.Prediction sift = 36; */ + if (message.sift) + Prediction.internalBinaryWrite( + message.sift, + writer.tag(36, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.vep_common.Prediction polyphen = 37; */ + if (message.polyphen) + Prediction.internalBinaryWrite( + message.polyphen, + writer.tag(37, WireType.LengthDelimited).fork(), + options + ).join() + /* repeated annonars.gnomad.vep_common.Domain domains = 38; */ + for (let i = 0; i < message.domains.length; i++) + Domain.internalBinaryWrite( + message.domains[i], + writer.tag(38, WireType.LengthDelimited).fork(), + options + ).join() + /* optional string hgvs_offset = 39; */ + if (message.hgvsOffset !== undefined) + writer.tag(39, WireType.LengthDelimited).string(message.hgvsOffset) + /* optional float gmaf = 40; */ + if (message.gmaf !== undefined) writer.tag(40, WireType.Bit32).float(message.gmaf) + /* optional float afr_maf = 41; */ + if (message.afrMaf !== undefined) writer.tag(41, WireType.Bit32).float(message.afrMaf) + /* optional float amr_maf = 42; */ + if (message.amrMaf !== undefined) writer.tag(42, WireType.Bit32).float(message.amrMaf) + /* optional float eas_maf = 43; */ + if (message.easMaf !== undefined) writer.tag(43, WireType.Bit32).float(message.easMaf) + /* optional float eur_maf = 44; */ + if (message.eurMaf !== undefined) writer.tag(44, WireType.Bit32).float(message.eurMaf) + /* optional float sas_maf = 45; */ + if (message.sasMaf !== undefined) writer.tag(45, WireType.Bit32).float(message.sasMaf) + /* optional float aa_maf = 46; */ + if (message.aaMaf !== undefined) writer.tag(46, WireType.Bit32).float(message.aaMaf) + /* optional float ea_maf = 47; */ + if (message.eaMaf !== undefined) writer.tag(47, WireType.Bit32).float(message.eaMaf) + /* optional float exac_maf = 48; */ + if (message.exacMaf !== undefined) writer.tag(48, WireType.Bit32).float(message.exacMaf) + /* optional float exac_adj_maf = 49; */ + if (message.exacAdjMaf !== undefined) writer.tag(49, WireType.Bit32).float(message.exacAdjMaf) + /* optional float exac_afr_maf = 50; */ + if (message.exacAfrMaf !== undefined) writer.tag(50, WireType.Bit32).float(message.exacAfrMaf) + /* optional float exac_amr_maf = 51; */ + if (message.exacAmrMaf !== undefined) writer.tag(51, WireType.Bit32).float(message.exacAmrMaf) + /* optional float exac_eas_maf = 52; */ + if (message.exacEasMaf !== undefined) writer.tag(52, WireType.Bit32).float(message.exacEasMaf) + /* optional float exac_fin_maf = 53; */ + if (message.exacFinMaf !== undefined) writer.tag(53, WireType.Bit32).float(message.exacFinMaf) + /* optional float exac_nfe_maf = 54; */ + if (message.exacNfeMaf !== undefined) writer.tag(54, WireType.Bit32).float(message.exacNfeMaf) + /* optional float exac_oth_maf = 55; */ + if (message.exacOthMaf !== undefined) writer.tag(55, WireType.Bit32).float(message.exacOthMaf) + /* optional float exac_sas_maf = 56; */ + if (message.exacSasMaf !== undefined) writer.tag(56, WireType.Bit32).float(message.exacSasMaf) + /* optional string clin_sig = 57; */ + if (message.clinSig !== undefined) + writer.tag(57, WireType.LengthDelimited).string(message.clinSig) + /* optional string somatic = 58; */ + if (message.somatic !== undefined) + writer.tag(58, WireType.LengthDelimited).string(message.somatic) + /* optional string pheno = 59; */ + if (message.pheno !== undefined) writer.tag(59, WireType.LengthDelimited).string(message.pheno) + /* optional string pubmed = 60; */ + if (message.pubmed !== undefined) + writer.tag(60, WireType.LengthDelimited).string(message.pubmed) + /* optional string motif_name = 61; */ + if (message.motifName !== undefined) + writer.tag(61, WireType.LengthDelimited).string(message.motifName) + /* optional string motif_pos = 62; */ + if (message.motifPos !== undefined) + writer.tag(62, WireType.LengthDelimited).string(message.motifPos) + /* optional string high_inf_pos = 63; */ + if (message.highInfPos !== undefined) + writer.tag(63, WireType.LengthDelimited).string(message.highInfPos) + /* optional string motif_score_change = 64; */ + if (message.motifScoreChange !== undefined) + writer.tag(64, WireType.LengthDelimited).string(message.motifScoreChange) + /* optional string lof = 65; */ + if (message.lof !== undefined) writer.tag(65, WireType.LengthDelimited).string(message.lof) + /* optional string lof_filter = 66; */ + if (message.lofFilter !== undefined) + writer.tag(66, WireType.LengthDelimited).string(message.lofFilter) + /* optional string lof_flags = 67; */ + if (message.lofFlags !== undefined) + writer.tag(67, WireType.LengthDelimited).string(message.lofFlags) + /* optional string lof_info = 68; */ + if (message.lofInfo !== undefined) + writer.tag(68, WireType.LengthDelimited).string(message.lofInfo) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.vep_gnomad2.Vep + */ +export const Vep = new Vep$Type() diff --git a/src/pbs/annonars/gnomad/vep_gnomad3.ts b/src/pbs/annonars/gnomad/vep_gnomad3.ts new file mode 100644 index 0000000..324543e --- /dev/null +++ b/src/pbs/annonars/gnomad/vep_gnomad3.ts @@ -0,0 +1,691 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/vep_gnomad3.proto" (package "annonars.gnomad.vep_gnomad3", syntax proto3) +// tslint:disable +// +// Protocol buffer definitions for gnomAD v3 VEP records. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { Domain } from './vep_common' +import { Prediction } from './vep_common' + +/** + * Protocol buffer for the gnomAD-nuclear VEP predictions. + * + * @generated from protobuf message annonars.gnomad.vep_gnomad3.Vep + */ +export interface Vep { + /** + * Allele of record. + * + * @generated from protobuf field: string allele = 1; + */ + allele: string + /** + * Consequence, e.g., `"missense_variant"`. + * + * @generated from protobuf field: string consequence = 2; + */ + consequence: string + /** + * Impact, e.g., `"MODERATE"`. + * + * @generated from protobuf field: string impact = 3; + */ + impact: string + /** + * Gene symbol, e.g., `"PCSK9"`. + * + * @generated from protobuf field: string symbol = 4; + */ + symbol: string + /** + * Gene ID, `e.g., "ENSG00000169174"`. + * + * @generated from protobuf field: string gene = 5; + */ + gene: string + /** + * Feature type, e.g., `"Transcript"`. + * + * @generated from protobuf field: string feature_type = 6; + */ + featureType: string + /** + * Feature ID, e.g., `"ENST00000302118"`. + * + * @generated from protobuf field: string feature = 7; + */ + feature: string + /** + * Feature biotype, e.g., `"protein_coding"`. + * + * @generated from protobuf field: string feature_biotype = 8; + */ + featureBiotype: string + /** + * Ranked exon number, e.g., `"1/4"`. + * + * @generated from protobuf field: optional string exon = 9; + */ + exon?: string + /** + * Ranked intron number, e.g., `"1/4"`. + * + * @generated from protobuf field: optional string intron = 10; + */ + intron?: string + /** + * cDNA position, e.g., `"ENST00000302118.5:c.89C>G"`. + * + * @generated from protobuf field: optional string hgvsc = 11; + */ + hgvsc?: string + /** + * Protein position, e.g., `"ENSP00000302118.5:p.Thr30Arg"`. + * + * @generated from protobuf field: optional string hgvsp = 12; + */ + hgvsp?: string + /** + * cDNA position, e.g., `"89/1863"`. + * + * @generated from protobuf field: optional string cdna_position = 13; + */ + cdnaPosition?: string + /** + * CDS position, e.g., `"89/1863"`. + * + * @generated from protobuf field: optional string cds_position = 14; + */ + cdsPosition?: string + /** + * Protein position, e.g., `"30/620"`. + * + * @generated from protobuf field: optional string protein_position = 15; + */ + proteinPosition?: string + /** + * Amino acids, e.g., `"T/R"`. + * + * @generated from protobuf field: optional string amino_acids = 16; + */ + aminoAcids?: string + /** + * Codons, e.g., `"gCg/gGg"`. + * + * @generated from protobuf field: optional string codons = 17; + */ + codons?: string + /** + * TODO: actually is optional int32 allele_num = 18; + * dbSNP ID, e.g., `"rs28942080"`. + * + * @generated from protobuf field: optional string dbsnp_id = 18; + */ + dbsnpId?: string + /** + * Distance output of VEP. + * + * @generated from protobuf field: optional string distance = 19; + */ + distance?: string + /** + * Strand, e.g., `"1"`. + * + * @generated from protobuf field: optional string strand = 20; + */ + strand?: string + /** + * Variant class, e.g., `"SNV"`. + * + * @generated from protobuf field: optional string variant_class = 21; + */ + variantClass?: string + /** + * Minimised output of VEP. + * + * @generated from protobuf field: optional string minimised = 22; + */ + minimised?: string + /** + * Symbol source, e.g., `"HGNC"`. + * + * @generated from protobuf field: optional string symbol_source = 23; + */ + symbolSource?: string + /** + * HGNC ID, e.g., `"HGNC:8706"`. + * + * @generated from protobuf field: optional string hgnc_id = 24; + */ + hgncId?: string + /** + * Whether this is the canonical transcript. + * + * @generated from protobuf field: optional bool canonical = 25; + */ + canonical?: boolean + /** + * Transcript support level, e.g., `"1"`. + * + * @generated from protobuf field: optional int32 tsl = 26; + */ + tsl?: number + /** + * APPRIS annotation, e.g. `"P1"`. + * + * @generated from protobuf field: optional string appris = 27; + */ + appris?: string + /** + * CCDS ID, e.g., `"CCDS30547.1"`. + * + * @generated from protobuf field: optional string ccds = 28; + */ + ccds?: string + /** + * Ensembl protein ID, e.g., `"ENSP00000302118"`. + * + * @generated from protobuf field: optional string ensp = 29; + */ + ensp?: string + /** + * SwissProt ID, e.g., `"P04114"`. + * + * @generated from protobuf field: optional string swissprot = 30; + */ + swissprot?: string + /** + * TREMBL ID, e.g., `"Q5T4W7"`. + * + * @generated from protobuf field: optional string trembl = 31; + */ + trembl?: string + /** + * UniParc ID, e.g., `"UPI000002D4B2"`. + * + * @generated from protobuf field: optional string uniparc = 32; + */ + uniparc?: string + /** + * Gene phenotype from VEP. + * + * @generated from protobuf field: optional string gene_pheno = 33; + */ + genePheno?: string + /** + * SIFT prediction, e.g., `"tolerated(0.06)"`. + * + * @generated from protobuf field: optional annonars.gnomad.vep_common.Prediction sift = 34; + */ + sift?: Prediction + /** + * PolyPhen prediction, e.g., `"benign(0.001)"`. + * + * @generated from protobuf field: optional annonars.gnomad.vep_common.Prediction polyphen = 35; + */ + polyphen?: Prediction + /** + * Protein domains, e.g., `[["2p4e", "ENSP_mappings"], ["2qtw", "ENSP_mappings"]]`. + * + * @generated from protobuf field: repeated annonars.gnomad.vep_common.Domain domains = 36; + */ + domains: Domain[] + /** + * HGVS offset. + * + * @generated from protobuf field: optional string hgvs_offset = 37; + */ + hgvsOffset?: string + /** + * Motif name. + * + * @generated from protobuf field: optional string motif_name = 38; + */ + motifName?: string + /** + * Motif name. + * + * @generated from protobuf field: optional string motif_pos = 39; + */ + motifPos?: string + /** + * "high inf pos" from VEP. + * + * @generated from protobuf field: optional string high_inf_pos = 40; + */ + highInfPos?: string + /** + * Motif score change. + * + * @generated from protobuf field: optional string motif_score_change = 41; + */ + motifScoreChange?: string + /** + * Loss of function prediction. + * + * @generated from protobuf field: optional string lof = 42; + */ + lof?: string + /** + * Loss of function filter. + * + * @generated from protobuf field: optional string lof_filter = 43; + */ + lofFilter?: string + /** + * Loss of function flags. + * + * @generated from protobuf field: optional string lof_flags = 44; + */ + lofFlags?: string + /** + * Loss of function info. + * + * @generated from protobuf field: optional string lof_info = 45; + */ + lofInfo?: string +} +// @generated message type with reflection information, may provide speed optimized methods +class Vep$Type extends MessageType { + constructor() { + super('annonars.gnomad.vep_gnomad3.Vep', [ + { no: 1, name: 'allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'consequence', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: 'impact', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'symbol', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'gene', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: 'feature_type', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: 'feature', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: 'feature_biotype', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: 'exon', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: 'intron', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: 'hgvsc', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: 'hgvsp', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: 'cdna_position', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 14, name: 'cds_position', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 15, name: 'protein_position', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 16, name: 'amino_acids', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 17, name: 'codons', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 18, name: 'dbsnp_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 19, name: 'distance', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 20, name: 'strand', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 21, name: 'variant_class', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 22, name: 'minimised', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 23, name: 'symbol_source', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 24, name: 'hgnc_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 25, name: 'canonical', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 26, name: 'tsl', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 27, name: 'appris', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 28, name: 'ccds', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 29, name: 'ensp', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 30, name: 'swissprot', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 31, name: 'trembl', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 32, name: 'uniparc', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 33, name: 'gene_pheno', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 34, name: 'sift', kind: 'message', T: () => Prediction }, + { no: 35, name: 'polyphen', kind: 'message', T: () => Prediction }, + { + no: 36, + name: 'domains', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => Domain + }, + { no: 37, name: 'hgvs_offset', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 38, name: 'motif_name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 39, name: 'motif_pos', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 40, name: 'high_inf_pos', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 41, name: 'motif_score_change', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 42, name: 'lof', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 43, name: 'lof_filter', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 44, name: 'lof_flags', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 45, name: 'lof_info', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ } + ]) + } + create(value?: PartialMessage): Vep { + const message = globalThis.Object.create(this.messagePrototype!) + message.allele = '' + message.consequence = '' + message.impact = '' + message.symbol = '' + message.gene = '' + message.featureType = '' + message.feature = '' + message.featureBiotype = '' + message.domains = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Vep + ): Vep { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string allele */ 1: + message.allele = reader.string() + break + case /* string consequence */ 2: + message.consequence = reader.string() + break + case /* string impact */ 3: + message.impact = reader.string() + break + case /* string symbol */ 4: + message.symbol = reader.string() + break + case /* string gene */ 5: + message.gene = reader.string() + break + case /* string feature_type */ 6: + message.featureType = reader.string() + break + case /* string feature */ 7: + message.feature = reader.string() + break + case /* string feature_biotype */ 8: + message.featureBiotype = reader.string() + break + case /* optional string exon */ 9: + message.exon = reader.string() + break + case /* optional string intron */ 10: + message.intron = reader.string() + break + case /* optional string hgvsc */ 11: + message.hgvsc = reader.string() + break + case /* optional string hgvsp */ 12: + message.hgvsp = reader.string() + break + case /* optional string cdna_position */ 13: + message.cdnaPosition = reader.string() + break + case /* optional string cds_position */ 14: + message.cdsPosition = reader.string() + break + case /* optional string protein_position */ 15: + message.proteinPosition = reader.string() + break + case /* optional string amino_acids */ 16: + message.aminoAcids = reader.string() + break + case /* optional string codons */ 17: + message.codons = reader.string() + break + case /* optional string dbsnp_id */ 18: + message.dbsnpId = reader.string() + break + case /* optional string distance */ 19: + message.distance = reader.string() + break + case /* optional string strand */ 20: + message.strand = reader.string() + break + case /* optional string variant_class */ 21: + message.variantClass = reader.string() + break + case /* optional string minimised */ 22: + message.minimised = reader.string() + break + case /* optional string symbol_source */ 23: + message.symbolSource = reader.string() + break + case /* optional string hgnc_id */ 24: + message.hgncId = reader.string() + break + case /* optional bool canonical */ 25: + message.canonical = reader.bool() + break + case /* optional int32 tsl */ 26: + message.tsl = reader.int32() + break + case /* optional string appris */ 27: + message.appris = reader.string() + break + case /* optional string ccds */ 28: + message.ccds = reader.string() + break + case /* optional string ensp */ 29: + message.ensp = reader.string() + break + case /* optional string swissprot */ 30: + message.swissprot = reader.string() + break + case /* optional string trembl */ 31: + message.trembl = reader.string() + break + case /* optional string uniparc */ 32: + message.uniparc = reader.string() + break + case /* optional string gene_pheno */ 33: + message.genePheno = reader.string() + break + case /* optional annonars.gnomad.vep_common.Prediction sift */ 34: + message.sift = Prediction.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sift + ) + break + case /* optional annonars.gnomad.vep_common.Prediction polyphen */ 35: + message.polyphen = Prediction.internalBinaryRead( + reader, + reader.uint32(), + options, + message.polyphen + ) + break + case /* repeated annonars.gnomad.vep_common.Domain domains */ 36: + message.domains.push(Domain.internalBinaryRead(reader, reader.uint32(), options)) + break + case /* optional string hgvs_offset */ 37: + message.hgvsOffset = reader.string() + break + case /* optional string motif_name */ 38: + message.motifName = reader.string() + break + case /* optional string motif_pos */ 39: + message.motifPos = reader.string() + break + case /* optional string high_inf_pos */ 40: + message.highInfPos = reader.string() + break + case /* optional string motif_score_change */ 41: + message.motifScoreChange = reader.string() + break + case /* optional string lof */ 42: + message.lof = reader.string() + break + case /* optional string lof_filter */ 43: + message.lofFilter = reader.string() + break + case /* optional string lof_flags */ 44: + message.lofFlags = reader.string() + break + case /* optional string lof_info */ 45: + message.lofInfo = reader.string() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Vep, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string allele = 1; */ + if (message.allele !== '') writer.tag(1, WireType.LengthDelimited).string(message.allele) + /* string consequence = 2; */ + if (message.consequence !== '') + writer.tag(2, WireType.LengthDelimited).string(message.consequence) + /* string impact = 3; */ + if (message.impact !== '') writer.tag(3, WireType.LengthDelimited).string(message.impact) + /* string symbol = 4; */ + if (message.symbol !== '') writer.tag(4, WireType.LengthDelimited).string(message.symbol) + /* string gene = 5; */ + if (message.gene !== '') writer.tag(5, WireType.LengthDelimited).string(message.gene) + /* string feature_type = 6; */ + if (message.featureType !== '') + writer.tag(6, WireType.LengthDelimited).string(message.featureType) + /* string feature = 7; */ + if (message.feature !== '') writer.tag(7, WireType.LengthDelimited).string(message.feature) + /* string feature_biotype = 8; */ + if (message.featureBiotype !== '') + writer.tag(8, WireType.LengthDelimited).string(message.featureBiotype) + /* optional string exon = 9; */ + if (message.exon !== undefined) writer.tag(9, WireType.LengthDelimited).string(message.exon) + /* optional string intron = 10; */ + if (message.intron !== undefined) + writer.tag(10, WireType.LengthDelimited).string(message.intron) + /* optional string hgvsc = 11; */ + if (message.hgvsc !== undefined) writer.tag(11, WireType.LengthDelimited).string(message.hgvsc) + /* optional string hgvsp = 12; */ + if (message.hgvsp !== undefined) writer.tag(12, WireType.LengthDelimited).string(message.hgvsp) + /* optional string cdna_position = 13; */ + if (message.cdnaPosition !== undefined) + writer.tag(13, WireType.LengthDelimited).string(message.cdnaPosition) + /* optional string cds_position = 14; */ + if (message.cdsPosition !== undefined) + writer.tag(14, WireType.LengthDelimited).string(message.cdsPosition) + /* optional string protein_position = 15; */ + if (message.proteinPosition !== undefined) + writer.tag(15, WireType.LengthDelimited).string(message.proteinPosition) + /* optional string amino_acids = 16; */ + if (message.aminoAcids !== undefined) + writer.tag(16, WireType.LengthDelimited).string(message.aminoAcids) + /* optional string codons = 17; */ + if (message.codons !== undefined) + writer.tag(17, WireType.LengthDelimited).string(message.codons) + /* optional string dbsnp_id = 18; */ + if (message.dbsnpId !== undefined) + writer.tag(18, WireType.LengthDelimited).string(message.dbsnpId) + /* optional string distance = 19; */ + if (message.distance !== undefined) + writer.tag(19, WireType.LengthDelimited).string(message.distance) + /* optional string strand = 20; */ + if (message.strand !== undefined) + writer.tag(20, WireType.LengthDelimited).string(message.strand) + /* optional string variant_class = 21; */ + if (message.variantClass !== undefined) + writer.tag(21, WireType.LengthDelimited).string(message.variantClass) + /* optional string minimised = 22; */ + if (message.minimised !== undefined) + writer.tag(22, WireType.LengthDelimited).string(message.minimised) + /* optional string symbol_source = 23; */ + if (message.symbolSource !== undefined) + writer.tag(23, WireType.LengthDelimited).string(message.symbolSource) + /* optional string hgnc_id = 24; */ + if (message.hgncId !== undefined) + writer.tag(24, WireType.LengthDelimited).string(message.hgncId) + /* optional bool canonical = 25; */ + if (message.canonical !== undefined) writer.tag(25, WireType.Varint).bool(message.canonical) + /* optional int32 tsl = 26; */ + if (message.tsl !== undefined) writer.tag(26, WireType.Varint).int32(message.tsl) + /* optional string appris = 27; */ + if (message.appris !== undefined) + writer.tag(27, WireType.LengthDelimited).string(message.appris) + /* optional string ccds = 28; */ + if (message.ccds !== undefined) writer.tag(28, WireType.LengthDelimited).string(message.ccds) + /* optional string ensp = 29; */ + if (message.ensp !== undefined) writer.tag(29, WireType.LengthDelimited).string(message.ensp) + /* optional string swissprot = 30; */ + if (message.swissprot !== undefined) + writer.tag(30, WireType.LengthDelimited).string(message.swissprot) + /* optional string trembl = 31; */ + if (message.trembl !== undefined) + writer.tag(31, WireType.LengthDelimited).string(message.trembl) + /* optional string uniparc = 32; */ + if (message.uniparc !== undefined) + writer.tag(32, WireType.LengthDelimited).string(message.uniparc) + /* optional string gene_pheno = 33; */ + if (message.genePheno !== undefined) + writer.tag(33, WireType.LengthDelimited).string(message.genePheno) + /* optional annonars.gnomad.vep_common.Prediction sift = 34; */ + if (message.sift) + Prediction.internalBinaryWrite( + message.sift, + writer.tag(34, WireType.LengthDelimited).fork(), + options + ).join() + /* optional annonars.gnomad.vep_common.Prediction polyphen = 35; */ + if (message.polyphen) + Prediction.internalBinaryWrite( + message.polyphen, + writer.tag(35, WireType.LengthDelimited).fork(), + options + ).join() + /* repeated annonars.gnomad.vep_common.Domain domains = 36; */ + for (let i = 0; i < message.domains.length; i++) + Domain.internalBinaryWrite( + message.domains[i], + writer.tag(36, WireType.LengthDelimited).fork(), + options + ).join() + /* optional string hgvs_offset = 37; */ + if (message.hgvsOffset !== undefined) + writer.tag(37, WireType.LengthDelimited).string(message.hgvsOffset) + /* optional string motif_name = 38; */ + if (message.motifName !== undefined) + writer.tag(38, WireType.LengthDelimited).string(message.motifName) + /* optional string motif_pos = 39; */ + if (message.motifPos !== undefined) + writer.tag(39, WireType.LengthDelimited).string(message.motifPos) + /* optional string high_inf_pos = 40; */ + if (message.highInfPos !== undefined) + writer.tag(40, WireType.LengthDelimited).string(message.highInfPos) + /* optional string motif_score_change = 41; */ + if (message.motifScoreChange !== undefined) + writer.tag(41, WireType.LengthDelimited).string(message.motifScoreChange) + /* optional string lof = 42; */ + if (message.lof !== undefined) writer.tag(42, WireType.LengthDelimited).string(message.lof) + /* optional string lof_filter = 43; */ + if (message.lofFilter !== undefined) + writer.tag(43, WireType.LengthDelimited).string(message.lofFilter) + /* optional string lof_flags = 44; */ + if (message.lofFlags !== undefined) + writer.tag(44, WireType.LengthDelimited).string(message.lofFlags) + /* optional string lof_info = 45; */ + if (message.lofInfo !== undefined) + writer.tag(45, WireType.LengthDelimited).string(message.lofInfo) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.vep_gnomad3.Vep + */ +export const Vep = new Vep$Type() diff --git a/src/pbs/annonars/gnomad/vep_gnomad4.ts b/src/pbs/annonars/gnomad/vep_gnomad4.ts new file mode 100644 index 0000000..400c1ee --- /dev/null +++ b/src/pbs/annonars/gnomad/vep_gnomad4.ts @@ -0,0 +1,686 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/gnomad/vep_gnomad4.proto" (package "annonars.gnomad.vep_gnomad4", syntax proto3) +// tslint:disable +// +// Protocol buffer definitions for gnomAD v4 VEP records. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { Domain } from './vep_common' + +/** + * Protocol buffer for the gnomAD-nuclear VEP predictions. + * + * @generated from protobuf message annonars.gnomad.vep_gnomad4.Vep + */ +export interface Vep { + /** + * Allele of record. + * + * @generated from protobuf field: string allele = 1; + */ + allele: string + /** + * Consequence, e.g., `"missense_variant"`. + * + * @generated from protobuf field: string consequence = 2; + */ + consequence: string + /** + * Impact, e.g., `"MODERATE"`. + * + * @generated from protobuf field: string impact = 3; + */ + impact: string + /** + * Gene symbol, e.g., `"PCSK9"`. + * + * @generated from protobuf field: string symbol = 4; + */ + symbol: string + /** + * Gene ID, `e.g., "ENSG00000169174"`. + * + * @generated from protobuf field: string gene = 5; + */ + gene: string + /** + * Feature type, e.g., `"Transcript"`. + * + * @generated from protobuf field: string feature_type = 6; + */ + featureType: string + /** + * Feature ID, e.g., `"ENST00000302118"`. + * + * @generated from protobuf field: string feature = 7; + */ + feature: string + /** + * Feature biotype, e.g., `"protein_coding"`. + * + * @generated from protobuf field: string feature_biotype = 8; + */ + featureBiotype: string + /** + * Ranked exon number, e.g., `"1/4"`. + * + * @generated from protobuf field: optional string exon = 9; + */ + exon?: string + /** + * Ranked intron number, e.g., `"1/4"`. + * + * @generated from protobuf field: optional string intron = 10; + */ + intron?: string + /** + * cDNA position, e.g., `"ENST00000302118.5:c.89C>G"`. + * + * @generated from protobuf field: optional string hgvsc = 11; + */ + hgvsc?: string + /** + * Protein position, e.g., `"ENSP00000302118.5:p.Thr30Arg"`. + * + * @generated from protobuf field: optional string hgvsp = 12; + */ + hgvsp?: string + /** + * cDNA position, e.g., `"89/1863"`. + * + * @generated from protobuf field: optional string cdna_position = 13; + */ + cdnaPosition?: string + /** + * CDS position, e.g., `"89/1863"`. + * + * @generated from protobuf field: optional string cds_position = 14; + */ + cdsPosition?: string + /** + * Protein position, e.g., `"30/620"`. + * + * @generated from protobuf field: optional string protein_position = 15; + */ + proteinPosition?: string + /** + * Amino acids, e.g., `"T/R"`. + * + * @generated from protobuf field: optional string amino_acids = 16; + */ + aminoAcids?: string + /** + * Codons, e.g., `"gCg/gGg"`. + * + * @generated from protobuf field: optional string codons = 17; + */ + codons?: string + /** + * Allele count. + * + * @generated from protobuf field: optional int32 allele_num = 18; + */ + alleleNum?: number + /** + * Distance output of VEP. + * + * @generated from protobuf field: optional string distance = 19; + */ + distance?: string + /** + * Strand, e.g., `"1"`. + * + * @generated from protobuf field: optional string strand = 20; + */ + strand?: string + /** + * Flags + * + * @generated from protobuf field: optional string flags = 21; + */ + flags?: string + /** + * Variant class, e.g., `"SNV"`. + * + * @generated from protobuf field: optional string variant_class = 22; + */ + variantClass?: string + /** + * Symbol source, e.g., `"HGNC"`. + * + * @generated from protobuf field: optional string symbol_source = 23; + */ + symbolSource?: string + /** + * HGNC ID, e.g., `"HGNC:8706"`. + * + * @generated from protobuf field: optional string hgnc_id = 24; + */ + hgncId?: string + /** + * Whether this is the canonical transcript. + * + * @generated from protobuf field: optional bool canonical = 25; + */ + canonical?: boolean + /** + * Presence in MANE Select + * + * @generated from protobuf field: optional bool mane_select = 26; + */ + maneSelect?: boolean + /** + * Presence in MANE Plus Clinical + * + * @generated from protobuf field: optional bool mane_plus_clinical = 27; + */ + manePlusClinical?: boolean + /** + * Transcript support level, e.g., `"1"`. + * + * @generated from protobuf field: optional int32 tsl = 28; + */ + tsl?: number + /** + * APPRIS annotation, e.g. `"P1"`. + * + * @generated from protobuf field: optional string appris = 29; + */ + appris?: string + /** + * CCDS ID, e.g., `"CCDS30547.1"`. + * + * @generated from protobuf field: optional string ccds = 30; + */ + ccds?: string + /** + * Ensembl protein ID, e.g., `"ENSP00000302118"`. + * + * @generated from protobuf field: optional string ensp = 31; + */ + ensp?: string + /** + * Uniprot isoform. + * + * @generated from protobuf field: optional string uniprot_isoform = 32; + */ + uniprotIsoform?: string + /** + * Value of VEP "SOURCE" field. + * + * @generated from protobuf field: optional string source = 33; + */ + source?: string + /** + * Protein domains, e.g., `[["2p4e", "ENSP_mappings"], ["2qtw", "ENSP_mappings"]]`. + * + * @generated from protobuf field: repeated annonars.gnomad.vep_common.Domain domains = 34; + */ + domains: Domain[] + /** + * miRNA information. + * + * @generated from protobuf field: optional string mirna = 35; + */ + mirna?: string + /** + * HGVS offset. + * + * @generated from protobuf field: optional string hgvs_offset = 36; + */ + hgvsOffset?: string + /** + * PubMed IDs + * + * @generated from protobuf field: optional string pubmed = 37; + */ + pubmed?: string + /** + * Motif name. + * + * @generated from protobuf field: optional string motif_name = 38; + */ + motifName?: string + /** + * Motif name. + * + * @generated from protobuf field: optional string motif_pos = 39; + */ + motifPos?: string + /** + * "high inf pos" from VEP. + * + * @generated from protobuf field: optional string high_inf_pos = 40; + */ + highInfPos?: string + /** + * Motif score change. + * + * @generated from protobuf field: optional string motif_score_change = 41; + */ + motifScoreChange?: string + /** + * Transcription factors. + * + * @generated from protobuf field: optional string transcription_factors = 42; + */ + transcriptionFactors?: string + /** + * Loss of function prediction. + * + * @generated from protobuf field: optional string lof = 43; + */ + lof?: string + /** + * Loss of function filter. + * + * @generated from protobuf field: optional string lof_filter = 44; + */ + lofFilter?: string + /** + * Loss of function flags. + * + * @generated from protobuf field: optional string lof_flags = 45; + */ + lofFlags?: string + /** + * Loss of function info. + * + * @generated from protobuf field: optional string lof_info = 46; + */ + lofInfo?: string +} +// @generated message type with reflection information, may provide speed optimized methods +class Vep$Type extends MessageType { + constructor() { + super('annonars.gnomad.vep_gnomad4.Vep', [ + { no: 1, name: 'allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'consequence', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: 'impact', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'symbol', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'gene', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: 'feature_type', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: 'feature', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: 'feature_biotype', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: 'exon', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: 'intron', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: 'hgvsc', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: 'hgvsp', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: 'cdna_position', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 14, name: 'cds_position', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 15, name: 'protein_position', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 16, name: 'amino_acids', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 17, name: 'codons', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 18, name: 'allele_num', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 19, name: 'distance', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 20, name: 'strand', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 21, name: 'flags', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 22, name: 'variant_class', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 23, name: 'symbol_source', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 24, name: 'hgnc_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 25, name: 'canonical', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 26, name: 'mane_select', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 27, name: 'mane_plus_clinical', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 28, name: 'tsl', kind: 'scalar', opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 29, name: 'appris', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 30, name: 'ccds', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 31, name: 'ensp', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 32, name: 'uniprot_isoform', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 33, name: 'source', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { + no: 34, + name: 'domains', + kind: 'message', + repeat: 1 /*RepeatType.PACKED*/, + T: () => Domain + }, + { no: 35, name: 'mirna', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 36, name: 'hgvs_offset', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 37, name: 'pubmed', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 38, name: 'motif_name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 39, name: 'motif_pos', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 40, name: 'high_inf_pos', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 41, name: 'motif_score_change', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { + no: 42, + name: 'transcription_factors', + kind: 'scalar', + opt: true, + T: 9 /*ScalarType.STRING*/ + }, + { no: 43, name: 'lof', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 44, name: 'lof_filter', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 45, name: 'lof_flags', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 46, name: 'lof_info', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ } + ]) + } + create(value?: PartialMessage): Vep { + const message = globalThis.Object.create(this.messagePrototype!) + message.allele = '' + message.consequence = '' + message.impact = '' + message.symbol = '' + message.gene = '' + message.featureType = '' + message.feature = '' + message.featureBiotype = '' + message.domains = [] + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Vep + ): Vep { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string allele */ 1: + message.allele = reader.string() + break + case /* string consequence */ 2: + message.consequence = reader.string() + break + case /* string impact */ 3: + message.impact = reader.string() + break + case /* string symbol */ 4: + message.symbol = reader.string() + break + case /* string gene */ 5: + message.gene = reader.string() + break + case /* string feature_type */ 6: + message.featureType = reader.string() + break + case /* string feature */ 7: + message.feature = reader.string() + break + case /* string feature_biotype */ 8: + message.featureBiotype = reader.string() + break + case /* optional string exon */ 9: + message.exon = reader.string() + break + case /* optional string intron */ 10: + message.intron = reader.string() + break + case /* optional string hgvsc */ 11: + message.hgvsc = reader.string() + break + case /* optional string hgvsp */ 12: + message.hgvsp = reader.string() + break + case /* optional string cdna_position */ 13: + message.cdnaPosition = reader.string() + break + case /* optional string cds_position */ 14: + message.cdsPosition = reader.string() + break + case /* optional string protein_position */ 15: + message.proteinPosition = reader.string() + break + case /* optional string amino_acids */ 16: + message.aminoAcids = reader.string() + break + case /* optional string codons */ 17: + message.codons = reader.string() + break + case /* optional int32 allele_num */ 18: + message.alleleNum = reader.int32() + break + case /* optional string distance */ 19: + message.distance = reader.string() + break + case /* optional string strand */ 20: + message.strand = reader.string() + break + case /* optional string flags */ 21: + message.flags = reader.string() + break + case /* optional string variant_class */ 22: + message.variantClass = reader.string() + break + case /* optional string symbol_source */ 23: + message.symbolSource = reader.string() + break + case /* optional string hgnc_id */ 24: + message.hgncId = reader.string() + break + case /* optional bool canonical */ 25: + message.canonical = reader.bool() + break + case /* optional bool mane_select */ 26: + message.maneSelect = reader.bool() + break + case /* optional bool mane_plus_clinical */ 27: + message.manePlusClinical = reader.bool() + break + case /* optional int32 tsl */ 28: + message.tsl = reader.int32() + break + case /* optional string appris */ 29: + message.appris = reader.string() + break + case /* optional string ccds */ 30: + message.ccds = reader.string() + break + case /* optional string ensp */ 31: + message.ensp = reader.string() + break + case /* optional string uniprot_isoform */ 32: + message.uniprotIsoform = reader.string() + break + case /* optional string source */ 33: + message.source = reader.string() + break + case /* repeated annonars.gnomad.vep_common.Domain domains */ 34: + message.domains.push(Domain.internalBinaryRead(reader, reader.uint32(), options)) + break + case /* optional string mirna */ 35: + message.mirna = reader.string() + break + case /* optional string hgvs_offset */ 36: + message.hgvsOffset = reader.string() + break + case /* optional string pubmed */ 37: + message.pubmed = reader.string() + break + case /* optional string motif_name */ 38: + message.motifName = reader.string() + break + case /* optional string motif_pos */ 39: + message.motifPos = reader.string() + break + case /* optional string high_inf_pos */ 40: + message.highInfPos = reader.string() + break + case /* optional string motif_score_change */ 41: + message.motifScoreChange = reader.string() + break + case /* optional string transcription_factors */ 42: + message.transcriptionFactors = reader.string() + break + case /* optional string lof */ 43: + message.lof = reader.string() + break + case /* optional string lof_filter */ 44: + message.lofFilter = reader.string() + break + case /* optional string lof_flags */ 45: + message.lofFlags = reader.string() + break + case /* optional string lof_info */ 46: + message.lofInfo = reader.string() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Vep, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string allele = 1; */ + if (message.allele !== '') writer.tag(1, WireType.LengthDelimited).string(message.allele) + /* string consequence = 2; */ + if (message.consequence !== '') + writer.tag(2, WireType.LengthDelimited).string(message.consequence) + /* string impact = 3; */ + if (message.impact !== '') writer.tag(3, WireType.LengthDelimited).string(message.impact) + /* string symbol = 4; */ + if (message.symbol !== '') writer.tag(4, WireType.LengthDelimited).string(message.symbol) + /* string gene = 5; */ + if (message.gene !== '') writer.tag(5, WireType.LengthDelimited).string(message.gene) + /* string feature_type = 6; */ + if (message.featureType !== '') + writer.tag(6, WireType.LengthDelimited).string(message.featureType) + /* string feature = 7; */ + if (message.feature !== '') writer.tag(7, WireType.LengthDelimited).string(message.feature) + /* string feature_biotype = 8; */ + if (message.featureBiotype !== '') + writer.tag(8, WireType.LengthDelimited).string(message.featureBiotype) + /* optional string exon = 9; */ + if (message.exon !== undefined) writer.tag(9, WireType.LengthDelimited).string(message.exon) + /* optional string intron = 10; */ + if (message.intron !== undefined) + writer.tag(10, WireType.LengthDelimited).string(message.intron) + /* optional string hgvsc = 11; */ + if (message.hgvsc !== undefined) writer.tag(11, WireType.LengthDelimited).string(message.hgvsc) + /* optional string hgvsp = 12; */ + if (message.hgvsp !== undefined) writer.tag(12, WireType.LengthDelimited).string(message.hgvsp) + /* optional string cdna_position = 13; */ + if (message.cdnaPosition !== undefined) + writer.tag(13, WireType.LengthDelimited).string(message.cdnaPosition) + /* optional string cds_position = 14; */ + if (message.cdsPosition !== undefined) + writer.tag(14, WireType.LengthDelimited).string(message.cdsPosition) + /* optional string protein_position = 15; */ + if (message.proteinPosition !== undefined) + writer.tag(15, WireType.LengthDelimited).string(message.proteinPosition) + /* optional string amino_acids = 16; */ + if (message.aminoAcids !== undefined) + writer.tag(16, WireType.LengthDelimited).string(message.aminoAcids) + /* optional string codons = 17; */ + if (message.codons !== undefined) + writer.tag(17, WireType.LengthDelimited).string(message.codons) + /* optional int32 allele_num = 18; */ + if (message.alleleNum !== undefined) writer.tag(18, WireType.Varint).int32(message.alleleNum) + /* optional string distance = 19; */ + if (message.distance !== undefined) + writer.tag(19, WireType.LengthDelimited).string(message.distance) + /* optional string strand = 20; */ + if (message.strand !== undefined) + writer.tag(20, WireType.LengthDelimited).string(message.strand) + /* optional string flags = 21; */ + if (message.flags !== undefined) writer.tag(21, WireType.LengthDelimited).string(message.flags) + /* optional string variant_class = 22; */ + if (message.variantClass !== undefined) + writer.tag(22, WireType.LengthDelimited).string(message.variantClass) + /* optional string symbol_source = 23; */ + if (message.symbolSource !== undefined) + writer.tag(23, WireType.LengthDelimited).string(message.symbolSource) + /* optional string hgnc_id = 24; */ + if (message.hgncId !== undefined) + writer.tag(24, WireType.LengthDelimited).string(message.hgncId) + /* optional bool canonical = 25; */ + if (message.canonical !== undefined) writer.tag(25, WireType.Varint).bool(message.canonical) + /* optional bool mane_select = 26; */ + if (message.maneSelect !== undefined) writer.tag(26, WireType.Varint).bool(message.maneSelect) + /* optional bool mane_plus_clinical = 27; */ + if (message.manePlusClinical !== undefined) + writer.tag(27, WireType.Varint).bool(message.manePlusClinical) + /* optional int32 tsl = 28; */ + if (message.tsl !== undefined) writer.tag(28, WireType.Varint).int32(message.tsl) + /* optional string appris = 29; */ + if (message.appris !== undefined) + writer.tag(29, WireType.LengthDelimited).string(message.appris) + /* optional string ccds = 30; */ + if (message.ccds !== undefined) writer.tag(30, WireType.LengthDelimited).string(message.ccds) + /* optional string ensp = 31; */ + if (message.ensp !== undefined) writer.tag(31, WireType.LengthDelimited).string(message.ensp) + /* optional string uniprot_isoform = 32; */ + if (message.uniprotIsoform !== undefined) + writer.tag(32, WireType.LengthDelimited).string(message.uniprotIsoform) + /* optional string source = 33; */ + if (message.source !== undefined) + writer.tag(33, WireType.LengthDelimited).string(message.source) + /* repeated annonars.gnomad.vep_common.Domain domains = 34; */ + for (let i = 0; i < message.domains.length; i++) + Domain.internalBinaryWrite( + message.domains[i], + writer.tag(34, WireType.LengthDelimited).fork(), + options + ).join() + /* optional string mirna = 35; */ + if (message.mirna !== undefined) writer.tag(35, WireType.LengthDelimited).string(message.mirna) + /* optional string hgvs_offset = 36; */ + if (message.hgvsOffset !== undefined) + writer.tag(36, WireType.LengthDelimited).string(message.hgvsOffset) + /* optional string pubmed = 37; */ + if (message.pubmed !== undefined) + writer.tag(37, WireType.LengthDelimited).string(message.pubmed) + /* optional string motif_name = 38; */ + if (message.motifName !== undefined) + writer.tag(38, WireType.LengthDelimited).string(message.motifName) + /* optional string motif_pos = 39; */ + if (message.motifPos !== undefined) + writer.tag(39, WireType.LengthDelimited).string(message.motifPos) + /* optional string high_inf_pos = 40; */ + if (message.highInfPos !== undefined) + writer.tag(40, WireType.LengthDelimited).string(message.highInfPos) + /* optional string motif_score_change = 41; */ + if (message.motifScoreChange !== undefined) + writer.tag(41, WireType.LengthDelimited).string(message.motifScoreChange) + /* optional string transcription_factors = 42; */ + if (message.transcriptionFactors !== undefined) + writer.tag(42, WireType.LengthDelimited).string(message.transcriptionFactors) + /* optional string lof = 43; */ + if (message.lof !== undefined) writer.tag(43, WireType.LengthDelimited).string(message.lof) + /* optional string lof_filter = 44; */ + if (message.lofFilter !== undefined) + writer.tag(44, WireType.LengthDelimited).string(message.lofFilter) + /* optional string lof_flags = 45; */ + if (message.lofFlags !== undefined) + writer.tag(45, WireType.LengthDelimited).string(message.lofFlags) + /* optional string lof_info = 46; */ + if (message.lofInfo !== undefined) + writer.tag(46, WireType.LengthDelimited).string(message.lofInfo) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.gnomad.vep_gnomad4.Vep + */ +export const Vep = new Vep$Type() diff --git a/src/pbs/annonars/helixmtdb/base.ts b/src/pbs/annonars/helixmtdb/base.ts new file mode 100644 index 0000000..cb8ed87 --- /dev/null +++ b/src/pbs/annonars/helixmtdb/base.ts @@ -0,0 +1,193 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/helixmtdb/base.proto" (package "annonars.helixmtdb.base", syntax proto3) +// tslint:disable +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +/** + * Protocol buffer for the HelixMtDb VCF record. + * + * @generated from protobuf message annonars.helixmtdb.base.Record + */ +export interface Record { + /** + * Chromosome name. + * + * @generated from protobuf field: string chrom = 1; + */ + chrom: string + /** + * 1-based start position. + * + * @generated from protobuf field: int32 pos = 2; + */ + pos: number + /** + * Reference allele. + * + * @generated from protobuf field: string ref_allele = 3; + */ + refAllele: string + /** + * / Alternate allele. + * + * @generated from protobuf field: string alt_allele = 4; + */ + altAllele: string + /** + * Total number of individuals. + * + * @generated from protobuf field: int32 num_total = 5; + */ + numTotal: number + /** + * Number of homoplasmic carriers. + * + * @generated from protobuf field: int32 num_het = 6; + */ + numHet: number + /** + * Number of heteroplasmic carriers. + * + * @generated from protobuf field: int32 num_hom = 7; + */ + numHom: number + /** + * Feature type. + * + * @generated from protobuf field: string feature_type = 8; + */ + featureType: string + /** + * Gene name. + * + * @generated from protobuf field: string gene_name = 9; + */ + geneName: string +} +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super('annonars.helixmtdb.base.Record', [ + { no: 1, name: 'chrom', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'pos', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: 'ref_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: 'alt_allele', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: 'num_total', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 6, name: 'num_het', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 7, name: 'num_hom', kind: 'scalar', T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: 'feature_type', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: 'gene_name', kind: 'scalar', T: 9 /*ScalarType.STRING*/ } + ]) + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create(this.messagePrototype!) + message.chrom = '' + message.pos = 0 + message.refAllele = '' + message.altAllele = '' + message.numTotal = 0 + message.numHet = 0 + message.numHom = 0 + message.featureType = '' + message.geneName = '' + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Record + ): Record { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string chrom */ 1: + message.chrom = reader.string() + break + case /* int32 pos */ 2: + message.pos = reader.int32() + break + case /* string ref_allele */ 3: + message.refAllele = reader.string() + break + case /* string alt_allele */ 4: + message.altAllele = reader.string() + break + case /* int32 num_total */ 5: + message.numTotal = reader.int32() + break + case /* int32 num_het */ 6: + message.numHet = reader.int32() + break + case /* int32 num_hom */ 7: + message.numHom = reader.int32() + break + case /* string feature_type */ 8: + message.featureType = reader.string() + break + case /* string gene_name */ 9: + message.geneName = reader.string() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Record, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string chrom = 1; */ + if (message.chrom !== '') writer.tag(1, WireType.LengthDelimited).string(message.chrom) + /* int32 pos = 2; */ + if (message.pos !== 0) writer.tag(2, WireType.Varint).int32(message.pos) + /* string ref_allele = 3; */ + if (message.refAllele !== '') writer.tag(3, WireType.LengthDelimited).string(message.refAllele) + /* string alt_allele = 4; */ + if (message.altAllele !== '') writer.tag(4, WireType.LengthDelimited).string(message.altAllele) + /* int32 num_total = 5; */ + if (message.numTotal !== 0) writer.tag(5, WireType.Varint).int32(message.numTotal) + /* int32 num_het = 6; */ + if (message.numHet !== 0) writer.tag(6, WireType.Varint).int32(message.numHet) + /* int32 num_hom = 7; */ + if (message.numHom !== 0) writer.tag(7, WireType.Varint).int32(message.numHom) + /* string feature_type = 8; */ + if (message.featureType !== '') + writer.tag(8, WireType.LengthDelimited).string(message.featureType) + /* string gene_name = 9; */ + if (message.geneName !== '') writer.tag(9, WireType.LengthDelimited).string(message.geneName) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.helixmtdb.base.Record + */ +export const Record = new Record$Type() diff --git a/src/pbs/annonars/regions/clingen.ts b/src/pbs/annonars/regions/clingen.ts new file mode 100644 index 0000000..b86e47a --- /dev/null +++ b/src/pbs/annonars/regions/clingen.ts @@ -0,0 +1,197 @@ +// @generated by protobuf-ts 2.9.3 with parameter keep_enum_prefix +// @generated from protobuf file "annonars/regions/clingen.proto" (package "annonars.regions.clingen", syntax proto3) +// tslint:disable +// +// Genomic region annotation with ClinGen information. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime' +import type { IBinaryWriter } from '@protobuf-ts/runtime' +import { WireType } from '@protobuf-ts/runtime' +import type { BinaryReadOptions } from '@protobuf-ts/runtime' +import type { IBinaryReader } from '@protobuf-ts/runtime' +import { UnknownFieldHandler } from '@protobuf-ts/runtime' +import type { PartialMessage } from '@protobuf-ts/runtime' +import { reflectionMergePartial } from '@protobuf-ts/runtime' +import { MessageType } from '@protobuf-ts/runtime' + +import { ClingenDosageScore } from '../genes/base' + +/** + * Dosage pathogenicity region annotation. + * + * @generated from protobuf message annonars.regions.clingen.Region + */ +export interface Region { + /** + * ISCA ID + * + * @generated from protobuf field: string isca_id = 1; + */ + iscaId: string + /** + * ISCA Region Name + * + * @generated from protobuf field: string isca_region_name = 2; + */ + iscaRegionName: string + /** + * Genomic locaion. + * + * @generated from protobuf field: string genomic_location = 3; + */ + genomicLocation: string + /** + * Haploinsufficiency score. + * + * @generated from protobuf field: annonars.genes.base.ClingenDosageScore haploinsufficiency_score = 4; + */ + haploinsufficiencyScore: ClingenDosageScore + /** + * Triplosensitivity score. + * + * @generated from protobuf field: annonars.genes.base.ClingenDosageScore triplosensitivity_score = 5; + */ + triplosensitivityScore: ClingenDosageScore + /** + * Haploinsufficiency Disease ID. + * + * @generated from protobuf field: optional string haploinsufficiency_disease_id = 6; + */ + haploinsufficiencyDiseaseId?: string + /** + * Haploinsufficiency Disease ID. + * + * @generated from protobuf field: optional string triplosensitivity_disease_id = 7; + */ + triplosensitivityDiseaseId?: string +} +// @generated message type with reflection information, may provide speed optimized methods +class Region$Type extends MessageType { + constructor() { + super('annonars.regions.clingen.Region', [ + { no: 1, name: 'isca_id', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: 'isca_region_name', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: 'genomic_location', kind: 'scalar', T: 9 /*ScalarType.STRING*/ }, + { + no: 4, + name: 'haploinsufficiency_score', + kind: 'enum', + T: () => ['annonars.genes.base.ClingenDosageScore', ClingenDosageScore] + }, + { + no: 5, + name: 'triplosensitivity_score', + kind: 'enum', + T: () => ['annonars.genes.base.ClingenDosageScore', ClingenDosageScore] + }, + { + no: 6, + name: 'haploinsufficiency_disease_id', + kind: 'scalar', + opt: true, + T: 9 /*ScalarType.STRING*/ + }, + { + no: 7, + name: 'triplosensitivity_disease_id', + kind: 'scalar', + opt: true, + T: 9 /*ScalarType.STRING*/ + } + ]) + } + create(value?: PartialMessage): Region { + const message = globalThis.Object.create(this.messagePrototype!) + message.iscaId = '' + message.iscaRegionName = '' + message.genomicLocation = '' + message.haploinsufficiencyScore = 0 + message.triplosensitivityScore = 0 + if (value !== undefined) reflectionMergePartial(this, message, value) + return message + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Region + ): Region { + const message = target ?? this.create(), + end = reader.pos + length + while (reader.pos < end) { + const [fieldNo, wireType] = reader.tag() + switch (fieldNo) { + case /* string isca_id */ 1: + message.iscaId = reader.string() + break + case /* string isca_region_name */ 2: + message.iscaRegionName = reader.string() + break + case /* string genomic_location */ 3: + message.genomicLocation = reader.string() + break + case /* annonars.genes.base.ClingenDosageScore haploinsufficiency_score */ 4: + message.haploinsufficiencyScore = reader.int32() + break + case /* annonars.genes.base.ClingenDosageScore triplosensitivity_score */ 5: + message.triplosensitivityScore = reader.int32() + break + case /* optional string haploinsufficiency_disease_id */ 6: + message.haploinsufficiencyDiseaseId = reader.string() + break + case /* optional string triplosensitivity_disease_id */ 7: + message.triplosensitivityDiseaseId = reader.string() + break + default: + const u = options.readUnknownField + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}` + ) + const d = reader.skip(wireType) + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ) + } + } + return message + } + internalBinaryWrite( + message: Region, + writer: IBinaryWriter, + options: BinaryWriteOptions + ): IBinaryWriter { + /* string isca_id = 1; */ + if (message.iscaId !== '') writer.tag(1, WireType.LengthDelimited).string(message.iscaId) + /* string isca_region_name = 2; */ + if (message.iscaRegionName !== '') + writer.tag(2, WireType.LengthDelimited).string(message.iscaRegionName) + /* string genomic_location = 3; */ + if (message.genomicLocation !== '') + writer.tag(3, WireType.LengthDelimited).string(message.genomicLocation) + /* annonars.genes.base.ClingenDosageScore haploinsufficiency_score = 4; */ + if (message.haploinsufficiencyScore !== 0) + writer.tag(4, WireType.Varint).int32(message.haploinsufficiencyScore) + /* annonars.genes.base.ClingenDosageScore triplosensitivity_score = 5; */ + if (message.triplosensitivityScore !== 0) + writer.tag(5, WireType.Varint).int32(message.triplosensitivityScore) + /* optional string haploinsufficiency_disease_id = 6; */ + if (message.haploinsufficiencyDiseaseId !== undefined) + writer.tag(6, WireType.LengthDelimited).string(message.haploinsufficiencyDiseaseId) + /* optional string triplosensitivity_disease_id = 7; */ + if (message.triplosensitivityDiseaseId !== undefined) + writer.tag(7, WireType.LengthDelimited).string(message.triplosensitivityDiseaseId) + const u = options.writeUnknownFields + if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer) + return writer + } +} +/** + * @generated MessageType for protobuf message annonars.regions.clingen.Region + */ +export const Region = new Region$Type()