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: bump dependencies (especially noodles) #179

Merged
merged 1 commit into from
Sep 18, 2023
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
808 changes: 351 additions & 457 deletions Cargo.lock

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions 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.14"
annonars = "0.20"
anyhow = "1.0"
bgzip = "0.3"
bio = "1.3"
Expand All @@ -40,28 +40,28 @@ csv = "1.2"
derivative = "2.2"
env_logger = "0.10"
flate2 = "1.0"
hgvs = "0.10"
hgvs = "0.11"
indexmap = "2.0"
indicatif = "0.17"
jsonl = "4.0"
lazy_static = "1.4"
log = "0.4"
nom = "7.1"
noodles-bgzf = "0.22"
noodles-bgzf = "0.24"
noodles-core = "0.12"
noodles-csi = "0.22"
noodles-fasta = "0.27"
noodles-tabix = "0.25"
noodles-vcf = "0.34"
noodles-csi = "0.24"
noodles-fasta = "0.29"
noodles-tabix = "0.29"
noodles-vcf = "0.39"
parse-display = "0.8"
procfs = "0.15"
prost = "0.11"
quick_cache = "0.3"
prost = "0.12"
quick_cache = "0.4"
rand = "0.8"
rand_core = "0.6"
rocksdb = { version = "0.21", features = ["multi-threaded-cf"] }
rustc-hash = "1.1"
seqrepo = "0.7"
seqrepo = "0.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_with = "3.3"
Expand Down
24 changes: 12 additions & 12 deletions src/annotate/seqvars/csq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

