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

Release 1.7.9 #512

Merged
merged 91 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 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
4e24726
Work in progress; restructure with placeholders for TAR/PWGS
iainrb Nov 12, 2024
f21153f
Add TAR params for GSICAPBENCH
iainrb Nov 12, 2024
dba1a33
work in progress on PWGS INI file
iainrb Nov 13, 2024
3e71d46
Merge pull request #493 from oicr-gsi/dev-GCGI-1464_report-diff-script
iainrb Nov 13, 2024
02a4bde
Placeholder values for PWGS; still needs work to mockup Cardea and GS…
iainrb Nov 13, 2024
6744199
Support WGS assay, and multiple assays per sample
iainrb Nov 13, 2024
a0d44fd
omit files pertaining to un-merged BAMs from glob results
iainrb Nov 22, 2024
c77fe8c
Merge branch 'release-1.7.8' into dev-GCGI-1462_gsicapbench-tar-pwgs
iainrb Nov 22, 2024
fea3d94
Rename util.benchmark to util.benchmark_tools; improved logging; fix …
iainrb Nov 22, 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
8e9642a
Fix arguments in calls to get_logger
iainrb Dec 18, 2024
6372219
Merge pull request #503 from oicr-gsi/fix-GCGI-1461_log-paths
iainrb Dec 19, 2024
eff2800
Make logger name more informative, update core tests
iainrb Dec 19, 2024
db24a76
Merge branch 'release-1.7.9' into dev-GCGI-1478_more-informative-logg…
iainrb Dec 19, 2024
1e529de
update changelog
iainrb Dec 19, 2024
050d90d
Merge pull request #505 from oicr-gsi/dev-GCGI-1478_more-informative-…
iainrb Dec 20, 2024
839725c
Add --pre-populate option; make assay names case-insensitive; add set…
iainrb Dec 20, 2024
b420060
Merge pull request #506 from oicr-gsi/dev-GCGI-1479_pre-populate
iainrb Dec 20, 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
481688b
Changed CGI manager name and phone to email
AqsaAlam Jan 7, 2025
b00b734
Changed percent genome altered total genome constant to updated value
AqsaAlam Jan 7, 2025
19f1842
Updated changelog
AqsaAlam Jan 7, 2025
dea9e98
Dev gcgi 1481 raw coverage autofill (#504)
OumaimaHamza Jan 9, 2025
a7a4bc2
Merge branch 'release-1.7.9' into GCGI-1480_email-in-header
AqsaAlam Jan 9, 2025
409d165
Merge pull request #508 from oicr-gsi/GCGI-1480_email-in-header
AqsaAlam Jan 9, 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
572b8d3
Merge changes from release-1.7.9 branch and fix conflicts
iainrb Jan 13, 2025
efa4741
Use relative instead of absolute ref paths; --ref-dir instead -f --re…
iainrb Jan 14, 2025
6a95493
add comments
iainrb Jan 14, 2025
9050593
Update report_equivalence_tester to handle PWGS and TAR reports
iainrb Jan 15, 2025
0fae3fd
Use deepcopy to correctly generate INI for multiple assays; omit repo…
iainrb Jan 15, 2025
c0b081d
Change 'Donor' column header to 'Report' in benchmark HTML
iainrb Jan 15, 2025
7588e56
Change benchmark status emoji and update tests
iainrb Jan 15, 2025
64c7237
Change emoji again, update tests and status key; fixes for PWGS INI
iainrb Jan 15, 2025
c770e16
Add plasma samples to benchmark plugin test
iainrb Jan 16, 2025
479ddef
Update benchmark plugin with full set of test inputs
iainrb Jan 16, 2025
cc79165
Replace 'ref_path' with 'ref_dir' and use path validator
iainrb Jan 16, 2025
4877a1b
Rename 'donor' to 'report' in benchmark plugin code; update test data
iainrb Jan 16, 2025
5e3b84f
Correct report identifiers and update tests for benchmark plugin
iainrb Jan 16, 2025
e5318bc
Fix critical bug in report diff; now compare both input reports, not …
iainrb Jan 16, 2025
52404ce
Fix dictionary keys and input names; reinstate test assertions; bench…
iainrb Jan 16, 2025
8b1a545
Add placeholder report ID for PWGS
iainrb Jan 16, 2025
3c5641f
Remove the Sequenza CNV plugin; move HTML functions to the Purple plu…
iainrb Jan 17, 2025
9777eb3
Merge pull request #510 from oicr-gsi/dev-GCGI-1492_remove-sequenza-cnv
iainrb Jan 17, 2025
b9bfd41
Merge updates from release-1.7.9 and fix conflicts
iainrb Jan 17, 2025
6654aec
Remove input paths from pwgs.analysis results
iainrb Jan 17, 2025
ffe67e0
Merge branch 'dev-GCGI-1490_remove-pwgs-input-paths' into dev-GCGI-14…
iainrb Jan 17, 2025
f2840f5
Merge pull request #511 from oicr-gsi/dev-GCGI-1490_remove-pwgs-input…
iainrb Jan 17, 2025
e4f053e
Update md5 in benchmarking test
iainrb Jan 17, 2025
e198ad5
disable verbose tests
iainrb Jan 21, 2025
6b2b876
Add non-zero delta for TAR metric comparison
iainrb Jan 21, 2025
c299f5e
Merge branch 'release-1.7.9' into GCGI-1413_move-failed-report-plugin…
AqsaAlam Jan 22, 2025
f092d00
Merge pull request #489 from oicr-gsi/GCGI-1413_move-failed-report-pl…
AqsaAlam Jan 22, 2025
d8d4714
Merge branch 'release-1.7.9' into dev-GCGI-1462_gsicapbench-tar-pwgs
iainrb Jan 22, 2025
08e7778
Merge pull request #509 from oicr-gsi/dev-GCGI-1462_gsicapbench-tar-pwgs
iainrb Jan 22, 2025
517aa5f
Update version and changelog for release 1.7.9
iainrb Jan 22, 2025
02cda20
Merge branch 'release-1.7.9' of github.com:oicr-gsi/djerba into relea…
iainrb Jan 22, 2025
e4f621d
Fix dictionary key for redaction in tests
iainrb Jan 22, 2025
423cd43
Use placeholder paths in test file
iainrb Jan 22, 2025
dac4067
fix paths again
iainrb Jan 22, 2025
060b02e
Remove obsolete donor_results entry
iainrb Jan 22, 2025
7baf780
Update md5 sum
iainrb Jan 22, 2025
e3b88da
Add 'templates' subdirectory to installation wildcards
iainrb Jan 22, 2025
c2a6d28
Add new INI files to setup.py
iainrb Jan 22, 2025
2557f9c
Update test checksum
iainrb 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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# CHANGELOG

## 1.7.9: 2025-01-22
- GCGI-1461: Fix output paths in calls to get_logger
- GCGI-1462: Extend GSICAPBENCH report to TAR/PWGS
- GCGI-1481: Fix raw coverage auto-population to exclude normal samples before selection in TAR assay
- 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
- GCGI-1482: Updated total genome segment length constant in percent genome altered calculation
- GCGI-1480: Updated CGI manager name and email
- GCGI-1490: Remove input paths from pwgs.analysis results
- GCGI-1492: Remove the Sequenza CNV plugin

## 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
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
'resources/*',
'R/*',
'r/*',
'Rscripts/*'
'Rscripts/*',
'templates/*'
]

