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

feat: write out fileDate on ingest (#210) #215

Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions src/seqvars/ingest/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ pub fn build_output_header(
input_header: &vcf::Header,
pedigree: &Option<mehari::ped::PedigreeByName>,
genomebuild: GenomeRelease,
file_date: &str,
case_uuid: &uuid::Uuid,
worker_version: &str,
) -> Result<vcf::Header, anyhow::Error> {
Expand All @@ -193,6 +194,10 @@ pub fn build_output_header(
use vcf::record::genotypes::keys::key;

let builder = vcf::Header::builder()
.insert(
"fileDate".parse()?,
vcf::header::record::Value::from(file_date),
)?
.add_filter("PASS", Map::<Filter>::new("All filters passed"))
.add_info(
"gnomad_exomes_an".parse()?,
Expand Down Expand Up @@ -466,6 +471,7 @@ mod test {
&input_vcf_header,
&Some(pedigree),
crate::common::GenomeRelease::Grch37,
"20230421",
&uuid::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap(),
"x.y.z",
)?;
Expand Down Expand Up @@ -500,6 +506,7 @@ mod test {
&input_vcf_header,
&Some(pedigree),
crate::common::GenomeRelease::Grch38,
"20230421",
&uuid::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap(),
"x.y.z",
)?;
Expand Down
13 changes: 10 additions & 3 deletions src/seqvars/ingest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ pub mod header;
#[derive(Debug, clap::Parser)]
#[command(author, version, about = "ingest sequence variant VCF", long_about = None)]
pub struct Args {
/// The path to the mehari database.
#[clap(long)]
pub path_mehari_db: String,
/// Value to write to `##fileDate`.
#[arg(long)]
pub file_date: String,
/// The case UUID to write out.
#[clap(long)]
pub case_uuid: uuid::Uuid,
/// The assumed genome build.
#[clap(long)]
pub genomebuild: GenomeRelease,

/// The path to the mehari database.
#[clap(long)]
pub path_mehari_db: String,
/// Path to the pedigree file.
#[clap(long)]
pub path_ped: String,
Expand Down Expand Up @@ -445,6 +449,7 @@ pub fn run(args_common: &crate::common::Args, args: &Args) -> Result<(), anyhow:
&input_header,
&Some(pedigree),
args.genomebuild,
&args.file_date,
&args.case_uuid,
worker_version(),
)
Expand Down Expand Up @@ -494,6 +499,7 @@ mod test {

let args_common = Default::default();
let args = super::Args {
file_date: String::from("20230421"),
case_uuid: uuid::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap(),
max_var_count: None,
path_mehari_db: "tests/seqvars/ingest/db".into(),
Expand Down Expand Up @@ -526,6 +532,7 @@ mod test {
.into();
let args_common = Default::default();
let args = super::Args {
file_date: String::from("20230421"),
case_uuid: uuid::Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap(),
max_var_count: None,
path_mehari_db: "tests/seqvars/ingest/db".into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(out_path_str)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=NA12878,Sex="Male",Disease="Affected">
##PEDIGREE=<ID=NA12878>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(out_path_str)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=CASE,Sex="Male",Disease="Affected">
##PEDIGREE=<ID=CASE>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(out_path_str)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=Case_1_father-N1-DNA1-WGS1,Sex="Male",Disease="Unaffected">
##SAMPLE=<ID=Case_1_index-N1-DNA1-WGS1,Sex="Female",Disease="Affected">
##SAMPLE=<ID=Case_1_mother-N1-DNA1-WGS1,Sex="Male",Disease="Unaffected">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(out_path_str)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=CASE,Sex="Male",Disease="Affected">
##PEDIGREE=<ID=CASE>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(out_path_str)?"
##contig=<ID=chrX,length=156040895,assembly="GRCh38",species="Homo sapiens">
##contig=<ID=chrY,length=57227415,assembly="GRCh38",species="Homo sapiens">
##contig=<ID=chrM,length=16569,assembly="GRCh38",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=NA12878,Sex="Male",Disease="Affected">
##PEDIGREE=<ID=NA12878>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(out_path_str)?"
##contig=<ID=chrX,length=156040895,assembly="GRCh38",species="Homo sapiens">
##contig=<ID=chrY,length=57227415,assembly="GRCh38",species="Homo sapiens">
##contig=<ID=chrM,length=16569,assembly="GRCh38",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=CASE,Sex="Male",Disease="Affected">
##PEDIGREE=<ID=CASE>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(out_path_str)?"
##contig=<ID=chrX,length=156040895,assembly="GRCh38",species="Homo sapiens">
##contig=<ID=chrY,length=57227415,assembly="GRCh38",species="Homo sapiens">
##contig=<ID=chrM,length=16569,assembly="GRCh38",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=Case_1_father-N1-DNA1-WGS1,Sex="Male",Disease="Unaffected">
##SAMPLE=<ID=Case_1_index-N1-DNA1-WGS1,Sex="Female",Disease="Affected">
##SAMPLE=<ID=Case_1_mother-N1-DNA1-WGS1,Sex="Male",Disease="Unaffected">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(out_path_str)?"
##contig=<ID=chrX,length=156040895,assembly="GRCh38",species="Homo sapiens">
##contig=<ID=chrY,length=57227415,assembly="GRCh38",species="Homo sapiens">
##contig=<ID=chrM,length=16569,assembly="GRCh38",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=CASE,Sex="Male",Disease="Affected">
##PEDIGREE=<ID=CASE>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(&args.path_out)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=Case_1_father-N1-DNA1-WGS1,Sex="Male",Disease="Unaffected">
##SAMPLE=<ID=Case_1_index-N1-DNA1-WGS1,Sex="Female",Disease="Affected">
##SAMPLE=<ID=Case_1_mother-N1-DNA1-WGS1,Sex="Female",Disease="Unaffected">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(&args.path_out)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=NA12878,Sex="Female",Disease="Affected">
##PEDIGREE=<ID=NA12878>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(&args.path_out)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=NA12878,Sex="Male",Disease="Affected">
##PEDIGREE=<ID=NA12878>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(&args.path_out)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=CASE,Sex="Male",Disease="Affected">
##PEDIGREE=<ID=CASE>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(&args.path_out)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=Case_1_father-N1-DNA1-WGS1,Sex="Male",Disease="Unaffected">
##SAMPLE=<ID=Case_1_index-N1-DNA1-WGS1,Sex="Female",Disease="Affected">
##SAMPLE=<ID=Case_1_mother-N1-DNA1-WGS1,Sex="Male",Disease="Unaffected">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ expression: "std::fs::read_to_string(&args.path_out)?"
##contig=<ID=X,length=155270560,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=Y,length=59373566,assembly="GRCh37",species="Homo sapiens">
##contig=<ID=MT,length=16569,assembly="GRCh37",species="Homo sapiens">
##fileDate=20230421
##SAMPLE=<ID=CASE,Sex="Male",Disease="Affected">
##PEDIGREE=<ID=CASE>
##x-varfish-case-uuid=00000000-0000-0000-0000-000000000000
Expand Down
Loading
Loading