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

Sylvain Jasson's avatar
Sylvain Jasson committed
4
LENGTH = 73
5
6

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

8
9
all: user_manual.pdf

10
11
.FORCE:

Sylvain Jasson's avatar
Sylvain Jasson committed
12
user_manual.pdf: spell-pedigree.tex detection.tex outputs.tex pipeline.tex pop.tex spell-marker.tex spell-qtl.tex spell-qtl-examples.tex version.tex user_manual.tex images/Spell-pipeline2.svg images/full_map.png images/logo_MIAT.png pdfs/by-sa.pdf pdfs/gpl-v3-logo.pdf .inputs .outputs 
13
	pdflatex --shell-escape user_manual.tex && pdflatex --shell-escape user_manual.tex 
Sylvain Jasson's avatar
Sylvain Jasson committed
14

15
16
17
version.tex: .FORCE
	git tag | tail -1 > /tmp/last-tag
	diff /tmp/last-tag $@ || cat /tmp/last-tag > $@
Sylvain Jasson's avatar
Sylvain Jasson committed
18

19
spell-pedigree.tex: $(SRCDIR)/doc/man/spell-pedigree.1.md
20
	/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
21
	sed -i s/\\label\{/\label\{spell-pedigree:/g spell-pedigree.tex
22
	sed -i s/--/-\{\}-/g spell-pedigree.tex 
Sylvain Jasson's avatar
Sylvain Jasson committed
23

24
spell-marker.tex: $(SRCDIR)/doc/man/spell-marker.1.md
25
	/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
26
	sed -i s/\\label\{/\label\{spell-marker:/g spell-marker.tex
27
	sed -i s/--/-\{\}-/g spell-marker.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
28

29
spell-qtl.tex: ../man/spell-qtl.1.md
30
	/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
31
	sed -i s/\\label\{/\label\{spell-qtl:/g spell-qtl.tex
32
	sed -i s/--/-\{\}-/g spell-qtl.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
33

34
spell-qtl-examples.tex: $(SRCDIR)/doc/man/spell-qtl-examples.1.md
35
	/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
36
	sed -i s/\\label\{/\label\{spell-qtl-examples:/g spell-qtl-examples.tex
37
	sed -i s/--/-\{\}-/g spell-qtl-examples.tex
Sylvain Jasson's avatar
Sylvain Jasson committed
38

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

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

47

Damien Leroux's avatar
Damien Leroux committed
48
49
.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
50

51
my_directory/my_name.cache/my_name.spell-pedigree.data: $(EXAMPLE_DIR)/example1.ped $(BINDIR)/spell-pedigree
52
53
	$(BINDIR)/spell-pedigree -wd my_directory -n my_name -p $<
	
54
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  $(BINDIR)/spell-marker
55
	$(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
56

57
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 $(BINDIR)/spell-qtl
58
59
	$(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

60
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 $(BINDIR)/spell-qtl
Sylvain Jasson's avatar
Sylvain Jasson committed
61
62
63
64
65
66
67
68
69
70
71
	$(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 QTL-detection CIM-

output_files/my_name.ch1.F2.0.csv: my_directory/my_name.n-point/ch1/F2/my_name.ch1.F2.0.csv
	mkdir -p output_files
	awk -v len=$(LENGTH) '{ if (length($$0) > len) print substr($$0, 1, len-3) "..."; else print; }' $< > $@

output_files/t1_report.txt: my_directory/my_name.report/t1/t1_report.txt
	mkdir -p output_files
	awk -v len=$(LENGTH) '{ if (length($$0) > len) print substr($$0, 1, len-3) "..."; else print; }' $< > $@


72
	
Sylvain Jasson's avatar
Sylvain Jasson committed
73
.outputs: output_files/t1_report.txt output_files/my_name.ch1.F2.0.csv
Damien Leroux's avatar
Damien Leroux committed
74
	touch $@
Sylvain Jasson's avatar
Sylvain Jasson committed
75

Sylvain Jasson's avatar
Sylvain Jasson committed
76
77


Sylvain Jasson's avatar
Sylvain Jasson committed
78
clean:
Sylvain Jasson's avatar
Sylvain Jasson committed
79
	rm -f *.aux *.log *.pdf *.toc *.out *.lol
Sylvain Jasson's avatar
Sylvain Jasson committed
80
81
	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
82
	rm -f images/*.pdf images/*.pdf_tex
83
	rm -rf input_files	
Sylvain Jasson's avatar
Sylvain Jasson committed
84
	rm -rf output_files
Sylvain Jasson's avatar
Sylvain Jasson committed
85

86
very_clean: clean
Sylvain Jasson's avatar
Sylvain Jasson committed
87
	rm -f *~
Sylvain Jasson's avatar
Sylvain Jasson committed
88
	rm -rf my_directory