Thomas před 1 rokem
rodič
revize
ddc5410ec4
5 změnil soubory, kde provedl 33 přidání a 13 odebrání
  1. 18 7
      jq_filters/jq_filters.jq
  2. 1 1
      src/config.rs
  3. 3 0
      src/lib.rs
  4. 8 1
      src/positions.rs
  5. 3 4
      src/variant/variant.rs

+ 18 - 7
jq_filters/jq_filters.jq

@@ -1,16 +1,27 @@
-def format:
-  del(.hash, .position)
-  | .vcf_variants[] |= (del(.hash,.position,.reference,.alternative) | .infos |= map(select(. != "Empty")));
-
-def n_alt_in_constit:
-	(.annotations | map(select(.ConstitAlt != null).ConstitAlt) // [0] | .[0]);
-
 def contig_to_num(contig):
   if contig == "chrX" then 23
   elif contig == "chrY" then 24
   elif contig == "chrM" then 25
   else (contig | ltrimstr("chr") | tonumber // 255) end;
 
+def num_to_contig(n_contig):
+  if n_contig == 23 then "chrX"
+  elif n_contig == 24 then "chrY"
+  elif n_contig == 25 then "chrM"
+  else (n_contig | "chr" + tostring // "other") end;
+
+def format:
+	. + {pos: .position} + . | del(.position) |
+	{position: (.pos.position + 1)} + . |
+	{contig: num_to_contig(.pos.contig)} + . |
+  del(.hash, .pos) |
+  .vcf_variants[] |= (del(.hash,.position,.reference,.alternative) |
+	.infos |= map(select(. != "Empty")));
+
+def n_alt_in_constit:
+	(.annotations | map(select(.ConstitAlt != null).ConstitAlt) // [0] | .[0]);
+
+
 def contig(contig_str):
 	.position.contig == contig_to_num(contig_str);
 

+ 1 - 1
src/config.rs

@@ -108,7 +108,7 @@ impl Default for Config {
 
             // DeepVariant
             deepvariant_output_dir: "{result_dir}/{id}/{time}/DeepVariant".to_string(),
-            deepvariant_threads: 155,
+            deepvariant_threads: 100,
             deepvariant_bin_version: "1.8.0".to_string(),
             deepvariant_model_type: "ONT_R104".to_string(),
             deepvariant_force: false,

+ 3 - 0
src/lib.rs

@@ -627,6 +627,9 @@ mod tests {
         )?;
         for bam in collections.bam.by_id_completed(15.0, 10.0).iter() {
             let id = &bam.id;
+            if id == "BANGA" {
+                continue;
+            }
             match Somatic::initialize(id, Config::default())?.run() {
                 Ok(_) => (),
                 Err(e) => error!("{e}"),

+ 8 - 1
src/positions.rs

@@ -1,3 +1,4 @@
+use core::panic;
 use std::{cmp::Ordering, fmt::Display, ops::Range, str::FromStr};
 
 use anyhow::Context;
@@ -50,9 +51,15 @@ impl TryFrom<(&str, &str)> for GenomePosition {
 
 impl From<VcfPosition> for GenomePosition {
     fn from(value: VcfPosition) -> Self {
+        let position = if value.position == 0 {
+            // position 0 is a variant inside telomeres
+            0
+        } else {
+            value.position - 1
+        };
         Self {
             contig: value.contig,
-            position: value.position - 1,
+            position,
         }
     }
 }

+ 3 - 4
src/variant/variant.rs

@@ -802,10 +802,9 @@ pub fn load_variants(
     iterable: &mut [CallerBox],
     annotations: &Annotations,
 ) -> anyhow::Result<Vec<VariantCollection>> {
-    // First, run all items in parallel
-    iterable
-        .par_iter_mut()
-        .try_for_each(|runner| runner.run())?;
+    // iterable
+    //     .iter_mut()
+    //     .try_for_each(|runner| runner.run())?;
 
     // Then, collect variants from all items in parallel
     let variants: Vec<VariantCollection> = iterable