with open("README.md", "r") as fh:
Expand All @@ -49,7 +50,10 @@
'data/20240315-allCuratedGenes.tsv',
'data/OncoTree.json',
'data/NCCN_annotations.txt',
'data/benchmark_config.ini',
'data/benchmark_pwgs.ini',
'data/benchmark_tar.ini',
'data/benchmark_wgs.ini',
'data/benchmark_wgts.ini',
'data/benchmark_params.json',
'data/cytoBand.txt',
'data/ensemble_conversion_hg38.txt',
Expand Down
4 changes: 2 additions & 2 deletions src/bin/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys

sys.path.pop(0) # do not import from script directory
from djerba.util.benchmark import benchmarker
from djerba.util.benchmark_tools import benchmarker

def get_parser():
"""Construct the parser for command-line arguments"""
Expand All @@ -21,7 +21,7 @@ def get_parser():
# operations
parser.add_argument('-i', '--input-dir', metavar='DIR', required=True, help='Directory to scan for workflow outputs, eg. ./GSICAPBENCHyymmdd/seqware-results/')
parser.add_argument('-o', '--output-dir', metavar='DIR', required=True, help='Directory in which to generate HTML output')
parser.add_argument('-r', '--ref-path', metavar='FILE', required=True, help='Path to JSON file listing reference reports')
parser.add_argument('-r', '--ref-dir', metavar='DIR', required=True, help='Directory with reference index and reports')
parser.add_argument('-s', '--sample', metavar='NAME', action='append', help='Sample names for directory scan; may be supplied more than once')
parser.add_argument('-w', '--work-dir', metavar='DIR', required=True, help='Working directory in which to generate Djerba reports')
cache_group = parser.add_mutually_exclusive_group()
Expand Down
2 changes: 1 addition & 1 deletion src/bin/diff_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

