Commit 49a937c5 authored by Penom Nom's avatar Penom Nom
Browse files

Decreased memory consumption.

parent c42d96d7
......@@ -143,20 +143,22 @@ def make_qual_stats (quals, options):
"""
# First get information from sequences qualities
qtable = []
quality_sum = []
nb_reads = []
for desc, qual in quals :
qualv = qual.split()
for i, val in enumerate(qualv):
try:
qtable[i].append(int(val))
quality_sum[i] += int(val)
nb_reads[i] += 1
except:
qtable.append([])
qtable[i].append(int(val))
quality_sum.append(int(val))
nb_reads.append(1)
stat_file = open(os.path.join(options.output, os.path.basename(options.input) + ".qual.stat"), 'wr')
plot_avg = []
for nuclq in qtable:
avg = float(sum(nuclq))/float(len(nuclq))
for pos in range(len(quality_sum)):
avg = float(quality_sum[pos])/float(nb_reads[pos])
plot_avg.append(avg)
stat_file.write(str(avg) + "\n")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment