From 406c7077d78dba754672ecdde62bf4e08e71fc76 Mon Sep 17 00:00:00 2001 From: Max Zhao Date: Thu, 5 Oct 2023 09:18:19 +0200 Subject: [PATCH] Adding failing test case --- src/annotate/seqvars/mod.rs | 35 +++++++++++++++++++ .../data/db/create/mitochondrial_variants.ped | 3 ++ .../data/db/create/mitochondrial_variants.vcf | 3 ++ 3 files changed, 41 insertions(+) create mode 100644 tests/data/db/create/mitochondrial_variants.ped create mode 100644 tests/data/db/create/mitochondrial_variants.vcf diff --git a/src/annotate/seqvars/mod.rs b/src/annotate/seqvars/mod.rs index cffe84da..6e99286b 100644 --- a/src/annotate/seqvars/mod.rs +++ b/src/annotate/seqvars/mod.rs @@ -1699,4 +1699,39 @@ mod test { Ok(()) } + + /// Mitochondnrial variants called by the DRAGEN v310 germline caller have special format + /// considerations. + /// + /// See: https://support-docs.illumina.com/SW/DRAGEN_v310/Content/SW/DRAGEN/MitochondrialCalling.htm + #[test] + fn test_dragen_mitochondrial_variant() -> Result<(), anyhow::Error> { + let temp = TempDir::default(); + let path_out = temp.join("output.tsv"); + + let args_common = crate::common::Args { + verbose: Verbosity::new(0, 1), + }; + let args = Args { + genome_release: None, + path_db: String::from("tests/data/annotate/db"), + path_input_vcf: String::from("tests/data/db/create/mitochondrial_variants.vcf"), + output: PathOutput { + path_output_vcf: None, + path_output_tsv: Some(path_out.into_os_string().into_string().unwrap()), + }, + max_var_count: None, + path_input_ped: Some(String::from( + "tests/data/db/create/mitochondrial_variants.ped", + )), + }; + + run(&args_common, &args)?; + + let actual = std::fs::read_to_string(args.output.path_output_tsv.unwrap())?; + let expected = std::fs::read_to_string("tests/data/db/create/badly_formed_vcf_entry.tsv")?; + assert_eq!(&expected, &actual); + + Ok(()) + } } diff --git a/tests/data/db/create/mitochondrial_variants.ped b/tests/data/db/create/mitochondrial_variants.ped new file mode 100644 index 00000000..90d1f727 --- /dev/null +++ b/tests/data/db/create/mitochondrial_variants.ped @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6a175f650923802a94c81637b8cfec56d0f0147a2c7c3a687dd01820a1d7eba +size 80 diff --git a/tests/data/db/create/mitochondrial_variants.vcf b/tests/data/db/create/mitochondrial_variants.vcf new file mode 100644 index 00000000..1d2b455b --- /dev/null +++ b/tests/data/db/create/mitochondrial_variants.vcf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0758e03e92a8a11b2853a2c51d618a0b63215e6a7c91fd9ca0b56d7236431b3 +size 9601