Skip to content

Commit

Permalink
feat: bump annonars, write out VCV+RCV+clinsig (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Oct 18, 2023
1 parent 1a32d71 commit 0d7b6d8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ path = "src/main.rs"

[dependencies]
actix-web = "4.4"
annonars = "0.23"
annonars = "0.24"
anyhow = "1.0"
bgzip = "0.3"
bio = "1.3"
Expand Down
50 changes: 35 additions & 15 deletions src/annotate/seqvars/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,20 @@ fn build_header(header_in: &VcfHeader) -> VcfHeader {
Map::<Info>::new(
Number::Count(1),
Type::String,
"ClinVar clinical significance",
"ClinVar clinical significance (one highest significance per VCV)",
),
);
header_out.infos_mut().insert(
field::Key::from_str("clinvar_rcv").unwrap(),
Map::<Info>::new(Number::Count(1), Type::String, "ClinVar RCV accession"),
Map::<Info>::new(
Number::Count(1),
Type::String,
"ClinVar RCV accession (corresponds to clinvar_clinsig)",
),
);
header_out.infos_mut().insert(
field::Key::from_str("clinvar_vcv").unwrap(),
Map::<Info>::new(Number::Count(1), Type::String, "ClinVar VCV accession"),
);

header_out
Expand Down Expand Up @@ -396,21 +404,33 @@ where
clinvar_minimal::pbs::Record::decode(&mut std::io::Cursor::new(&raw_value))?;

let clinvar_minimal::pbs::Record {
clinical_significance,
rcv,
vcv,
reference_assertions,
..
} = clinvar_record;
let clinical_significance: clinvar_minimal::cli::reading::ClinicalSignificance =
clinical_significance.into();

vcf_record.info_mut().insert(
field::Key::from_str("clinvar_clinsig").unwrap(),
Some(field::Value::String(clinical_significance.to_string())),
);
vcf_record.info_mut().insert(
field::Key::from_str("clinvar_rcv").unwrap(),
Some(field::Value::String(rcv)),
);
if let Some(reference_assertion) = reference_assertions.first() {
let clinvar_minimal::pbs::ReferenceAssertion {
rcv,
clinical_significance,
..
} = reference_assertion.clone();

let clinical_significance: clinvar_minimal::cli::reading::ClinicalSignificance =
clinical_significance.into();

vcf_record.info_mut().insert(
field::Key::from_str("clinvar_clinsig").unwrap(),
Some(field::Value::String(clinical_significance.to_string())),
);
vcf_record.info_mut().insert(
field::Key::from_str("clinvar_rcv").unwrap(),
Some(field::Value::String(rcv)),
);
vcf_record.info_mut().insert(
field::Key::from_str("clinvar_vcv").unwrap(),
Some(field::Value::String(vcv)),
);
}
}

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions tests/data/db/create/seqvar_freqs/db-rs1263393206/output.vcf
Git LFS file not shown

0 comments on commit 0d7b6d8

Please sign in to comment.