+
+int Sequence::getNumBases(){
+ return numBases;
+}
+
+//********************************************************************************************************************
+
+void Sequence::printSequence(ostream& out){
+
+ out << ">" << name << endl;
+ if(isAligned){
+ out << aligned << endl;
+ }
+ else{
+ out << unaligned << endl;
+ }
+}
+
+//********************************************************************************************************************
+
+int Sequence::getAlignLength(){
+ return alignmentLength;
+}
+
+//********************************************************************************************************************
+
+int Sequence::getAmbigBases(){
+ if(ambigBases == -1){
+ ambigBases = 0;
+ for(int j=0;j<numBases;j++){
+ if(unaligned[j] != 'A' && unaligned[j] != 'T' && unaligned[j] != 'G' && unaligned[j] != 'C'){
+ ambigBases++;
+ }
+ }
+ }
+
+ return ambigBases;
+}
+
+//********************************************************************************************************************
+
+int Sequence::getLongHomoPolymer(){
+ if(longHomoPolymer == -1){
+ longHomoPolymer = 1;
+ int homoPolymer = 1;
+ for(int j=1;j<numBases;j++){
+ if(unaligned[j] == unaligned[j-1]){
+ homoPolymer++;
+ }
+ else{
+ if(homoPolymer > longHomoPolymer){ longHomoPolymer = homoPolymer; }
+ homoPolymer = 1;
+ }
+ }
+ if(homoPolymer > longHomoPolymer){ longHomoPolymer = homoPolymer; }
+ }
+ return longHomoPolymer;
+}
+
+//********************************************************************************************************************
+
+int Sequence::getStartPos(){
+ if(endPos == -1){
+ for(int j = 0; j < alignmentLength; j++) {
+ if(aligned[j] != '.'){
+ startPos = j + 1;
+ break;
+ }
+ }
+ }
+ if(isAligned == 0){ startPos = 1; }
+
+ return startPos;
+}
+
+//********************************************************************************************************************
+
+int Sequence::getEndPos(){
+ if(endPos == -1){
+ for(int j=alignmentLength-1;j>=0;j--){
+ if(aligned[j] != '.'){
+ endPos = j + 1;
+ break;
+ }
+ }
+ }
+ if(isAligned == 0){ endPos = numBases; }
+
+ return endPos;
+}
+
+//********************************************************************************************************************
+
+bool Sequence::getIsAligned(){
+ return isAligned;
+}
+
+//********************************************************************************************************************
+
+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;
+ aligned = temp;
+
+}
+/**************************************************************************************************/