Skip to content

Commit 99369e1

Browse files
authored
Merge pull request #17 from karel-brinda/proc_subst
Fix tests
2 parents 8f9b1bd + d3a9ca5 commit 99369e1

File tree

7 files changed

+81
-11
lines changed

7 files changed

+81
-11
lines changed

tests/00_data/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.fa

tests/00_data/Makefile

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.PHONY: all help clean cleanall view
2+
3+
SHELL=/usr/bin/env bash -eo pipefail
4+
5+
.SECONDARY:
6+
7+
.SUFFIXES:
8+
9+
FASTAS=001334.fa 101058.fa 203692.fa 302649.fa 403790.fa
10+
11+
##############
12+
## Commands ##
13+
##############
14+
15+
all: test_spneumo.tar.xz
16+
17+
test_spneumo.tar.xz: $(FASTAS)
18+
tar -cvf - $? \
19+
| xz -T1 -9 \
20+
> $@.tmp
21+
mv $@.tmp $@
22+
23+
%.fa:
24+
curl -L "https://github.com/c2-d2/rase-db-spneumoniae-sparc/raw/master/isolates/$*.fa" \
25+
| seqtk seq \
26+
> $@.tmp
27+
mv $@.tmp $@
28+
29+
30+
help: ## Print help messages
31+
@echo -e "$$(grep -hE '^\S*(:.*)?##' $(MAKEFILE_LIST) \
32+
| sed \
33+
-e 's/:.*##\s*/:/' \
34+
-e 's/^\(.*\):\(.*\)/ \\x1b[36m\1\\x1b[m:\2/' \
35+
-e 's/^\([^#]\)/\1/g' \
36+
-e 's/: /:/g' \
37+
-e 's/^#\(.*\)#/\\x1b[90m\1\\x1b[m/' \
38+
| column -c2 -t -s : )"
39+
40+
clean: ## Clean
41+
rm -fv *.fa
42+
43+
cleanall: clean ## Clean all
44+
rm -fv *.tar.xz
45+
46+
view: ## View output

tests/00_data/test_spneumo.tar.xz

1000 KB
Binary file not shown.

tests/02_simple_tree/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
file_list.txt
12
*.fa
23
*.nw

tests/02_simple_tree/Makefile

+31-11
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,39 @@ SHELL=/usr/bin/env bash -eo pipefail
66

77
.SUFFIXES:
88

9-
FASTAS=001334.fa 101058.fa 203692.fa 302649.fa 403790.fa
9+
FASTAS=$(shell tar -tf test_spneumo.tar.xz)
1010

11-
##############
12-
## Commands ##
13-
##############
11+
###################
12+
## Compare trees ##
13+
###################
14+
15+
all: tree.default.nw tree.file_list.nw tree.precomputed.newick
16+
diff tree.default.nw tree.precomputed.newick
17+
diff tree.file_list.nw tree.precomputed.newick
18+
19+
###################################
20+
# Different ways to compute trees #
21+
###################################
1422

15-
all: tree.nw
23+
tree.default.nw: file_list.txt
24+
../../attotree/attotree.py $(shell cat $<) > "$@.tmp"
25+
mv "$@.tmp" "$@"
1626

17-
tree.nw: $(FASTAS)
18-
../../attotree/attotree.py $? > $@.tmp
19-
mv $@.tmp $@
27+
tree.file_list.nw: file_list.txt
28+
../../attotree/attotree.py -L "$<" > "$@.tmp"
29+
mv "$@.tmp" "$@"
30+
31+
tree.precomputed.newick: tree.default.nw
32+
cp $< $@
33+
34+
##############
35+
# Input data #
36+
##############
2037

21-
%.fa:
22-
curl -L "https://github.com/c2-d2/rase-db-spneumoniae-sparc/raw/master/isolates/$*" > $@
38+
file_list.txt: test_spneumo.tar.xz
39+
tar xvf $<
40+
tar -tf $< > file_list.txt.tmp
41+
mv file_list.txt.tmp file_list.txt
2342

2443
help: ## Print help messages
2544
@echo -e "$$(grep -hE '^\S*(:.*)?##' $(MAKEFILE_LIST) \
@@ -32,8 +51,9 @@ help: ## Print help messages
3251
| column -c2 -t -s : )"
3352

3453
clean: ## Clean
35-
rm -fv *.nw
54+
rm -f *.nw *.tmp
3655

3756
cleanall: clean ## Clean all
57+
rm -f file_list.txt *.fa
3858

3959
view: ## View output
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../00_data/test_spneumo.tar.xz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
((203692:0.00537,001334:0.00473):0.00060,(302649:0.00543,101058:0.00531):0.00062,403790:0.01403);

0 commit comments

Comments
 (0)