This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I visualize the output of BAM metrics files generated by samtools stats?

I have a few dozen BAM files and I used samtools stats to generate .txt files containing the outputted BAM metrics for each of my BAMs. I would now like to visualize this output to better understand it, but I'm not sure how to do this.

The samtools stats page in htslib (http://www.htslib.org/doc/samtools-stats.html) says I can visualize the output with plot-bamstats, but I'm finding no information on how to use plot-bamstats. I tried the syntax plot-bamstats my_BAM.txt, but it said I was missing a -p flag which I do not know how to use.

How can I visualize the output with plot-bamstats or some other method?

bam visualization samtools

1 answer

dariober has answered that here: https://stackoverflow.com/questions/54908223/plot-bamtools-where-are-the-commands

samtools stats sortedbamfilename.bam > sortedbamfilename.stats
plot-bamstats -p my_output sortedbamfilename.stats

gnuplot package is required for this to work.

Thanks -- I also had to install Libjpeg Turbo (conda install -c conda-forge libjpeg-turbo) to make this work.

Log in to answer this question.