Permalink
Browse files

Add --no-unal option to stop reporting of unaligned reads

  • Loading branch information...
1 parent 5ce9329 commit f053cb6521c4020a736578430e53fb3b00990c10 @ch4rr0 ch4rr0 committed Jun 5, 2017
Showing with 11 additions and 0 deletions.
  1. +6 −0 ebwt_search.cpp
  2. +4 −0 sam.cpp
  3. +1 −0 search_globals.h
View
@@ -147,6 +147,7 @@ static vector<string> qualities2;
static string wrapper; // Type of wrapper script
bool gAllowMateContainment;
bool gReportColorPrimer;
+bool noUnal; // don't print unaligned reads
MUTEX_T gLock;
static void resetOptions() {
@@ -255,6 +256,7 @@ static void resetOptions() {
wrapper.clear();
gAllowMateContainment = false; // true -> alignments where one mate lies inside the other are valid
gReportColorPrimer = false; // true -> print flag with trimmed color primer and downstream color
+ noUnal = false; // true -> do not report unaligned reads
}
// mating constraints
@@ -340,6 +342,7 @@ enum {
ARG_COLOR_PRIMER,
ARG_WRAPPER,
ARG_INTERLEAVED_FASTQ,
+ ARG_SAM_NO_UNAL,
};
static struct option long_options[] = {
@@ -446,6 +449,7 @@ static struct option long_options[] = {
{(char*)"col-primer", no_argument, 0, ARG_COLOR_PRIMER},
{(char*)"wrapper", required_argument, 0, ARG_WRAPPER},
{(char*)"interleaved", required_argument, 0, ARG_INTERLEAVED_FASTQ},
+ {(char*)"no-unal", no_argument, 0, ARG_SAM_NO_UNAL},
{(char*)0, 0, 0, 0} // terminator
};
@@ -526,6 +530,7 @@ static void printUsage(ostream& out) {
<< " --refidx refer to ref. seqs by 0-based index rather than name" << endl
<< " --al <fname> write aligned reads/pairs to file(s) <fname>" << endl
<< " --un <fname> write unaligned reads/pairs to file(s) <fname>" << endl
+ << " --no-unal suppress SAM records for unaligned reads" << endl
<< " --max <fname> write reads/pairs over -m limit to file(s) <fname>" << endl
<< " --suppress <cols> suppresses given columns (comma-delim'ed) in default output" << endl
<< " --fullref write entire ref name (default: only up to 1st space)" << endl
@@ -828,6 +833,7 @@ static void parseOptions(int argc, const char **argv) {
case ARG_SAM_NO_QNAME_TRUNC: samNoQnameTrunc = true; break;
case ARG_SAM_NOHEAD: samNoHead = true; break;
case ARG_SAM_NOSQ: samNoSQ = true; break;
+ case ARG_SAM_NO_UNAL: noUnal = true; break;
case ARG_SAM_RG: {
if(!rgs.empty()) rgs += '\t';
rgs += optarg;
View
@@ -11,6 +11,7 @@
#include "pat.h"
#include "hit.h"
#include "sam.h"
+#include "search_globals.h"
using namespace std;
@@ -66,6 +67,9 @@ void SAMHitSink::reportUnOrMax(
{
if(un) {
HitSink::reportUnaligned(threadId, p);
+ if (noUnal) {
+ return;
+ }
} else {
HitSink::reportMaxed(*hs, threadId, p);
}
View
@@ -20,6 +20,7 @@ extern bool showSeed;
extern bool quiet;
extern bool gAllowMateContainment;
extern bool gReportColorPrimer;
+extern bool noUnal;
extern MUTEX_T gLock;

0 comments on commit f053cb6

Please sign in to comment.