sys.path.pop(0) # do not import from script directory

from djerba.util.benchmark import report_equivalence_tester
from djerba.util.benchmark_tools import report_equivalence_tester
from djerba.util.logger import logger
from djerba.util.validator import path_validator

Expand Down
10 changes: 6 additions & 4 deletions src/bin/djerba.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys

sys.path.pop(0) # do not import from script directory
from djerba.core.main import main, arg_processor, DjerbaSubcommandError
from djerba.core.main import main, arg_processor, DjerbaInvalidNameError
from djerba.version import get_djerba_version
import djerba.util.constants as constants

Expand All @@ -23,9 +23,10 @@ def get_parser():
parser.add_argument('--version', action='store_true', help='Print the version number and exit')
subparsers = parser.add_subparsers(title='subcommands', help='sub-command help', dest='subparser_name')
setup_parser = subparsers.add_parser(constants.SETUP, help='setup for a Djerba report')
setup_parser.add_argument('-a', '--assay', metavar='NAME', required=True, choices=['WGTS', 'WGS', 'TAR', 'PWGS'], help='Name of assay')
setup_parser.add_argument('-a', '--assay', metavar='NAME', required=True, help='Name of assay (case-insensitive)')
setup_parser.add_argument('-i', '--ini', metavar='PATH', help='Output path for INI file; defaults to config.ini in current directory')
setup_parser.add_argument('-c', '--compact', action='store_true', help="Output required manual parameters only")
setup_parser.add_argument('-p', '--pre-populate', metavar='PATH', help='INI file with key/value pairs to pre-populate config')
config_parser = subparsers.add_parser(constants.CONFIGURE, help='get configuration parameters')
config_parser.add_argument('-i', '--ini', metavar='PATH', required=True, help='INI config file with user inputs')
config_parser.add_argument('-o', '--ini-out', metavar='PATH', required=True, help='Path for output of fully specified INI config file')
Expand Down Expand Up @@ -69,7 +70,8 @@ def get_parser():
sys.exit(0)
try:
ap = arg_processor(args)
except DjerbaSubcommandError as err:
main(ap.get_work_dir(), ap.get_log_level(), ap.get_log_path()).run(args)
except DjerbaInvalidNameError as err:
print("{0}".format(err), file=sys.stderr)
sys.exit(1)
main(ap.get_work_dir(), ap.get_log_level(), ap.get_log_path()).run(args)

6 changes: 4 additions & 2 deletions src/lib/djerba/core/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def __init__(self, **kwargs):
self.module_dir = kwargs[cc.MODULE_DIR]
self.log_level = kwargs[cc.LOG_LEVEL]
self.log_path = kwargs[cc.LOG_PATH]
self.logger = self.get_logger(self.log_level, __name__, self.log_path)
logger_name = 'djerba:'+self.identifier
self.logger = self.get_logger(self.log_level, logger_name, self.log_path)
self.ini_required = set() # names of INI parameters the user must supply
self.ini_defaults = {} # names and default values for other INI parameters

Expand Down Expand Up @@ -373,7 +374,8 @@ def __init__(self, config, identifier, log_level=logging.WARNING, log_path=None)
# identifier is the component identifier, used to retrieve INI params
self.config = config
self.identifier = identifier
self.logger = self.get_logger(log_level, __name__, log_path)
logger_name = 'djerba:'+self.identifier+':config_wrapper'
self.logger = self.get_logger(log_level, logger_name, log_path)

def get_config(self):
return self.config
Expand Down
6 changes: 3 additions & 3 deletions src/lib/djerba/core/html/clinical_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
</tr>
<tr>
<td>Main contact:</td>
<td>Alexander Fortuna, MSc</td>
<td>Beatriz Lujan Toro, MSc</td>
</tr>
<tr>
<td>Phone:</td>
<td>416-673-8539</td>
<td>Email:</td>
<td>[email protected]</td>
</tr>
<tr>
<td>Hours of Operation:</td>
Expand Down
74 changes: 54 additions & 20 deletions src/lib/djerba/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,10 @@ def run(self, args):
assay = ap.get_assay()
compact = ap.get_compact()
ini_path = ap.get_ini_path()
pre_populate = ap.get_pre_populate()
if ini_path == None:
ini_path = os.path.join(os.getcwd(), 'config.ini')
self.setup(assay, ini_path, compact)
self.setup(assay, ini_path, compact, pre_populate)
elif mode == constants.CONFIGURE:
ini_path = ap.get_ini_path()
ini_path_out = ap.get_ini_out_path() # may be None
Expand Down Expand Up @@ -485,9 +486,9 @@ def run(self, args):
self.logger.error(msg)
raise RuntimeError(msg)

