SuffixTree::~SuffixTree(){
for(int i=0;i<nodeVector.size();i++){ delete nodeVector[i]; }
+ nodeVector.clear();
}
//********************************************************************************************************************
-void SuffixTree::loadSequence(Sequence* seq){
+void SuffixTree::loadSequence(Sequence seq){
nodeCounter = 0; // initially there are 0 nodes in the tree
activeStartPosition = 0;
activeEndPosition = -1;
- seqName = seq->getName();
- sequence = seq->convert2ints();
+ seqName = seq.getName();
+ sequence = seq.convert2ints();
sequence += '5'; // this essentially concatenates a '$' to the end of the sequence to
int seqLength = sequence.length(); // make it a cononical suffix tree
void SuffixTree::print(){
vector<SuffixNode*> hold = nodeVector;
sort(hold.begin(), hold.end(), compareParents);
- cout << "Address\t\tParent\tNode\tSuffix\tStartC\tEndC\tSuffix" << endl;
+ mothurOut("Address\t\tParent\tNode\tSuffix\tStartC\tEndC\tSuffix"); mothurOutEndLine();
for(int i=1;i<=nodeCounter;i++){
hold[i]->print(sequence, i);
}