/**************************************************************************************************/
-Database::Database(string fastaFileName){ // This assumes that the template database is in fasta format, may
- // need to alter this in the future?
-
- ifstream fastaFile;
- openInputFile(fastaFileName, fastaFile);
-
- mothurOutEndLine();
- mothurOut("Reading in the " + fastaFileName + " template sequences...\t"); cout.flush();
+Database::Database(){
+ longest = 0;
+ numSeqs = 0;
+ m = MothurOut::getInstance();
+}
+/**************************************************************************************************/
- //all of this is elsewhere already!
- numSeqs=count(istreambuf_iterator<char>(fastaFile),istreambuf_iterator<char>(), '>'); // count the number of
- fastaFile.seekg(0); // sequences
-
- templateSequences.resize(numSeqs);
-
- string seqName, sequence;
- for(int i=0;i<numSeqs;i++){
- fastaFile >> seqName;
- seqName = seqName.substr(1);
- char letter;
- string aligned;
-
- while(fastaFile && (letter=fastaFile.get()) != '>'){
- if(isprint(letter)){
- letter = toupper(letter);
- if(letter == 'U'){letter = 'T';}
- aligned += letter;
- }
- }
- templateSequences[i] = Sequence(seqName, aligned);
- fastaFile.putback(letter);
- }
-
- fastaFile.close();
- //all of this is elsewhere already!
-
- mothurOut("DONE.");
- mothurOutEndLine(); cout.flush();
+Database::~Database(){}
-}
/**************************************************************************************************/
-Database::~Database(){
+float Database::getSearchScore() { return searchScore; } // we're assuming that the search is already done
- templateSequences.clear();
-}
/**************************************************************************************************/
-float Database::getSearchScore() { return searchScore; } // we're assuming that the search is already done
+int Database::getLongestBase() { return longest+1; }
/**************************************************************************************************/