aboutsummaryrefslogtreecommitdiff
path: root/src/c/quikr.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.c
parentf251dc46c40501704bfebf2d778577b1f1dc3484 (diff)
allow for kmer inference and fix memory leak in get_fasta_files_from_file
Diffstat (limited to 'src/c/quikr.c')
-rw-r--r--src/c/quikr.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/c/quikr.c b/src/c/quikr.c
index de1f39a..5ed72b0 100644
--- a/src/c/quikr.c
+++ b/src/c/quikr.c
@@ -131,25 +131,23 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
+ // load sensing matrix
+ struct matrix *sensing_matrix = load_sensing_matrix(sensing_matrix_filename, kmer);
+
if(kmer == 0) {
- fprintf(stderr, "Error: zero is not a valid kmer\n");
- exit(EXIT_FAILURE);
+ fprintf(stdout, "Warning: zero is not a valid kmer, inferring kmer from sensing matrix\n");
+ kmer = sensing_matrix->kmer;
}
-
// 4 "ACGT" ^ Kmer gives us the size of output rows
width = pow_four(kmer);
- // load sensing matrix
- struct matrix *sensing_matrix = load_sensing_matrix(sensing_matrix_filename, kmer);
-
if(verbose) {
printf("width: %llu\n", width);
printf("sequences: %llu\n", sensing_matrix->sequences);
}
-
// load counts matrix
double *count_matrix = malloc(width * sizeof(double));
check_malloc(count_matrix, NULL);