Thomas 1 年之前
父節點
當前提交
eaefae4807
共有 3 個文件被更改,包括 51 次插入205 次删除
  1. 7 174
      Cargo.lock
  2. 0 1
      Cargo.toml
  3. 44 30
      src/lib.rs

+ 7 - 174
Cargo.lock

@@ -99,21 +99,6 @@ dependencies = [
  "num-traits",
 ]
 
-[[package]]
-name = "arrayvec"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
-
-[[package]]
-name = "atomic-polyfill"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
-dependencies = [
- "critical-section",
-]
-
 [[package]]
 name = "autocfg"
 version = "1.3.0"
@@ -265,9 +250,9 @@ dependencies = [
 
 [[package]]
 name = "clap"
-version = "4.5.13"
+version = "4.5.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc"
+checksum = "c937d4061031a6d0c8da4b9a4f98a172fc2976dfb1c19213a9cf7d0d3c837e36"
 dependencies = [
  "clap_builder",
  "clap_derive",
@@ -275,9 +260,9 @@ dependencies = [
 
 [[package]]
 name = "clap_builder"
-version = "4.5.13"
+version = "4.5.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99"
+checksum = "85379ba512b21a328adf887e85f7742d12e96eb31f3ef077df4ffc26b506ffed"
 dependencies = [
  "anstream",
  "anstyle",
@@ -312,12 +297,6 @@ dependencies = [
  "cc",
 ]
 
-[[package]]
-name = "cobs"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15"
-
 [[package]]
 name = "colorchoice"
 version = "1.0.2"
@@ -358,12 +337,6 @@ dependencies = [
  "cfg-if",
 ]
 
-[[package]]
-name = "critical-section"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216"
-
 [[package]]
 name = "crossbeam-channel"
 version = "0.5.13"
@@ -541,12 +514,6 @@ version = "1.13.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
 
-[[package]]
-name = "embedded-io"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced"
-
 [[package]]
 name = "encode_unicode"
 version = "0.3.6"
@@ -661,15 +628,6 @@ dependencies = [
  "crunchy",
 ]
 
-[[package]]
-name = "hash32"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67"
-dependencies = [
- "byteorder",
-]
-
 [[package]]
 name = "hashbrown"
 version = "0.14.5"
@@ -691,20 +649,6 @@ dependencies = [
  "hashbrown",
 ]
 
-[[package]]
-name = "heapless"
-version = "0.7.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f"
-dependencies = [
- "atomic-polyfill",
- "hash32",
- "rustc_version 0.4.0",
- "serde",
- "spin",
- "stable_deref_trait",
-]
-
 [[package]]
 name = "heck"
 version = "0.5.0"
@@ -1071,7 +1015,7 @@ version = "0.1.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ac8cd24d9f185bb7223958d8c1ff7a961b74b1953fd05dba7cc568a63b3861ec"
 dependencies = [
- "rustc_version 0.1.7",
+ "rustc_version",
 ]
 
 [[package]]
@@ -1227,16 +1171,6 @@ dependencies = [
  "num-traits",
 ]
 
-[[package]]
-name = "num-format"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3"
-dependencies = [
- "arrayvec",
- "itoa",
-]
-
 [[package]]
 name = "num-integer"
 version = "0.1.46"
@@ -1309,7 +1243,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
 [[package]]
 name = "pandora_lib_pileup"
 version = "0.1.0"
-source = "git+https://git.t0m4.fr/Thomas/pandora_lib_pileup.git#e5408e038ff66c8c95e131ef34f89f6199e0799c"
+source = "git+https://git.t0m4.fr/Thomas/pandora_lib_pileup.git#896ce97f874980cdcc22f3c477454e714363caf3"
 dependencies = [
  "anyhow",
  "average",
@@ -1321,28 +1255,6 @@ dependencies = [
  "uuid",
 ]
 
-[[package]]
-name = "pandora_lib_scan"
-version = "0.1.0"
-source = "git+https://git.t0m4.fr/Thomas/pandora_lib_scan.git#76fb7d0974e211056fa250e83ec139a55d99d6a1"
-dependencies = [
- "anyhow",
- "crossbeam-channel",
- "env_logger",
- "flate2",
- "indicatif",
- "indicatif-log-bridge",
- "log",
- "num-format",
- "pandora_lib_pileup",
- "pandora_lib_variants 0.1.0 (git+https://git.t0m4.fr/Thomas/pandora_lib_variants.git)",
- "postcard",
- "rayon",
- "rust-htslib",
- "serde",
- "uuid",
-]
-
 [[package]]
 name = "pandora_lib_variants"
 version = "0.1.0"
@@ -1370,49 +1282,6 @@ dependencies = [
  "noodles-vcf",
  "num-integer",
  "pandora_lib_pileup",
- "pandora_lib_scan",
- "pot",
- "prettytable-rs",
- "rayon",
- "regex",
- "rust-htslib",
- "rust-lapper",
- "serde",
- "serde_json",
- "serde_rusqlite",
- "statrs",
- "trc",
- "utoipa",
- "uuid",
-]
-
-[[package]]
-name = "pandora_lib_variants"
-version = "0.1.0"
-source = "git+https://git.t0m4.fr/Thomas/pandora_lib_variants.git#a49815478eac792537b131854bd0b059afcb163f"
-dependencies = [
- "anyhow",
- "bgzip",
- "clap",
- "confy",
- "crossbeam-deque",
- "csv",
- "dashmap",
- "env_logger",
- "hashbrown",
- "indicatif",
- "indicatif-log-bridge",
- "log",
- "noodles-bam",
- "noodles-bgzf",
- "noodles-core",
- "noodles-csi",
- "noodles-fasta 0.42.0",
- "noodles-gff",
- "noodles-sam",
- "noodles-tabix",
- "noodles-vcf",
- "num-integer",
  "pot",
  "prettytable-rs",
  "rayon",
@@ -1465,18 +1334,6 @@ version = "1.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
 
-[[package]]
-name = "postcard"
-version = "1.0.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8"
-dependencies = [
- "cobs",
- "embedded-io",
- "heapless",
- "serde",
-]
-
 [[package]]
 name = "pot"
 version = "3.0.0"
@@ -1731,16 +1588,7 @@ version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
 dependencies = [
- "semver 0.1.20",
-]
-
-[[package]]
-name = "rustc_version"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
-dependencies = [
- "semver 1.0.23",
+ "semver",
 ]
 
 [[package]]
@@ -1776,12 +1624,6 @@ version = "0.1.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
 
-[[package]]
-name = "semver"
-version = "1.0.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
-
 [[package]]
 name = "serde"
 version = "1.0.205"
@@ -1858,15 +1700,6 @@ version = "1.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
 
-[[package]]
-name = "spin"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
-dependencies = [
- "lock_api",
-]
-
 [[package]]
 name = "stable_deref_trait"
 version = "1.2.0"

+ 0 - 1
Cargo.toml

@@ -42,5 +42,4 @@ trc = "1.2.4"
 pot = "=3.0.0"
 utoipa = "4.2.3"
 regex = "1.10.6"
-pandora_lib_scan = { git  = "https://git.t0m4.fr/Thomas/pandora_lib_scan.git" }
 pandora_lib_pileup = { git  = "https://git.t0m4.fr/Thomas/pandora_lib_pileup.git" }

+ 44 - 30
src/lib.rs

@@ -135,34 +135,48 @@ mod tests {
         Ok(())
     }
 
-    #[test]
-    fn phase() -> anyhow::Result<()> {
-        // init();
-        let id = "SALICETTO";
-        let contig = "chr1";
-        let logger =
-            env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info"))
-                .build();
-        let multi = MultiProgress::new();
-        LogWrapper::new(multi.clone(), logger).try_init().unwrap();
-
-        let phases = pandora_lib_scan::phase::load_phases(&format!(
-            "/data/longreads_basic_pipe/{id}/diag/phases/{id}_{contig}_phases.postcard.gz"
-        ))?;
-
-        let mut variants = Variants::new_from_bytes(
-            id,
-            &format!("/data/longreads_basic_pipe/{id}/diag/{id}_variants.bytes.gz"),
-            multi,
-        )?;
-
-        variants.phase_contig(
-            &phases,
-            &format!("/data/longreads_basic_pipe/{id}/diag/{id}_diag_hs1.bam",),
-            contig,
-        );
-        let n_phased = variants.with_annotation(&AnnotationType::Phase(annotations::phase::Phase{id: "".to_string()})).len();
-        info!("{n_phased} variants phased");
-        Ok(())
-    }
+    // #[test]
+    // fn phase() -> anyhow::Result<()> {
+    //     // init();
+    //     let id = "SALICETTO";
+    //     let contig = "chr1";
+    //     let logger =
+    //         env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info"))
+    //             .build();
+    //     let multi = MultiProgress::new();
+    //     LogWrapper::new(multi.clone(), logger).try_init().unwrap();
+    //
+    //     let phases = pandora_lib_scan::phase::load_phases(&format!(
+    //         "/data/longreads_basic_pipe/{id}/diag/phases/{id}_{contig}_phases.postcard.gz"
+    //     ))?;
+    //
+    //     let mut variants = Variants::new_from_bytes(
+    //         id,
+    //         &format!("/data/longreads_basic_pipe/{id}/diag/{id}_variants.bytes.gz"),
+    //         multi,
+    //     )?;
+    //
+    //     variants.phase_contig(
+    //         &phases,
+    //         &format!("/data/longreads_basic_pipe/{id}/diag/{id}_diag_hs1.bam",),
+    //         contig,
+    //     );
+    //     let phased = variants.with_annotation(&AnnotationType::Phase(annotations::phase::Phase{id: "".to_string()}));
+    //     let n_phased = phased.len();
+    //     info!("{n_phased} variants phased");
+    //
+    //     for v in phased {
+    //         let phases_ids: Vec<String> = v.annotations.iter().flat_map(|a| {
+    //             if let AnnotationType::Phase(p) = a {
+    //                 vec![p.id.to_string()]
+    //             } else {
+    //                 vec![]
+    //             }
+    //         }).collect();
+    //         if phases_ids.len() > 1 {
+    //             println!("{}:{}\t{}", v.contig, v.position, phases_ids.join("|"));
+    //         }
+    //     }
+    //     Ok(())
+    // }
 }