Skip to content

Commit

Permalink
Merge pull request #154 from ncbi/stxtype
Browse files Browse the repository at this point in the history
Release 4.0.3
  • Loading branch information
evolarjun authored Oct 29, 2024
2 parents a826b72 + 10c8bef commit e3007c0
Show file tree
Hide file tree
Showing 33 changed files with 8,256 additions and 793 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y hmmer ncbi-blast+ git libcurl4-openssl-dev build-essential curl
- name: submodule checkout
run: git submodule update --init --recursive
- name: make
run: cat version.txt; make
- name: download db
Expand All @@ -26,12 +28,10 @@ jobs:
- name: make test
run: make test
- name: test for no-overwrite database update (PD-3469 / https://github.com/ncbi/amr/issues/16)
run: |
./amrfinder -u 2>&1 | tee output
fgrep 'Skipping update, use amrfinder --force_update to overwrite the existing database' output
run: ./amrfinder -u 2>&1 | fgrep 'Skipping update'
- name: make github_binaries
run: make github_binaries
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: release-binary
path: amrfinder_binaries_v*.tar.gz
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/mac_ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: submodule checkout
run: git submodule update --init --recursive
- name: prerequisites
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Expand All @@ -29,13 +31,13 @@ jobs:
- name: make test
run: make test
- name: test for no-overwrite database update (PD-3469 / https://github.com/ncbi/amr/issues/16)
run: ./amrfinder -u 2>&1 | fgrep 'Skipping update, use amrfinder --force_update to overwrite the existing database'
run: ./amrfinder -u 2>&1 | fgrep 'Skipping update'
- name: make github_binaries
run: |
make github_binaries
version=`cat version.txt`
mv amrfinder_binaries_v$version.tar.gz amrfinder_binaries_osx_v$version.txt
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: release-binary
path: amrfinder_binaries_osx_v*.tar.gz
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ data/
*.o
amr_report
amrfinder
fasta_check
fasta_extract
dna_mutation
gff_check
amrfinder_index
amrfinder_update
amrfinder_customize
dna_mutation
fasta_check
fasta_extract
fasta2parts
gff_check
mutate
*.got
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "stxtyper"]
path = stx
url = https://github.com/ncbi/stxtyper.git
51 changes: 34 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ CXX=g++
COMPILE.cpp= $(CXX) $(CPPFLAGS) $(SVNREV) $(DBDIR) $(TEST_UPDATE_DB) -c


.PHONY: all clean install release
.PHONY: all clean install release stxtyper test

BINARIES= amr_report amrfinder amrfinder_index amrfinder_update fasta_check fasta_extract fasta2parts gff_check dna_mutation
BINARIES= amr_report amrfinder amrfinder_index amrfinder_update fasta_check \
fasta_extract fasta2parts gff_check dna_mutation mutate

all: $(BINARIES)
all: $(BINARIES) stxtyper

release: clean
svnversion . > version.txt
Expand All @@ -95,18 +96,19 @@ common.o: common.hpp common.inc
curl_easy.o: curl_easy.hpp common.hpp common.inc
gff.o: gff.hpp common.hpp common.inc
alignment.o: alignment.hpp alignment.hpp common.inc
seq.o: seq.hpp common.hpp common.inc

amr_report.o: common.hpp common.inc gff.hpp alignment.hpp
amr_report.o: common.hpp common.inc gff.hpp alignment.hpp tsv.hpp columns.hpp version.txt
amr_reportOBJS=amr_report.o common.o gff.o alignment.o
amr_report: $(amr_reportOBJS)
$(CXX) $(LDFLAGS) -o $@ $(amr_reportOBJS)

amrfinder.o: common.hpp common.inc gff.hpp
amrfinder.o: common.hpp common.inc gff.hpp tsv.hpp columns.hpp version.txt
amrfinderOBJS=amrfinder.o common.o gff.o tsv.o
amrfinder: $(amrfinderOBJS)
$(CXX) $(LDFLAGS) -o $@ $(amrfinderOBJS) -pthread $(DBDIR)

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

amrfinder_index.o: common.hpp common.inc
amrfinder_index.o: common.hpp common.inc version.txt
amrfinder_indexOBJS=amrfinder_index.o common.o
amrfinder_index: $(amrfinder_indexOBJS)
$(CXX) $(LDFLAGS) -o $@ $(amrfinder_indexOBJS)

fasta_check.o: common.hpp common.inc
fasta_check.o: common.hpp common.inc version.txt
fasta_checkOBJS=fasta_check.o common.o
fasta_check: $(fasta_checkOBJS)
$(CXX) $(LDFLAGS) -o $@ $(fasta_checkOBJS)

fasta_extract.o: common.hpp common.inc
fasta_extract.o: common.hpp common.inc version.txt
fasta_extractOBJS=fasta_extract.o common.o
fasta_extract: $(fasta_extractOBJS)
$(CXX) $(LDFLAGS) -o $@ $(fasta_extractOBJS)

fasta2parts.o: common.hpp common.inc
fasta2parts.o: common.hpp common.inc version.txt
fasta2partsOBJS=fasta2parts.o common.o
fasta2parts: $(fasta2partsOBJS)
$(CXX) $(LDFLAGS) -o $@ $(fasta2partsOBJS)

gff_check.o: common.hpp common.inc gff.hpp
gff_check.o: common.hpp common.inc gff.hpp version.txt
gff_checkOBJS=gff_check.o common.o gff.o
gff_check: $(gff_checkOBJS)
$(CXX) $(LDFLAGS) -o $@ $(gff_checkOBJS)

dna_mutation.o: common.hpp common.inc alignment.hpp
dna_mutation.o: common.hpp common.inc alignment.hpp tsv.hpp columns.hpp version.txt
dna_mutationOBJS=dna_mutation.o common.o alignment.o
dna_mutation: $(dna_mutationOBJS)
$(CXX) $(LDFLAGS) -o $@ $(dna_mutationOBJS)

mutate.o: common.hpp common.inc alignment.hpp seq.hpp version.txt
mutateOBJS=mutate.o common.o alignment.o seq.o
mutate: $(mutateOBJS)
$(CXX) -o $@ $(mutateOBJS)

stxtyper:
$(MAKE) -C stx

clean:
rm -f *.o
rm -f $(BINARIES)
$(MAKE) -C stx clean

install:
@if [ ! -e $(DESTDIR)$(bindir) ]; \
then \
mkdir -p $(DESTDIR)$(bindir); \
fi
$(INSTALL) $(BINARIES) $(DESTDIR)$(bindir)
make -C stx install PREFIX=$(PREFIX) bindir=$(bindir)

# amrfinder binaries for github binary release
GITHUB_FILE=amrfinder_binaries_v$(VERSION_STRING)
GITHUB_FILES = test_amrfinder.sh test_*.expected test_*.fa test_*.gff $(BINARIES)

github_binaries:
@if [ ! -e version.txt ]; \
then \
echo >&2 "version.txt required to make a distribution file"; \
false; \
fi
# first recompile amrfinder.o to pick up the new version info
rm amrfinder.o amrfinder
make
# and remove leaky NCBI paths
make clean
make all CXX=/usr/bin/g++ LD_RUN_PATH=
mkdir $(GITHUB_FILE)
echo $(VERSION_STRING) > $(GITHUB_FILE)/version.txt
cp $(GITHUB_FILES) $(GITHUB_FILE)
make -C stx
make -C stx install INSTALL_DIR=../$(GITHUB_FILE)/stx CXX=/usr/bin/g++ LD_RUN_PATH=
cp stx/test_stxtyper.sh stx/version.txt $(GITHUB_FILE)/stx
mkdir $(GITHUB_FILE)/stx/test
cp -R stx/test/*.fa stx/test/*.expected $(GITHUB_FILE)/stx/test
if [ -e $(GITHUB_FILE).tar.gz ]; then rm $(GITHUB_FILE).tar.gz; fi
cd $(GITHUB_FILE); tar cvfz ../$(GITHUB_FILE).tar.gz *
# tar cvfz $(GITHUB_FILE).tar.gz $(GITHUB_FILE)/*
cd $(GITHUB_FILE); ln -s stx/stxtyper .; tar cvfz ../$(GITHUB_FILE).tar.gz *
rm -r $(GITHUB_FILE)/*
rmdir $(GITHUB_FILE)

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
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
make -C stx test
./test_amrfinder.sh
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# WARNING: This is an experimental version that includes StxTyper

Currently it will need to be compiled from source to install.

### Downloading and compiling AMRFinderPlus with StxTyper

git clone https://github.com/ncbi/amr.git
cd amr
git checkout stxtype
git submodule update --init
make
./amrfinder -u
make test

# NCBI Antimicrobial Resistance Gene Finder (AMRFinderPlus)

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).
Expand Down
Loading

0 comments on commit e3007c0

Please sign in to comment.