makefile 3.73 KB
Newer Older
1
2
3
4
5
BINDIR = /home/sjasson/INSTALL_DIR/SPELL_TEST/spell_qtl-0.1-alpha.1-Linux/bin
SRCDIR = /home/sjasson/dev/spel


EXAMPLE_DIR = $(SRCDIR)/examples/three_parents_F2
Sylvain Jasson's avatar
Sylvain Jasson committed
6

7
8
all: user_manual.pdf

Damien Leroux's avatar
Damien Leroux committed
9
user_manual.pdf: spell-pedigree.tex spell-marker.tex spell-qtl.tex spell-qtl-examples.tex version.tex user_manual.tex images/Spell-pipeline2.svg .inputs .outputs
10
	pdflatex --shell-escape user_manual.tex && pdflatex --shell-escape user_manual.tex 
Sylvain Jasson's avatar
Sylvain Jasson committed
11

12
version.tex: 
Sylvain Jasson's avatar
Sylvain Jasson committed
13
14
	git tag | tail -1 > version.tex

15
spell-pedigree.tex: $(SRCDIR)/doc/man/spell-pedigree.1.md
16
	/usr/bin/pandoc $(SRCDIR)/doc/man/spell-pedigree.1.md --listings -f markdown -t latex -o spell-pedigree.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
17
	sed -i s/\\label\{/\label\{spell-pedigree:/g spell-pedigree.tex
18
	sed -i s/--/-\{\}-/g spell-pedigree.tex 
Sylvain Jasson's avatar
Sylvain Jasson committed
19

20
spell-marker.tex: $(SRCDIR)/doc/man/spell-marker.1.md
21
	/usr/bin/pandoc $(SRCDIR)/doc/man/spell-marker.1.md --listings -f markdown -t latex -o spell-marker.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
22
	sed -i s/\\label\{/\label\{spell-marker:/g spell-marker.tex
23
	sed -i s/--/-\{\}-/g spell-marker.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
24

25
spell-qtl.tex: ../man/spell-qtl.1.md
26
	/usr/bin/pandoc $(SRCDIR)/doc/man/spell-qtl.1.md --listings -f markdown -t latex -o spell-qtl.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
27
	sed -i s/\\label\{/\label\{spell-qtl:/g spell-qtl.tex
28
	sed -i s/--/-\{\}-/g spell-qtl.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
29

30
spell-qtl-examples.tex: $(SRCDIR)/doc/man/spell-qtl-examples.1.md
31
	/usr/bin/pandoc $(SRCDIR)/doc/man/spell-qtl-examples.1.md --listings -f markdown -t latex -o spell-qtl-examples.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
32
	sed -i s/\\label\{/\label\{spell-qtl-examples:/g spell-qtl-examples.tex
33
	sed -i s/--/-\{\}-/g spell-qtl-examples.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
34

35
input_files/example1.map  input_files/example1_F2.gen input_files/example1.ped:input_files/%: $(EXAMPLE_DIR)/%
Sylvain Jasson's avatar
Sylvain Jasson committed
36
	mkdir -p input_files
37
38
39
40
41
42
	awk -v len=73 '{ if (length($$0) > len) print substr($$0, 1, len-3) "..."; else print; }' $< > $@

input_files/example1_F2.phen: $(EXAMPLE_DIR)/example1_F2.phen
	mkdir -p input_files
	awk '{printf $$1;for(i=2;i<=NF;i++){printf " %.3f", $$i}; printf "\n"}' $(EXAMPLE_DIR)/example1_F2.phen | awk -v len=73 '{ if (length($$0) > len) print substr($$0, 1, len-3) "..."; else print; }' > input_files/example1_F2.phen

43

Damien Leroux's avatar
Damien Leroux committed
44
45
.inputs: input_files/example1.map input_files/example1_F2.phen input_files/example1_F2.gen input_files/example1.ped
	touch $@
Sylvain Jasson's avatar
Sylvain Jasson committed
46

47
my_directory/my_name.cache/my_name.spell-pedigree.data: $(EXAMPLE_DIR)/example1.ped
48
49
	$(BINDIR)/spell-pedigree -wd my_directory -n my_name -p $<
	
50
my_directory/my_name.cache/my_name.spell-marker.data: my_directory/my_name.cache/my_name.spell-pedigree.data $(EXAMPLE_DIR)/example1_F2.gen $(EXAMPLE_DIR)/example1_F2C.gen
51
	$(BINDIR)/spell-marker -wd my_directory -n my_name -m F2:A/B $(EXAMPLE_DIR)/example1_F2.gen -m F2C:A/C $(EXAMPLE_DIR)/example1_F2C.gen -o F2,F2C -O1 -Op
52

53
my_directory/my_name.n-point/ch1/F2/my_name.ch1.F2.0.csv:  my_directory/my_name.cache/my_name.spell-marker.data $(EXAMPLE_DIR)/example1_F2.phen $(EXAMPLE_DIR)/example1_F2C.phen $(EXAMPLE_DIR)/example1.map
54
55
	$(BINDIR)/spell-qtl -wd my_directory -n my_name -P auto -p F2 $(EXAMPLE_DIR)/example1_F2.phen -p F2C $(EXAMPLE_DIR)/example1_F2C.phen -gm $(EXAMPLE_DIR)/example1.map output-nppop

56
my_directory/my_name.report/t1/t1_report.txt: my_directory/my_name.cache/my_name.spell-marker.data $(EXAMPLE_DIR)/example1_F2.phen $(EXAMPLE_DIR)/example1_F2C.phen $(EXAMPLE_DIR)/example1.map
57
58
	$(BINDIR)/spell-qtl -wd my_directory -n my_name -P auto -p F2 $(EXAMPLE_DIR)/example1_F2.phen -p F2C $(EXAMPLE_DIR)/example1_F2C.phen -gm $(EXAMPLE_DIR)/example1.map
	
Damien Leroux's avatar
Damien Leroux committed
59
60
.outputs: my_directory/my_name.report/t1/t1_report.txt my_directory/my_name.n-point/ch1/F2/my_name.ch1.F2.0.csv
	touch $@
Sylvain Jasson's avatar
Sylvain Jasson committed
61

Sylvain Jasson's avatar
Sylvain Jasson committed
62
clean:
Sylvain Jasson's avatar
Sylvain Jasson committed
63
	rm -f *.aux *.log *.pdf *.toc *.out *.lol
Sylvain Jasson's avatar
Sylvain Jasson committed
64
65
	rm -f version.tex
	rm -f spell-pedigree.tex spell-marker.tex spell-qtl.tex spell-qtl-examples.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
66
	rm -f images/*.pdf images/*.pdf_tex
67
	rm -rf input_files	
Sylvain Jasson's avatar
Sylvain Jasson committed
68

69
very_clean: clean
Sylvain Jasson's avatar
Sylvain Jasson committed
70
	rm -f *~
Sylvain Jasson's avatar
Sylvain Jasson committed
71
	rm -rf my_directory