-
Notifications
You must be signed in to change notification settings - Fork 31
207 lines (171 loc) · 6.96 KB
/
main.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: CI
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.7, 3.8, 3.9]
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Upgrade setuptools
run: |
pip3 install wheel --upgrade
pip3 install setuptools --upgrade
- name: Install Gurobi
run: |
wget https://packages.gurobi.com/9.0/gurobi9.0.2_linux64.tar.gz -O gurobi9.0.2_linux64.tar.gz
tar xvzf gurobi9.0.2_linux64.tar.gz
(cd gurobi902/linux64/src/build && make)
(cd gurobi902/linux64/lib && ln -f -s ../src/build/libgurobi_c++.a libgurobi_c++.a)
echo "GUROBI_HOME=$(realpath gurobi902)" >> $GITHUB_ENV
- name: Activate Gurobi License
run: |
(cd gurobi902/linux64/bin && ./grbgetkey -q ${{ secrets.GUROBI_KEYCODE }} --path ${GUROBI_HOME})
echo "GRB_LICENSE_FILE=${GUROBI_HOME}/gurobi.lic" >> $GITHUB_ENV
continue-on-error: true
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install HATCHet with dev dependencies
run: |
python -m pip install .[dev]
env:
CXXFLAGS: -pthread
- name: Pre-commit checks
run: |
pre-commit run --all-files
- name: Download Testing Data
run: |
pip3 install zenodo-get
python3 -m zenodo_get 10.5281/zenodo.4046906 --output-dir=testdata
echo "HATCHET_TESTS_BAM_DIRECTORY=$(realpath testdata)" >> $GITHUB_ENV
- name: Install coinor-cbc
run: |
sudo apt install coinor-cbc
echo "HATCHET_COMPUTE_CN_SOLVER=cbc" >> $GITHUB_ENV
- name: Install SAMtools
run: |
wget https://sourceforge.net/projects/samtools/files/samtools/1.7/samtools-1.7.tar.bz2/download -O samtools-1.7.tar.bz2
tar xvjf samtools-1.7.tar.bz2
(cd samtools-1.7 && ./configure && make)
echo "HATCHET_PATHS_SAMTOOLS=$(realpath samtools-1.7)" >> $GITHUB_ENV
- name: Install BCFTools
run: |
wget https://sourceforge.net/projects/samtools/files/samtools/1.7/bcftools-1.7.tar.bz2/download -O bcftools-1.7.tar.bz2
tar xvjf bcftools-1.7.tar.bz2
(cd bcftools-1.7 && ./configure && make)
echo "HATCHET_PATHS_BCFTOOLS=$(realpath bcftools-1.7)" >> $GITHUB_ENV
- name: Install tabix
run: |
wget https://sourceforge.net/projects/samtools/files/tabix/tabix-0.2.6.tar.bz2/download -O tabix-0.2.6.tar.bz2
bzip2 -d tabix-0.2.6.tar.bz2
tar -xvf tabix-0.2.6.tar
(cd tabix-0.2.6 && make)
echo "HATCHET_PATHS_TABIX=$(realpath tabix-0.2.6)" >> $GITHUB_ENV
echo "HATCHET_PATHS_BGZIP=$(realpath tabix-0.2.6)" >> $GITHUB_ENV
- name: Install mosdepth
run: |
wget https://github.com/brentp/mosdepth/releases/download/v0.3.2/mosdepth -O mosdepth
chmod 775 mosdepth
echo "HATCHET_PATHS_MOSDEPTH=$(pwd)" >> $GITHUB_ENV
- name: Install picard
run: |
wget https://github.com/broadinstitute/picard/releases/download/2.26.2/picard.jar -O picard.jar
echo "HATCHET_PATHS_PICARD=$(pwd)" >> $GITHUB_ENV
- name: Install shapeit2
run: |
wget https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.v2.r904.glibcv2.17.linux.tar.gz -O shapeit.v2.r904.glibcv2.17.linux.tar.gz
tar -xf shapeit.v2.r904.glibcv2.17.linux.tar.gz
echo "HATCHET_PATHS_SHAPEIT=$(realpath shapeit.v2.904.3.10.0-693.11.6.el7.x86_64/bin)" >> $GITHUB_ENV
- name: Install bedtools
run: |
wget https://github.com/arq5x/bedtools2/releases/download/v2.30.0/bedtools.static.binary -O bedtools
chmod 775 bedtools
echo "$(pwd)" >> $GITHUB_PATH
- name: Download and index hg19.fa
working-directory: testdata
run: |
wget https://hgdownload.soe.ucsc.edu/goldenPath/hg19/bigZips/hg19.fa.gz
gunzip hg19.fa.gz
$HATCHET_PATHS_SAMTOOLS/samtools faidx hg19.fa
$HATCHET_PATHS_SAMTOOLS/samtools dict hg19.fa > hg19.dict
echo "HATCHET_PATHS_REFERENCE=$(realpath hg19.fa)" >> $GITHUB_ENV
# Instead of downloading the entire 1000GP_Phase3 panel (huge) using
# wget https://mathgen.stats.ox.ac.uk/impute/1000GP_Phase3.tgz
# we download equivalent data only for chr22, from zenodo
- name: Download 1000GP reference panel
working-directory: testdata
run: |
python3 -m zenodo_get 10.5281/zenodo.6709541
tar zxvf 1000GP_Phase3.tgz --wildcards *chr22* *sample
echo "HATCHET_DOWNLOAD_PANEL_REFPANELDIR=$(pwd)" >> $GITHUB_ENV
- name: HATCHet Check
run: |
hatchet check
- name: Pytest
run: |
pytest tests --cov=hatchet
# We may end up with files that have a ':' in their filenames,
# due to the <chr>:start:end notation of chromosomes we process through SAMtools/BCFtools.
# upload-artifact is unable to handle these, so we replace colons with dashes
- name: Clean up artifact filenames
run: |
sudo apt install rename
find tests/out -name "*:*" -exec rename 's|:|-|g' {} \;
- name: Save Pytest Output Data
uses: actions/upload-artifact@v2
with:
name: test-results
path: tests/out
- name: Convert coverage
run: |
python -m coverage xml
continue-on-error: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
build_docs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.8]
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Upgrade setuptools
run: |
pip3 install wheel --upgrade
pip3 install setuptools --upgrade
- name: Install Gurobi
run: |
wget https://packages.gurobi.com/9.0/gurobi9.0.2_linux64.tar.gz -O gurobi9.0.2_linux64.tar.gz
tar xvzf gurobi9.0.2_linux64.tar.gz
(cd gurobi902/linux64/src/build && make)
(cd gurobi902/linux64/lib && ln -f -s ../src/build/libgurobi_c++.a libgurobi_c++.a)
echo "GUROBI_HOME=$(realpath gurobi902)" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install package
run: |
CXXFLAGS=-pthread pip install .[dev]
- name: Build docs
run: |
cd docs && sphinx-apidoc -f -o ./source/src ../src/hatchet -H Modules && make html && touch build/html/.nojekyll
- name: Update gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: "docs/buildDocs.sh"
shell: bash