Skip to content

Commit

Permalink
refactor: consolidating models with worker (#1956)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Oct 28, 2024
1 parent a02cf55 commit 3f43423
Show file tree
Hide file tree
Showing 30 changed files with 1,933 additions and 2,002 deletions.
4 changes: 2 additions & 2 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ protos-download:
rm -f protos/seqvars/protos/*_p*2*.py

wget -O protos/seqvars/protos/output.proto \
https://raw.githubusercontent.com/varfish-org/varfish-server-worker/main/protos/varfish/v1/seqvars/output.proto
https://raw.githubusercontent.com/varfish-org/varfish-server-worker/refactor-more-protobuf-cleaning-2/protos/varfish/v1/seqvars/output.proto
wget -O protos/seqvars/protos/query.proto \
https://raw.githubusercontent.com/varfish-org/varfish-server-worker/main/protos/varfish/v1/seqvars/query.proto
https://raw.githubusercontent.com/varfish-org/varfish-server-worker/refactor-more-protobuf-cleaning-2/protos/varfish/v1/seqvars/query.proto

mkdir -p seqvars/protos
touch seqvars/protos/__init__.py
Expand Down
20 changes: 4 additions & 16 deletions backend/protos/seqvars/protos/output.proto
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ message FrequencyAnnotation {
// gnomAD-genomes filter
optional NuclearFrequency gnomad_genomes = 2;
// gnomAD-MT filter
optional GnomadMitochondrialFrequency gnomad_mtdna = 3;
optional MitochondrialFrequency gnomad_mtdna = 3;
// HelixMtDb filter
optional HelixMtDbFrequency helixmtdb = 4;
optional MitochondrialFrequency helixmtdb = 4;
// In-house filter
optional NuclearFrequency inhouse = 5;
}
Expand All @@ -356,8 +356,8 @@ message NuclearFrequency {
float af = 5;
}

// gnomAD mitochondrial frequency information.
message GnomadMitochondrialFrequency {
// Mitochondrial frequency information.
message MitochondrialFrequency {
// Number of covered alleles.
int32 an = 1;
// Number of heteroplasmic carriers.
Expand All @@ -368,18 +368,6 @@ message GnomadMitochondrialFrequency {
float af = 4;
}

// HelixMtDb frequency information.
message HelixMtDbFrequency {
// Number of covered alleles.
int32 an = 1;
// Number of heterozygous carriers in HelixMtDb
int32 het = 2;
// Number of homozygous carriers in HelixMtDb
int32 homalt = 3;
// Frequency in HelixMtDb
float af = 4;
}

// Database identifiers.
message DbIds {
// dbSNP ID.
Expand Down
59 changes: 30 additions & 29 deletions backend/protos/seqvars/protos/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -88,57 +88,58 @@ message QuerySettingsQuality {
repeated SampleQualitySettings sample_qualities = 1;
}

// gnomAD and In-house nuclear filter options.
// gnomAD filter options.
message NuclearFrequencySettings {
// Whether to enable filtration by 1000 Genomes.
// Whether to enable filtration.
bool enabled = 1;
// Maximal number of in-house heterozygous carriers
optional int32 heterozygous = 2;
// Maximal number of in-house homozygous carriers
optional int32 homozygous = 3;
// Maximal number of in-house hemizygous carriers
optional int32 hemizygous = 4;
// Maximal number of heterozygous carriers
optional int32 max_het = 2;
// Maximal number of homozygous carriers
optional int32 max_hom = 3;
// Maximal number of hemizygous carriers
optional int32 max_hemi = 4;
// Maximal allele frequency.
optional float frequency = 5;
optional float max_af = 5;
}

// gnomAD mitochondrial filter options.
message GnomadMitochondrialFrequencySettings {
// Whether to enable filtration by 1000 Genomes.
// Mitochondrial filter options.
message MitochondrialFrequencySettings {
// Whether to enable filtration.
bool enabled = 1;
// Maximal number of heteroplasmic carriers.
optional int32 heteroplasmic = 2;
optional int32 max_het = 2;
// Maximal number of homoplasmic carriers.
optional int32 homoplasmic = 3;
optional int32 max_hom = 3;
// Maximal allele frequency.
optional float frequency = 4;
optional float max_af = 4;
}

// HelixMtDb filter options.
message HelixMtDbFrequencySettings {
// Whether to enable filtration by mtDB
// In-house filter options.
message InhouseFrequencySettings {
// Whether to enable filtration.
bool enabled = 1;
// Maximal number of heterozygous carriers in HelixMtDb
optional int32 heteroplasmic = 2;
// Maximal number of homozygous carriers in HelixMtDb
optional int32 homoplasmic = 3;
// Maximal frequency in HelixMtDb
optional float frequency = 4;
// Maximal number of heterozygous carriers
optional int32 max_het = 2;
// Maximal number of homozygous carriers
optional int32 max_hom = 3;
// Maximal number of hemizygous carriers
optional int32 max_hemi = 4;
// Maximal number of total carriers.
optional int32 max_carriers = 5;
}


// Population frequency filter options.
message QuerySettingsFrequency {
// gnomAD-exomes filter
NuclearFrequencySettings gnomad_exomes = 1;
// gnomAD-genomes filter
NuclearFrequencySettings gnomad_genomes = 2;
// gnomAD-MT filter
GnomadMitochondrialFrequencySettings gnomad_mtdna = 3;
MitochondrialFrequencySettings gnomad_mtdna = 3;
// HelixMtDb filter
HelixMtDbFrequencySettings helixmtdb = 4;
MitochondrialFrequencySettings helixmtdb = 4;
// In-house filter
NuclearFrequencySettings inhouse = 5;
InhouseFrequencySettings inhouse = 5;
}

// The variant types.
Expand Down Expand Up @@ -284,7 +285,7 @@ message Range {
// 1-based start position.
int32 start = 1;
// 1-based end position.
int32 end = 2;
int32 stop = 2;
}

// Genomic region.
Expand Down
Loading

0 comments on commit 3f43423

Please sign in to comment.