]> git.donarmstrong.com Git - mothur.git/blobdiff - sequence.cpp
added trim.seqs command
[mothur.git] / sequence.cpp
index e997cc2872cba1e4deeeffc3d3c1c32009568fcf..6a15eb5f7d23f93272811a975beedc649a0d9ce9 100644 (file)
@@ -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