BAM_STATS(1)

NAME
bam_stats.pl - Generates a file containing read statistics for a given bam file.

SYNOPSIS
bam_stats.pl [options] [file...]

  Required parameters:
    -input    -i   File path to read in.
    -output   -o   File path to output. Defaults to STDOUT.

  Optional parameters:
    -plots    -p   Folder to contain quality score plots.
                    - not available with '-t'
    -threads  -t   Use multiple threads to process the input
                    - warning the complete file is read for each thread.

  Other:
    -help     -h   Brief help message.
    -man      -m   Full documentation.
    -version  -v   Prints the version number.

    bam_stats.pl -i my.bam -o my.bam.bas
    bam_stats.pl -i my.bam > my.bam.bas

OPTIONS

-input
    File path to read. Accepts only .bam files.

-output
    File path to output data. If this option is omitted the script will attempt to write to STDOUT. The

-plots
    Directory to place quality plot images. If omitted no information about base qualities will be collected, thus speeding up the stats collection.

-help
    Print a brief help message and exits.

-man
    Prints the manual page and exits.

-version
    Prints the version number and exits.

DESCRIPTION
bam_stats.pl will attempt to generate a file of statistics for a given .bam file. The stats are are outputted as a tab-delimited rows containing a single header line. The output consists of the following columns:

      'bam_filename' = the name of the bam file stats have been collected for.
      'sample' = the name of the sample (taken from the bam file).
      'platform' = the name of the hardware platform (taken from the bam file).
      'platform_unit' = the platform unit (i.e. lane/run) of the hardware platform (taken from the bam file).
      'library' = the library name associated with the read group.
      'readgroup' = the read group name.
      'read_length_r1' = the read length associated with read 1.
      'read_length_r2' = the read length associated with read 2.
      '#_mapped_bases' = the total number of mapped bases.
      '#_mapped_bases_r1' = the total number of mapped bases for all read 1s.
      '#_mapped_bases_r2' = the total number of mapped bases for all read 2s.
      '#_divergent_bases' = the total number of bases divergent from the reference.
      '#_divergent_bases_r1' = the total number of bases divergent from the reference for all read 1s.
      '#_divergent_bases_r2' = the total number of bases divergent from the reference for all read 2s.
      '#_total_reads' = the total number of reads.
      '#_total_reads_r1' = the total number of read 1s.
      '#_total_reads_r2' = the total number of read 2s.
      '#_mapped_reads' = the total number of unmapped reads.
      '#_mapped_reads_r1' = the total number of unmapped read 1s.
      '#_mapped_reads_r2' = the total number of unmapped read 2s.
      '#_mapped_reads_properly_paired' = the total number of properly paired reads.
      '#_gc_bases_r1' = the total number of G/C bases in read 1s.
      '#_gc_bases_r2' = the total number of G/C bases in read 2s.
      'mean_insert_size' = the mean insert size.
      'insert_size_sd' = the insert size standard deviation.
      'median_insert_size' = the median insert size.
      '#_duplicate_reads' = the total number of duplicate reads.
      '#_mapped_pairs' = the total number of pairs with both ends mapped.
      '#_inter_chr_pairs' = the total number of pairs where each end maps to a different chromosome.

Any reads not linked to a ReadGroup will be combined into the group '.' Please note that the accuracy of statistics in this group may be questionable.