2929#include < stdlib.h>
3030#include < regex.h>
3131#include < zlib.h>
32+ #include < inttypes.h>
3233
3334
3435#include " hash.h"
@@ -58,7 +59,7 @@ static inline unsigned int median_rl(FASTQ_FILE* fd1,FASTQ_FILE* fd2) {
5859FASTQ_FILE* validate_interleaved (char *f) {
5960 // unsigned long cline=1;
6061
61- fprintf (stderr ," Paired-end interleaved\n " );
62+ fprintf (stdout ," Paired-end interleaved\n " );
6263
6364 FASTQ_FILE* fd1=fastq_new (f,FALSE ," r" );
6465 fastq_is_pe (fd1);
@@ -237,7 +238,7 @@ int fastq_info_main(int argc, char **argv ) {
237238 break ;
238239 case ' f' :
239240 // fix_dot = TRUE;
240- fprintf (stderr ," Fixing (-f) enabled: Replacing . by N (creating .fix.gz files)\n " );
241+ fprintf (stdout ," Fixing (-f) enabled: Replacing . by N (creating .fix.gz files)\n " );
241242 PRINT_ERROR (" -f option is no longer valid." );
242243 exit (PARAMS_ERROR_EXIT_STATUS);
243244 ++nopt;
@@ -276,30 +277,31 @@ int fastq_info_main(int argc, char **argv ) {
276277 fd1=validate_interleaved (argv[1 +nopt]);
277278 num_reads1=fd1->num_rds ;
278279 } else if ( is_paired_data && is_sorted && skip_readname_check ) {
279- fprintf (stderr ," -s option used: assuming that reads have the same ordering in both files\n " );
280+ fprintf (stdout ," -s option used: assuming that reads have the same ordering in both files\n " );
280281 fd1=validate_paired_sorted_fastq_file (argv[1 +nopt],argv[2 +nopt]);
281282 num_reads1=fd1->num_rds ;
282283
283284 } else if ( !is_paired_data && skip_readname_check) {
284285 // SE & skip readname check
285- fprintf (stderr ," Skipping check for duplicated read names\n " );
286+ fprintf (stdout ," Skipping check for duplicated read names\n " );
286287 fd1=validate_single_fastq_file (argv[1 +nopt]);
287288 num_reads1=fd1->num_rds ;
288289 } else {
289290 // single or pair of fastq file(s)
290291 fd1=fastq_new (argv[1 +nopt],FALSE ," r" );
291292 if ( is_paired_data) fastq_is_pe (fd1);
292- fprintf (stderr ," DEFAULT_HASHSIZE=%lu\n " ,(long unsigned int )DEFAULT_HASHSIZE);
293+ fprintf (stdout ," DEFAULT_HASHSIZE=%lu\n " ,(long unsigned int )DEFAULT_HASHSIZE);
293294 index=new_hashtable (DEFAULT_HASHSIZE);
294295 index_mem+=sizeof (hashtable);
295- fprintf (stderr ," Scanning and indexing all reads from %s\n " ,fd1->filename );
296+ fprintf (stdout ," Scanning and indexing all reads from %s\n " ,fd1->filename );
296297 fastq_index_readnames (fd1,index,0 ,FALSE );
297- fprintf (stderr ," Scanning complete.\n " );
298+ fprintf (stdout ," Scanning complete.\n " );
298299 num_reads1=index->n_entries ;
299- fprintf (stderr ," \n " );
300+ fprintf (stdout ," \n " );
300301 // print some info
301- fprintf (stderr," Reads processed: %llu\n " ,index->n_entries );
302- fprintf (stderr," Memory used in indexing: ~%ld MB\n " ,index_mem/1024 /1024 );
302+ fprintf (stdout, " Reads processed: %" PRIu64 " \n " , index->n_entries );
303+ // fprintf(stdout,"Reads processed: %llu\n",index->n_entries);
304+ fprintf (stdout," Memory used in indexing: ~%ld MB\n " ,index_mem/1024 /1024 );
303305 }
304306
305307 if (num_reads1 == 0 ) {
@@ -321,8 +323,8 @@ int fastq_info_main(int argc, char **argv ) {
321323
322324 // pair-end
323325 if (argc-nopt ==3 && !is_interleaved && ! is_sorted ) {
324- fprintf (stderr ," File %s processed\n " ,argv[1 +nopt]);
325- fprintf (stderr ," Next file %s\n " ,argv[2 +nopt]);
326+ fprintf (stdout ," File %s processed\n " ,argv[1 +nopt]);
327+ fprintf (stdout ," Next file %s\n " ,argv[2 +nopt]);
326328 // validate the second file and check if all reads are paired
327329 fd2=fastq_new (argv[2 +nopt],FALSE ," r" );
328330 fastq_is_pe (fd2);
@@ -352,7 +354,8 @@ int fastq_info_main(int argc, char **argv ) {
352354 printf (" \n " );
353355 // fastq_destroy(fdf);//???
354356 if (index->n_entries >0 ) {
355- PRINT_ERROR (" Error in file %s: found %llu unpaired reads" ,argv[1 +nopt],index->n_entries );
357+ PRINT_ERROR (" Error in file %s: found %" PRIu64 " unpaired reads" ,argv[1 +nopt],index->n_entries );
358+ // PRINT_ERROR("Error in file %s: found %llu unpaired reads",argv[1+nopt],index->n_entries);
356359 exit (FASTQ_FORMAT_ERROR_EXIT_STATUS);
357360 }
358361 // stats
@@ -365,7 +368,7 @@ int fastq_info_main(int argc, char **argv ) {
365368 // stats
366369 // min qual/max qual/read len
367370 FILE* out;
368- out=stderr ;
371+ out=stdout ;
369372
370373 fprintf (out," ------------------------------------\n " );
371374 if ( num_reads2>0 ) {
0 commit comments