]> git.donarmstrong.com Git - mothur.git/blobdiff - sequence.cpp
mods to seq.errror
[mothur.git] / sequence.cpp
index 872a0f091d49fddac359d528c53c799a50ef3c66..6aa0c0f8ae2c46a32edde8a67276ccb966bc0003 100644 (file)
@@ -427,6 +427,13 @@ string Sequence::getAligned(){
        else                            {  return aligned;  }
 }
 
+//********************************************************************************************************************
+
+string Sequence::getInlineSeq(){
+       return name + '\t' + aligned;   
+}
+
+
 //********************************************************************************************************************
 
 string Sequence::getPairwise(){
@@ -514,7 +521,7 @@ int Sequence::getLongHomoPolymer(){
 //********************************************************************************************************************
 
 int Sequence::getStartPos(){
-       if(endPos == -1){
+       if(startPos == -1){
                for(int j = 0; j < alignmentLength; j++) {
                        if(aligned[j] != '.'){
                                startPos = j + 1;
@@ -529,6 +536,17 @@ int Sequence::getStartPos(){
 
 //********************************************************************************************************************
 
+void Sequence::padToPos(int start){
+
+       for(int j = startPos-1; j < start-1; j++) {
+               aligned[j] = '.';
+       }
+       startPos = start;
+
+}
+
+//********************************************************************************************************************
+
 int Sequence::getEndPos(){
        if(endPos == -1){
                for(int j=alignmentLength-1;j>=0;j--){
@@ -545,6 +563,17 @@ int Sequence::getEndPos(){
 
 //********************************************************************************************************************
 
+void Sequence::padFromPos(int end){
+       
+       for(int j = end; j < endPos; j++) {
+               aligned[j] = '.';
+       }
+       endPos = end;
+       
+}
+
+//********************************************************************************************************************
+
 bool Sequence::getIsAligned(){
        return isAligned;
 }