]> git.donarmstrong.com Git - fastq-tools.git/blobdiff - src/fastq-grep.c
Much simpler faster code for parsing fastq files.
[fastq-tools.git] / src / fastq-grep.c
index 8eb6f7f6cc1f8182b4705e6673e26faceadab5a1..4d1603f7ced45f3d34e28d00e60204689031d4a8 100644 (file)
@@ -59,10 +59,10 @@ void fastq_grep(FILE* fin, FILE* fout, FILE* mismatch_file, pcre* re)
     int ovector[3];
     size_t count = 0;
 
-    fastq_t* fqf = fastq_open(fin);
-    seq_t* seq = fastq_alloc_seq();
+    fastq_t* fqf = fastq_create(fin);
+    seq_t* seq = seq_create();
 
-    while (fastq_next(fqf, seq)) {
+    while (fastq_read(fqf, seq)) {
 
         rc = pcre_exec(re,          /* pattern */
                        NULL,        /* extra data */
@@ -82,8 +82,8 @@ void fastq_grep(FILE* fin, FILE* fout, FILE* mismatch_file, pcre* re)
         }
     }
 
-    fastq_free_seq(seq);
-    fastq_close(fqf);
+    seq_free(seq);
+    fastq_free(fqf);
 
     if (count_flag) fprintf(fout, "%zu\n", count);
 }