diff options
author | Frederick Muriuki Muriithi | 2022-05-02 13:04:03 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-05-02 13:04:03 +0300 |
commit | fcade690de59249a2789c26e8f668f36f8f4e075 (patch) | |
tree | 73a9f8d40871e7942c4ae034eabf39855b6756ea /qc_app/parse.py | |
parent | 5632dcab27058875de99d63cbd263acfa3a9a2d5 (diff) | |
download | gn-uploader-fcade690de59249a2789c26e8f668f36f8f4e075.tar.gz |
Optimise strain names parsing
- Use a way faster way of parsing the strains file
Diffstat (limited to 'qc_app/parse.py')
-rw-r--r-- | qc_app/parse.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/qc_app/parse.py b/qc_app/parse.py index 795cc01..baad9a6 100644 --- a/qc_app/parse.py +++ b/qc_app/parse.py @@ -19,8 +19,7 @@ from quality_control.parsing import ( FileType, parse_file, strain_names, - parse_errors, - parse_strains) + parse_errors) parsebp = Blueprint("parse", __name__) @@ -34,8 +33,7 @@ def queued_parse( try: job_meta = jobs.update_meta( dbconn, job_id, status = "in-progress", progress = 0) - parsed = parse_file( - filepath, filetype, strain_names(parse_strains(strainsfile))) + parsed = parse_file(filepath, filetype, strain_names(strainsfile)) for line, curr_size in parsed: job_meta = jobs.update_meta( dbconn, job_id, @@ -174,11 +172,10 @@ def queued_collect_errors( dbconn = sqlite3.connect(dbpath) job_meta = jobs.retrieve_meta(dbconn, job.get_id()) for error in parse_errors( - filepath, filetype, strain_names(parse_strains(strainsfile)), + filepath, filetype, strain_names(strainsfile), seek_pos): count = count + 1 progress = ((error["position"] / job_meta["filesize"]) * 100) - print(f"CURRENT PROGRESS: {progress}") job_meta = jobs.update_meta( dbconn, job_id, message = f"Collected {count} errors", progress = progress) |