Skip to content

Commit

Permalink
Merge v3b into master
Browse files Browse the repository at this point in the history
  • Loading branch information
evolarjun committed Jul 22, 2019
2 parents 78a12d2 + c3a1ea6 commit b11e5a9
Show file tree
Hide file tree
Showing 23 changed files with 5,283 additions and 1,315 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
data/
*.pyc
*.o
amr_report
amrfinder
fasta_check
point_mut
gff_check
amrfinder_update
fasta2parts
156 changes: 94 additions & 62 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
##############################################################################
# PUBLIC DOMAIN NOTICE This software/database is "United States Government
# Work" under the terms of the United States Copyright Act. It was written as
# part of the authors' official duties for the United States Government and
# thus cannot be copyrighted. This software/database is freely available to the
# public for use without a copyright notice. Restrictions cannot be placed on
# its present or future use.
#
# Although all reasonable efforts have been taken to ensure the accuracy and
# reliability of the software and data, the National Center for Biotechnology
# Information (NCBI) and the U.S. Government do not and cannot warrant the
# performance or results that may be obtained by using this software or data.
# NCBI, NLM, and the U.S. Government disclaim all warranties as to performance,
# merchantability or fitness for any particular purpose.
#
# In any work or product derived from this material, proper attribution of the
# authors as the source of the software or data should be made, using:
# https://ncbi.nlm.nih.gov/pathogens/antimicrobial-resistance/AMRFinder/ as the
# citation.
###############################################################################

# the SVNREV is set automatically here for convenience,
# but when actually building we should override it like:
# make all SVNREV=-D\'SVN_REV=\"$VERSION\"\' or use
# a version.txt file
ifeq ($(wildcard version.txt),)
VERSION_STRING := $(shell svnversion -n .)
VERSION_STRING := $(shell git describe --tags)
else
VERSION_STRING := $(shell cat version.txt)
endif
SVNREV := -D'SVN_REV="$(VERSION_STRING)"'

SHELL=/bin/sh
INSTALL = install
# Define default paths
PREFIX ?= /usr/local
INSTALL=install

CPPFLAGS = -std=gnu++11 \
-malign-double -fno-math-errno \
-Wall -Wextra \
-Wcast-align -Wconversion -Wdeprecated-declarations -Wformat -Winit-self -Wlogical-op \
-Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs \
-Woverloaded-virtual -pedantic -Wparentheses -Wpointer-arith -Wsequence-point -Wshadow -Wunused \
-Wsuggest-attribute=format -Wswitch -Wuninitialized -Wsign-conversion -Wuseless-cast \
-O3 \
$(SVNREV) \
-Wno-error=misleading-indentation -Wno-nonnull-compare \
CPPFLAGS = -std=gnu++11 -pthread -malign-double -fno-math-errno -O3 \

CXX=g++
COMPILE.cpp= $(CXX) $(CPPFLAGS) -c

#prefix = /panfs/pan1.be-md.ncbi.nlm.nih.gov/bacterial_pathogens/backup
prefix=/usr/local

# soft links are created here to INSTALL_DIR
bindir="$(prefix)/bin"
COMPILE.cpp= $(CXX) $(CPPFLAGS) $(SVNREV) -c

datadir=$(prefix)/share

# This is where AMRFinder and the default database will be installed
INSTALL_DIR=$(datadir)/amrfinder
.PHONY: all clean install release

BINARIES= amr_report amrfinder amrfinder_update fasta_check fasta2parts gff_check point_mut

.PHONY: all clean install dist
DISTFILES = Makefile *.cpp *.hpp *.inc test_* amrfinder.pl AMRFinder-dna.sh AMRFinder-prot.sh fasta_check gff_check amr_report

all: amr_report fasta_check gff_check
all: $(BINARIES)

release: clean
svnversion . > version.txt
Expand All @@ -55,35 +58,66 @@ amr_reportOBJS=amr_report.o common.o gff.o
amr_report: $(amr_reportOBJS)
$(CXX) -o $@ $(amr_reportOBJS)

fasta_check.o: common.hpp common.inc
fasta_checkOBJS=fasta_check.o common.o
amrfinder.o: common.hpp common.inc amrfinder.inc
amrfinderOBJS=amrfinder.o common.o
amrfinder: $(amrfinderOBJS)
$(CXX) -o $@ $(amrfinderOBJS) -pthread

amrfinder_update.o: common.hpp common.inc amrfinder.inc
amrfinder_updateOBJS=amrfinder_update.o common.o
amrfinder_update: $(amrfinder_updateOBJS)
$(CXX) -o $@ $(amrfinder_updateOBJS) -lcurl

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

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

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

