-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
78 lines (69 loc) · 3.19 KB
/
Makefile
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Based on https://github.com/biocore/qurro/blob/master/Makefile.
# This file contains a few directives that make it easy to run all tests for
# Empress ("make test", run style-checking ("make stylecheck"), auto-format the
# JS code ("make jsstyle"), etc.
#
# Running the follow requires the following npm packages: qunit-puppeteer,
# jshint, [email protected]. In addition, you will need a working version of flake8
# in your conda env. Note: if you are having difficulties getting qunit to
# to run, you can simply load tests/index.html into a browser instead of
# make jstest.
.PHONY: test pytest jstest stylecheck jsstyle githook docs
JSLOCS = empress/support_files/js/*.js tests/*.js
CSSLOCS = empress/support_files/css/*.css
test: pytest jstest
pytest:
nosetests tests/python
jstest:
@# Note: this assumes you're running this on a Linux/macOS system
qunit-puppeteer file://$(shell pwd)/tests/index.html
# Lints and checks code style
stylecheck:
jshint $(JSLOCS)
prettier --check --tab-width 4 $(JSLOCS) $(CSSLOCS)
flake8 empress/*.py tests/python/*.py setup.py empress/scripts/*.py
# Auto-formats the JS code
jsstyle:
@# To be extra safe, do a dry run of prettier and check that it hasn't
@# changed the code's abstract syntax tree (AST)
prettier --debug-check --tab-width 4 $(JSLOCS) $(CSSLOCS)
prettier --write --tab-width 4 $(JSLOCS) $(CSSLOCS)
githook:
@# Try to add in a pre-commit hook that runs "make stylecheck"
@# Solution loosely inspired by
@# https://www.viget.com/articles/two-ways-to-share-git-hooks-with-your-team/
echo "#!/bin/bash\nmake stylecheck" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
docs:
@# For now, this just regenerates the moving pictures QZV
@# Assumes you're in a QIIME 2 conda environment
qiime empress tree-plot \
--i-tree docs/moving-pictures/rooted-tree.qza \
--o-visualization docs/moving-pictures/plain.qzv
qiime empress tree-plot \
--i-tree docs/moving-pictures/rooted-tree.qza \
--m-feature-metadata-file docs/moving-pictures/taxonomy.qza \
--o-visualization docs/moving-pictures/just-fm.qzv
qiime empress community-plot \
--i-tree docs/moving-pictures/rooted-tree.qza \
--i-feature-table docs/moving-pictures/table.qza \
--m-sample-metadata-file docs/moving-pictures/sample_metadata.tsv \
--m-feature-metadata-file docs/moving-pictures/taxonomy.qza \
--o-visualization docs/moving-pictures/empress-tree.qzv
qiime empress community-plot \
--i-tree docs/moving-pictures/rooted-tree.qza \
--i-feature-table docs/moving-pictures/table.qza \
--i-pcoa docs/moving-pictures/unweighted_unifrac_pcoa_results.qza \
--m-sample-metadata-file docs/moving-pictures/sample_metadata.tsv \
--m-feature-metadata-file docs/moving-pictures/taxonomy.qza \
--o-visualization docs/moving-pictures/empire.qzv \
--p-filter-extra-samples
qiime empress community-plot \
--i-tree docs/moving-pictures/rooted-tree.qza \
--i-pcoa docs/moving-pictures/biplot.qza \
--i-feature-table docs/moving-pictures/table.qza \
--m-sample-metadata-file docs/moving-pictures/sample_metadata.tsv \
--m-feature-metadata-file docs/moving-pictures/taxonomy.qza \
--o-visualization docs/moving-pictures/empire-biplot.qzv \
--p-filter-extra-samples \
--p-number-of-features 10