Skip to content

Commit

Permalink
Version 3.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrover committed Jan 3, 2020
1 parent 0cd9162 commit 782828c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 32 deletions.
6 changes: 6 additions & 0 deletions alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,12 @@ void Alignment::qc () const

QC_ASSERT (nident <= (refEnd - refStart) / al2ref_len);
QC_ASSERT (nident <= (targetEnd - targetStart) / al2target_len);

for (const SeqChange& seqChange : seqChanges)
{
seqChange. qc ();
QC_ASSERT (seqChange. al == this);
}
}


Expand Down
4 changes: 2 additions & 2 deletions amr_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,7 @@ struct Batch
for (const SeqChange& seqChange1 : blastAl1->seqChanges)
{
ASSERT (seqChange1. al == blastAl1);
if (! seqChange1. mutation)
continue;
ASSERT (seqChange1. mutation);
for (const BlastAlignment* blastAl2 : goodBlastAls)
if ( blastAl2->targetName == blastAl1->targetName
&& blastAl2->targetStrand == blastAl1->targetStrand
Expand All @@ -1190,6 +1189,7 @@ struct Batch
for (Iter<Vector<SeqChange>> iter (var_cast (blastAl2) -> seqChanges); iter. next (); )
{
SeqChange& seqChange2 = *iter;
ASSERT (seqChange2. mutation);
ASSERT (seqChange2. al == blastAl2);
if ( seqChange1. start_target == seqChange2. start_target
&& seqChange1. better (seqChange2)
Expand Down
8 changes: 5 additions & 3 deletions amrfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* cat, cp, cut, grep, head, mkdir, mv, nproc, sed, sort, tail
*
* Release changes:
* 3.6.3 01/03/2020 PD-3230 sorting of report rows
* 12/28/2019 QC in dna_mutation
* 3.6.2 12/27/2019 PD-3230 Redundant reported lines are removed for mutated reference proteins
* Reports are sorted by sort
* 3.6.1 12/27/2019 PD-3230 Mutated proteins are added to AMRProt
Expand Down Expand Up @@ -90,7 +92,7 @@ using namespace Common_sp;
#ifdef SVN_REV
#define SOFTWARE_VER SVN_REV
#else
#define SOFTWARE_VER "3.6.2"
#define SOFTWARE_VER "3.6.3"
#endif
#define DATA_VER_MIN "2019-12-26.1"

Expand Down Expand Up @@ -655,8 +657,8 @@ struct ThisApplication : ShellApplication
}

// Sorting
// PD-2244
const string sortS (emptyArg (dna) && emptyArg (gff) ? "-k2 -k1" : "-k2 -k3n -k4n -k5 -k1");
// PD-2244, PD-3230
const string sortS (emptyArg (dna) && emptyArg (gff) ? "-k1,1 -k2,2" : "-k1,1 -k2,2 -k3,3n -k4,4n -k5,5");
exec ("head -1 " + tmp + ".amr > " + tmp + ".amr-out");
exec ("LANG=C && tail -n +2 " + tmp + ".amr | sort " + sortS + " >> " + tmp + ".amr-out");
exec ("mv " + tmp + ".amr-out " + tmp + ".amr");
Expand Down
2 changes: 1 addition & 1 deletion amrfinder_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ using namespace Common_sp;
#ifdef SVN_REV
#define SOFTWARE_VER SVN_REV
#else
#define SOFTWARE_VER "3.6.2"
#define SOFTWARE_VER "3.6.3"
#endif

string curMinor;
Expand Down
55 changes: 30 additions & 25 deletions dna_mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ using namespace Alignment_sp;
#ifdef SVN_REV
#define SOFTWARE_VER SVN_REV
#else
#define SOFTWARE_VER "3.6.2"
#define SOFTWARE_VER "3.6.3"
#endif


Expand All @@ -65,7 +65,6 @@ unique_ptr<OFStream> mutation_all; // ??


struct BlastnAlignment : Alignment
// BLASTN alignment
{
// PD-2001
static constexpr const size_t flankingLen = 200; // PAR
Expand Down Expand Up @@ -149,7 +148,7 @@ struct BlastnAlignment : Alignment

struct Batch
{
vector<BlastnAlignment> blastAls;
VectorOwn<BlastnAlignment> blastAls;


explicit Batch (const string &mutation_tab)
Expand Down Expand Up @@ -214,10 +213,11 @@ struct Batch
os << td. str () << endl;
}

for (const auto& blastAl : blastAls)
for (const BlastnAlignment* blastAl : blastAls)
{
blastAl. qc ();
blastAl. saveText (os);
ASSERT (blastAl);
blastAl->qc ();
blastAl->saveText (os);
}
}
};
Expand Down Expand Up @@ -259,10 +259,12 @@ struct ThisApplication : Application
if (verbose ())
cout << f. line << endl;
}
BlastnAlignment al (f. line);
al. qc ();
if (al. good ())
batch. blastAls. push_back (move (al));
auto al = new BlastnAlignment (f. line);
al->qc ();
if (al->good ())
batch. blastAls << al;
else
delete al;
}
}
if (verbose ())
Expand All @@ -275,32 +277,35 @@ struct ThisApplication : Application
if (verbose ())
{
cout << "After process():" << endl;
for (const auto& blastAl : batch. blastAls)
for (const BlastnAlignment* blastAl : batch. blastAls)
{
blastAl. saveText (cout);
cout << ' ' << blastAl. seqChanges. size () << endl;
ASSERT (blastAl);
blastAl->saveText (cout);
cout << ' ' << blastAl->seqChanges. size () << endl;
}
}


for (const BlastnAlignment& blastAl1 : batch. blastAls)
for (const SeqChange& seqChange1 : blastAl1. seqChanges)
for (const BlastnAlignment* blastAl1 : batch. blastAls)
for (const SeqChange& seqChange1 : blastAl1->seqChanges)
{
if (! seqChange1. mutation)
continue;
for (BlastnAlignment& blastAl2 : batch. blastAls)
if ( blastAl2. targetName == blastAl1. targetName
&& blastAl2. targetStrand == blastAl1. targetStrand
&& & blastAl2 != & blastAl1
ASSERT (seqChange1. al == blastAl1);
ASSERT (seqChange1. mutation);
for (const BlastnAlignment* blastAl2 : batch. blastAls)
if ( blastAl2->targetName == blastAl1->targetName
&& blastAl2->targetStrand == blastAl1->targetStrand
&& blastAl2 != blastAl1
)
for (SeqChange& seqChange2 : blastAl2. seqChanges)
//for (SeqChange& seqChange2 : blastAl2. seqChanges)
for (Iter<Vector<SeqChange>> iter (var_cast (blastAl2) -> seqChanges); iter. next (); )
{
if (! seqChange2. mutation)
continue;
SeqChange& seqChange2 = *iter;
ASSERT (seqChange2. al == blastAl2);
ASSERT (seqChange2. mutation);
if ( seqChange1. start_target == seqChange2. start_target
&& seqChange1. neighborhoodMismatch < seqChange2. neighborhoodMismatch
)
seqChange2 = SeqChange ();
iter. erase ();
}
}

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.2
3.6.3

0 comments on commit 782828c

Please sign in to comment.