Created
September 30, 2019 08:31
-
-
Save wdecoster/6d96abcc1cf421ad86e4ecb9d05a8b0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Bio import SeqIO | |
import seaborn as sns | |
from collections import defaultdict | |
import gzip | |
import sys | |
q_per_base = defaultdict(list) | |
for record in SeqIO.parse(gzip.open(sys.argv[1], 'rt'), "fastq"): | |
for n, q in zip(record.seq, record.letter_annotations["phred_quality"]): | |
q_per_base[n].append(q) | |
ax = sns.violinplot(data=list(q_per_base.values())) | |
ax.set_xticklabels(list(q_per_base.keys())) | |
fig = ax.get_figure() | |
fig.savefig(fname="Per_base_quality.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment