Skip to content

Commit

Permalink
Adding a test for gzip compressed files
Browse files Browse the repository at this point in the history
  • Loading branch information
linsalrob committed Aug 5, 2019
1 parent dd76dad commit 13224e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "fastq_pair.h"
#include "is_gzipped.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Expand All @@ -20,7 +21,7 @@ void help(char *s);
int main(int argc, char* argv[]) {

if (argc == 2 && (strcmp(argv[1], "-V") == 0)) {
fprintf(stdout, "%s version %0.1f\n", argv[0], 0.2);
fprintf(stdout, "%s version %0.1f\n", argv[0], 0.3);
exit(0);
}
if (argc < 3) {
Expand Down Expand Up @@ -61,6 +62,14 @@ int main(int argc, char* argv[]) {
exit(-1);
}

//if (test_gzip(left_file) || test_gzip(right_file)) {
if (test_gzip(left_file) || test_gzip(right_file)) {
fprintf(stderr, "ERROR: It appears that your files are compressed with gzip.\n");
fprintf(stderr, "At this time we can't handle gzipped files because we use random access reading of the data stream.\n");
fprintf(stderr, "Please either uncompress the files, or check these alternatives: https://edwards.sdsu.edu/research/sorting-and-paring-fastq-files/\n");
exit(-1);
}


long long start_time, end_time, overhead_time;
start_time = get_time_ms();
Expand All @@ -71,7 +80,7 @@ int main(int argc, char* argv[]) {
int success = pair_files(left_file, right_file, opt);
end_time = get_time_ms();
if (opt->verbose)
printf ("Elapsed time = %lld (ms)\n", end_time - start_time - overhead_time);
printf ("Elapsed time = %lld (ms)\n", end_time - start_time - overhead_time);

return success;
}
Expand Down
Binary file added test/left.fastq.gz
Binary file not shown.
Binary file added test/right.fastq.gz
Binary file not shown.

0 comments on commit 13224e5

Please # to comment.