Thomas 11 months ago
parent
commit
832f02a868
4 changed files with 432 additions and 211 deletions
  1. 389 175
      Cargo.lock
  2. 29 29
      Cargo.toml
  3. 8 5
      src/annotations/ncbi_gff.rs
  4. 6 2
      src/rna_seq.rs

File diff suppressed because it is too large
+ 389 - 175
Cargo.lock


+ 29 - 29
Cargo.toml

@@ -8,43 +8,43 @@ include = ["src/**/*"]
 
 [dependencies]
 log = "^0.4.22"
-env_logger = "^0.11.5"
-clap = { version = "^4.5.13", features = ["derive"] }
-anyhow = "^1.0.89"
-indicatif = {version = "0.17.8", features = ["rayon"]}
-indicatif-log-bridge = "0.2.2"
+env_logger = "^0.11.6"
+clap = { version = "^4.5.23", features = ["derive"] }
+anyhow = "^1.0.95"
+indicatif = {version = "0.17.9", features = ["rayon"]}
+indicatif-log-bridge = "0.2.3"
 num-integer = "0.1.46"
-serde = { version = "^1.0.204", features = ["derive"] }
+serde = { version = "^1.0.217", features = ["derive"] }
 confy = "0.6.1"
-hashbrown = { version = "0.14.5", features = ["rayon", "serde"] }
+hashbrown = { version = "0.15.2", features = ["rayon", "serde"] }
 serde_json = "1.0"
 bgzip = "0.3.1"
 rust-lapper = "1.1.0"
-csv = "1.3.0"
-statrs = "0.17.1"
-rust-htslib = "0.47.0"
-uuid = { version = "1.10.0", features = ["serde", "v4"] }
+csv = "1.3.1"
+statrs = "0.18.0"
+rust-htslib = "0.49.0"
+uuid = { version = "1.11.0", features = ["serde", "v4"] }
 prettytable-rs = "^0.10"
 noodles-core = "0.15.0"
-noodles-gff = "0.38.0"
-noodles-bgzf = "0.33.0"
-noodles-csi = "0.39.0"
-noodles-fasta = "0.43.0"
-noodles-sam = "0.64.0"
-noodles-bam = "0.67.0"
-noodles-vcf = "0.67.0"
-noodles-tabix = "0.45.0"
+noodles-gff = "0.41.0"
+noodles-bgzf = "0.34.0"
+noodles-csi = "0.41.0"
+noodles-fasta = "0.46.0"
+noodles-sam = "0.68.0"
+noodles-bam = "0.72.0"
+noodles-vcf = "0.70.0"
+noodles-tabix = "0.47.0"
 rayon = "1.10.0"
-serde_rusqlite = "0.35.0"
-dashmap = { version = "6.0.1", features = ["rayon", "serde"] }
-crossbeam-deque = "0.8.5"
+serde_rusqlite = "0.36.0"
+dashmap = { version = "6.1.0", features = ["rayon", "serde"] }
+crossbeam-deque = "0.8.6"
 trc = "1.2.4"
-pot = "=3.0.0"
-utoipa = "4.2.3"
-regex = "1.10.6"
+pot = "=3.0.1"
+utoipa = "5.3.1"
+regex = "1.11.1"
 pandora_lib_pileup = { git  = "https://git.t0m4.fr/Thomas/pandora_lib_pileup.git" }
-crossbeam-channel = "0.5.13"
-flate2 = "1.0.31"
+crossbeam-channel = "0.5.14"
+flate2 = "1.0.35"
 num-format = "0.4.4"
-postcard = { version = "1.0.8", features = ["alloc"] }
-charming = { version = "0.3.1", features = ["ssr"] }
+postcard = { version = "1.1.1", features = ["alloc"] }
+charming = { version = "0.4.0", features = ["ssr"] }

+ 8 - 5
src/annotations/ncbi_gff.rs

@@ -1,6 +1,6 @@
-use std::str::FromStr;
 use anyhow::{Context, Ok, Result};
-use serde::{Serialize, Deserialize};
+use serde::{Deserialize, Serialize};
+use std::str::FromStr;
 use utoipa::ToSchema;
 
 #[derive(Debug, PartialEq, Serialize, Deserialize, Clone, ToSchema)]
@@ -14,12 +14,15 @@ pub struct NCBIGFF {
     pub regulatory_class: Option<String>,
 }
 
-impl From<noodles_gff::Record> for NCBIGFF {
-    fn from(r: noodles_gff::Record) -> Self {
+impl From<noodles_gff::RecordBuf> for NCBIGFF {
+    fn from(r: noodles_gff::RecordBuf) -> Self {
         let attr = r.attributes();
 
         let inner_string = |name: &str| {
-            attr.get(name).map(|e| e.to_string())
+            attr.get(name).map(|e| match e {
+                noodles_gff::record_buf::attributes::field::Value::String(s) => s.to_string(),
+                noodles_gff::record_buf::attributes::field::Value::Array(v) => v.join(" "),
+            })
         };
 
         NCBIGFF {

+ 6 - 2
src/rna_seq.rs

@@ -25,13 +25,17 @@ pub fn find_monoallelics(
     let mut curr_gene = Gene::default();
     let mut contig = String::new();
 
-    for result in reader.records() {
+    for result in reader.record_bufs() {
         let record = result?;
         contig = record.reference_sequence_name().to_string();
 
         if record.ty() == "exon" {
             if let Some(gene) = record.attributes().get("gene") {
-                let gene_name = gene.to_string();
+                
+                let gene_name = match gene {
+                    noodles_gff::record_buf::attributes::field::Value::String(v) => v.to_string(),
+                    noodles_gff::record_buf::attributes::field::Value::Array(vec) => vec.join(" "),
+                };
                 if curr_gene.name != gene_name {
                     genes_by_contig
                         .entry(contig.clone())

Some files were not shown because too many files changed in this diff