From fb7009902e174cb8fc57f0c73945bde910c48339 Mon Sep 17 00:00:00 2001 From: Jasmine Baker Date: Tue, 23 Apr 2024 14:36:50 -0500 Subject: [PATCH 01/17] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..dd84ea78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. From 6c69e5e12047c26619d5d2c4db3955dc42308263 Mon Sep 17 00:00:00 2001 From: Kyle Anderson Date: Thu, 22 Feb 2024 14:35:18 -0500 Subject: [PATCH 02/17] Fix dict KeyError in cravat_convert Re: https://github.com/KarchinLab/open-cravat/issues/210 TODO: add a unit test for this; cravat_convert.MasterCravatConverter.run() is a monster of a function, so it was taking a long time to get this test running. Find the WIP version on branch chore/210/cravat_convert_unit_test --- cravat/cravat_convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cravat/cravat_convert.py b/cravat/cravat_convert.py index ee695dea..a15df6ad 100644 --- a/cravat/cravat_convert.py +++ b/cravat/cravat_convert.py @@ -450,7 +450,7 @@ def run(self): chrom = "chrM" wdict["chrom"] = self.chromdict.get(chrom, chrom) if multiple_files: - if wdict["sample_id"]: + if "sample_id" in wdict: wdict["sample_id"] = "__".join( [samp_prefix, wdict["sample_id"]] ) From 38e0b1743f00228ad4103ca32d3f8559884a9f2a Mon Sep 17 00:00:00 2001 From: Kyle Moad Date: Mon, 26 Feb 2024 13:55:09 -0500 Subject: [PATCH 03/17] allow fetching error file --- cravat/websubmit/nocache/websubmit.js | 22 +++++++++++++++++----- cravat/websubmit/websubmit.py | 24 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/cravat/websubmit/nocache/websubmit.js b/cravat/websubmit/nocache/websubmit.js index d0e6c620..9323dad5 100644 --- a/cravat/websubmit/nocache/websubmit.js +++ b/cravat/websubmit/nocache/websubmit.js @@ -562,13 +562,25 @@ function populateJobTr (job) { logLink.setAttribute('href','/submit/jobs/' + job.id + '/log'); logLink.setAttribute('target', '_blank'); logLink.setAttribute('title', 'Click to download.'); - var button = getEl('button'); - button.classList.add('butn'); - button.classList.add('active-download-button'); - addEl(button, getTn('Log')); - addEl(logLink, button); + var logButton = getEl('button'); + logButton.classList.add('butn'); + logButton.classList.add('active-download-button'); + addEl(logButton, getTn('Log')); + addEl(logLink, logButton); addEl(dbTd, logLink); addEl(jobTr, dbTd); + // Err + var errLink = getEl('a'); + errLink.setAttribute('href','/submit/jobs/' + job.id + '/err'); + errLink.setAttribute('target', '_blank'); + errLink.setAttribute('title', 'Check for per-variant errors.'); + var errButton = getEl('button'); + errButton.classList.add('butn'); + errButton.classList.add('active-download-button'); + addEl(errButton, getTn('Errors')); + addEl(errLink, errButton); + addEl(dbTd, errLink); + addEl(jobTr, dbTd); // + button var btn = getEl('button'); btn.classList.add('butn'); diff --git a/cravat/websubmit/websubmit.py b/cravat/websubmit/websubmit.py index 92dcfd3a..daecd58d 100644 --- a/cravat/websubmit/websubmit.py +++ b/cravat/websubmit/websubmit.py @@ -209,6 +209,16 @@ async def job_log (self, request, job_id): else: log_path = None return log_path + + async def job_err (self, request, job_id): + run_path = await self.job_run_path(request, job_id) + if run_path is not None: + err_path = run_path + '.err' + if os.path.exists(err_path) == False: + err_path = None + else: + err_path = None + return err_path class WebJob(object): def __init__(self, job_dir, job_status_fpath): @@ -705,6 +715,19 @@ async def get_job_log (request): else: return web.Response(text='log file does not exist.') +async def get_job_err (request): + global filerouter + job_id = request.match_info['job_id'] + err_path = await filerouter.job_err(request, job_id) + if err_path is not None: + if os.stat(err_path).st_size == 0: + return web.Response(text='No errors') + else: + with open(err_path) as f: + return web.Response(text=f.read()) + else: + return web.Response(text='log file does not exist.') + def get_valid_report_types(): global valid_report_types if valid_report_types is not None: @@ -1278,6 +1301,7 @@ async def import_job (request): routes.append(['POST','/submit/jobs/{job_id}/reports/{report_type}',generate_report]) routes.append(['GET','/submit/jobs/{job_id}/reports/{report_type}',download_report]) routes.append(['GET','/submit/jobs/{job_id}/log',get_job_log]) +routes.append(['GET','/submit/jobs/{job_id}/err',get_job_err]) routes.append(['GET', '/submit/getjobsdir', get_jobs_dir]) routes.append(['GET', '/submit/setjobsdir', set_jobs_dir]) routes.append(['GET', '/submit/getsystemconfinfo', get_system_conf_info]) From ecaabc9ddb06e9f9e32d6210ddeb1efa029e57f7 Mon Sep 17 00:00:00 2001 From: Kyle Moad Date: Wed, 13 Mar 2024 11:28:21 -0400 Subject: [PATCH 04/17] change quicksave help text --- cravat/webresult/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cravat/webresult/index.html b/cravat/webresult/index.html index ddf23aa2..23aa7c2d 100644 --- a/cravat/webresult/index.html +++ b/cravat/webresult/index.html @@ -98,7 +98,7 @@
- +