Skip to content

Commit

Permalink
Merge branch 'v2'
Browse files Browse the repository at this point in the history
Release 3.8.28

 - amrfinder -u option no longer overwrites databases if they already exist.
    New --force_update option will still overwrite the database as the old -u
    option did. ([#16])
 - New --protein_output and --nucleotide_output options will produce FASTA files
    containing the sequence of AMRFinderPlus hits
 - --mutation_all output has been streamlined and some bugs have been fixed
 - New --name option will prepend a "Name" field to every row of the
    AMRFinderPlus report ([#25])
 - Fusion genes are now reported with both element symbols separated by a '/' on
    both lines of the report. E.g., aac(6')-Ie/aph(2'')-If2
 - For HMM-only hits (have HMM in the method column which means they do not have
    BLAST results that meet cutoff) BLAST statistics will now be reported
    if any alignment at that location was made.
 - When in COMBINED (nucleotide + protein) mode and when an "INTERNAL_STOP" is detected
    at a locus that also has a protein, the protein result will be reported with
    Method of INTERNAL_STOP (Previously the nucleotide result was reported. This
    would affect the identity, length, and coverage statistics AMRFinderPlus reports.
 - Improved handling of partial alignments for point-mutation detection, including
    prioritization of translated matches (POINTX) when the protein match identifies fewer
    known SNPs.
 - Incorrect amino acids inferred by protein annotations extended in the 5' (N-terminal)
    direction because correct annotations start with alternative start codons will
    no longer count as mismatches.
 - Small improvements in performance.
  • Loading branch information
evolarjun committed Oct 6, 2020
2 parents 7966313 + 86cf27e commit 63fb016
Show file tree
Hide file tree
Showing 19 changed files with 1,375 additions and 501 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@ jobs:
run: ./amrfinder -u
- 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'
- name: make github_binaries
run: make github_binaries
- uses: actions/upload-artifact@v2
with:
name: release-binary
path: amrfinder_binaries_v*.tar.gz

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ data/
amr_report
amrfinder
fasta_check
fasta_extract
dna_mutation
gff_check
amrfinder_update
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ COMPILE.cpp= $(CXX) $(CPPFLAGS) $(SVNREV) $(DBDIR) -c

.PHONY: all clean install release

BINARIES= amr_report amrfinder amrfinder_update fasta_check fasta2parts gff_check dna_mutation
BINARIES= amr_report amrfinder amrfinder_update fasta_check fasta_extract fasta2parts gff_check dna_mutation

all: $(BINARIES)

Expand Down Expand Up @@ -89,6 +89,11 @@ fasta_checkOBJS=fasta_check.o common.o
fasta_check: $(fasta_checkOBJS)
$(CXX) -o $@ $(fasta_checkOBJS)

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

fasta2parts.o: common.hpp common.inc
fasta2partsOBJS=fasta2parts.o common.o
fasta2parts: $(fasta2partsOBJS)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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.
[Please subscribe to our announce list](https://www.ncbi.nlm.nih.gov/mailman/listinfo/amrfinder-announce) for announcements of database and software updates.

----
# Licenses
Expand Down
59 changes: 54 additions & 5 deletions alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ bool normalizeSeq (const string &seq1,
ASSERT (seq1. size () == seq2. size ());

bool changed = false;
size_t start = NO_INDEX;
size_t start = no_index;
FFOR (size_t, i, seq1. size ())
if (start == NO_INDEX)
if (start == no_index)
{
if (seq2 [i] == '-')
start = i;
Expand All @@ -432,7 +432,7 @@ bool normalizeSeq (const string &seq1,
changed = true;
}
else
start = NO_INDEX;
start = no_index;
}
ASSERT (seq1. size () == seq2. size ());

Expand Down Expand Up @@ -694,13 +694,13 @@ void Alignment::setSeqChanges (const Vector<Mutation> &refMutations,
}

// SeqChange::mutation
size_t start_ref_prev = NO_INDEX;
size_t start_ref_prev = no_index;
for (SeqChange& seqChange : seqChanges)
{
seqChange. qc ();
if (verbose ())
seqChange. saveText (cout);
IMPLY (start_ref_prev != NO_INDEX, start_ref_prev <= seqChange. start_ref);
IMPLY (start_ref_prev != no_index, start_ref_prev <= seqChange. start_ref);
while (j < refMutations. size ())
{
const Mutation& mut = refMutations [j];
Expand Down Expand Up @@ -829,6 +829,55 @@ void Alignment::qc () const



bool Alignment::getFrameShift_right (const Alignment &rightPart,
size_t diff_max) const
{
ASSERT (! targetProt);
ASSERT (refProt);
ASSERT (rightPart. refProt);

if (this == & rightPart)
return false;

if (rightPart. targetProt)
return false;

if ( targetName != rightPart. targetName
|| refName != rightPart. refName
|| targetStrand != rightPart. targetStrand
)
return false;

if ( refStart >= rightPart. refStart
|| refEnd >= rightPart. refEnd
|| refEnd + diff_max / 3 < rightPart. refStart
)
return false;

if (targetStrand)
{
if ( targetStart >= rightPart. targetStart
|| targetEnd >= rightPart. targetEnd
|| targetEnd + diff_max < rightPart. targetStart
)
return false;
}
else
{
if ( targetStart <= rightPart. targetStart
|| targetEnd <= rightPart. targetEnd
|| targetStart > rightPart. targetEnd + diff_max
)
return false;
}

if (targetStart % 3 == rightPart. targetStart % 3)
return false;

return true;
}



} // namespace

Expand Down
17 changes: 17 additions & 0 deletions alignment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ struct SeqChange : Root
char prev {'\0'};

const Mutation* mutation {nullptr};

const SeqChange* replacement {nullptr};


SeqChange () = default;
Expand Down Expand Up @@ -182,6 +184,7 @@ struct SeqChange : Root
bool finish (const string &refSeq,
size_t flankingLen);
// Return: good match
// Input: flankingLen: valid if > 0
private:
void setSeq ();
void setStartStopRef ();
Expand Down Expand Up @@ -252,6 +255,7 @@ struct Alignment : Root
void setSeqChanges (const Vector<Mutation> &refMutations,
size_t flankingLen/*,
bool allMutationsP*/);
// Input: flankingLen: valid if > 0
public:
bool empty () const override
{ return targetName. empty (); }
Expand Down Expand Up @@ -288,6 +292,19 @@ struct Alignment : Root
&& nident == refLen
&& nident == targetSeq. size ();
}
bool getFrameShift (const Alignment &other,
size_t diff_max) const
// Return: success
// Input: diff_max: in bp
// Requires: !targetProt, refProt, rightPart.refProt
{ return nident >= other. nident
&& ( getFrameShift_right (other, diff_max)
|| other. getFrameShift_right (*this, diff_max)
);
}
private:
bool getFrameShift_right (const Alignment &rightPart,
size_t diff_max) const;
};


Expand Down
Loading

0 comments on commit 63fb016

Please sign in to comment.