Skip to content

Commit

Permalink
Merge pull request #70 from deltadev/patches
Browse files Browse the repository at this point in the history
sga overlap - "--prefix" option added.
  • Loading branch information
jts committed Apr 4, 2014
2 parents d7c1781 + e9cbc19 commit 7c0a475
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
9 changes: 9 additions & 0 deletions src/.gitignore
Expand Up @@ -12,3 +12,12 @@ build*
*.o
*.a
Makefile

config.h
config.log
config.status
stamp-h1
compile
.deps

SGA/sga
17 changes: 12 additions & 5 deletions src/SGA/overlap.cpp
Expand Up @@ -63,6 +63,7 @@ static const char *OVERLAP_USAGE_MESSAGE =
" -t, --threads=NUM use NUM worker threads to compute the overlaps (default: no threading)\n"
" -e, --error-rate the maximum error rate allowed to consider two sequences aligned (default: exact matches only)\n"
" -m, --min-overlap=LEN minimum overlap required between two reads (default: 45)\n"
" -p, --prefix=PREFIX use PREFIX for the names of the index files (default: prefix of the input file)\n"
" -f, --target-file=FILE perform the overlap queries against the reads in FILE\n"
" -x, --exhaustive output all overlaps, including transitive edges\n"
" --exact force the use of the exact-mode irreducible block algorithm. This is faster\n"
Expand All @@ -88,7 +89,8 @@ namespace opt
static std::string readsFile;
static std::string targetFile;
static std::string outFile;

static std::string prefix;

static double errorRate = 0.0f;
static unsigned int minOverlap = DEFAULT_MIN_OVERLAP;
static int seedLength = 0;
Expand All @@ -98,7 +100,7 @@ namespace opt
static bool bExactIrreducible = false;
}

static const char* shortopts = "m:d:e:t:l:s:o:f:vix";
static const char* shortopts = "m:d:e:t:l:s:o:f:p:vix";

enum { OPT_HELP = 1, OPT_VERSION, OPT_EXACT };

Expand Down Expand Up @@ -148,11 +150,15 @@ int overlapMain(int argc, char** argv)
// Determine which index files to use. If a target file was provided,
// use the index of the target reads
std::string indexPrefix;
if(!opt::targetFile.empty())
indexPrefix = stripFilename(opt::targetFile);
if(!opt::prefix.empty())
indexPrefix = opt::prefix;
else
{
if(!opt::targetFile.empty())
indexPrefix = stripFilename(opt::targetFile);
else
indexPrefix = stripFilename(opt::readsFile);

}
BWT* pBWT = new BWT(indexPrefix + BWT_EXT, opt::sampleRate);
BWT* pRBWT = new BWT(indexPrefix + RBWT_EXT, opt::sampleRate);
OverlapAlgorithm* pOverlapper = new OverlapAlgorithm(pBWT, pRBWT,
Expand Down Expand Up @@ -325,6 +331,7 @@ void parseOverlapOptions(int argc, char** argv)
{
case 'm': arg >> opt::minOverlap; break;
case 'o': arg >> opt::outFile; break;
case 'p': arg >> opt::prefix; break;
case 'e': arg >> opt::errorRate; break;
case 't': arg >> opt::numThreads; break;
case 'l': arg >> opt::seedLength; break;
Expand Down

0 comments on commit 7c0a475

Please sign in to comment.