def plot_bar_mapq(self, fontsize=16, filename=None):
"""Plots bar plots of the MAPQ (quality) of alignments
.. plot::
:include-source:
from sequana import BAM, sequana_data
b = BAM(sequana_data('test.bam', "testing"))
b.plot_bar_mapq()
"""
df = self.get_mapq_as_df()
df.plot(kind='hist', bins=range(0,df.max().values[0]+1), legend=False,
grid=True, logy=True)
pylab.xlabel("MAPQ", fontsize=fontsize)
pylab.ylabel("Count", fontsize=fontsize)
try:
# This may raise issue on MAC platforms
pylab.tight_layout()
except:
pass
if filename:
pylab.savefig(filename)
评论列表
文章目录