aboutsummaryrefslogtreecommitdiff
path: root/kmer_utils.c
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-02-02 00:40:35 -0500
committerCalvin Morrison <mutantturkey@gmail.com>2014-02-02 00:40:35 -0500
commit18580d2bd0fc240d337b285e6e805104867e891a (patch)
tree51f497a196ce8325f33928f42dbb0a1616dc9b77 /kmer_utils.c
parent9e8c8b136fbee0c55c5a428f58fad4ffa2a19702 (diff)
add a helper function for python
Diffstat (limited to 'kmer_utils.c')
-rw-r--r--kmer_utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kmer_utils.c b/kmer_utils.c
index a8589c5..587404d 100644
--- a/kmer_utils.c
+++ b/kmer_utils.c
@@ -229,3 +229,14 @@ unsigned long long * get_kmer_counts_from_file(FILE *fh, const unsigned int kmer
return counts;
}
+
+unsigned long long * get_kmer_counts_from_filename(const char *fn, const unsigned int kmer) {
+ FILE *fh = fopen(fn, "r");
+ if(fh == NULL) {
+ fprintf(stderr, "Could not open %s - %s\n", fn, strerror(errno));
+ return 0;
+ }
+
+ return get_kmer_counts_from_file(fh, kmer);
+}
+