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 > $@;
$(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 > $@;