@@ -240,24 +240,84 @@ rule dnds_plots:
240240 "../scripts/report/dnds_plots.R"
241241
242242
243- rule snp_plots :
243+ rule af_time_correlation_per_snp_data :
244244 conda : "../envs/renv.yaml"
245245 params :
246- design = config ["PLOTS" ],
247246 cor_method = config ["COR" ]["METHOD" ],
248- cor_exact = config ["COR" ]["EXACT" ]
247+ cor_exact = config ["COR" ]["EXACT" ],
249248 input :
250- vcf = OUTDIR / f"{ OUTPUT_NAME } .variants.tsv" ,
251- metadata = config ["METADATA" ]
249+ variants = OUTDIR / f"{ OUTPUT_NAME } .variants.tsv" ,
250+ metadata = config ["METADATA" ],
251+ output :
252+ fmt_variants = temp (OUTDIR / f"{ OUTPUT_NAME } .variants.filled.dated.tsv" ),
253+ correlations = report (REPORT_DIR_TABLES / "af_time_correlation_per_snp.csv" ), # fig 6
254+ log :
255+ LOGDIR / "af_time_correlation_per_snp_data" / "log.txt"
256+ script :
257+ "../scripts/report/af_time_correlation_per_snp_data.R"
258+
259+
260+ rule af_time_correlation_per_snp_plot :
261+ conda : "../envs/renv.yaml"
262+ params :
263+ design = config ["PLOTS" ],
264+ input :
265+ correlations = REPORT_DIR_TABLES / "af_time_correlation_per_snp.csv" ,
266+ output :
267+ plot = report (REPORT_DIR_PLOTS / "af_time_correlation_per_snp.png" ), # fig 6
268+ log :
269+ LOGDIR / "af_time_correlation_per_snp_plot" / "log.txt"
270+ script :
271+ "../scripts/report/af_time_correlation_per_snp_plot.R"
272+
273+
274+ rule af_trajectory_panel_data : # panel with AF trajectories in time
275+ # TODO
276+ conda : "../envs/renv.yaml"
277+ input :
278+ fmt_variants = OUTDIR / f"{ OUTPUT_NAME } .variants.filled.dated.tsv" ,
279+ correlations = REPORT_DIR_TABLES / "af_time_correlation_per_snp.csv" ,
280+ output :
281+ table = report (REPORT_DIR_TABLES / "af_trajectory_panel.csv" ), # fig 7
282+ log :
283+ LOGDIR / "af_trajectory_panel_data" / "log.txt"
284+ script :
285+ "../scripts/report/af_trajectory_panel_data.R"
286+
287+
288+ rule af_trajectory_panel_plot : # panel with AF trajectories in time
289+ # TODO
290+ conda : "../envs/renv.yaml"
291+ params :
292+ design = config ["PLOTS" ],
293+ input :
294+ table = REPORT_DIR_TABLES / "af_trajectory_panel.csv" ,
252295 output :
253- pseudovolcano = report (REPORT_DIR_PLOTS / "figure_6.png" ),
254- snp_panel = report (REPORT_DIR_PLOTS / "figure_7.png" ),
255- table_1 = report (REPORT_DIR_TABLES / "figure_6.csv" ),
256- table_2 = report (REPORT_DIR_TABLES / "figure_7.csv" )
296+ plot = report (REPORT_DIR_PLOTS / "af_trajectory_panel.png" ), # fig 7
257297 log :
258- LOGDIR / "snp_plots " / "log.txt"
298+ LOGDIR / "af_trajectory_panel_plot " / "log.txt"
259299 script :
260- "../scripts/report/snp_plots.R"
300+ "../scripts/report/af_trajectory_panel_plot.R"
301+
302+
303+ # rule snp_plots:
304+ # conda: "../envs/renv.yaml"
305+ # params:
306+ # design = config["PLOTS"],
307+ # cor_method = config["COR"]["METHOD"],
308+ # cor_exact = config["COR"]["EXACT"]
309+ # input:
310+ # vcf = OUTDIR/f"{OUTPUT_NAME}.variants.tsv",
311+ # metadata = config["METADATA"]
312+ # output:
313+ # pseudovolcano = report(REPORT_DIR_PLOTS/"figure_6.png"),
314+ # snp_panel = report(REPORT_DIR_PLOTS/"figure_7.png"),
315+ # table_1 = report(REPORT_DIR_TABLES/"figure_6.csv"),
316+ # table_2 = report(REPORT_DIR_TABLES/"figure_7.csv")
317+ # log:
318+ # LOGDIR / "snp_plots" / "log.txt"
319+ # script:
320+ # "../scripts/report/snp_plots.R"
261321
262322
263323rule summary_table :
@@ -284,8 +344,8 @@ rule report:
284344 fig_cor = report (REPORT_DIR_PLOTS / "figure_4.png" ),
285345 SNV = report (REPORT_DIR_PLOTS / "figure_5a.png" ),
286346 SNV_spike = report (REPORT_DIR_PLOTS / "figure_5b.png" ),
287- volcano = report (REPORT_DIR_PLOTS / "figure_6 .png" ),
288- panel = report (REPORT_DIR_PLOTS / "figure_7 .png" ),
347+ volcano = report (REPORT_DIR_TABLES / "af_time_correlation_per_snp .png" ),
348+ panel = report (REPORT_DIR_TABLES / "af_trajectory_panel .png" ),
289349 tree = report (REPORT_DIR_PLOTS / "allele_freq_tree.png" ),
290350 temest = report (REPORT_DIR_PLOTS / "time_signal.png" ),
291351 heat_table = report (REPORT_DIR_TABLES / "heatmap.csv" ),
0 commit comments