Skip to content
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "monty"]
path = monty
url = git@github.com:pydantic/monty.git
url = git@github.com:madhavajay/monty.git
[submodule "noodles"]
path = noodles
url = git@github.com:madhavajay/noodles.git
Expand Down
2 changes: 1 addition & 1 deletion monty
9 changes: 9 additions & 0 deletions rust/Cargo.lock

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

1 change: 1 addition & 0 deletions rust/bioscript-cli/src/cli_bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ fn run_cli_script(
RuntimeConfig {
limits: options.limits,
loader: options.loader,
..RuntimeConfig::default()
},
)
.map_err(|err| err.to_string())?;
Expand Down
1 change: 1 addition & 0 deletions rust/bioscript-cli/src/report_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ fn run_bioscript_analysis_script(
RuntimeConfig {
limits,
loader: loader.clone(),
..RuntimeConfig::default()
},
)
.map_err(|err| err.to_string())?;
Expand Down
11 changes: 9 additions & 2 deletions rust/bioscript-ffi/src/run_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ pub fn run_file_request(request: RunFileRequest) -> Result<RunFileResult, String
run_auto_index(&request, &runtime_root, &mut loader, &mut ffi_timings)?;
}

let runtime = BioscriptRuntime::with_config(runtime_root, RuntimeConfig { limits, loader })
.map_err(|err| err.to_string())?;
let runtime = BioscriptRuntime::with_config(
runtime_root,
RuntimeConfig {
limits,
loader,
..RuntimeConfig::default()
},
)
.map_err(|err| err.to_string())?;
let inputs = runtime_inputs(&request);

runtime
Expand Down
27 changes: 5 additions & 22 deletions rust/bioscript-formats/src/genotype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1219,28 +1219,11 @@ mod tests {
..GenotypeLoadOptions::default()
},
};
for variant in [
VariantSpec::default(),
VariantSpec {
grch38: Some(locus("1", 10, 10)),
alternate: Some("G".to_owned()),
kind: Some(VariantKind::Snp),
..VariantSpec::default()
},
VariantSpec {
grch38: Some(locus("1", 10, 10)),
reference: Some("AT".to_owned()),
alternate: Some("G".to_owned()),
kind: Some(VariantKind::Snp),
..VariantSpec::default()
},
] {
assert!(
lookup_indexed_vcf_variants(&indexed, &[variant])
.unwrap()
.is_none()
);
}
assert!(
lookup_indexed_vcf_variants(&indexed, &[VariantSpec::default()])
.unwrap()
.is_none()
);
let err = lookup_indexed_vcf_variants(
&indexed,
&[VariantSpec {
Expand Down
38 changes: 10 additions & 28 deletions rust/bioscript-formats/src/genotype/vcf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ use super::{
describe_query, genotype_from_vcf_gt, is_bgzf_path, types::VcfBackend, variant_sort_key,
};

mod indexed;
mod matching;
mod reader;

use indexed::observe_indexed_vcf_variant;
use matching::imputed_reference_observation;
pub(crate) use matching::{
choose_variant_locus_for_assembly, normalize_chromosome_name, vcf_row_matches_variant,
};
use matching::{first_single_base_allele, imputed_reference_observation};
pub use reader::observe_vcf_snp_with_reader;
pub use reader::{observe_vcf_snp_with_reader, observe_vcf_variant_with_reader};

#[derive(Debug, Clone)]
pub(crate) struct ParsedVcfRow {
Expand Down Expand Up @@ -208,12 +206,6 @@ pub(crate) fn lookup_indexed_vcf_variants(
let Some(locus) = choose_variant_locus_for_assembly(variant, detected_assembly) else {
return Ok(None);
};
if matches!(variant.kind, None | Some(VariantKind::Snp))
&& (first_single_base_allele(variant.reference.as_deref()).is_none()
|| first_single_base_allele(variant.alternate.as_deref()).is_none())
{
return Ok(None);
}
indexed_variants.push((idx, variant, locus));
}

Expand All @@ -234,25 +226,15 @@ pub(crate) fn lookup_indexed_vcf_variants(
);

let mut results = vec![VariantObservation::default(); variants.len()];
let label = backend.path.display().to_string();
for (idx, variant, locus) in indexed_variants {
let observation = if let (Some(reference), Some(alternate), true) = (
first_single_base_allele(variant.reference.as_deref()),
first_single_base_allele(variant.alternate.as_deref()),
matches!(variant.kind, None | Some(VariantKind::Snp)),
) {
observe_vcf_snp_with_reader(
&mut indexed,
&label,
&locus,
reference,
alternate,
variant.rsids.first().cloned(),
detected_assembly,
)?
} else {
observe_indexed_vcf_variant(&mut indexed, &label, variant, &locus, detected_assembly)?
};
let observation = observe_vcf_variant_with_reader(
&mut indexed,
&backend.path.display().to_string(),
&locus,
variant,
variant.rsids.first().cloned(),
detected_assembly,
)?;
results[idx] = if backend.options.impute_vcf_missing_as_reference
&& observation.genotype.is_none()
&& observation
Expand Down
120 changes: 0 additions & 120 deletions rust/bioscript-formats/src/genotype/vcf/indexed.rs

This file was deleted.

Loading
Loading