Skip to content

Commit e3007c0

Browse files
authored
Merge pull request #154 from ncbi/stxtype
Release 4.0.3
2 parents a826b72 + 10c8bef commit e3007c0

33 files changed

+8256
-793
lines changed

.github/workflows/ccpp.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
run: |
1818
sudo apt-get update
1919
sudo apt-get install -y hmmer ncbi-blast+ git libcurl4-openssl-dev build-essential curl
20+
- name: submodule checkout
21+
run: git submodule update --init --recursive
2022
- name: make
2123
run: cat version.txt; make
2224
- name: download db
@@ -26,12 +28,10 @@ jobs:
2628
- name: make test
2729
run: make test
2830
- name: test for no-overwrite database update (PD-3469 / https://github.com/ncbi/amr/issues/16)
29-
run: |
30-
./amrfinder -u 2>&1 | tee output
31-
fgrep 'Skipping update, use amrfinder --force_update to overwrite the existing database' output
31+
run: ./amrfinder -u 2>&1 | fgrep 'Skipping update'
3232
- name: make github_binaries
3333
run: make github_binaries
34-
- uses: actions/upload-artifact@v2
34+
- uses: actions/upload-artifact@v3
3535
with:
3636
name: release-binary
3737
path: amrfinder_binaries_v*.tar.gz

.github/workflows/mac_ccpp.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v3
16+
- name: submodule checkout
17+
run: git submodule update --init --recursive
1618
- name: prerequisites
1719
run: |
1820
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
@@ -29,13 +31,13 @@ jobs:
2931
- name: make test
3032
run: make test
3133
- name: test for no-overwrite database update (PD-3469 / https://github.com/ncbi/amr/issues/16)
32-
run: ./amrfinder -u 2>&1 | fgrep 'Skipping update, use amrfinder --force_update to overwrite the existing database'
34+
run: ./amrfinder -u 2>&1 | fgrep 'Skipping update'
3335
- name: make github_binaries
3436
run: |
3537
make github_binaries
3638
version=`cat version.txt`
3739
mv amrfinder_binaries_v$version.tar.gz amrfinder_binaries_osx_v$version.txt
38-
- uses: actions/upload-artifact@v2
40+
- uses: actions/upload-artifact@v3
3941
with:
4042
name: release-binary
4143
path: amrfinder_binaries_osx_v*.tar.gz

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ data/
22
*.o
33
amr_report
44
amrfinder
5-
fasta_check
6-
fasta_extract
7-
dna_mutation
8-
gff_check
95
amrfinder_index
106
amrfinder_update
117
amrfinder_customize
8+
dna_mutation
9+
fasta_check
10+
fasta_extract
1211
fasta2parts
12+
gff_check
13+
mutate
1314
*.got

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "stxtyper"]
2+
path = stx
3+
url = https://github.com/ncbi/stxtyper.git

Makefile

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@ CXX=g++
8181
COMPILE.cpp= $(CXX) $(CPPFLAGS) $(SVNREV) $(DBDIR) $(TEST_UPDATE_DB) -c
8282

8383

84-
.PHONY: all clean install release
84+
.PHONY: all clean install release stxtyper test
8585

86-
BINARIES= amr_report amrfinder amrfinder_index amrfinder_update fasta_check fasta_extract fasta2parts gff_check dna_mutation
86+
BINARIES= amr_report amrfinder amrfinder_index amrfinder_update fasta_check \
87+
fasta_extract fasta2parts gff_check dna_mutation mutate
8788

88-
all: $(BINARIES)
89+
all: $(BINARIES) stxtyper
8990

9091
release: clean
9192
svnversion . > version.txt
@@ -95,18 +96,19 @@ common.o: common.hpp common.inc
9596
curl_easy.o: curl_easy.hpp common.hpp common.inc
9697
gff.o: gff.hpp common.hpp common.inc
9798
alignment.o: alignment.hpp alignment.hpp common.inc
99+
seq.o: seq.hpp common.hpp common.inc
98100

99-
amr_report.o: common.hpp common.inc gff.hpp alignment.hpp
101+
amr_report.o: common.hpp common.inc gff.hpp alignment.hpp tsv.hpp columns.hpp version.txt
100102
amr_reportOBJS=amr_report.o common.o gff.o alignment.o
101103
amr_report: $(amr_reportOBJS)
102104
$(CXX) $(LDFLAGS) -o $@ $(amr_reportOBJS)
103105

104-
amrfinder.o: common.hpp common.inc gff.hpp
106+
amrfinder.o: common.hpp common.inc gff.hpp tsv.hpp columns.hpp version.txt
105107
amrfinderOBJS=amrfinder.o common.o gff.o tsv.o
106108
amrfinder: $(amrfinderOBJS)
107109
$(CXX) $(LDFLAGS) -o $@ $(amrfinderOBJS) -pthread $(DBDIR)
108110

109-
amrfinder_update.o: common.hpp common.inc
111+
amrfinder_update.o: common.hpp common.inc curl_easy.hpp version.txt
110112
amrfinder_updateOBJS=amrfinder_update.o common.o curl_easy.o
111113
amrfinder_update: $(amrfinder_updateOBJS)
112114
@if [ "$(TEST_UPDATE)" != "" ] ; \
@@ -115,69 +117,84 @@ amrfinder_update: $(amrfinder_updateOBJS)
115117
fi # make sure the next make command rebuilds amrfinder_update
116118
$(CXX) $(LDFLAGS) -o $@ $(amrfinder_updateOBJS) -lcurl
117119

118-
amrfinder_index.o: common.hpp common.inc
120+
amrfinder_index.o: common.hpp common.inc version.txt
119121
amrfinder_indexOBJS=amrfinder_index.o common.o
120122
amrfinder_index: $(amrfinder_indexOBJS)
121123
$(CXX) $(LDFLAGS) -o $@ $(amrfinder_indexOBJS)
122124

123-
fasta_check.o: common.hpp common.inc
125+
fasta_check.o: common.hpp common.inc version.txt
124126
fasta_checkOBJS=fasta_check.o common.o
125127
fasta_check: $(fasta_checkOBJS)
126128
$(CXX) $(LDFLAGS) -o $@ $(fasta_checkOBJS)
127129

128-
fasta_extract.o: common.hpp common.inc
130+
fasta_extract.o: common.hpp common.inc version.txt
129131
fasta_extractOBJS=fasta_extract.o common.o
130132
fasta_extract: $(fasta_extractOBJS)
131133
$(CXX) $(LDFLAGS) -o $@ $(fasta_extractOBJS)
132134

133-
fasta2parts.o: common.hpp common.inc
135+
fasta2parts.o: common.hpp common.inc version.txt
134136
fasta2partsOBJS=fasta2parts.o common.o
135137
fasta2parts: $(fasta2partsOBJS)
136138
$(CXX) $(LDFLAGS) -o $@ $(fasta2partsOBJS)
137139

138-
gff_check.o: common.hpp common.inc gff.hpp
140+
gff_check.o: common.hpp common.inc gff.hpp version.txt
139141
gff_checkOBJS=gff_check.o common.o gff.o
140142
gff_check: $(gff_checkOBJS)
141143
$(CXX) $(LDFLAGS) -o $@ $(gff_checkOBJS)
142144

143-
dna_mutation.o: common.hpp common.inc alignment.hpp
145+
dna_mutation.o: common.hpp common.inc alignment.hpp tsv.hpp columns.hpp version.txt
144146
dna_mutationOBJS=dna_mutation.o common.o alignment.o
145147
dna_mutation: $(dna_mutationOBJS)
146148
$(CXX) $(LDFLAGS) -o $@ $(dna_mutationOBJS)
147149

150+
mutate.o: common.hpp common.inc alignment.hpp seq.hpp version.txt
151+
mutateOBJS=mutate.o common.o alignment.o seq.o
152+
mutate: $(mutateOBJS)
153+
$(CXX) -o $@ $(mutateOBJS)
148154

155+
stxtyper:
156+
$(MAKE) -C stx
149157

150158
clean:
151159
rm -f *.o
152160
rm -f $(BINARIES)
161+
$(MAKE) -C stx clean
153162

154163
install:
155164
@if [ ! -e $(DESTDIR)$(bindir) ]; \
156165
then \
157166
mkdir -p $(DESTDIR)$(bindir); \
158167
fi
159168
$(INSTALL) $(BINARIES) $(DESTDIR)$(bindir)
169+
make -C stx install PREFIX=$(PREFIX) bindir=$(bindir)
160170

161171
# amrfinder binaries for github binary release
162172
GITHUB_FILE=amrfinder_binaries_v$(VERSION_STRING)
163173
GITHUB_FILES = test_amrfinder.sh test_*.expected test_*.fa test_*.gff $(BINARIES)
174+
164175
github_binaries:
165176
@if [ ! -e version.txt ]; \
166177
then \
167178
echo >&2 "version.txt required to make a distribution file"; \
168179
false; \
169180
fi
170181
# first recompile amrfinder.o to pick up the new version info
171-
rm amrfinder.o amrfinder
172-
make
182+
# and remove leaky NCBI paths
183+
make clean
184+
make all CXX=/usr/bin/g++ LD_RUN_PATH=
173185
mkdir $(GITHUB_FILE)
174186
echo $(VERSION_STRING) > $(GITHUB_FILE)/version.txt
175187
cp $(GITHUB_FILES) $(GITHUB_FILE)
188+
make -C stx
189+
make -C stx install INSTALL_DIR=../$(GITHUB_FILE)/stx CXX=/usr/bin/g++ LD_RUN_PATH=
190+
cp stx/test_stxtyper.sh stx/version.txt $(GITHUB_FILE)/stx
191+
mkdir $(GITHUB_FILE)/stx/test
192+
cp -R stx/test/*.fa stx/test/*.expected $(GITHUB_FILE)/stx/test
176193
if [ -e $(GITHUB_FILE).tar.gz ]; then rm $(GITHUB_FILE).tar.gz; fi
177-
cd $(GITHUB_FILE); tar cvfz ../$(GITHUB_FILE).tar.gz *
178-
# tar cvfz $(GITHUB_FILE).tar.gz $(GITHUB_FILE)/*
194+
cd $(GITHUB_FILE); ln -s stx/stxtyper .; tar cvfz ../$(GITHUB_FILE).tar.gz *
179195
rm -r $(GITHUB_FILE)/*
180196
rmdir $(GITHUB_FILE)
181197

182-
test : $(DISTFILES) Makefile *.cpp *.hpp *.inc test_dna.fa test_prot.fa test_prot.gff test_dna.fa test_dna.expected test_prot.expected test_both.expected
198+
test: $(DISTFILES) Makefile *.cpp *.hpp *.inc test_dna.fa test_prot.fa test_prot.gff test_dna.fa test_dna.expected test_prot.expected test_both.expected
199+
make -C stx test
183200
./test_amrfinder.sh

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# WARNING: This is an experimental version that includes StxTyper
2+
3+
Currently it will need to be compiled from source to install.
4+
5+
### Downloading and compiling AMRFinderPlus with StxTyper
6+
7+
git clone https://github.com/ncbi/amr.git
8+
cd amr
9+
git checkout stxtype
10+
git submodule update --init
11+
make
12+
./amrfinder -u
13+
make test
14+
115
# NCBI Antimicrobial Resistance Gene Finder (AMRFinderPlus)
216

317
This software and the accompanying database are designed to find acquired antimicrobial resistance genes and point mutations in protein and/or assembled nucleotide sequences. We have also added "plus" stress, heat, and biocide resistance and virulence factors for [some organisms](https://github.com/evolarjun/amr/wiki/Curated-organisms).

0 commit comments

Comments
 (0)