Hello BioStars,

Is there a tool which generates mapping quality score distributions from bam files?

I know I could potentially do this myself, but I am looking for something which would essentially do the work for me, and also something which plugs in nicely to multiqc

I have had a quick search, and it is surprisingly difficult to find a tool which provides this functionality, so I am just wondering if I am missing something obvious here? The obvious candidate would be something like picard, but picard does not seem to offer this functionality from what I can tell

Thanks in advance!
```
$ samtools view input.bam | cut -f 5 | sort | uniq  -c | sort -n | awk '{printf("MAPQ:%s\t%d\n",$2,$1);}' | gnuplot -e " set terminal dumb ;set nokey; plot '-' using 2:xtic(1) with boxes"



  400 ++---+---------+---------+---------+--------+---------+----***********
      |    +         +         +         +        +         +    *    +    *
  350 ++                                                         *        +*
      |                                                          *         *
      |                                                          *         *
  300 ++                                                         *        +*
      |                                                          *         *
  250 ++                                                         *        +*
      |                                                          *         *
  200 ++                                                         *        +*
      |                                                          *         *
      |                                                          *         *
  150 ++                                                         *        +*
      |                                                          *         *
  100 ++                                                         *        +*
      |                                                          *         *
      |                                                          *         *
   50 ++                                               ***********        +*
      |    +         +         +         +   ***********    +    *    +    *
    0 **********************************************************************
        MAPQ:7    MAPQ:25   MAPQ:0    MAPQ:70  MAPQ:29   MAPQ:37   MAPQ:60



```