[Seqan-dev] index creation fails


Hi

I emailed a month ago, got no response. I can't seem to create a
ticket on the trac. Thought I might try again here.

The following code snippet is crashing. I think it's a bug though
can't be sure since I'm not an expert. The code might not look very
minimal but I needed to generate enough data to reproduce it, thus the
rather large example. The point at which the crash occurs is here:

 indexRequire(index, QGramSA());

I'm on an up to date svn. I'm running OSX Snow Leopard. Please let me
know if there's any other information I can provide or otherwise.

Thank you in advance,

Daniel



#include <algorithm>
#include <seqan.h>

using namespace seqan;

// Generates random nucleotides.
struct MyGenerator : std::unary_function<char, void>
{
   std::string syms;
   MyGenerator (std::string syms = "ACGT") : syms(syms) { srand(time(NULL)); }
  char operator()(void) { return syms[rand() % syms.size()]; }
};

int main(int argc, char** argv)
{
  typedef StringSet<DnaString>                                  TMyStringSet;
  typedef Index<TMyStringSet, IndexQGram<UngappedShape<8> > >   TMyIndex;

  StringSet<DnaString> myStringSet;

  for (unsigned i = 0; i < 100; ++i) {
      DnaString input;
      resize(input, 60);
      generate_n(begin(input), 60, MyGenerator());
      appendValue(myStringSet, input);
  }

  std::cout << myStringSet[0] << std::endl;
  TMyIndex index(myStringSet);
  std::cout << "requiring QGramSA..." << std::endl;

  indexRequire(index, QGramSA());

  return 0;
}