Skip to content

Commit

Permalink
Merge pull request #42 from csf-ngs/prefix_for_fm-merge
Browse files Browse the repository at this point in the history
added prefix for fm-merge
  • Loading branch information
jts committed Mar 12, 2013
2 parents 009b71a + 321140f commit aa7e5e1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/SGA/fm-merge.cpp
Expand Up @@ -43,6 +43,7 @@ static const char *FMMERGE_USAGE_MESSAGE =
"\n" "\n"
" --help display this help and exit\n" " --help display this help and exit\n"
" -v, --verbose display verbose output\n" " -v, --verbose display verbose output\n"
" -p, --prefix=PREFIX use PREFIX for the names of the index files (default: prefix of the input file)\n"
" -t, --threads=NUM use NUM worker threads (default: no threading)\n" " -t, --threads=NUM use NUM worker threads (default: no threading)\n"
" -m, --min-overlap=LEN minimum overlap required between two reads to merge (default: 45)\n" " -m, --min-overlap=LEN minimum overlap required between two reads to merge (default: 45)\n"
" -o, --outfile=FILE write the merged sequences to FILE (default: basename.merged.fa)\n" " -o, --outfile=FILE write the merged sequences to FILE (default: basename.merged.fa)\n"
Expand All @@ -66,6 +67,7 @@ static const char* shortopts = "p:m:d:e:t:l:s:o:vix";
enum { OPT_HELP = 1, OPT_VERSION }; enum { OPT_HELP = 1, OPT_VERSION };


static const struct option longopts[] = { static const struct option longopts[] = {
{ "prefix", required_argument, NULL, 'p' },
{ "verbose", no_argument, NULL, 'v' }, { "verbose", no_argument, NULL, 'v' },
{ "threads", required_argument, NULL, 't' }, { "threads", required_argument, NULL, 't' },
{ "min-overlap", required_argument, NULL, 'm' }, { "min-overlap", required_argument, NULL, 'm' },
Expand Down Expand Up @@ -204,8 +206,16 @@ void parseFMMergeOptions(int argc, char** argv)


// Parse the input filenames // Parse the input filenames
opt::readsFile = argv[optind++]; opt::readsFile = argv[optind++];
opt::prefix = stripFilename(opt::readsFile);
if(opt::prefix.empty())
{
opt::prefix = stripFilename(opt::readsFile);
}


if(opt::outFile.empty()) if(opt::outFile.empty())
{
opt::outFile = opt::prefix + ".merged.fa"; opt::outFile = opt::prefix + ".merged.fa";
}

} }

0 comments on commit aa7e5e1

Please sign in to comment.