Skip to content

Commit

Permalink
adding option -l/--minReadLen; reads shorter than this threshold will…
Browse files Browse the repository at this point in the history
… be reported as un-mapped
  • Loading branch information
haghshenas committed Dec 18, 2017
1 parent af1f537 commit 2ee15a2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/CommandLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ int parseCommandLine (int argc, char *argv[])
{"unMapped", required_argument, 0, 'u'},
{"thread", required_argument, 0, 't'},
{"minAnchorLen", required_argument, 0, 'k'},
{"minReadLen", required_argument, 0, 'l'},
{"seedCount", required_argument, 0, 'c'},
{"err", required_argument, 0, 'e'},
{"maxRefHit", required_argument, 0, 'm'},
Expand All @@ -140,7 +141,7 @@ int parseCommandLine (int argc, char *argv[])



while ( (o = getopt_long ( argc, argv, "I:S:s:o:u:t:k:c:e:m:n:hv", longOptions, &index))!= -1 )
while ( (o = getopt_long ( argc, argv, "I:S:s:o:u:t:k:l:c:e:m:n:hv", longOptions, &index))!= -1 )
{
switch (o)
{
Expand Down Expand Up @@ -174,6 +175,9 @@ int parseCommandLine (int argc, char *argv[])
case 'k':
WINDOW_SIZE = atoi(optarg);
break;
case 'l':
CHUNK_OVERLAP = atoi(optarg);
break;
case 'c':
SAMPLING_COUNT = atoi(optarg);
break;
Expand All @@ -200,6 +204,8 @@ int parseCommandLine (int argc, char *argv[])
// case 'z':
// MAX_MEMORY = atoi(optarg);
// break;
default:
return 1;
}

}
Expand Down
15 changes: 15 additions & 0 deletions src/LordFAST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,21 @@ void* mapSeq(void *idp)
readLen = (*read->length);
qualLen = (*read->isFq ? *read->length : 1);

if(readLen < CHUNK_OVERLAP)
{
outBuffer<< read->name << "\t4\t*\t0\t0\t*\t*\t0\t0\t" << read->seq << "\t" << read->qual << "\t"
<< "AS:i:0\n";
if(outBuffer.tellp() > opt_outputBufferSize)
{
pthread_mutex_lock(&_pf_outputLock);
fprintf(_pf_outFile, "%s", outBuffer.str().c_str());
pthread_mutex_unlock(&_pf_outputLock);
outBuffer.str("");
outBuffer.clear();
}
continue;
}

reverseComplete(read->seq, seq_rev, *read->length);

// extract forward-reverse seeds
Expand Down

0 comments on commit 2ee15a2

Please sign in to comment.