aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-03-11 16:00:24 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2014-03-11 16:00:24 -0400
commit26df4bd2e155f0eac67b00270fe22323f26988b1 (patch)
tree3f71974d7bbacc3b48c6390ccb4d9a471eb5e727
parent615405ae7a95bf9f9453f67e26275cb8d9616527 (diff)
more efficient counting on errorsparse
-rw-r--r--kmer_utils.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/kmer_utils.c b/kmer_utils.c
index b96f831..44b5eb0 100644
--- a/kmer_utils.c
+++ b/kmer_utils.c
@@ -218,7 +218,6 @@ kmer_map *get_sparse_kmer_counts_from_file(FILE *fh, int kmer) {
// for each char in the k-mer check if it is an error char
for(i = position + kmer - 1; i >= position; i--){
if(seq[i] == 5) {
- mer = width;
position = i;
goto next;
}
@@ -228,12 +227,9 @@ kmer_map *get_sparse_kmer_counts_from_file(FILE *fh, int kmer) {
mer += seq[i] * multiply;
multiply = multiply << 2;
}
- // use this point to get mer of our loop
- next:
- {
- // bump up the mer value in the counts array
- (*counts)[mer]++;
- }
+ // bump up the mer value in the counts array
+ (*counts)[mer]++;
+ next: ;
}
}
@@ -291,7 +287,6 @@ unsigned long long * get_dense_kmer_counts_from_file(FILE *fh, const unsigned in
// for each char in the k-mer check if it is an error char
for(i = position + kmer - 1; i >= position; i--){
if(seq[i] == 5) {
- mer = width;
position = i;
goto next;
}
@@ -301,12 +296,9 @@ unsigned long long * get_dense_kmer_counts_from_file(FILE *fh, const unsigned in
mer += seq[i] * multiply;
multiply = multiply << 2;
}
- // use this point to get mer of our loop
- next:
- {
- // bump up the mer value in the counts array
- counts[mer]++;
- }
+ // bump up the mer value in the counts array
+ counts[mer]++;
+ next: ;
}
}