// Skip transcripts that are protein coding but do not have a CDS.
// TODO: do not include such transcripts when building the database.
if TranscriptBiotype::from_i32(tx.biotype).expect("invalid tx biotype")
if TranscriptBiotype::try_from(tx.biotype).expect("invalid tx biotype")
== TranscriptBiotype::Coding
&& tx.start_codon.is_none()
{
Expand Down Expand Up @@ -222,23 +222,23 @@
if var_start <= exon_start && var_end >= exon_end {
consequences.push(Consequence::ExonLossVariant);
if var_start < exon_start {
if Strand::from_i32(alignment.strand).expect("invalid strand") == Strand::Plus
if Strand::try_from(alignment.strand).expect("invalid strand") == Strand::Plus

Check warning on line 225 in src/annotate/seqvars/csq.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/csq.rs#L225

Added line #L225 was not covered by tests
&& rank.ord != 1
{
consequences.push(Consequence::SpliceAcceptorVariant);
} else if Strand::from_i32(alignment.strand).expect("invalid strand")
} else if Strand::try_from(alignment.strand).expect("invalid strand")

Check warning on line 229 in src/annotate/seqvars/csq.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/csq.rs#L229

Added line #L229 was not covered by tests
== Strand::Minus
&& rank.ord != rank.total
{
consequences.push(Consequence::SpliceDonorVariant);
}
}
if var_end > exon_end {
if Strand::from_i32(alignment.strand).expect("invalid strand") == Strand::Plus
if Strand::try_from(alignment.strand).expect("invalid strand") == Strand::Plus

Check warning on line 237 in src/annotate/seqvars/csq.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/csq.rs#L237

Added line #L237 was not covered by tests
&& rank.ord != rank.total
{
consequences.push(Consequence::SpliceDonorVariant);
} else if Strand::from_i32(alignment.strand).expect("invalid strand")
} else if Strand::try_from(alignment.strand).expect("invalid strand")

Check warning on line 241 in src/annotate/seqvars/csq.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/csq.rs#L241

Added line #L241 was not covered by tests
== Strand::Minus
&& rank.ord != rank.total
{
Expand All @@ -255,15 +255,15 @@
// Check the cases where the variant overlaps with the splice acceptor/donor site.
if var_start < intron_start + 2 && var_end > intron_start - ins_shift {
// Left side, is acceptor/donor depending on transcript's strand.
match Strand::from_i32(alignment.strand).expect("invalid strand") {
match Strand::try_from(alignment.strand).expect("invalid strand") {
Strand::Plus => consequences.push(Consequence::SpliceDonorVariant),
Strand::Minus => consequences.push(Consequence::SpliceAcceptorVariant),
}
}
// Check the case where the variant overlaps with the splice donor site.
if var_start < intron_end + ins_shift && var_end > intron_end - 2 {
// Left side, is acceptor/donor depending on transcript's strand.
match Strand::from_i32(alignment.strand).expect("invalid strand") {
match Strand::try_from(alignment.strand).expect("invalid strand") {
Strand::Plus => consequences.push(Consequence::SpliceAcceptorVariant),
Strand::Minus => consequences.push(Consequence::SpliceDonorVariant),
}
Expand All @@ -279,7 +279,7 @@
consequences.push(Consequence::SpliceRegionVariant);
}
if var_start < exon_end && var_end > exon_end - 3 {
if Strand::from_i32(alignment.strand).expect("invalid strand") == Strand::Plus {
if Strand::try_from(alignment.strand).expect("invalid strand") == Strand::Plus {
if rank.ord != rank.total {
consequences.push(Consequence::SpliceRegionVariant);
}
Expand All @@ -291,7 +291,7 @@
}
}
if var_start < exon_start + 3 && var_end > exon_start {
if Strand::from_i32(alignment.strand).expect("invalid strand") == Strand::Plus {
if Strand::try_from(alignment.strand).expect("invalid strand") == Strand::Plus {
if rank.ord != 1 {
consequences.push(Consequence::SpliceRegionVariant);
}
Expand All @@ -314,7 +314,7 @@
let max_end = max_end.expect("must have seen exon");

let feature_biotype =
match TranscriptBiotype::from_i32(tx.biotype).expect("invalid transcript biotype") {
match TranscriptBiotype::try_from(tx.biotype).expect("invalid transcript biotype") {
TranscriptBiotype::Coding => FeatureBiotype::Coding,
TranscriptBiotype::NonCoding => FeatureBiotype::Noncoding,
};
Expand All @@ -334,7 +334,7 @@
} else if is_upstream {
let val = -(min_start - var_end);
if val.abs() <= 5_000 {
match Strand::from_i32(alignment.strand).expect("invalid strand") {
match Strand::try_from(alignment.strand).expect("invalid strand") {
Strand::Plus => consequences.push(Consequence::UpstreamGeneVariant),
Strand::Minus => consequences.push(Consequence::DownstreamGeneVariant),
}
Expand All @@ -343,7 +343,7 @@
} else if is_downstream {
let val = var_start - max_end;
if val.abs() <= 5_000 {
match Strand::from_i32(alignment.strand).expect("invalid strand") {
match Strand::try_from(alignment.strand).expect("invalid strand") {
Strand::Plus => consequences.push(Consequence::DownstreamGeneVariant),
Strand::Minus => consequences.push(Consequence::UpstreamGeneVariant),
}
Expand Down
44 changes: 22 additions & 22 deletions src/annotate/seqvars/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,16 @@
);

header_out.infos_mut().insert(
field::Key::from_str("clinvar_patho").unwrap(),
Map::<Info>::new(Number::Count(1), Type::String, "ClinVar pathogenicity"),
field::Key::from_str("clinvar_clinsig").unwrap(),
Map::<Info>::new(
Number::Count(1),
Type::String,
"ClinVar clinical significance",
),
);
header_out.infos_mut().insert(
field::Key::from_str("clinvar_vcv").unwrap(),
Map::<Info>::new(Number::Count(1), Type::String, "ClinVar VCV accession"),
field::Key::from_str("clinvar_rcv").unwrap(),
Map::<Info>::new(Number::Count(1), Type::String, "ClinVar RCV accession"),
);

header_out
Expand Down Expand Up @@ -392,24 +396,20 @@
clinvar_minimal::pbs::Record::decode(&mut std::io::Cursor::new(&raw_value))?;

let clinvar_minimal::pbs::Record {
summary_clinvar_pathogenicity,
vcv,
clinical_significance,
rcv,

Check warning on line 400 in src/annotate/seqvars/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/mod.rs#L399-L400

Added lines #L399 - L400 were not covered by tests
..
} = clinvar_record;
let summary_clinvar_pathogenicity: Vec<_> = summary_clinvar_pathogenicity
.into_iter()
.map(|i: i32| -> clinvar_minimal::cli::reading::Pathogenicity { i.into() })
.collect();
let clinical_significance: clinvar_minimal::cli::reading::ClinicalSignificance =
clinical_significance.into();

Check warning on line 404 in src/annotate/seqvars/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/mod.rs#L403-L404

Added lines #L403 - L404 were not covered by tests

vcf_record.info_mut().insert(
field::Key::from_str("clinvar_patho").unwrap(),
Some(field::Value::String(
summary_clinvar_pathogenicity.first().unwrap().to_string(),
)),
field::Key::from_str("clinvar_clinsig").unwrap(),
Some(field::Value::String(clinical_significance.to_string())),

Check warning on line 408 in src/annotate/seqvars/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/mod.rs#L407-L408

Added lines #L407 - L408 were not covered by tests
);
vcf_record.info_mut().insert(
field::Key::from_str("clinvar_vcv").unwrap(),
Some(field::Value::String(vcv)),
field::Key::from_str("clinvar_rcv").unwrap(),
Some(field::Value::String(rcv)),

Check warning on line 412 in src/annotate/seqvars/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/mod.rs#L411-L412

Added lines #L411 - L412 were not covered by tests
);
}

Expand Down Expand Up @@ -1078,15 +1078,15 @@
) -> Result<(), anyhow::Error> {
tsv_record.in_clinvar = record
.info()
.get(&field::Key::from_str("clinvar_patho").unwrap())
.get(&field::Key::from_str("clinvar_clinsig").unwrap())
.unwrap_or_default()
.map(|v| match v {
field::Value::String(value) => {
clinvar_minimal::cli::reading::Pathogenicity::from_str(value).unwrap_or(
clinvar_minimal::cli::reading::Pathogenicity::UncertainSignificance,
) >= clinvar_minimal::cli::reading::Pathogenicity::LikelyPathogenic
clinvar_minimal::cli::reading::ClinicalSignificance::from_str(value).unwrap_or(
clinvar_minimal::cli::reading::ClinicalSignificance::UncertainSignificance,

Check warning on line 1086 in src/annotate/seqvars/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/mod.rs#L1085-L1086

Added lines #L1085 - L1086 were not covered by tests
) >= clinvar_minimal::cli::reading::ClinicalSignificance::LikelyPathogenic
}
_ => panic!("Unexpected value type for INFO/clinvar_patho"),
_ => panic!("Unexpected value type for INFO/clinvar_clinsig"),

Check warning on line 1089 in src/annotate/seqvars/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/annotate/seqvars/mod.rs#L1089

Added line #L1089 was not covered by tests
})
.unwrap_or_default();

Expand Down Expand Up @@ -1368,7 +1368,7 @@
/// Run the annotation with the given `Write` within the `VcfWriter`.
fn run_with_writer(writer: &mut dyn AnnotatedVcfWriter, args: &Args) -> Result<(), anyhow::Error> {
tracing::info!("Open VCF and read header");
let mut reader = VariantReaderBuilder::default().build_from_path(&args.path_input_vcf)?;
let mut reader = VariantReaderBuilder.build_from_path(&args.path_input_vcf)?;
let header_in = reader.read_header()?;
let header_out = build_header(&header_in);

Expand Down
4 changes: 2 additions & 2 deletions src/annotate/seqvars/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl ProviderInterface for MehariProvider {
tx_ac: tx_ac.to_string(),
alt_ac: alt_ac.to_string(),
alt_aln_method: ALT_ALN_METHOD.to_string(),
alt_strand: match Strand::from_i32(genome_alignment.strand)
alt_strand: match Strand::try_from(genome_alignment.strand)
.expect("invalid strand")
{
Strand::Plus => 1,
Expand Down Expand Up @@ -324,7 +324,7 @@ impl ProviderInterface for MehariProvider {
TxForRegionRecord {
tx_ac: tx.id.clone(),
alt_ac: alt_ac.to_string(),
alt_strand: match Strand::from_i32(alt_strand).expect("invalid strand") {
alt_strand: match Strand::try_from(alt_strand).expect("invalid strand") {
Strand::Plus => 1,
Strand::Minus => -1,
},
Expand Down
Loading
Loading