Hi,I constructed a Trie with createTrie and then I tried to call parseString. The following error message came up: seqan-trunk/core/include/seqan/graph_types/graph_impl_automaton.h:905 Assertion failed : idInUse(g.data_id_managerV, vertex) should be true but was 0
When I broke my program down, I saw that my parseString call does not work at all. (But the error message vanished mysteriously) It should store the final Vertex, but it doesn't.
Regards, Jakob Here my little code example: (without error message) #include <iostream> #include <seqan/graph_algorithms.h> #include <seqan/graph_types.h> using namespace seqan; using namespace std; int main() { typedef Graph<Automaton<Dna> > TGraph; typedef VertexDescriptor<TGraph>::Type TVertexDescriptor; String<String<unsigned int> > terminalStateMap; TGraph g; String<CharString> sequenceList; appendValue(sequenceList, "aat"); appendValue(sequenceList, "aac"); createTrie(g, terminalStateMap, sequenceList); DnaString str; appendValue(str, 'c'); appendValue(str, 'a'); appendValue(str, 'a'); appendValue(str, 'c'); Iterator<Dna>::Type itBegin = begin(str) + 1; Iterator<Dna>::Type itEnd = end(str); TVertexDescriptor finalVertex = getRoot(g); parseString(g, finalVertex, itBegin, itEnd); cout << "finalVertex = " << finalVertex << endl;cout << "finalVertex == root" << "\t" << isRoot(g, finalVertex) << endl;
return 0; } Output: finalVertex = 0 finalVertex == root 1
#include <iostream> #include <seqan/graph_algorithms.h> #include <seqan/graph_types.h> using namespace seqan; using namespace std; int main() { typedef Graph<Automaton<Dna> > TGraph; typedef VertexDescriptor<TGraph>::Type TVertexDescriptor; String<String<unsigned int> > terminalStateMap; TGraph g; String<CharString> sequenceList; appendValue(sequenceList, "aat"); appendValue(sequenceList, "aac"); createTrie(g, terminalStateMap, sequenceList); DnaString str; appendValue(str, 'c'); appendValue(str, 'a'); appendValue(str, 'a'); appendValue(str, 'c'); Iterator<Dna>::Type itBegin = begin(str) + 1; Iterator<Dna>::Type itEnd = end(str); TVertexDescriptor finalVertex = getRoot(g); parseString(g, finalVertex, itBegin, itEnd); cout << "finalVertex = " << finalVertex << endl; cout << "finalVertex == root" << "\t" << isRoot(g, finalVertex) << endl; return 0; }