Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
Add file md5sums to database
Browse files Browse the repository at this point in the history
  • Loading branch information
stefpiatek committed Apr 18, 2019
1 parent e3c13da commit 51fa506
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -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", "<tab>").rstrip()) +
"Expected format: '{}'\n".format(chromosomes[0].replace("\t", "<tab>start<tab>end<tab>gene"))
"Line: '{}'\n".format(line.replace("\t", "<tab>").rstrip())
+ "Expected format: '{}'\n".format(chromosomes[0].replace("\t", "<tab>start<tab>end<tab>gene"))
+ "Please update 'chromosome_prefix' in local settings file, or alter the BED file."
)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 51fa506

Please sign in to comment.