Skip to content

Instantly share code, notes, and snippets.

@macmanes
Forked from lindenb/snippet.mk
Last active August 29, 2015 14:18
Show Gist options
  • Save macmanes/dfecd6603a9e111aa1fe to your computer and use it in GitHub Desktop.
Save macmanes/dfecd6603a9e111aa1fe to your computer and use it in GitHub Desktop.
define run_fastqc
$$(addsuffix .ok,$(1)) : $(1)
mkdir -p $$(dir $$@) ∧ \
unzip -p $$< $$(addsuffix .tmp_fastqc/fastqc_data.txt,$$(notdir $$<)) |\
grep ">>" | grep -v ">>END_MODULE" | cut -c 3- |\
awk -F ' ' 'BEGIN{N=0;} {if(($$$$1=="Basic Statistics" || $$$$1=="Per base sequence quality" || $$$$1=="Per base N content") ∧ $$$$2=="pass" ) N++;} END { if(N>2) {print "__PASS__"}}' |\
grep __PASS__ ∧ echo "FASTQC ok for $$<" $$@
$(1) : $(2)
mkdir -p $$(dir $$@) ∧ \
cat $$^ > $$(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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment