modified: diffout.py
[GalaxyCodeBases.git] / makefiles / sep.mk
blobdc262eb6d9b6422f5da30376f9d41823e6137553
1 INPUTPATH := fqrad
2 OUTPUTPREFIX := out
4 INF := $(patsubst %.1.cut.gz,%,$(foreach ONEINPUTPATH,$(INPUTPATH),$(wildcard $(ONEINPUTPATH)/*.1.cut.gz)))
6 OUTF := $(addprefix $(OUTPUTPREFIX)/,$(INF))
7 SEP1 := $(addsuffix _000000,$(OUTF))
8 SEP2 := $(addsuffix _210210,$(OUTF))
9 SEP3 := $(addsuffix _221210,$(OUTF))
11 PATHS := $(addprefix $(OUTPUTPREFIX)/,$(INPUTPATH))
13 NEEDED_COMMANDS := bc grep mkdir free gzip ./src/separatebytag.pl
15 all: $(SEP1) $(SEP2) $(SEP3)
16 @echo "[$(OUTF)]" "[$(INF)]" "[$@]" "[$(SAMMEM) $(FREEMEM)]"
17 date > $(OUTPUTPREFIX)/_alldone.log
19 check:
20 @for thecmd in $(NEEDED_COMMANDS); do \
21 if ! command -v "$${thecmd%% *}" >/dev/null 2>&1; then \
22 checkok="0"; \
23 echo "[x]'$${thecmd%% *}' not found."; \
24 fi; \
25 done; \
26 if [ "$${checkok}" == "0" ]; then \
27 echo "[!]Please install missing cmd(s) above."; \
28 exit -1; \
29 fi;
31 $(PATHS): check
32 mkdir -p $@
34 $(SEP1): $(PATHS)
35 $(eval IN := $(patsubst $(OUTPUTPREFIX)/%_000000,%,$@))
36 echo "$@" "$<" "$(IN)"
37 ./src/separatebytag.pl tigrad.lst 000000 $(IN).1.cut.gz $(IN).2.cut.gz $(@)
38 touch $@
40 $(SEP2): $(SEP1)
41 $(eval IN := $(patsubst %_210210,%,$@))
42 ./src/separatebytag.pl tigrad.lst 210210 $(IN)_000000.NA.Unknown.1.fq.gz $(IN)_000000.NA.Unknown.2.fq.gz $(@)
43 touch $@
45 $(SEP3): $(SEP2)
46 $(eval IN := $(patsubst %_221210,%,$@))
47 ./src/separatebytag.pl tigrad.lst 221210 $(IN)_210210.NA.Unknown.1.fq.gz $(IN)_210210.NA.Unknown.2.fq.gz $(@)
48 touch $@