aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2013-10-17 10:36:18 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2013-10-17 10:36:18 -0400
commit87926cdc71d259eaff2146fe193424b264b7c627 (patch)
tree9fd1ffc3248877ca10d85a3190b1d5d780fc6ef0
parentb5618d07a51ed431b9710c7f35ae7f4cc8d4e0a3 (diff)
update kmer utils
-rw-r--r--kmer_utils.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/kmer_utils.c b/kmer_utils.c
index 111e550..0f5f6d6 100644
--- a/kmer_utils.c
+++ b/kmer_utils.c
@@ -46,35 +46,8 @@ inline unsigned long num_to_index(const char *str, const int kmer, const long er
return out;
}
-void convert_kmer_to_num(char *str, const unsigned long length) {
-
- unsigned long i = 0;
-
- for(i = 0; i < length; i++) {
- // this is _not_ portable, only works with ASCII values.
- switch(str[i] | 0x20 ) {
- case 'a':
- str[i] = 0;
- break;
- case 'c':
- str[i] = 1;
- break;
- case 'g':
- str[i] = 2;
- break;
- case 't':
- str[i] = 3;
- break;
- default:
- // Error Checking: use 4 so we can shift right twice
- // to check quickly is there is an non ACGT character
- str[i] = 5;
- }
-
- }
-
-}
-
+// Strip out any character 'c' from char array 's' into a destination dest (you
+// need to allocate that) and copy only len characters.
char *strnstrip(const char *s, char *dest, int c, unsigned long long len) {
unsigned long long i = 0;