Skip to content

Commit 4d91742

Browse files
committed
Parametrize remaining plot size
1 parent 16523fc commit 4d91742

4 files changed

Lines changed: 17 additions & 11 deletions

File tree

workflow/rules/report.smk

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ rule polymorphic_sites_over_time_plot:
130130
conda: "../envs/renv.yaml"
131131
params:
132132
design = config["PLOTS"],
133+
plot_width_mm = 159.2,
134+
plot_height_mm = 119.4,
133135
input:
134136
table = REPORT_DIR_PLOTS/"polymorphic_sites_over_time.csv",
135137
output:
@@ -183,8 +185,8 @@ rule nv_panel_plot:
183185
params:
184186
design = config["PLOTS"],
185187
window_step = config["WINDOW"]["STEP"],
186-
plot_height_mm = 250,
187-
plot_width_mm = 240,
188+
plot_height_mm = 250.0,
189+
plot_width_mm = 240.0,
188190
input:
189191
panel = REPORT_DIR_TABLES/"nv_panel.csv",
190192
window = REPORT_DIR_TABLES/"window.csv",
@@ -336,7 +338,9 @@ rule time_signal_plot:
336338
rule dnds_plots:
337339
conda: "../envs/renv.yaml"
338340
params:
339-
design = config["PLOTS"]
341+
design = config["PLOTS"],
342+
plot_height_mm = 119.4,
343+
plot_width_mm = 159.2,
340344
input:
341345
table = REPORT_DIR_TABLES/"dnds.csv",
342346
output:
@@ -370,6 +374,8 @@ rule af_time_correlation_plot:
370374
conda: "../envs/renv.yaml"
371375
params:
372376
design = config["PLOTS"],
377+
plot_height_mm = 119.4,
378+
plot_width_mm = 159.2,
373379
input:
374380
correlations = REPORT_DIR_TABLES/"af_time_correlation.csv",
375381
output:

workflow/scripts/report/af_time_correlation_plot.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ p <- correlations %>%
4343
ggsave(
4444
filename = snakemake@output$plot,
4545
plot = p,
46-
width = 159.2,
47-
height = 119.4,
46+
width = snakemake@params$plot_width_mm,
47+
height = snakemake@params$plot_height_mm,
4848
units = "mm",
4949
dpi = 250
5050
)

workflow/scripts/report/dnds_plots.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ p.dn.ds <- plot.df %>%
5353
ggsave(
5454
filename = snakemake@output$plot_dn_ds,
5555
plot = p.dn.ds,
56-
width = 159.2,
57-
height = 119.4,
56+
width = snakemake@params$plot_width_mm,
57+
height = snakemake@params$plot_height_mm,
5858
units = "mm",
5959
dpi = 250
6060
)
@@ -78,8 +78,8 @@ p.omega <- plot.df %>%
7878
ggsave(
7979
filename = snakemake@output$plot_omega,
8080
plot = p.omega,
81-
width = 159.2,
82-
height = 119.4,
81+
width = snakemake@params$plot_width_mm,
82+
height = snakemake@params$plot_height_mm,
8383
units = "mm",
8484
dpi = 250
8585
)

workflow/scripts/report/polymorphic_sites_over_time_plot.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ log_info("Saving plot")
3535
ggsave(
3636
filename = snakemake@output$plot,
3737
plot = p,
38-
width = 250,
39-
height = 119.4,
38+
width = snakemake@params$plot_width_mm,
39+
height = snakemake@params$plot_height_mm,
4040
units = "mm",
4141
dpi = 250
4242
)

0 commit comments

Comments
 (0)