Skip to content

Commit

Permalink
Merge pull request #28 from edawine/handle-no-bad-kmers
Browse files Browse the repository at this point in the history
Handle empty list if there are no bad kmers
  • Loading branch information
mdshw5 authored Oct 8, 2017
2 parents 7a34cd8 + 3648187 commit de49a0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fastqp/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ def kmerplot(positions, counts, filename, top_kmers, fig_kw):
all_kmers = [counts[k].keys() for k in sorted(counts.keys())]
kmers = set(list(itertools.chain.from_iterable(all_kmers)))
kmer_len = len(tuple(kmers)[0])
#kmer_sums = Counter(dict(zip(kmers, [sum([counts[pos].get(kmer, 0) for pos in positions]) for kmer in kmers])))
#top_kmers = [x[0] for x in kmer_sums.most_common(9)]
if not top_kmers:
top_kmers = [None]
cmap = mpl.cm.get_cmap(name='Set1')
colors = [cmap(i) for i in np.linspace(0, 1, len(top_kmers))]
mpl.rcParams['axes.prop_cycle'] = mpl.cycler(color=colors)
Expand Down

0 comments on commit de49a0d

Please sign in to comment.