Răsfoiți Sursa

Annotation::VNTR

Thomas 7 luni în urmă
părinte
comite
49a95012cf
2 a modificat fișierele cu 10 adăugiri și 6 ștergeri
  1. 4 0
      src/annotation/mod.rs
  2. 6 6
      src/pipes/somatic.rs

+ 4 - 0
src/annotation/mod.rs

@@ -81,6 +81,8 @@ pub enum Annotation {
     CpG,
 
     LowMAPQ,
+
+    VNTR
 }
 
 /// Denotes the biological sample type associated with a variant call.
@@ -204,6 +206,7 @@ impl fmt::Display for Annotation {
             Annotation::LowEntropy => "LowEntropy".into(),
             Annotation::VEP(_) => "VEP".into(),
             Annotation::CpG => "CpG".into(),
+            Annotation::VNTR => "VNTR".into(),
             Annotation::TriNucleotides(bases) => format!(
                         "Trinucleotides({})",
                         bases.iter().map(|b| b.to_string()).collect::<String>(),
@@ -358,6 +361,7 @@ impl Annotations {
                     | Annotation::ReplicationTiming(_)
                     | Annotation::HighDepth
                     | Annotation::CpG
+                    | Annotation::VNTR
                     | Annotation::Panel(_)
                     | Annotation::LowMAPQ
                     | Annotation::HighConstitAlt => categorical.push(ann.to_string()),

+ 6 - 6
src/pipes/somatic.rs

@@ -1,12 +1,8 @@
 use crate::{
-    annotation::is_gnomad_and_constit_alt,
-    collection::ShouldRun,
-    create_should_run_normal_tumoral, init_solo_callers_normal_tumoral,
-    scan::scan::SomaticScan,
-    variant::{
+    annotation::is_gnomad_and_constit_alt, collection::ShouldRun, create_should_run_normal_tumoral, init_solo_callers_normal_tumoral, io::bed::read_bed, positions::GenomeRange, scan::scan::SomaticScan, variant::{
         variant::{run_if_required, ShouldRunBox},
         variants_stats::somatic_depth_quality_ranges,
-    },
+    }
 };
 use anyhow::Context;
 use itertools::Itertools;
@@ -482,6 +478,10 @@ impl Run for SomaticPipe {
 
         // Ensure sorted (should already be sorted) and save
         variants.sort();
+
+        let vntrs: Vec<GenomeRange> = read_bed("/data/ref/hs1/vntrs_chm13.bed")?.iter().map(|r| r.range.clone()).collect();
+        variants.annotate_with_ranges(&vntrs, Some(Annotation::VNTR), 0, Vec::new());
+
         variants.save_to_json(&result_json)?;
         variants.save_to_file(&result_bit)?;
         variants.write_vcf(&result_vcf, &config.dict_file, config.somatic_pipe_force)?;