X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=database.cpp;h=f587f42f4440261934277d2adab1e8fe006f97ee;hp=44e663bde3c9a9d9bd40895ef1a600779594ce21;hb=050a3ff02473a3d4c0980964e1a9ebe52e55d6b8;hpb=544469443afe44920bdf279aefd26d29534cabaf diff --git a/database.cpp b/database.cpp index 44e663b..f587f42 100644 --- a/database.cpp +++ b/database.cpp @@ -7,55 +7,28 @@ * */ -using namespace std; - - +#include "mothur.h" #include "sequence.hpp" #include "database.hpp" /**************************************************************************************************/ -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); - - cout << endl << "Reading in the " << fastaFileName << " template sequences...\t"; cout.flush(); - - //all of this is elsewhere already! - numSeqs=count(istreambuf_iterator(fastaFile),istreambuf_iterator(), '>'); // count the number of - fastaFile.seekg(0); // sequences - - templateSequences.resize(numSeqs); - - string seqName, sequence; - for(int i=0;i> 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] = new Sequence(seqName, aligned); - fastaFile.putback(letter); - } - - fastaFile.close(); - //all of this is elsewhere already! - - cout << "DONE." << endl; cout.flush(); - +Database::Database(){ + longest = 0; + numSeqs = 0; + m = MothurOut::getInstance(); } +/**************************************************************************************************/ + +Database::~Database(){} /**************************************************************************************************/ float Database::getSearchScore() { return searchScore; } // we're assuming that the search is already done + +/**************************************************************************************************/ + +int Database::getLongestBase() { return longest+1; } + /**************************************************************************************************/