@@ -930,11 +930,19 @@ static int mpileup(mplp_conf_t *conf)
930930 // init mpileup
931931 conf -> iter = bam_mplp_init (conf -> nfiles , mplp_func , (void * * )conf -> mplp_data );
932932 if ( conf -> flag & MPLP_SMART_OVERLAPS ) bam_mplp_init_overlaps (conf -> iter );
933- fprintf (stderr , "[%s] maximum number of reads per input file set to -d %d\n" , __func__ , conf -> max_depth );
934- if ( (double )conf -> max_depth * conf -> nfiles > 1 <<20 )
935- fprintf (stderr , "Warning: Potential memory hog, up to %.0fM reads in the pileup!\n" , (double )conf -> max_depth * conf -> nfiles );
936- if ( (double )conf -> max_depth * conf -> nfiles / nsmpl < 250 )
937- fprintf (stderr , "Note: The maximum per-sample depth with -d %d is %.1fx\n" , conf -> max_depth ,(double )conf -> max_depth * conf -> nfiles / nsmpl );
933+ if ( !conf -> max_depth )
934+ {
935+ conf -> max_depth = INT_MAX ;
936+ fprintf (stderr , "[%s] Max depth set to maximum value (%d)\n" , __func__ , INT_MAX );
937+ }
938+ else
939+ {
940+ fprintf (stderr , "[%s] maximum number of reads per input file set to -d %d\n" , __func__ , conf -> max_depth );
941+ if ( (double )conf -> max_depth * conf -> nfiles > 1 <<20 )
942+ fprintf (stderr , "Warning: Potential memory hog, up to %.0fM reads in the pileup!\n" , (double )conf -> max_depth * conf -> nfiles );
943+ if ( (double )conf -> max_depth * conf -> nfiles / nsmpl < 250 )
944+ fprintf (stderr , "Note: The maximum per-sample depth with -d %d is %.1fx\n" , conf -> max_depth ,(double )conf -> max_depth * conf -> nfiles / nsmpl );
945+ }
938946 bam_mplp_set_maxcnt (conf -> iter , conf -> max_depth );
939947 conf -> max_indel_depth = conf -> max_indel_depth * nsmpl ;
940948 conf -> bcf_rec = bcf_init1 ();
0 commit comments