From c0838b7286f3da6ba1d0962b78df24b80c4a8d1d Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Tue, 9 Sep 2014 17:49:37 -0400 Subject: allow for kmer inference and fix memory leak in get_fasta_files_from_file --- src/c/quikr_functions.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/c/quikr_functions.c') 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); } -- cgit v1.2.3