def plot_gc_content(self, fontsize=16, ec="k", bins=100):
"""plot GC content histogram
:params bins: a value for the number of bins or an array (with a copy()
method)
:param ec: add black contour on the bars
.. plot::
:include-source:
from sequana import BAM, sequana_data
b = BAM(sequana_data('test.bam'))
b.plot_gc_content()
"""
data = self.get_gc_content()
try:
X = np.linspace(0, 100, bins)
except:
X = bins.copy()
pylab.hist(data, X, normed=True, ec=ec)
pylab.grid(True)
mu = pylab.mean(data)
sigma = pylab.std(data)
X = pylab.linspace(X.min(), X.max(), 100)
pylab.plot(X, pylab.normpdf(X, mu, sigma), lw=2, color="r", ls="--")
pylab.xlabel("GC content", fontsize=16)
评论列表
文章目录