def setup(self, assay, ini_path, compact):
if assay == 'WGTS':
component_list = [
def setup(self, assay, ini_path, compact, pre_populate=None):
components_by_assay = {
'WGTS': [
'core',
'input_params_helper',
'provenance_helper',
Expand All @@ -504,9 +505,8 @@ def setup(self, assay, ini_path, compact):
'fusion',
'gene_information_merger',
'supplement.body',
]
elif assay == 'WGS':
component_list = [
],
'WGS': [
'core',
'input_params_helper',
'provenance_helper',
Expand All @@ -521,9 +521,8 @@ def setup(self, assay, ini_path, compact):
'wgts.cnv_purple',
'gene_information_merger',
'supplement.body',
]
elif assay == 'TAR':
component_list = [
],
'TAR': [
'core',
'tar_input_params_helper',
'provenance_helper',
Expand All @@ -537,9 +536,8 @@ def setup(self, assay, ini_path, compact):
'tar.swgs',
'gene_information_merger',
'supplement.body',
]
elif assay == 'PWGS':
component_list = [
],
'PWGS': [
'core',
'report_title',
'patient_info',
Expand All @@ -551,12 +549,20 @@ def setup(self, assay, ini_path, compact):
'pwgs.analysis',
'supplement.body'
]
}
assay = assay.upper()
if assay in components_by_assay:
component_list = components_by_assay[assay]
else:
msg = "Invalid assay name '{0}'".format(assay)
names = sorted(list(components_by_assay.keys()))
msg = "Invalid assay name '{0}'. ".format(assay)+\
"Assay names are not case-sensitive; valid names are {0}".format(names)
self.logger.error(msg)
raise ValueError(msg)
raise DjerbaInvalidNameError(msg)
generator = ini_generator(self.log_level, self.log_path)
generator.write_config(component_list, ini_path, compact)
if pre_populate is not None:
self.write_pre_population(ini_path, pre_populate)
self.logger.info("Wrote config for {0} to {1}".format(assay, ini_path))

def update(self, config_path, json_path, out_dir, archive, pdf, summary_only, force):
Expand All @@ -570,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 Expand Up @@ -616,6 +627,24 @@ def upload_archive(self, data):
else:
self.logger.warning(f"Archiving was NOT successful: {report_id}")

def write_pre_population(self, config_path, prepop_path):
# write pre-population values from one INI into another
# sections in prepop_path not present in config_path are silently ignored
cp_config = ConfigParser()
cp_prepop = ConfigParser()
cp_config.read(config_path)
cp_prepop.read(prepop_path)
total = 0
for section in cp_config.sections():
if section in cp_prepop.sections():
for option in cp_prepop.options(section):
cp_config.set(section, option, cp_prepop.get(section, option))
total += 1
with open(config_path, 'w') as config_file:
cp_config.write(config_file)
template = "Pre-populated {0} value(s) in {1} from {2}"
self.logger.debug(template.format(total, config_path, prepop_path))


class arg_processor(arg_processor_base):
# class to process command-line args for creating a main object
Expand All @@ -632,6 +661,9 @@ def get_ini_path(self):
def get_ini_out_path(self):
return self._get_arg('ini_out')

def get_pre_populate(self):
return self._get_arg('pre_populate')

def get_summary_path(self):
return self._get_arg('summary')

Expand Down Expand Up @@ -667,6 +699,8 @@ def validate_args(self, args):
if args.subparser_name == constants.SETUP:
if args.ini!=None:
v.validate_output_file(args.ini)
if args.pre_populate!=None:
v.validate_input_file(args.pre_populate)
elif args.subparser_name == constants.CONFIGURE:
v.validate_input_file(args.ini)
v.validate_output_file(args.ini_out)
Expand Down Expand Up @@ -695,16 +729,16 @@ def validate_args(self, args):
v.validate_output_dir(args.work_dir)
elif args.subparser_name == None:
msg = "No subcommand name given; run with -h/--help for valid names"
raise DjerbaSubcommandError(msg)
raise DjerbaInvalidNameError(msg)
else:
# shouldn't happen, but handle this case for completeness
raise DjerbaSubcommandError("Unknown subcommand: " + args.subparser_name)
raise DjerbaInvalidNameError("Unknown subcommand: " + args.subparser_name)
self.logger.info("Command-line path validation finished.")

class DjerbaDependencyError(Exception):
pass

class DjerbaSubcommandError(Exception):
class DjerbaInvalidNameError(Exception):
pass

class DjerbaUpdateKeyError(Exception):
Expand Down
Loading
Loading