Thomas il y a 6 heures
Parent
commit
65a90d09ee
2 fichiers modifiés avec 12 ajouts et 12 suppressions
  1. 4 0
      Cargo.lock
  2. 8 12
      src/annotation/dbsnp.rs

+ 4 - 0
Cargo.lock

@@ -1376,6 +1376,8 @@ dependencies = [
 [[package]]
 name = "hts-sys"
 version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e38d7f1c121cd22aa214cb4dadd4277dc5447391eac518b899b29ba6356fbbb2"
 dependencies = [
  "bindgen",
  "bzip2-sys",
@@ -2628,6 +2630,8 @@ dependencies = [
 [[package]]
 name = "rust-htslib"
 version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f22161678c3d72e6434c5f3383325dbf88c3cacce665f0c7b4b077fc6e957ba9"
 dependencies = [
  "bio-types",
  "byteorder",

+ 8 - 12
src/annotation/dbsnp.rs

@@ -12,11 +12,6 @@ use crate::{
     variant::vcf_variant::{Info, VcfVariant},
 };
 
-
-// TODO;
-// handle: chr5    141739987       rs1754540290    G       A       .       PASS    GENEINFO=PCDHB13:56123;NSM;RS=1754540290;SSR=0;VC=SNV;dbSNPBuildID=155
-
-
 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Encode, Decode)]
 pub struct DbSnpFreqEntry {
     pub source: String,
@@ -192,13 +187,14 @@ pub fn annotate_dbsnp(
                             None
                         }
                     });
-                    if let Some(freq) = freq {
-                        annotations.insert_update(
-                            variant.hash,
-                            &[Annotation::DbSnp(dv.id.clone(), freq)],
-                        );
-                        break;
-                    }
+                    annotations.insert_update(
+                        variant.hash,
+                        &[Annotation::DbSnp(
+                            dv.id.clone(),
+                            freq.unwrap_or(DbSnpFreq(Vec::new())),
+                        )],
+                    );
+                    break;
                 }
             }
         },