Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: consolidating models with worker (#1956) #2063

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Branch reference needs immediate update - file exists in main

The referenced feature branch refactor-more-protobuf-cleaning-2 no longer exists, but the proto files are present in the main branch. This is causing potential build issues.

  • Update URLs in backend/Makefile to use the main branch:
-https://raw.githubusercontent.com/varfish-org/varfish-server-worker/refactor-more-protobuf-cleaning-2/protos/varfish/v1/seqvars/output.proto
+https://raw.githubusercontent.com/varfish-org/varfish-server-worker/main/protos/varfish/v1/seqvars/output.proto
  • Same change needed for query.proto URL on the next line
🔗 Analysis chain

Consider using a stable reference instead of a feature branch.

While the changes look correct, referencing a specific feature branch (refactor-more-protobuf-cleaning-2) in the Makefile could cause issues once the branch is merged and deleted.

Consider one of these approaches:

  1. Use a specific commit hash for stability:
-https://raw.githubusercontent.com/varfish-org/varfish-server-worker/refactor-more-protobuf-cleaning-2/protos/varfish/v1/seqvars/output.proto
+https://raw.githubusercontent.com/varfish-org/varfish-server-worker/<commit-hash>/protos/varfish/v1/seqvars/output.proto
  1. Use a git tag if this represents a specific version
  2. Revert to using 'main' once the changes are merged

Let's verify the branch status:

Also applies to: 151-151

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the branch exists and its status
gh api repos/varfish-org/varfish-server-worker/branches/refactor-more-protobuf-cleaning-2 --jq '.name, .protected, .commit.sha'

Length of output: 288


Script:

#!/bin/bash
# Let's check if the proto files are available in the main branch
gh api repos/varfish-org/varfish-server-worker/contents/protos/varfish/v1/seqvars/output.proto?ref=main --jq '.sha'

# Also check the current Makefile for any other branch references
rg -A 1 "varfish-server-worker/.+/protos" backend/Makefile

Length of output: 548

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
Loading