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

added trace to have a n idea of the time needed to retrieve the number of...

added trace to have a n idea of the time needed to retrieve the number of reacors in the input fastq file
parent 9372c740
No related branches found
No related tags found
No related merge requests found
Pipeline #152958 passed
......@@ -6,7 +6,8 @@ from __future__ import print_function
import gzip
from utilities import reverseComplement,changeCase
from time import gmtime, strftime
import datetime
import io
import time # temporary : just to make an idea of the time we spend getting a chunk of reads or getting the number of lines in the file.
try:
import cPickle as pickle
......@@ -284,7 +285,9 @@ class ReadGetter:
### READS Functions
def totReads(filin):
"""Verify and retrieve the number of reads in the fastq file before alignment"""
start_t=time.perf_counter_ns()
if filin.endswith('.gz'):
print(io.DEFAULT_BUFFER_SIZE)
filein = gzip.open(filin, 'rb')
else:
filein = open(filin, 'r')
......@@ -294,6 +297,11 @@ def totReads(filin):
line += 1
seq = float(round(line / 4))
filein.close()
end_t = time.perf_counter_ns()
d=end_t-start_t
d=d/1000000000
d=d//60
print("spent ", d," minutes to get the number of reads from input file")
return seq
### SEQUENCE parsing function
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment