|
@@ -168,6 +168,7 @@ mod tests {
|
|
|
use functions::assembler::{Assembler, AssemblerConfig};
|
|
use functions::assembler::{Assembler, AssemblerConfig};
|
|
|
use helpers::estimate_shannon_entropy;
|
|
use helpers::estimate_shannon_entropy;
|
|
|
use io::bed::read_bed;
|
|
use io::bed::read_bed;
|
|
|
|
|
+ use itertools::Itertools;
|
|
|
use log::{error, info, warn};
|
|
use log::{error, info, warn};
|
|
|
use pipes::somatic::SomaticPipe;
|
|
use pipes::somatic::SomaticPipe;
|
|
|
use positions::{overlaps_par, GenomePosition, GenomeRange};
|
|
use positions::{overlaps_par, GenomePosition, GenomeRange};
|
|
@@ -177,7 +178,7 @@ mod tests {
|
|
|
|
|
|
|
|
use self::{collection::pod5::{FlowCellCase, Pod5Collection}, commands::dorado, config::Config};
|
|
use self::{collection::pod5::{FlowCellCase, Pod5Collection}, commands::dorado, config::Config};
|
|
|
use super::*;
|
|
use super::*;
|
|
|
- use crate::{annotation::Annotation, callers::{clairs::ClairS, deep_variant::DeepVariant, nanomonsv::{NanomonSV, NanomonSVSolo}, savana::SavanaCN}, collection::{bam::{self, nt_pileup_new}, flowcells::{scan_archive, FlowCells}, run_tasks, vcf::VcfCollection, Collections, CollectionsConfig, ShouldRun}, commands::dorado::Dorado, helpers::find_files, io::{dict::read_dict, gff::features_ranges}, pipes::somatic::const_stats, positions::{merge_overlapping_genome_ranges, range_intersection_par, sort_ranges}, scan::scan::somatic_scan, variant::{variant::{AlterationCategory, BNDDesc, BNDGraph, ToBNDGraph}, variants_stats::{self, somatic_depth_quality_ranges, VariantsStats}}};
|
|
|
|
|
|
|
+ use crate::{annotation::Annotation, callers::{clairs::ClairS, deep_variant::DeepVariant, nanomonsv::{NanomonSV, NanomonSVSolo}, savana::SavanaCN}, collection::{bam::{self, nt_pileup_new}, flowcells::{scan_archive, FlowCells}, run_tasks, vcf::VcfCollection, Collections, CollectionsConfig, ShouldRun}, commands::dorado::Dorado, helpers::find_files, io::{dict::read_dict, gff::features_ranges}, pipes::somatic::const_stats, positions::{merge_overlapping_genome_ranges, range_intersection_par, sort_ranges}, scan::scan::somatic_scan, variant::{variant::{AlterationCategory, BNDDesc, BNDGraph, GroupByThreshold, ToBNDGraph}, variant_collection::{group_variants_by_bnd_desc, Variant}, variants_stats::{self, somatic_depth_quality_ranges, VariantsStats}}};
|
|
|
|
|
|
|
|
// export RUST_LOG="debug"
|
|
// export RUST_LOG="debug"
|
|
|
fn init() {
|
|
fn init() {
|
|
@@ -846,6 +847,8 @@ mod tests {
|
|
|
)?;
|
|
)?;
|
|
|
let bams = collections.bam.by_id_completed(15.0, 10.0);
|
|
let bams = collections.bam.by_id_completed(15.0, 10.0);
|
|
|
let n = bams.len();
|
|
let n = bams.len();
|
|
|
|
|
+ let mut config = Config::default();
|
|
|
|
|
+ // config.somatic_scan_force = true;
|
|
|
warn!("{n} cases");
|
|
warn!("{n} cases");
|
|
|
for (i, bam) in bams.iter().enumerate() {
|
|
for (i, bam) in bams.iter().enumerate() {
|
|
|
let id = &bam.id;
|
|
let id = &bam.id;
|
|
@@ -858,7 +861,7 @@ mod tests {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- match SomaticPipe::initialize(id, Config::default())?.run() {
|
|
|
|
|
|
|
+ match SomaticPipe::initialize(id, config.clone())?.run() {
|
|
|
Ok(_) => (),
|
|
Ok(_) => (),
|
|
|
Err(e) => error!("{id} {e}"),
|
|
Err(e) => error!("{id} {e}"),
|
|
|
};
|
|
};
|
|
@@ -881,14 +884,23 @@ mod tests {
|
|
|
#[test]
|
|
#[test]
|
|
|
fn load_variants() -> anyhow::Result<()> {
|
|
fn load_variants() -> anyhow::Result<()> {
|
|
|
init();
|
|
init();
|
|
|
- let id = "ADJAGBA";
|
|
|
|
|
|
|
+ let id = "ACHITE";
|
|
|
let config = Config::default();
|
|
let config = Config::default();
|
|
|
- let path = format!("{}/{id}/diag/somatic_variants.json.gz", config.result_dir);
|
|
|
|
|
- let variants = variant_collection::Variants::load_from_json(&path)?;
|
|
|
|
|
|
|
+ let path = format!("{}/{id}/diag/{id}_somatic_variants.bit", config.result_dir);
|
|
|
|
|
+ let variants = variant_collection::Variants::load_from_file(&path)?;
|
|
|
println!("n variants {}", variants.data.len());
|
|
println!("n variants {}", variants.data.len());
|
|
|
|
|
|
|
|
let n_vep: usize = variants.data.iter().map(|v| v.vep().len()).sum();
|
|
let n_vep: usize = variants.data.iter().map(|v| v.vep().len()).sum();
|
|
|
println!("VEP: {n_vep}");
|
|
println!("VEP: {n_vep}");
|
|
|
|
|
+
|
|
|
|
|
+ let translocations = variants.get_alteration_cat(AlterationCategory::TRL);
|
|
|
|
|
+ println!("{} translocations", translocations.len());
|
|
|
|
|
+ let res = group_variants_by_bnd_desc(&translocations, 5);
|
|
|
|
|
+
|
|
|
|
|
+ res.iter().for_each(|group| {
|
|
|
|
|
+ println!("{:?}", group.len());
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
Ok(())
|
|
Ok(())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1319,5 +1331,4 @@ mod tests {
|
|
|
assert_eq!(comps[0].len(), 3);
|
|
assert_eq!(comps[0].len(), 3);
|
|
|
assert_eq!(comps[1].len(), 3);
|
|
assert_eq!(comps[1].len(), 3);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|