aboutsummaryrefslogtreecommitdiff
path: root/src/c/quikr_functions.c
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-09-09 17:49:37 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2014-09-09 17:49:37 -0400
commitc0838b7286f3da6ba1d0962b78df24b80c4a8d1d (patch)
tree0047614ecfe318e711b5875977992683a47641b4 /src/c/quikr_functions.c
parentf251dc46c40501704bfebf2d778577b1f1dc3484 (diff)
allow for kmer inference and fix memory leak in get_fasta_files_from_file
Diffstat (limited to 'src/c/quikr_functions.c')
-rw-r--r--src/c/quikr_functions.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/c/quikr_functions.c b/src/c/quikr_functions.c
index 5715024..8156a19 100644
--- a/src/c/quikr_functions.c
+++ b/src/c/quikr_functions.c
@@ -317,9 +317,10 @@ struct matrix *load_sensing_matrix(const char *filename, unsigned int target_kme
}
lineno++;
- if(kmer != target_kmer) {
- fprintf(stderr, "The sensing_matrix was trained with a different kmer than your requested kmer\n");
- exit(EXIT_FAILURE);
+ // if passed kmer in is zero, just use whatever the matrix is trained as.
+ if(target_kmer != 0 && kmer != target_kmer ) {
+ fprintf(stderr, "The sensing_matrix was trained with a different kmer than your requested kmer\n");
+ exit(EXIT_FAILURE);
}
width = pow_four(kmer);
@@ -344,6 +345,7 @@ struct matrix *load_sensing_matrix(const char *filename, unsigned int target_kme
read = gzgetline(&buf, &len, fh);
if(read == 0) {
fprintf(stderr, "Error parsing sensing matrix, could not read header\n");
+ fprintf(stderr, "%s\n", buf);
exit(EXIT_FAILURE);
}