-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopyFiles.mak
More file actions
79 lines (61 loc) · 2.72 KB
/
Copy pathCopyFiles.mak
File metadata and controls
79 lines (61 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copy final marker .tsv, .plot.pdf, and .plot.png files from directory given by
# the parameter file given by argument PARAMS= to the saveOutputFiles directory,
# same subdirectory name as given by DIR_IGGPIPE_OUT in the PARAMS= file, but
# with simpler file names.
# Delete created files if error occurs creating them.
.DELETE_ON_ERROR:
# Run all commands of a target build using a single shell invocation.
.ONESHELL:
# We will use secondary expansion.
.SECONDEXPANSION:
# Use this shell.
SHELL=/bin/sh
# Some useful variables.
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
INDENT := $(EMPTY) $(EMPTY)
# Cancel C-compiler implicit rules.
% : %.cpp
%.o : %.cpp
% : %.o
# Include parameter definition file.
include $(PARAMS)
# Get suffix of parameter definition file, which becomes part of the name of the
# copied files.
PARAM_SFX := $(patsubst allParameters.%,%,$(PARAMS))
# If variable PARAMS is not defined, show basic usage info, else do the copy.
ifeq ($(PARAMS),)
all:
@echo "This copies some of the output files from a specified IGGPIPE run to"
@echo "a subfolder within folder saveOutputFiles. To use this, specify the"
@echo "parameters file whose output files are to be copied as the PARAMS="
@echo "argument, as follows:"
@echo
@echo "$(INDENT)make -f CopyFiles.mak PARAMS=allParameters.test"
@echo
else
# The full name of the counts plot output file.
MARKER_COUNTS_FILE := $(PFX_MARKER_COUNTS_PATH).plot.pdf
# Names of all density plot files and all copied-to names.
DENSITY_PLOT_FILES := $(foreach G,$(GENOME_LETTERS),$(PFX_MARKER_DENSITY_PATH)_$(G).plot.png)
COPIED_DENSITY_PLOT_FILES := $(foreach G,$(GENOME_LETTERS),MarkerDensity_$(G).$(PARAM_SFX).plot.png)
# Define variables DENSITY_x := #, where x = a genome letter, equal to that density plot .plot.png file.
$(foreach G,$(GENOME_LETTERS),$(eval DENSITY_$(G) := $(PFX_MARKER_DENSITY_PATH)_$(G).plot.png))
# The output directory to copy files to.
COPY_TO := saveOutputFiles/$(DIR_IGGPIPE_OUT)
all: $(COPIED_DENSITY_PLOT_FILES) $(PATH_OVERLAPPING_MARKERS_FILE) \
$(PATH_NONOVERLAPPING_MARKERS_FILE) $(MARKER_COUNTS_FILE) | $(COPY_TO)
@cp $(PATH_OVERLAPPING_MARKERS_FILE) $(COPY_TO)/MarkersOverlapping.$(PARAM_SFX).tsv
@cp $(PATH_NONOVERLAPPING_MARKERS_FILE) $(COPY_TO)/MarkersNonoverlapping.$(PARAM_SFX).tsv
@cp $(MARKER_COUNTS_FILE) $(COPY_TO)/MarkerCounts.$(PARAM_SFX).plot.pdf
$(COPY_TO):
@mkdir -p $(COPY_TO)
$(COPIED_DENSITY_PLOT_FILES) : MarkerDensity_%.$(PARAM_SFX).plot.png : $(DENSITY_PLOT_FILES)
cp $(DENSITY_$*) $(COPY_TO)/$@
endif
# Remove the destination files.
clean:
-rm $(COPY_TO)/MarkersOverlapping.$(PARAM_SFX).tsv
-rm $(COPY_TO)/MarkersNonoverlapping.$(PARAM_SFX).tsv
-rm $(COPY_TO)/MarkerCounts.$(PARAM_SFX).plot.pdf
-rm $(COPY_TO)/$(COPIED_DENSITY_PLOT_FILES)