Explorar el Código

Use all raster images for presentation

This ensures compatibility with potential HTML slide output
Ryan C. Thompson hace 5 años
padre
commit
ee4ac1744a
Se han modificado 2 ficheros con 30 adiciones y 12 borrados
  1. 20 2
      Snakefile
  2. 10 10
      presentation.mkdn

+ 20 - 2
Snakefile

@@ -309,10 +309,20 @@ rule pdf_crop:
     shell: 'pdfcrop --resolution 300 {input:q} {output:q}'
 
 rule pdf_raster:
-    '''Rasterize PDF to PNG at 600 PPI.'''
+    '''Rasterize PDF to PNG at 600 PPI.
+
+    The largest dimension is scaled '''
     input: pdf = 'graphics/{basename}.pdf'
     output: png = 'graphics/{basename}-RASTER.png'
-    shell: 'pdftoppm -r 600 {input:q} | convert - {output:q}'
+    shell: 'pdftoppm -singlefile -r 600 {input:q} | convert - {output:q}'
+
+rule pdf_raster_res:
+    '''Rasterize PDF to PNG at specific PPI.
+
+    The largest dimension is scaled '''
+    input: pdf = 'graphics/{basename}.pdf'
+    output: png = 'graphics/{basename}-RASTER{res,[1-9][0-9]+}.png'
+    shell: 'pdftoppm -singlefile -r {wildcards.res} {input:q} | convert - {output:q}'
 
 rule png_crop:
     '''Crop away empty margins from a PNG.'''
@@ -334,6 +344,14 @@ rule svg_to_pdf:
         outfile = os.path.join(os.path.abspath("."), output[0])
         shell('''inkscape {infile:q} --export-pdf={outfile:q} --export-dpi=300''')
 
+rule svg_raster:
+    input: 'graphics/{filename}.svg'
+    output: 'graphics/{filename}-SVG.png'
+    run:
+        infile = os.path.join(os.path.abspath("."), input[0])
+        outfile = os.path.join(os.path.abspath("."), output[0])
+        shell('''inkscape {infile:q} --export-png={outfile:q} --export-dpi=300''')
+
 rule R_to_html:
     '''Render an R script as syntax-hilighted HTML.'''
     input: '{dirname}/{basename}.R'

+ 10 - 10
presentation.mkdn

@@ -23,7 +23,7 @@
 
 ## Organ transplants are a life-saving treatment for many
 
-![Organ donation statistics for the USA in 2018[^2]](graphics/presentation/transplants-organ-CROP.pdf){ height=70% }
+![Organ donation statistics for the USA in 2018[^2]](graphics/presentation/transplants-organ-CROP-RASTER.png){ height=70% }
 
 [^2]: Source: https://www.organdonor.gov/statistics-stories/statistics.html
 
@@ -94,7 +94,7 @@ and memory $\mathsf{CD4}^{+}$ T-cell activation
 
 ## Memory cells: faster, stronger, and more independent
 
-![Memory T-cells proliferate and respond more quickly](graphics/presentation/T-cells-SVG.pdf)
+![Memory T-cells proliferate and respond more quickly](graphics/presentation/T-cells-SVG.png)
 
 ## Memory cells are a problem for immune suppression
 
@@ -156,15 +156,15 @@ Data generated by Sarah Lamere, published in GEO as
 
 ## A few intermediate analysis steps are required
 
-![Flowchart of workflow for data analysis](graphics/CD4-csaw/rulegraphs/rulegraph-all.pdf)
+![Flowchart of workflow for data analysis](graphics/CD4-csaw/rulegraphs/rulegraph-all-RASTER300.png)
 
 ## Histone modifications are observed on consecutive histones
 
-![Strand cross-correlation plots](graphics/CD4-csaw/csaw/CCF-plots-PAGE2-CROP.pdf)
+![Strand cross-correlation plots](graphics/CD4-csaw/csaw/CCF-plots-PAGE2-CROP-RASTER.png)
 
 ## Histone modifications are observed on consecutive histones
 
-![ChIP-seq coverage in IL2 gene[^5]](graphics/presentation/LaMere-thesis-fig3.9-SVG-CROP.pdf){ height=70% }
+![ChIP-seq coverage in IL2 gene[^5]](graphics/presentation/LaMere-thesis-fig3.9-SVG-CROP.png){ height=70% }
 
 [^5]: Sarah LaMere. "Dynamic epigenetic regulation of CD4 T cell activation and memory formation". PhD thesis. TSRI, 2015.
 
@@ -175,18 +175,18 @@ Data generated by Sarah Lamere, published in GEO as
 * Use Irreducible Discovery Rate framework to identify peaks that are
   called consistently across multiple donors
 
-![Peak-calling summary statistics](graphics/presentation/RCT-thesis-table2.2-SVG-CROP.pdf)
+![Peak-calling summary statistics](graphics/presentation/RCT-thesis-table2.2-SVG-CROP.png)
 
 
 ## Each histone mark has an "effective promoter radius"
 
-![Enrichment of peaks near promoters](graphics/CD4-csaw/Promoter-Peak-Distance-Profile-PAGE1-CROP.pdf)
+![Enrichment of peaks near promoters](graphics/CD4-csaw/Promoter-Peak-Distance-Profile-PAGE1-CROP-RASTER.png)
 
 ## Peaks in promoters are correlated with gene expression
 
 <!-- TODO: Pull out one column and rotate it -->
 
-![Expression distributions of genes with and without promoter peaks](graphics/CD4-csaw/FPKM-by-Peak-Violin-Plots-CROP.pdf)
+![Expression distributions of genes with and without promoter peaks](graphics/CD4-csaw/FPKM-by-Peak-Violin-Plots-CROP-RASTER.png)
 
 ## The story so far
 
@@ -261,7 +261,7 @@ presence or absence anywhere within the promoter?
 
 ## Differential modification disappears by Day 14
 
-![Differential modification between naïve and memory samples at each time point](graphics/presentation/RCT-thesis-table2.4-SVG-CROP.pdf)
+![Differential modification between naïve and memory samples at each time point](graphics/presentation/RCT-thesis-table2.4-SVG-CROP.png)
 
 ## Convergence at Day 14 H3K4me2
 
@@ -300,7 +300,7 @@ presence or absence anywhere within the promoter?
 
 <!-- ## Slide -->
 
-<!-- ![(Insert figure legend)](graphics/CD4-csaw/LaMere2016_fig8.pdf) -->
+<!-- ![(Insert figure legend)](graphics/CD4-csaw/LaMere2016_fig8-RASTER.png) -->
 
 
 ## Takeaway 1: Each histone mark has an "effective promoter radius"