File: Makefile

package info (click to toggle)
snippy 4.6.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,348 kB
  • sloc: perl: 1,420; makefile: 55; sh: 24
file content (61 lines) | stat: -rw-r--r-- 1,606 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
SHELL := /bin/bash
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --no-builtin-variables

.SUFFIXES:
.DELETE_ON_ERROR:
.SECONDARY:
.ONESHELL:
.DEFAULT: all

CPUS = 2
RAM = 2

SNIPPY = ../bin/snippy --cpus $(CPUS) --ram $(RAM)
SNIPPYCORE = ../bin/snippy-core
R1 = reads_R1.fastq.gz
R2 = reads_R2.fastq.gz
WGSIM = wgsim

GBK=example.gbk
REF=example.fna
BED=example.bed

all: core.txt
	wc -l S?/snps.tab

core.txt : S1/snps.tab S2/snps.tab S3/snps.tab S4/snps.tab
	$(SNIPPYCORE) --prefix core --ref $(REF) S1 S2 S3 S4
	$(SNIPPYCORE) --prefix core-mask --ref $(REF) --mask $(BED) S1 S2 S3 S4

%/snps.tab : %/R1.fq %/R2.fq
	$(SNIPPY) --force --ref $(REF) --outdir $(@D) --R1 $(word 1,$^) --R2 $(word 2,$^)

%/R1.fq %/R2.fq : $(REF)
	mkdir -p $(@D)
	$(WGSIM) -S $(shell echo $(@D) | sed 's/[^0-9]//g') \
	         -h -r 0.005 -N 12000 -1 100 -2 100 -d 200 \
	         $< $(@D)/R1.fq $(@D)/R2.fq > $(@D)/dwgsim.tab

%.fna : %.gbk
	any2fasta -n -u $< > $@

bigtest/snps.tab : genome.fa reads_R1.fq.gz reads_R2.fq.gz
	$(SNIPPY) --force --cpus 36 --outdir bigtest --ref $(word 1,$^) --R1 $(word 2,$^) --R2 $(word 3,$^)

genome.fa : 
	curl http://ftp.ebi.ac.uk/pub/databases/ena/wgs/public/cv/CVOW01.fasta.gz \
		| gunzip | sed -e 's/ENA|CVOW01000001|//' > $@

reads_R1.fq.gz :
	curl ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR115/006/SRR1157476/SRR1157476_1.fastq.gz \
		| gunzip | seqtk sample 0.2 - | pigz -9 > $@
	
reads_R2.fq.gz :
	curl ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR115/006/SRR1157476/SRR1157476_2.fastq.gz \
		| gzip -d -c | seqtk sample 0.2 - | pigz -9 > $@

clean :
	rm -fr ./bigtest core*.* ./S{1,2,3,4}