X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=database.cpp;h=f587f42f4440261934277d2adab1e8fe006f97ee;hp=f8491469a3fec224f299125fdd960a38343f921b;hb=050a3ff02473a3d4c0980964e1a9ebe52e55d6b8;hpb=74c78f9abd9e733f0c2f812efec97a76632fcbf8 diff --git a/database.cpp b/database.cpp index f849146..f587f42 100644 --- a/database.cpp +++ b/database.cpp @@ -13,47 +13,22 @@ /**************************************************************************************************/ -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; } + /**************************************************************************************************/