+ m->errorOut(e, "Sequence", "getCommentString");
+ exit(1);
+ }
+}
+//********************************************************************************************************************
+string Sequence::getSequenceString(istringstream& fastaFile, int& numAmbig) {
+ try {
+ char letter;
+ string sequence = "";
+ numAmbig = 0;
+
+ while(!fastaFile.eof()){
+ letter= fastaFile.get();
+
+ if(letter == '>'){
+ fastaFile.putback(letter);
+ break;
+ }
+ else if(isprint(letter)){
+ letter = toupper(letter);
+ if(letter == 'U'){letter = 'T';}
+ if(letter != '.' && letter != '-' && letter != 'A' && letter != 'T' && letter != 'G' && letter != 'C' && letter != 'N'){
+ letter = 'N';
+ numAmbig++;
+ }
+ sequence += letter;
+ }
+ }
+
+ return sequence;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Sequence", "getSequenceString");
+ exit(1);
+ }
+}
+//********************************************************************************************************************
+//comment can contain '>' so we need to account for that
+string Sequence::getCommentString(istringstream& fastaFile) {
+ try {
+ char letter;
+ string sequence = "";
+
+ while(fastaFile){
+ letter=fastaFile.get();
+ if((letter == '\r') || (letter == '\n')){
+ m->gobble(fastaFile); //in case its a \r\n situation
+ break;
+ }
+ }
+
+ return sequence;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Sequence", "getCommentString");