Skip to content
Snippets Groups Projects
Commit 9d746b0d authored by Veronique Legrand's avatar Veronique Legrand
Browse files

work in progress: testing the impact of underlying buffer size when reading gzip fasta files

parent 8ac42f86
No related branches found
No related tags found
No related merge requests found
Pipeline #153219 failed with stage
in 1 minute and 46 seconds
......@@ -286,14 +286,15 @@ class ReadGetter:
def totReads(filin):
"""Verify and retrieve the number of reads in the fastq file before alignment"""
start_t=time.perf_counter_ns()
bufsize=102400
if filin.endswith('.gz'):
print(io.DEFAULT_BUFFER_SIZE)
filein = gzip.open(filin, 'rb')
else:
filein = open(filin, 'r')
line = 0
while filein.readline():
with io.BufferedReader(filein, buffer_size=bufsize) as buffered_f:
#while filein.readline():
line += 1
seq = float(round(line / 4))
filein.close()
......
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