point_mut.o: common.hpp common.inc
point_mutOBJS=point_mut.o common.o
point_mut: $(point_mutOBJS)
$(CXX) -o $@ $(point_mutOBJS)


clean:
rm -f *.o
rm -f amr_report fasta_check gff_check
#rm version.txt
rm -f $(BINARIES)

install:
$(INSTALL) -D -t $(INSTALL_DIR) amr_report fasta_check gff_check amrfinder.pl
# @dest=$(INSTALL_DIR); \
# if [ ! -e $(bindir)/amrfinder.pl ]; \
# then \
# ln -s "$$dest/amrfinder.pl" $(bindir); \
# ln -s "$$dest/amr_report" $(bindir); \
# ln -s "$$dest/fasta_check" $(bindir); \
# ln -s "$$dest/gff_check" $(bindir); \
# else \
# echo "$$dest/amrfinder.pl already exists, so skipping link creation"; \
# fi

DISTDIR=amrfinder.$(VERSION_STRING)
$(INSTALL) -D --target-directory=$(PREFIX)/bin $(BINARIES)

# amrfinder binaries for github binary release
GITHUB_FILE=amrfinder_binaries_v$(VERSION_STRING)
GITHUB_FILES = test_* $(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
mkdir $(GITHUB_FILE)
echo $(VERSION_STRING) > $(GITHUB_FILE)/version.txt
cp $(GITHUB_FILES) $(GITHUB_FILE)
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)/*
rm -r $(GITHUB_FILE)/*
rmdir $(GITHUB_FILE)

DISTFILES=$(GITHUB_FILES) Makefile *.cpp *.hpp *.inc
dist:
@if [ ! -e version.txt ]; \
then \
Expand All @@ -104,22 +138,20 @@ dist:
rm -r $(DISTDIR)/*
rmdir $(DISTDIR)

# amrfinder binaries for github binary release
GITHUB_FILE=amrfinder_binaries_v$(VERSION_STRING)
GITHUB_FILES = test_* amrfinder.pl fasta_check gff_check amr_report
github_binaries: all
@if [ ! -e version.txt ]; \
then \
echo >&2 "version.txt required to make a distribution file"; \
false; \
fi
mkdir $(GITHUB_FILE)
echo $(VERSION_STRING) > $(GITHUB_FILE)/version.txt
cp $(GITHUB_FILES) $(GITHUB_FILE)
sed "s/curr_version = .*/curr_version = '$(VERSION_STRING)';/" amrfinder.pl > $(GITHUB_FILE)/amrfinder.pl
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)/*
rm -r $(GITHUB_FILE)/*
rmdir $(GITHUB_FILE)

test:
curl -O https://raw.githubusercontent.com/ncbi/amr/v3b/test_dna.fa \
-O https://raw.githubusercontent.com/ncbi/amr/v3b/test_prot.fa \
-O https://raw.githubusercontent.com/ncbi/amr/v3b/test_prot.gff \
-O https://raw.githubusercontent.com/ncbi/amr/v3b/test_both.expected \
-O https://raw.githubusercontent.com/ncbi/amr/v3b/test_dna.expected \
-O https://raw.githubusercontent.com/ncbi/amr/v3b/test_prot.expected
amrfinder --plus -p test_prot.fa -g test_prot.gff -O Campylobacter > test_prot.got
diff test_prot.expected test_prot.got
amrfinder --plus -n test_dna.fa -O Campylobacter > test_dna.got
diff test_dna.expected test_dna.got
amrfinder --plus -n test_dna.fa -p test_prot.fa -g test_prot.gff -O Campylobacter > test_both.got
diff test_both.got test_both.expected


-O https://raw.githubusercontent.com/ncbi/amr/v3b/test_prot.expected
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NCBI Antimicrobial Resistance Gene Finder (AMRFinder)
# NCBI Antimicrobial Resistance Gene Finder (AMRFinderPlus)

This software and the accompanying database are designed to find acquired antimicrobial resistance genes in protein or nucleotide sequences.
This software and the accompanying database are designed to find acquired antimicrobial resistance genes and some point mutations in protein or assembled nucleotide sequences. We have also added "plus" stress, head, and biocide resistance as well as some virulence factors and E. coli antigens.

## See [the wiki for documentation](https://github.com/ncbi/amr/wiki)
[Subscribe to our announce list](https://www.ncbi.nlm.nih.gov/mailman/listinfo/amrfinder-announce) for announcements of database or software updates.
Expand Down
Loading

0 comments on commit b11e5a9

Please sign in to comment.