Re-factored the repository to automatically calculate QC on every flowcell. I also...
[htsworkflow.git] / htswanalysis / scripts / Flowcell_QC_Makefile
index 8f91e433a4fe9b836492fde10170e6a04ebdacb6..1c94fd02691bb0de73d9d13dd582925214297dec 100644 (file)
@@ -5,11 +5,15 @@ FLOWCELL=$(shell pwd | awk -F/ '{print $$NF}')
 FILES=$(shell ls -1d *.align*.txt)
 QPCR_FILES=$(shell ls -1d *.align*.txt | sed -e s/txt/txt.qPCR/)
 COUNT_FILES=$(shell ls -1d *.align*.txt | sed -e s/txt/txt.count/)
+CMPLX_FILES=$(shell ls -1d *.align*.txt | sed -e s/txt/txt.complexity/)
 PROFILE_FILES=$(shell ls -1d *.align*.txt | sed -e s/txt/txt.profile/)
 PROFILE_IMAGES=$(shell ls -1d *.align*.txt | sed -e s/txt/txt.profile.png/)
 PERCENT_BASE_IMAGES=$(shell ls -1d *.pf.txt.gz | sed -e s/pf.txt.gz/percent_base.png/)
 
-all: $(QPCR_FILES) $(PROFILE_FILES) $(PROFILE_IMAGES) $(PERCENT_BASE_IMAGES) $(COUNT_FILES) $(FILES) $(FLOWCELL)_qPCR_summary.txt $(FLOWCELL)_qPCR_summary.html $(FLOWCELL)_LibraryInfo.xml $(FLOWCELL)_SequencingSummary.html $(FLOWCELL)_QC_Summary.html
+all: $(QPCR_FILES) $(PROFILE_FILES) $(CMPLX_FILES) $(PROFILE_IMAGES) $(PERCENT_BASE_IMAGES) $(COUNT_FILES) $(FILES) $(FLOWCELL)_qPCR_summary.txt $(FLOWCELL)_qPCR_summary.html $(FLOWCELL)_LibraryInfo.xml $(FLOWCELL)_SequencingSummary.html $(FLOWCELL)_QC_Summary.html
+
+%.txt.complexity: %.txt
+       $(ROOT_DIR)/bin/complexity_count `basename $<` $< > $@
 
 %.txt.count: %.txt
        grep -v contam $< | awk '{if(NF > 3) {print $$1} }' | wc -l > $@;
@@ -44,5 +48,5 @@ $(FLOWCELL)_LibraryInfo.xml: $(COUNT_FILES)
 $(FLOWCELL)_SequencingSummary.html: $(FLOWCELL)_LibraryInfo.xml
        $(EXPTRACK_DIR)/scripts/SummarizeLibrary.pm $< > $@
 
-$(FLOWCELL)_QC_Summary.html: $(FLOWCELL)_SequencingSummary.html $(FLOWCELL)_qPCR_summary.html $(PROFILE_FILES)
+$(FLOWCELL)_QC_Summary.html: $(FLOWCELL)_SequencingSummary.html $(FLOWCELL)_qPCR_summary.html $(PROFILE_IMAGES) $(PERCENT_BASE_IMAGES)
        $(EXPTRACK_DIR)/scripts/WriteQCSummary.pm $(FLOWCELL)_LibraryInfo.xml $(FLOWCELL)_qPCR_summary.txt > $@;