Skip to content

Commit

Permalink
Update utility/ and make sqStoreCreate warn and accept malformatted i…
Browse files Browse the repository at this point in the history
…nputs.
  • Loading branch information
brianwalenz committed Sep 17, 2020
1 parent 69e22c9 commit 8c967e4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/seqrequester
34 changes: 27 additions & 7 deletions src/stores/sqStoreCreate.C
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,18 @@ public:
class loadStats {
public:
loadStats() {
nINVALID = nSHORT = nLONG = nLOADED=0;
bINVALID = bSHORT = bLONG = bLOADED=0;
nINVALID = nSHORT = nLONG = nLOADED = nWARNINGS = 0;
bINVALID = bSHORT = bLONG = bLOADED = 0;
};
~loadStats() {
};

void import(loadStats &that) {
nINVALID += that.nINVALID; bINVALID += that.bINVALID;
nSHORT += that.nSHORT; bSHORT += that.bSHORT;
nLONG += that.nLONG; bLONG += that.bLONG;
nLOADED += that.nLOADED; bLOADED += that.bLOADED;
nINVALID += that.nINVALID; bINVALID += that.bINVALID;
nSHORT += that.nSHORT; bSHORT += that.bSHORT;
nLONG += that.nLONG; bLONG += that.bLONG;
nLOADED += that.nLOADED; bLOADED += that.bLOADED;
nWARNINGS += that.nWARNINGS;
};

#define PERC(x,t) (t > 0) ? (100.0 * x / t) : (0.0)
Expand Down Expand Up @@ -113,10 +114,15 @@ public:
nINVALID, PERC(nINVALID, nTotal),
bINVALID, PERC(bINVALID, bTotal));

if (nWARNINGS > 0)
fprintf(F, "%-10s %9" F_U32P "\n",
"Warnings",
nWARNINGS);

fprintf(F, "\n");
};

uint32 nINVALID, nSHORT, nLONG, nLOADED;
uint32 nINVALID, nSHORT, nLONG, nLOADED, nWARNINGS;
uint64 bINVALID, bSHORT, bLONG, bLOADED;
};

Expand Down Expand Up @@ -196,6 +202,20 @@ loadReads(sqStore *seqStore,

while (SF->loadSequence(sq) == true) {

// Check for and log parsing errors.

if (sq.wasError() == true) {
fprintf(errorLog, "error reading sequence at/before '%s' in file '%s'.\n",
sq.name(), fileName);
filestats.nWARNINGS += 1;
}

if (sq.wasReSync() == true) {
fprintf(errorLog, "lost sync reading before sequence '%s' in file '%s'.\n",
sq.name(), fileName);
filestats.nWARNINGS += 1;
}

// Trim Ns from the ends of the sequence.
uint64 bgn = trimBgn(sq, 0, sq.length());
uint64 end = trimEnd(sq, bgn, sq.length());
Expand Down
2 changes: 1 addition & 1 deletion src/utility

0 comments on commit 8c967e4

Please sign in to comment.