From 5c05c2fa3ca967117dffffc4e1930f1607f5b7db Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Fri, 6 Sep 2024 14:12:24 +0200 Subject: [PATCH] fix: off-by-one positions on clinvar-minimal import (#530) --- src/clinvar_minimal/cli/import.rs | 8 ++++---- src/clinvar_minimal/cli/query.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/clinvar_minimal/cli/import.rs b/src/clinvar_minimal/cli/import.rs index e9706e1c..8fa9bd8e 100644 --- a/src/clinvar_minimal/cli/import.rs +++ b/src/clinvar_minimal/cli/import.rs @@ -75,7 +75,7 @@ fn jsonl_import( let sequence_location = sequence_location.expect("sequence_location is required"); let crate::pbs::clinvar_data::clinvar_public::location::SequenceLocation { chr, - start, + position_vcf, reference_allele_vcf, alternate_allele_vcf, .. @@ -84,12 +84,12 @@ fn jsonl_import( crate::pbs::clinvar_data::clinvar_public::Chromosome::try_from(chr).map_err(|e| { anyhow::anyhow!("problem converting chromosome {} to Chromosome: {}", chr, e) })?; - if let (Some(start), Some(reference_allele_vcf), Some(alternate_allele_vcf)) = - (start, reference_allele_vcf, alternate_allele_vcf) + if let (Some(position_vcf), Some(reference_allele_vcf), Some(alternate_allele_vcf)) = + (position_vcf, reference_allele_vcf, alternate_allele_vcf) { let var = keys::Var::from( &chr_pb.as_chr_name(), - start as i32, + position_vcf as i32, &reference_allele_vcf, &alternate_allele_vcf, ); diff --git a/src/clinvar_minimal/cli/query.rs b/src/clinvar_minimal/cli/query.rs index cf58dc27..48d09837 100644 --- a/src/clinvar_minimal/cli/query.rs +++ b/src/clinvar_minimal/cli/query.rs @@ -168,7 +168,7 @@ pub fn query_for_accession( /// Implementation of `tsv query` sub command. pub fn run(common: &common::cli::Args, args: &Args) -> Result<(), anyhow::Error> { - tracing::info!("Starting 'gnomad-mtdna query' command"); + tracing::info!("Starting 'clinvar-minimal query' command"); tracing::info!("common = {:#?}", &common); tracing::info!("args = {:#?}", &args);