Skip to content

Commit

Permalink
change addPadding approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaura committed Jan 27, 2022
1 parent b96ccd8 commit 66b6f68
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/AlevinUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,12 +629,11 @@ namespace alevin {

void addPadding(std::string& seq, uint32_t max, const char padBases[], uint32_t padLen) {
int diff = max - seq.length() + 1; // add one base if the length is same to avoid erroneous collisions
int rep = diff / padLen;
int extra = diff % padLen;
for(int i = 0; i < rep; i++){
seq += padBases;
}
for(int i = 0; i < extra; i++){
for(int i = 0; i < diff; i++){
if(i >= padLen){
i -= padLen;
diff -= padLen;
}
seq += padBases[i];
}
}
Expand Down

0 comments on commit 66b6f68

Please sign in to comment.