My demo project ngsxml contains 6 fastq files. https://github.com/lindenb/ngsxml
A FastQC can be generated for each sample in parallel using make -j x
# 1 target
# 2 fastq files
define run_fastqc
$(1) : $(2) ${fastqc.exe}
mkdir -p $$(dir $$@) && \
cat $(2) > $$(addsuffix .tmp.gz,$$@) && \
${fastqc.exe} \
-o $$(dir $$@) \
-j ${java.exe} \
--format fastq --noextract \
$$(addsuffix .tmp.gz,$$@) && \
rm $$(addsuffix .tmp.gz,$$@) && \
mv $$(addsuffix .tmp_fastqc.zip,$$@) $$@
endef
(...)
all_fastqc : \
$(call project_dir,Proj1)/Samples/NA12878/FASTQC/NA12878.for_fastq.zip \
$(call project_dir,Proj1)/Samples/NA12878/FASTQC/NA12878.rev_fastq.zip \
$(call project_dir,Proj1)/Samples/NA12891/FASTQC/NA12891.for_fastq.zip \
$(call project_dir,Proj1)/Samples/NA12891/FASTQC/NA12891.rev_fastq.zip \
$(call project_dir,Proj1)/Samples/NA12892/FASTQC/NA12892.for_fastq.zip \
$(call project_dir,Proj1)/Samples/NA12892/FASTQC/NA12892.rev_fastq.zip
(...)
$(eval $(call run_fastqc,$(call project_dir,Proj1)/Samples/NA12878/FASTQC/NA12878.for_fastq.zip, test/fastq/NA12878_01_R1.fastq.gz test/fastq/NA12878_02_R1.fastq.gz))
$(eval $(call run_fastqc,$(call project_dir,Proj1)/Samples/NA12878/FASTQC/NA12878.rev_fastq.zip, test/fastq/NA12878_01_R2.fastq.gz test/fastq/NA12878_02_R2.fastq.gz))
If you have access to a cluster, you could use GNU parallel in combination with the multithreaded option to gain additional speed up.