|
|
@@ -122,6 +122,8 @@
|
|
|
//! - Usage examples
|
|
|
//! - Scientific publications
|
|
|
|
|
|
+use std::{sync::Arc, thread};
|
|
|
+
|
|
|
use crate::{
|
|
|
callers::{
|
|
|
clairs::ClairS, deep_somatic::DeepSomatic, deep_variant::DeepVariant, nanomonsv::NanomonSV,
|
|
|
@@ -205,23 +207,60 @@ pub mod straglr;
|
|
|
/// ```
|
|
|
pub fn run_somatic_callers(id: &str, config: &Config) -> anyhow::Result<()> {
|
|
|
// ClairS - somatic SNV/indels with haplotype awareness
|
|
|
+ // First gives germlines for phasing/haplotagging
|
|
|
ClairS::initialize(id, config)?.run()?;
|
|
|
|
|
|
+ // if slurm send jobs in parallel else run caller sequentially
|
|
|
+ if config.slurm_runner {
|
|
|
+ let config = Arc::new(config.clone());
|
|
|
+ let id: Arc<str> = Arc::from(id);
|
|
|
+
|
|
|
+ let handles = vec![
|
|
|
+ {
|
|
|
+ let config = Arc::clone(&config);
|
|
|
+ let id = Arc::clone(&id);
|
|
|
+ thread::spawn(move || -> anyhow::Result<()> {
|
|
|
+ Severus::initialize(&id, &config)?.run()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ {
|
|
|
+ let config = Arc::clone(&config);
|
|
|
+ let id = Arc::clone(&id);
|
|
|
+ thread::spawn(move || -> anyhow::Result<()> {
|
|
|
+ Savana::initialize(&id, &config)?.run()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ {
|
|
|
+ let config = Arc::clone(&config);
|
|
|
+ let id = Arc::clone(&id);
|
|
|
+ thread::spawn(move || -> anyhow::Result<()> {
|
|
|
+ NanomonSV::initialize(&id, &config)?.run()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ {
|
|
|
+ let config = Arc::clone(&config);
|
|
|
+ let id = Arc::clone(&id);
|
|
|
+ thread::spawn(move || -> anyhow::Result<()> {
|
|
|
+ DeepSomatic::initialize(&id, &config)?.run()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ for h in handles {
|
|
|
+ h.join().expect("thread panicked")?;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Severus::initialize(id, config)?.run()?;
|
|
|
+ Savana::initialize(id, config)?.run()?;
|
|
|
+ NanomonSV::initialize(id, config)?.run()?;
|
|
|
+ }
|
|
|
+
|
|
|
// DeepVariant - germline variants for normal sample
|
|
|
DeepVariant::initialize(id, &config.normal_name, config)?.run()?;
|
|
|
|
|
|
// DeepVariant - germline variants for tumor sample
|
|
|
DeepVariant::initialize(id, &config.tumoral_name, config)?.run()?;
|
|
|
|
|
|
- // Severus - structural variants and VNTRs
|
|
|
- Severus::initialize(id, config)?.run()?;
|
|
|
-
|
|
|
- // Savana - haplotype-aware SVs and CNVs
|
|
|
- Savana::initialize(id, config)?.run()?;
|
|
|
-
|
|
|
- // NanomonSV - structural variants (paired analysis)
|
|
|
- NanomonSV::initialize(id, config)?.run()?;
|
|
|
-
|
|
|
// DeepSomatic - somatic SNV/indels
|
|
|
DeepSomatic::initialize(id, config)?.run()?;
|
|
|
|
|
|
@@ -240,6 +279,6 @@ mod tests {
|
|
|
fn callers_run_all() -> anyhow::Result<()> {
|
|
|
test_init();
|
|
|
let config = Config::default();
|
|
|
- run_somatic_callers("DUMCO", &config)
|
|
|
+ run_somatic_callers("CHAHA", &config)
|
|
|
}
|
|
|
}
|