Browse Source

tmp removed typst

Thomas 9 months ago
parent
commit
1eedb2d7ef
6 changed files with 297 additions and 2035 deletions
  1. 224 2003
      Cargo.lock
  2. 12 5
      Cargo.toml
  3. 1 6
      src/cytoband.rs
  4. 1 1
      src/lib.rs
  5. 3 3
      src/report.rs
  6. 56 17
      typst_template/template.typ

File diff suppressed because it is too large
+ 224 - 2003
Cargo.lock


+ 12 - 5
Cargo.toml

@@ -5,8 +5,15 @@ edition = "2021"
 
 [dependencies]
 anyhow = "1.0.89"
-typst = "0.11.1"
-typst-as-lib = { version = "0.8.0", features = ["packages"] }
-typst-pdf = "0.11.1"
-ureq = "2.10.1"
-usvg = "0.44.0"
+# typst = "0.13.0"
+# typst-as-lib = { version = "0.14.1", features = ["packages", "edition2024"] }
+# typst-pdf = "0.13.0"
+ureq = "3.0.7"
+usvg = "0.45.0"
+
+# anyhow = "1.0.89"
+# typst = "0.11.1"
+# typst-as-lib = { version = "0.8.0", features = ["packages"] }
+# typst-pdf = "0.11.1"
+# ureq = "2.10.1"
+# usvg = "0.44.0"

+ 1 - 6
src/cytoband.rs

@@ -80,13 +80,8 @@ fn calculate_svg_config(width: u32, height: u32, additional_rects: &[AdditionalR
         rect_height,
     }
 }
-fn generate_svg_header(config: &SvgConfig) -> String {
-    let svg_width = config.width + 100;
-    let svg_height = config.height + 100;
-    let circle_radius = (config.height as f64) / 2.0;
-    let rect_height = config.rect_height as f64;
-    let path_radius = circle_radius + rect_height / 2.0;
 
+fn generate_svg_header(config: &SvgConfig) -> String {
     format!(
         r#"<svg width="{}" height="{}" xmlns="http://www.w3.org/2000/svg">
         <defs>

+ 1 - 1
src/lib.rs

@@ -89,7 +89,7 @@ mod tests {
 
     #[test]
     fn pdf() {
-        compile_typst_report("RIVOALEN").unwrap();
+        compile_typst_report("LEVASSEUR").unwrap();
         // write_report("/data/test.pdf");
     }
 }

+ 3 - 3
src/report.rs

@@ -1,8 +1,8 @@
 use std::process::Command;
 
-use typst::foundations::{Bytes, Dict, Smart};
-use typst::text::Font;
-use typst_as_lib::TypstTemplate;
+// use typst::foundations::{Bytes, Dict, Smart};
+// use typst::text::Font;
+// use typst_as_lib::TypstTemplate;
 
 // pub fn write_report(path: &str) {
 //     let font = include_bytes!("../typst_template/fonts/unicode.futurab.ttf");

+ 56 - 17
typst_template/template.typ

@@ -740,12 +740,33 @@
     numbering("1.1", ..numbers.pos().slice(1))
   }
 })
-
+#set list(marker: [---])
 #heading(level: 1, outlined: false)[Whole Genome Sequencing Report]
 
 #outline(title: "Table of Contents", depth: 3)
 #pagebreak()
-== Identity
+
+== Interprétation
+#v(0.5cm)
+
+#let scoped-content = {
+
+  show heading: it => {
+    set text(font: "FreeSans", size: 14pt)
+    align(left, it)
+    v(5pt)
+  }
+
+  cmarker.render(
+    read(sys.inputs.base + "/diag/report/" + sys.inputs.id + "_conclusion.md"), h1-level: 4,
+  )
+}
+
+#scoped-content
+
+#pagebreak()
+
+== Sample identity
 #sys.inputs.id
 
 == Alignement
@@ -779,14 +800,6 @@
   )
 ]
 
-=== Coverage by chromosome
-==== Proportion at given depth by chromosome
-#reportCoverage(sys.inputs.base + "/diag/report/data/scan/" + sys.inputs.id)
-#set footnote(numbering: n => {
-  " "
-})
-#footnote[Values computed by Pandora development version]
-
 == Variants
 === Variants calling
 #pagebreak()
@@ -831,6 +844,11 @@
 #pagebreak()
 
 === Selected Variants
+==== Classification 
+- Pathogenic: experimentally proved that the variant participate in the oncogenic process.
+- Likely pathogenic: gene or variant that could be linked to the oncogenic process in bibliography.
+- Unknown significance: somatic variant without more information.
+
 ==== Pathogenics
 #variants(
   sys.inputs.base + "/diag/report/data/" + sys.inputs.id + "_annot_variants.json",
@@ -843,16 +861,37 @@
   interpretation: "PROBPATHO",
 )
 
-==== Variants of uncertain significance
+==== Variants of Unknown Significance
 #variants(
   sys.inputs.base + "/diag/report/data/" + sys.inputs.id + "_annot_variants.json",
   interpretation: "US",
 )
 
-#pagebreak()
-== Conclusion
-#v(0.5cm)
+== Coverage by chromosome
+=== Proportion at given depth by chromosome
+#reportCoverage(sys.inputs.base + "/diag/report/data/scan/" + sys.inputs.id)
+#set footnote(numbering: n => {
+  " "
+})
+#footnote[Values computed by Pandora development version]
 
-#cmarker.render(
-  read(sys.inputs.base + "/diag/report/" + sys.inputs.id + "_conclusion.md"),
-)
+== Method
+=== Sample preparation and sequencing
++ DNA sampling and collection in EDTA tubes.
++ Buffy coat: pooling of multiple EDTA tubes then centrifugation (1200 rpm 10 minutes).
++ DNA extraction according to Maxwell® Promega RSC Buffy Coat DNA Kit.
++ Nanodrop DNA quantification.
++ DNA shearing: 3µg of DNA mechanically sheared by Covaris g-TUBE (8000 rpm, 1 minute).
++ DNA size qualification aiming a median of 10 kb determined by TapeStation.
++ Libary was constructed following the Oxford Nanopore Technologies Ligation Sequencing Kit V14 (SQK-LSK114) protocol with 1.5 µg as input DNA.
++ Qubit quantification
++ After evaluation of flowcell (rev 10) for pore availability (> 6000 available pores). Two distinct barcoded libraries were pooled for each flowcell.
++ sequencing run was initiated and controlled using MinKNOW software (sequencing 80 hours, data output format: Raw pod5 files).
+
+=== Bioinformatic analysis
++ Orchestration and global analysis realized by in-house software (source code is accessible at Github).
++ Basecalling and alignment: dorado v0.8.2 with parameters "sup,5mC_5hmC --trim all" with alignment on hs1 genome (T2T chm13v2.0).
++ Variant calling was realized with ClairS v0.4.0, DeepVariant v1.6.1, DeepSomatic v1.7.0, Nanomonsv v0.7.2.
++ Variants filtering and merging done with in-house software.
++ Annotation: ensembl-VEP 112 with gene features defined by RefSeq Liftoff v5.1. SNP from gnomAD_4-2022_10 and Cosmic v99.
++ Interpretation and report generation performed on a local web service also published in open source.

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