def plot_qual(ax, quallist, invert=False):
'''
Create a FastQC-like "?Per base sequence quality?" plot
Plot average quality per position
zip will stop when shortest read is exhausted
'''
sns.set_style("darkgrid")
if invert:
l_Q, = ax.plot(np.array([np.mean(position) for position in zip(
*[list(reversed(read)) for read in quallist])]), 'orange', label="Quality")
ax.set_xlabel('Position in read from end')
ax.set_xticklabels(-1 * ax.get_xticks().astype(int))
else:
l_Q, = ax.plot(np.array([np.mean(position)
for position in zip(*quallist)]), 'orange', label="Quality")
ax.set_xlabel('Position in read from start')
return l_Q
评论列表
文章目录