name = newName;
if(sequence.find_first_of('-') != string::npos) {
setAligned(sequence);
- isAligned = 1;
}
setUnaligned(sequence);
//********************************************************************************************************************
Sequence::Sequence(ifstream& fastaFile){
+ initialize();
string accession; // provided a file handle to a fasta-formatted sequence file, read in the next
fastaFile >> accession; // accession number and sequence we find...
}
}
}
-
+ isAligned = 1;
}
//********************************************************************************************************************
if(endPos == -1){
for(int j = 0; j < alignmentLength; j++) {
if(aligned[j] != '.'){
- startPos = j;
+ startPos = j + 1;
break;
}
}
- }
+ }
+ if(isAligned == 0){ startPos = 1; }
+
return startPos;
}
if(endPos == -1){
for(int j=alignmentLength-1;j>=0;j--){
if(aligned[j] != '.'){
- endPos = j;
+ endPos = j + 1;
break;
}
}
}
+ if(isAligned == 0){ endPos = numBases; }
+
return endPos;
}
}
//********************************************************************************************************************
+
+void Sequence::reverseComplement(){
+
+ string temp;
+ for(int i=numBases-1;i>=0;i--){
+ if(unaligned[i] == 'A') { temp += 'T'; }
+ else if(unaligned[i] == 'T'){ temp += 'A'; }
+ else if(unaligned[i] == 'G'){ temp += 'C'; }
+ else if(unaligned[i] == 'C'){ temp += 'G'; }
+ else { temp += 'N'; }
+ }
+ unaligned = temp;
+
+}
+
+//********************************************************************************************************************