浏览代码

filter variant cat

Thomas 10 月之前
父节点
当前提交
d230a27155
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/variant/variant_collection.rs

+ 9 - 0
src/variant/variant_collection.rs

@@ -318,6 +318,15 @@ impl Variants {
         debug!("Successfully loaded variants from {}", filename);
         Ok(variants)
     }
+
+    pub fn get_alteration_cat(&self, cat: AlterationCategory) -> Vec<Variant> {
+        self
+            .data
+            .iter()
+            .filter(|v| v.alteration_category().contains(&cat))
+            .cloned()
+            .collect()
+    }
 }
 
 fn create_variant(vcf_variants: Vec<VcfVariant>, annotations: &Annotations) -> Variant {