Skip to content

Commit

Permalink
fix: writing gnomad-version meta info for gnomad-mtdna (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored May 24, 2023
1 parent 50fe505 commit a051d7e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gnomad_mtdna/cli/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ pub struct Args {
#[arg(long)]
pub path_out_rocksdb: String,

/// The gnomAD version to write out.
#[arg(long)]
pub gnomad_version: String,

/// Windows size for TBI-based parallel import.
#[arg(long, default_value = "100000")]
pub tbi_window_size: usize,
Expand Down Expand Up @@ -199,6 +203,7 @@ pub fn run(common: &common::cli::Args, args: &Args) -> Result<(), anyhow::Error>
)?);
tracing::info!(" writing meta information");
let cf_meta = db.cf_handle("meta").unwrap();
db.put_cf(&cf_meta, "gnomad-version", &args.gnomad_version)?;
db.put_cf(&cf_meta, "annonars-version", crate::VERSION)?;
db.put_cf(
&cf_meta,
Expand Down Expand Up @@ -244,6 +249,7 @@ mod test {
path_in_vcf: String::from("tests/gnomad-mtdna/example/gnomad-mtdna.vcf.bgz"),
path_out_rocksdb: format!("{}", tmp_dir.join("out-rocksdb").display()),
cf_name: String::from("gnomad_mtdna_data"),
gnomad_version: String::from("3.1.1"),
path_wal_dir: None,
tbi_window_size: 1_000_000,
import_fields_json: Some(serde_json::to_string(&DetailsOptions::with_all_enabled())?),
Expand Down

0 comments on commit a051d7e

Please sign in to comment.