Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ENH: Use cellprofiler batch mode for multi-core processing
  • Loading branch information
pan14001 committed Mar 22, 2017
1 parent 0f827d9 commit a610ad4
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Makefile
Expand Up @@ -8,6 +8,7 @@

# Overwritable paths to executables
CELLPROFILER := cellprofiler
PARALLEL := parallel
PYTHON := python
RSCRIPT := Rscript

Expand All @@ -21,8 +22,15 @@ TARGETS_img_filelist := results/cellprofiler/filelist
SOURCES_cellprofiler_filelist := $(TARGETS_img_filelist)
SOURCES_cellprofiler_pipe := src/image-processing-pipeline.cpproj
SOURCES_cellprofiler_img := $(TARGETS_zproj)
SOURCES_cellprofiler := $(SOURCES_cellprofiler_filelist) \
$(SOURCES_cellprofiler_pipe) $(SOURCES_cellprofiler_img)
SOURCES_cellprofiler_common := $(SOURCES_cellprofiler_filelist) \
$(SOURCES_cellprofiler_img)
SOURCES_cellprofiler_gui := $(SOURCES_cellprofiler_common) \
$(SOURCES_cellprofiler_pipe)
SOURCES_cellprofiler_batch := $(SOURCES_cellprofiler_common)
TARGETS_cellprofiler_batch := results/cellprofiler/Batch_data.h5
SOURCES_cellprofiler_commands := $(TARGETS_cellprofiler_batch)
TARGETS_cellprofiler_commands := results/cellprofiler/batch_commands.sh
SOURCES_cellprofiler_headless := $(TARGETS_cellprofiler_commands)
TARGETS_cellprofiler_db := results/cellprofiler/all-plates.db
TARGETS_cellprofiler_prop := results/cellprofiler/all-plates.properties
TARGETS_cellprofiler := $(TARGETS_cellprofiler_db) $(TARGETS_cellprofiler_prop)
Expand Down Expand Up @@ -70,7 +78,13 @@ $(TARGETS_img_zproj) : $(SOURCES_img_zproj)

.PHONY : cellprofiler
cellprofiler : $(TARGETS_cellprofiler) ## Collect statistics about all images.
$(call singleton,$(TARGETS_cellprofiler)) : $(SOURCES_cellprofiler)
$(call singleton,$(TARGETS_cellprofiler)) : $(SOURCES_cellprofiler_headless)
$(PARALLEL) :::: $<

$(TARGETS_cellprofiler_commands) : $(SOURCES_cellprofiler_commands)
$(CELLPROFILER) --get-batch-commands=$< | sed 's#^CellProfiler#$(CELLPROFILER)#' > $@

$(TARGETS_cellprofiler_batch) : $(SOURCES_cellprofiler)
$(CELLPROFILER) $(CELLPROFILER_OPTS) --run-headless

.PHONY : gui-cellprofiler
Expand Down

0 comments on commit a610ad4

Please sign in to comment.