X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sequence.cpp;h=6aa0c0f8ae2c46a32edde8a67276ccb966bc0003;hb=0bcfddf7bc721a334bdae42d86a580019303537d;hp=872a0f091d49fddac359d528c53c799a50ef3c66;hpb=c67cf4168e1a124088b6f017946f0aa1fbdf1301;p=mothur.git diff --git a/sequence.cpp b/sequence.cpp index 872a0f0..6aa0c0f 100644 --- a/sequence.cpp +++ b/sequence.cpp @@ -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; }