Browse files

Paired variant discovery is now a command line option

  • Loading branch information...
1 parent a079cc3 commit 5211a9c3333ab3825b06d708ea49e2f6103faaae @jts committed Apr 29, 2013
Showing with 14 additions and 2 deletions.
  1. +7 −1 src/GraphDiff/GraphCompare.cpp
  2. +2 −1 src/GraphDiff/GraphCompare.h
  3. +5 −0 src/SGA/graph-diff.cpp
View
8 src/GraphDiff/GraphCompare.cpp
@@ -243,10 +243,16 @@ GraphBuildResult GraphCompare::processVariantKmer(const std::string& str, int /*
if(m_parameters.algorithm == GCA_DEBRUIJN_GRAPH)
{
+ DeBruijnHaplotypeBuilder dbg_builder(m_parameters);
+ dbg_builder.setInitialHaplotype(str);
+ dbg_builder.run(result.variant_haplotypes);
+ }
+ else if(m_parameters.algorithm == GCA_PAIRED_DEBRUIJN_GRAPH)
+ {
PairedDeBruijnHaplotypeBuilder dbg_builder(m_parameters);
dbg_builder.setInitialHaplotype(str);
dbg_builder.run(result.variant_haplotypes);
- }
+ }
else if(m_parameters.algorithm == GCA_STRING_GRAPH)
{
OverlapHaplotypeBuilder overlap_builder(m_parameters);
View
3 src/GraphDiff/GraphCompare.h
@@ -33,7 +33,8 @@
enum GraphCompareAlgorithm
{
GCA_STRING_GRAPH,
- GCA_DEBRUIJN_GRAPH
+ GCA_DEBRUIJN_GRAPH,
+ GCA_PAIRED_DEBRUIJN_GRAPH
};
// Parameters structure
View
5 src/SGA/graph-diff.cpp
@@ -77,6 +77,7 @@ static const char *GRAPH_DIFF_USAGE_MESSAGE =
" -k, --kmer=K use K-mers to discover variants\n"
" -x, --min-discovery-count=T require a variant k-mer to be seen at least T times\n"
" --debruijn use the de Bruijn graph assembly algorithm (default: string graph)\n"
+" --paired-debruijn use the de Bruijn graph assembly algorithm with paired-end constraints(default: string graph)\n"
" -m, --min-overlap=N require at least N bp overlap when assembling using a string graph\n"
" --min-dbg-count=T only use k-mers seen T times when assembling using a de Bruijn graph\n"
"\nReport bugs to " PACKAGE_BUGREPORT "\n\n";
@@ -99,6 +100,7 @@ namespace opt
// Calling modes
static bool deBruijnMode = false;
+ static bool deBruijnPairedMode = false;
static bool lowCoverage = false;
static bool referenceMode = false;
static bool useQualityScores = false;
@@ -123,6 +125,7 @@ enum { OPT_HELP = 1,
OPT_MIN_DBG_COUNT,
OPT_INDEX,
OPT_DEBRUIJN,
+ OPT_PAIRED_DEBRUIJN,
OPT_LOWCOVERAGE,
OPT_QUALSCORES,
OPT_BLOOM_GENOME,
@@ -139,6 +142,7 @@ static const struct option longopts[] = {
{ "prefix", required_argument, NULL, 'p' },
{ "min-overlap", required_argument, NULL, 'm' },
{ "debruijn", no_argument, NULL, OPT_DEBRUIJN },
+ { "paired-debruijn", no_argument, NULL, OPT_PAIRED_DEBRUIJN },
{ "low-coverage", no_argument, NULL, OPT_LOWCOVERAGE },
{ "use-quality-scores", no_argument, NULL, OPT_QUALSCORES},
{ "index", required_argument, NULL, OPT_INDEX },
@@ -458,6 +462,7 @@ void parseGraphDiffOptions(int argc, char** argv)
case 'v': opt::verbose++; break;
case OPT_REFERENCE: arg >> opt::referenceFile; break;
case OPT_DEBRUIJN: opt::deBruijnMode = true; break;
+ case OPT_PAIRED_DEBRUIJN: opt::deBruijnPairedMode = true; break;
case OPT_LOWCOVERAGE: opt::lowCoverage = true; break;
case OPT_MIN_DBG_COUNT: arg >> opt::minDBGCount; break;
case OPT_BLOOM_GENOME: arg >> opt::bloomGenomeSize; break;

0 comments on commit 5211a9c

Please sign in to comment.