Scripts that implement samtools flagstat functionality, but provide statistics for individual reads rather than individual alignments
Script can be run in multi-threaded mode (actually turns out slower due to thread lock) or in non-threaded mode:
SAMstatsParallel \
--sorted_sam_file examples/wgs_bam_NA12878_20k_b37_NA12878.sam \
--outf stats.parallel.txt \
--chunk_size 1000 \
--threads 2
SAMstats \
--sorted_sam_file examples/wgs_bam_NA12878_20k_b37_NA12878.sam \
--outf stats.txt \
--chunk_size 1000