From 51fa506fad43acc5e25072389f8b022d6deb988d Mon Sep 17 00:00:00 2001 From: Stef Piatek Date: Thu, 18 Apr 2019 12:16:57 +0100 Subject: [PATCH] Add file md5sums to database --- scripts/base_classes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/base_classes.py b/scripts/base_classes.py index a98760e..e04b5cb 100755 --- a/scripts/base_classes.py +++ b/scripts/base_classes.py @@ -75,8 +75,7 @@ def __init__(self, capture, gene, start_time, normal_panel=True): "capture": capture, "gene": gene, "start_time": start_time, - # To add in after sure all genes run correctly - # "sample_sheet_md5sum": self.get_md5sum(self.sample_sheet), + "sample_sheet_md5sum": self.get_md5sum(self.sample_sheet)[0], "capture_path": f"/mnt/input/{capture}/bed/{capture}.bed", "unknown_bams": unknown_docker_bams, } @@ -98,8 +97,8 @@ def check_chrom_prefix(self, bed_file): raise Exception( "BED file contains line which has an invalid chromosome:\n" f"Line number: {line_number}\n" - "Line: '{}'\n".format(line.replace("\t", "").rstrip()) + - "Expected format: '{}'\n".format(chromosomes[0].replace("\t", "startendgene")) + "Line: '{}'\n".format(line.replace("\t", "").rstrip()) + + "Expected format: '{}'\n".format(chromosomes[0].replace("\t", "startendgene")) + "Please update 'chromosome_prefix' in local settings file, or alter the BED file." ) @@ -457,7 +456,8 @@ def upload_run_data(self, sample_names): run_defaults = {"gene_id": gene_instance.id, "caller_id": caller_instance.id} upload_data = {"samples": json.dumps(sample_ids), "duration": duration} run_instance, created = Queries.update_or_create(models.Run, self.session, defaults=run_defaults, **upload_data) - # self.upload_all_md5sums(run_instance.id) + self.session.commit() + self.upload_all_md5sums(run_instance.id) self.session.commit() @logger.catch(reraise=True)