X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sequence.cpp;h=6a15eb5f7d23f93272811a975beedc649a0d9ce9;hb=64eee3a595ae53817f52807d7393b22e74e31f56;hp=e997cc2872cba1e4deeeffc3d3c1c32009568fcf;hpb=986663e2220f6b043ee83d1699cfa081dc49cbed;p=mothur.git diff --git a/sequence.cpp b/sequence.cpp index e997cc2..6a15eb5 100644 --- a/sequence.cpp +++ b/sequence.cpp @@ -30,12 +30,14 @@ Sequence::Sequence(string newName, string sequence) { //******************************************************************************************************************** Sequence::Sequence(ifstream& fastaFile){ + initialize(); + fastaFile >> name; + name = name.substr(1); + char c; + + while ((c = fastaFile.get()) != EOF) { if (c == 10){ break; } } // get rest of line if there's any crap there - string accession; // provided a file handle to a fasta-formatted sequence file, read in the next - fastaFile >> accession; // accession number and sequence we find... - setName(accession); - char letter; string sequence; @@ -50,7 +52,6 @@ Sequence::Sequence(ifstream& fastaFile){ if(letter == 'U'){letter = 'T';} sequence += letter; } - } if(sequence.find_first_of('-') != string::npos){ // if there are any gaps in the sequence, assume that it is