diff options
Diffstat (limited to 'kmer_utils.c')
-rw-r--r-- | kmer_utils.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/kmer_utils.c b/kmer_utils.c index e737346..c0441e2 100644 --- a/kmer_utils.c +++ b/kmer_utils.c @@ -16,27 +16,23 @@ // long kmer - how long of a index value you want to return // long error_pos - what index to return for a non ACGT character // -inline long convert_kmer_to_index(const char *str, long kmer, long error_pos) { +inline long convert_kmer_to_index(const char *str, int kmer, long error_pos) { - long i = 0; - long out = 0; - long multiply = 1; + int i = 0; + unsigned long out = 0; + unsigned long multiply = 1; for(i = kmer - 1; i >= 0; i--){ - switch(str[i]) { + switch(str[i] | 0x20 ) { case 'a': - case 'A': break; case 'c': - case 'C': out += 1 * multiply; break; case 'g': - case 'G': out += 2 * multiply; break; case 't': - case 'T': out += 3 * multiply; break; default: |