From 0611956316fd70c0e951b9e7a8aff41412db2443 Mon Sep 17 00:00:00 2001 From: Pariksheet Nanda Date: Thu, 23 Mar 2017 10:28:44 -0400 Subject: [PATCH] ENH: Automate running the R scripts --- Makefile | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index b73c420..d750ff3 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ PYTHON := python RSCRIPT := Rscript TIME := command time --format "Completed in wall clock time [H:M:S]: %E" -# Make rule sources and targets +# Make rule sources, targets and helper functions SOURCES_img_raw := data/April_14_2016.tar.xz TARGETS_img_raw := data/April_14_2016 SOURCES_img_zproj := $(TARGETS_img_raw) @@ -53,12 +53,12 @@ $(CELLPROFILER_OPTS_COMMON) \ --pipeline=$(SOURCES_cellprofiler_commands) \ --run-headless endef -SOURCES_signif_wells := $(TARGETS_cellprofiler_db) +SOURCES_signif_wells := src/overlap-analysis.R $(TARGETS_cellprofiler_db) TARGETS_signif_wells := results/tables/rnai-p_values.csv -SOURCES_plot_overlap := $(TARGETS_signif_wells) -TARGETS_plot_overlap := $(addsuffix results/plots/,) -SOURCES_plot_plates := $(TARGETS_signif_wells) -TARGETS_plot_plates := $(addsuffix results/plots/,) +SOURCES_plot_overlap := src/plots.R $(TARGETS_signif_wells) +TARGETS_plot_overlap := results/plots/rnai-hist-signif.png +SOURCES_plot_plates := src/plot-plates.R $(TARGETS_signif_wells) +TARGETS_plot_plates := results/plots/stddev-scatter.png TARGETS_plots := $(TARGETS_plot_overlap) $(TARGETS_plot_plates) # Functions @@ -70,7 +70,7 @@ $(foreach path,$1,$(shell echo -n $(path) | sed 's#\(.*\)\.#\1%##')) endef .PHONY : all -all : z-projection cellprofiler plots ## (Default) Run full pipeline from image processing to plots. +all : z-projection cellprofiler stats plots ## (Default) Run full pipeline from image processing to plots. # Self-documenting help modified from # https://gist.github.com/prwhite/8168133#gistcomment-1737630 @@ -108,14 +108,19 @@ gui-cellprofiler : $(SOURCES_cellprofiler) ## Interactively run CellProfiler. $(TARGETS_img_filelist) : $(abspath $(SOURCES_img_filelist)) find $< -type f | sort > $@ +.PHONY : stats +stats : $(TARGETS_signif_wells) ## Find significant wells from cellprofiler measurements. +$(TARGETS_signif_wells) : $(SOURCES_signif_wells) + cd $(