Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gcgi 1413 move failed report plugin to summary #489

Merged
merged 31 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6d23ebf
Dev gcgi 1378 new gsicapbench inputs (#486)
iainrb Nov 7, 2024
561cc12
Removed failed report plugin and moved to summary plugin instead
AqsaAlam Nov 7, 2024
260fa67
Merged with release 1.7.8
AqsaAlam Nov 7, 2024
07e95c3
Updated changelog
AqsaAlam Nov 7, 2024
fe283a4
Merge pull request #492 from oicr-gsi/main
iainrb Nov 11, 2024
8eb4e5f
Add new JSON diff script and tests
iainrb Nov 11, 2024
3e71d46
Merge pull request #493 from oicr-gsi/dev-GCGI-1464_report-diff-script
iainrb Nov 13, 2024
773521f
Added patient study id raw
AqsaAlam Dec 3, 2024
fab3323
Updated changelog
AqsaAlam Dec 3, 2024
fe0d18c
Allowed tumour and normal ids to be manually specified for provenance…
AqsaAlam Dec 4, 2024
7bc16c5
Added oncokb definitions to 40x assays
AqsaAlam Dec 4, 2024
bcd98e6
Merge pull request #495 from oicr-gsi/GCGI-1472_grab-all-patient-ids
AqsaAlam Dec 4, 2024
60193d5
Merge branch 'release-1.7.8' into GCGI-1469_provenance-overrides-manu…
AqsaAlam Dec 4, 2024
ede4bf3
Merge pull request #496 from oicr-gsi/GCGI-1469_provenance-overrides-…
AqsaAlam Dec 4, 2024
ceb481a
Merge branch 'release-1.7.8' into GCGI-1454_add-oncokb-defs-to-WGTS40X
AqsaAlam Dec 4, 2024
7018c08
Merge pull request #497 from oicr-gsi/GCGI-1454_add-oncokb-defs-to-WG…
AqsaAlam Dec 4, 2024
f65a7cd
Dev-GCGI-1446_fusion-total (#498)
OumaimaHamza Dec 4, 2024
6de11bc
self.patient_id_raw defaults to None when not in use -- instead of be…
iainrb Dec 12, 2024
fa36547
Merge pull request #499 from oicr-gsi/fix-provenance-default
iainrb Dec 12, 2024
bed6cf8
Dev gcgi 1326 whizbam links for fusions (#487)
OumaimaHamza Dec 12, 2024
9c1ac82
Release 1.7.8 update (#500)
OumaimaHamza Dec 12, 2024
53015cd
Refactor fusion plugin test; move setup operations to setUp(self)
iainrb Dec 13, 2024
f38c5e4
Remove self.maxDiff = None
iainrb Dec 13, 2024
56da678
Merge pull request #501 from oicr-gsi/fusion-plugin-test-fixup
iainrb Dec 13, 2024
961a0bf
Merged with main
AqsaAlam Jan 6, 2025
02ce287
Merge branch 'release-1.7.8' into GCGI-1413_move-failed-report-plugin…
AqsaAlam Jan 6, 2025
d52f6a6
Merged with changes from release 1.7.9
AqsaAlam Jan 6, 2025
3596839
Merge branch 'GCGI-1413_move-failed-report-plugin-to-summary' of http…
AqsaAlam Jan 6, 2025
c134dc9
update core test checksums
iainrb Jan 10, 2025
ba01d9e
Enable 'failed' summary option in update mode, and update tests
iainrb Jan 10, 2025
c299f5e
Merge branch 'release-1.7.9' into GCGI-1413_move-failed-report-plugin…
AqsaAlam Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
- GCGI-1461: Fix output paths in calls to get_logger
- GCGI-1478: More informative logger name for plugin/helper/merger components
- GCGI-1479: New `--pre-populate` option in `djerba.py` setup mode

- GCGI-1413: Remove failed report plugin and allow summary plugin to handle failed reports
-
## 1.7.8: 2024-12-12
- GCGI-1464: Standalone script to diff two Djerba JSON reports
- GCGI-1454: Added OncoKB definitions to WGTS40X and WGS40X assays
Expand Down
9 changes: 7 additions & 2 deletions src/lib/djerba/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,17 +576,22 @@ def update(self, config_path, json_path, out_dir, archive, pdf, summary_only, fo
# 1. INI config with core + plugins to update
# 2. Text file to update summary only
# The 'summary_only' argument controls which one is used
with open(json_path, encoding=cc.TEXT_ENCODING) as in_file:
data = json.loads(in_file.read())
if summary_only:
# get failed/not-failed status from input data
failed = data[cc.PLUGINS]['summary'][cc.RESULTS]['failed']
failed_opt = 'true' if failed else 'false'
self.logger.debug('Found report failure status: '+failed_opt)
# make an appropriate ConfigParser on-the-fly
config_in = ConfigParser()
config_in.add_section(cc.CORE)
config_in.add_section('summary')
config_in.set('summary', 'summary_file', config_path)
config_in.set('summary', 'failed', failed_opt)
config = self.configure_from_parser(config_in)
else:
config = self.configure(config_path)
with open(json_path, encoding=cc.TEXT_ENCODING) as in_file:
data = json.loads(in_file.read())
data_new = self.base_extract(config)
data = self.update_data_from_file(data_new, json_path, force)
if archive:
Expand Down
2 changes: 1 addition & 1 deletion src/lib/djerba/plugins/benchmark/test/plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def testBenchmark(self):
params = {
self.INI: self.write_ini_file(data_dir),
self.JSON: json_location,
self.MD5: 'bd6a26968d6f384dd43c9c7b1f511dd6'
self.MD5: 'e3b67a025a395ea38a649959d2c099be'
}
self.run_basic_test(test_source_dir, params)

Expand Down
Empty file.
15 changes: 0 additions & 15 deletions src/lib/djerba/plugins/failed_report/failed_report_template.html

This file was deleted.

87 changes: 0 additions & 87 deletions src/lib/djerba/plugins/failed_report/plugin.py

This file was deleted.

Empty file.
3 changes: 0 additions & 3 deletions src/lib/djerba/plugins/failed_report/test/failed_report.ini

This file was deleted.

16 changes: 0 additions & 16 deletions src/lib/djerba/plugins/failed_report/test/failed_report.json

This file was deleted.

31 changes: 0 additions & 31 deletions src/lib/djerba/plugins/failed_report/test/plugin_test.py

This file was deleted.

16 changes: 12 additions & 4 deletions src/lib/djerba/plugins/summary/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,34 @@ class main(plugin_base):
PRIORITY = 400
PLUGIN_VERSION = '0.1'
MAKO_TEMPLATE_NAME = 'summary_report_template.html'
SUMMARY_TEMPLATE_FILE = 'summary_template.txt'
SUMMARY_TEMPLATE_FILE = 'templates/summary_template.txt'
FAILED_TEMPLATE_FILE = 'templates/failed_template.txt'
SUMMARY_FILE = 'summary_file'
SUMMARY_TEXT = 'summary_text'
FAILED = 'failed'

def configure(self, config):
config = self.apply_defaults(config)
wrapper = self.get_config_wrapper(config)
failed = wrapper.get_my_boolean(self.FAILED)
if wrapper.my_param_is_null(self.SUMMARY_FILE):
summary_template_path = \
os.path.join(os.path.dirname(__file__), self.SUMMARY_TEMPLATE_FILE)
wrapper.set_my_param(self.SUMMARY_FILE, summary_template_path)
if not failed:
template_path = os.path.join(os.path.dirname(__file__), self.SUMMARY_TEMPLATE_FILE)
elif failed:
template_path = os.path.join(os.path.dirname(__file__), self.FAILED_TEMPLATE_FILE)
wrapper.set_my_param(self.SUMMARY_FILE, template_path)
return wrapper.get_config()

def extract(self, config):
wrapper = self.get_config_wrapper(config)
summary_path = wrapper.get_my_string(self.SUMMARY_FILE)
failed = wrapper.get_my_boolean(self.FAILED)
with open(summary_path, encoding=core_constants.TEXT_ENCODING) as in_file:
summary_text = in_file.read()
self.logger.debug('Read summary from {0}: "{1}"'.format(summary_path, summary_text))
data = self.get_starting_plugin_data(wrapper, self.PLUGIN_VERSION)
data[core_constants.RESULTS][self.SUMMARY_TEXT] = summary_text
data[core_constants.RESULTS][self.FAILED] = failed
filename = 'results_summary.txt'
self.workspace.write_string(filename, summary_text)
self.logger.debug('Wrote summary to {0}'.format(self.workspace.abs_path(filename)))
Expand All @@ -49,6 +56,7 @@ def specify_params(self):
for key in discovered:
self.add_ini_discovered(key)
self.set_ini_default(core_constants.ATTRIBUTES, 'clinical')
self.set_ini_default(self.FAILED, False)
self.set_priority_defaults(self.PRIORITY)

def render(self, data):
Expand Down
12 changes: 9 additions & 3 deletions src/lib/djerba/plugins/summary/summary_report_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
from djerba.util.html import html_builder
from djerba.plugins.summary.plugin import main as summary
SUMMARY_TEXT = results.get(summary.SUMMARY_TEXT)
FAILED = results.get(summary.FAILED)
%>

<!-- results summary -->
${html_builder().section_cells_begin("<h2>Results Summary</h2>","main")}

${html_builder().markdown_to_html(SUMMARY_TEXT)}


% if not FAILED:
${html_builder().markdown_to_html(SUMMARY_TEXT)}
% elif FAILED:
<p style="border-width:3px; border-style:solid; border-color:#FF0000; padding: 1em;" ${html_builder().markdown_to_html(SUMMARY_TEXT)}</p>
% endif

${html_builder().section_cells_end()}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The patient has been diagnosed with ... and has been referred for the OICR Genomics ... assay through the ... study. A quality failure report for this sample is being issued due to the informatically inferred tumour purity of ...% which is below the reportable threshold of 30% for the assay \ is being issued due to failed extraction \ is being issued as the quantity of extracted DNA/RNA from tissue material was below the lower quantifiable range and therefore below the minimum input amount for this assay (minimums of 25ng for DNA and 50ng for RNA)...
4 changes: 4 additions & 0 deletions src/lib/djerba/plugins/summary/test/failed.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[core]

[summary]
failed = True
15 changes: 13 additions & 2 deletions src/lib/djerba/plugins/summary/test/plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@ def testSummary(self):
params = {
self.INI: 'summary.ini',
self.JSON: json_location,
self.MD5: '155e22cc02a45e04dc9058112354367c'
self.MD5: '1599ec66c80c2607e71a1dea9d53aacf'
}
self.run_basic_test(test_source_dir, params)

def testFailedSummary(self):
test_source_dir = os.path.realpath(os.path.dirname(__file__))
json_location = os.path.join(self.data_dir_root, "plugins", "summary", "report_json", "failed.json")
params = {
self.INI: 'failed.ini',
self.JSON: json_location,
self.MD5: 'abf18dc395150bf990a0b24b1cf9b422'
}
self.run_basic_test(test_source_dir, params)


def testSummaryWithCustomText(self):
test_source_dir = os.path.realpath(os.path.dirname(__file__))
summary_path = os.path.join(test_source_dir, 'custom_summary.txt')
Expand All @@ -43,7 +54,7 @@ def testSummaryWithCustomText(self):
params = {
self.INI: ini_path,
self.JSON: json_location,
self.MD5: 'cebbb53b9b074131e309dca71704a896'
self.MD5: 'b58589404184cd4b8d1a88f276f096b7'
}
self.run_basic_test(test_source_dir, params)

Expand Down
1 change: 1 addition & 0 deletions src/test/core/simple_report_for_update.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
],
"merge_inputs": {},
"results": {
"failed": false,
"summary_text": "Summary text goes here"
}
}
Expand Down
Loading
Loading