diff options
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/multifasta_to_otu.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/c/multifasta_to_otu.c b/src/c/multifasta_to_otu.c index 268dec6..f61c76f 100644 --- a/src/c/multifasta_to_otu.c +++ b/src/c/multifasta_to_otu.c @@ -122,9 +122,6 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - // set defaults - - if(verbose) { printf("kmer: %d\n", kmer); printf("lambda: %d\n", lambda); @@ -136,6 +133,16 @@ int main(int argc, char **argv) { } + if(access (sensing_matrix_filename, F_OK) == -1) { + fprintf(stderr, "Error: could not find %s\n", sensing_matrix_filename); + exit(EXIT_FAILURE); + } + + if(access (sensing_fasta_filename, F_OK) == -1) { + fprintf(stderr, "Error: could not find %s\n", sensing_fasta_filename); + exit(EXIT_FAILURE); + } + input_directory_dh = opendir(input_fasta_directory); if(input_fasta_directory == NULL) { fprintf(stderr, "could not open %s\n", input_fasta_directory); @@ -155,6 +162,9 @@ int main(int argc, char **argv) { // 4 "ACGT" ^ Kmer gives us the size of output rows width = pow(4, kmer) + 1; sequences = count_sequences(sensing_fasta_filename); + if(sequences == 0) { + fprintf(stderr, "Error: %s contains 0 fasta sequences\n", sensing_fasta_filename); + } if(verbose) { printf("directory count: %d\n", dir_count); |