Skip to content

Commit

Permalink
Clean up some old code
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmar-van-den-Berg committed Oct 26, 2023
1 parent 87e021c commit d75f27e
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ that users understand how the changes affect the new version.
- Use multiple threads for Cutadapt, and reduce the compression of output files

### Changes
- Remove run name from the report
- Deprecate option `fusion-partners`, in favour of `report_genes`, which points
to a list of fusion genes to report
- Show allele frequency as a percentage in the pfd report
Expand Down
4 changes: 0 additions & 4 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ localrules:
align_exon_cov_ref,
align_genome_txt,
align_json_output,
align_table_vars_all,
align_table_vars_hi,
create_summary,
fusion_arriba_to_json,
Expand All @@ -15,7 +14,6 @@ localrules:
itd_json_output,
itd_plot_itd_flt3,
itd_plot_itd_kmt2a,
package_results,


rule all:
Expand Down Expand Up @@ -137,7 +135,6 @@ rule create_summary:
scr=srcdir("scripts/create_summary.py"),
params:
pipeline_ver=PIPELINE_VERSION,
run_name=RUN_NAME,
output:
js="{sample}/{sample}.summary.json",
log:
Expand All @@ -149,7 +146,6 @@ rule create_summary:
python {input.scr} \
{input.idm} \
--pipeline-version {params.pipeline_ver} \
--run-name {params.run_name} \
--sample-name {wildcards.sample} \
--module {input.fusion_json} \
--module {input.snv_indels_json} \
Expand Down
16 changes: 0 additions & 16 deletions common.smk
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from functools import partial
from os.path import dirname
from uuid import uuid4


Expand All @@ -10,21 +8,7 @@ samples = pep.sample_table["sample_name"]

containers = {
"hamlet-scripts": "docker://quay.io/redmar_van_den_berg/hamlet-scripts:0.3",
"zip": "docker://quay.io/redmar_van_den_berg/zip:3.0",
}

# The version of HAMLET
PIPELINE_VERSION = "v1.0.2-dev-1"
RUN_NAME = config.get("run_name") or f"hamlet-{uuid4().hex[:8]}"


def make_pattern(extension, dirname):
"""Helper function to create a wildcard-containing path for output files."""
return f"{{sample}}/{dirname}/{{sample}}{extension}"


seqqc_output = partial(make_pattern, dirname="qc-seq")
var_output = partial(make_pattern, dirname="snv-indels")
fusion_output = partial(make_pattern, dirname="fusion")
expr_output = partial(make_pattern, dirname="expression")
itd_output = partial(make_pattern, dirname="itd")
4 changes: 0 additions & 4 deletions report/templates/contents_basic.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
<td>Read group count</td>
<td>{{ modules.qc_seq.per_read_group|length }}</td>
</tr>
<tr>
<td>Run name</td>
<td>{{ metadata.run_name }}</td>
</tr>
<tr>
<td>Pipeline version</td>
<td>{{ metadata.pipeline_version }}</td>
Expand Down
4 changes: 2 additions & 2 deletions report/templates/cover.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<h1>HAMLET</h1>
<p class="pipeline-subtitle">Acute Myeloid Leukemia mRNA-seq Analysis Pipeline</p>
<h2>Analysis Report</h2>
<p class="report-subtitle">Sample '{{ sample_name }}' - Run '{{ run_name }}'</p>
<p class="report-subtitle">Sample '{{ sample_name }}'</p>
<div class="logo">
<img src="{{ imgs_dir }}/hamlet-logo.jpg" height="250">
</div>
<p>Version {{ pipeline_version|default('unknown') }}<br />Generated on {{ timestamp.strftime('%A, %d %B %Y at %H:%M') }}</p>
<p>Version {{ pipeline_version }}<br />Generated on {{ timestamp.strftime('%A, %d %B %Y at %H:%M') }}</p>
<div class="logo lumc">
<img src="{{ imgs_dir }}/lumc-logo.jpg" height="40">
</div>
Expand Down
2 changes: 0 additions & 2 deletions scripts/create_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def main(args):
combined = {
"metadata": {
"pipeline_version": args.pipeline_version,
"run_name": args.run_name,
"sample_name": args.sample_name,
"genes_of_interest": idm,
},
Expand All @@ -44,7 +43,6 @@ def main(args):
parser = argparse.ArgumentParser()

parser.add_argument("id_mappings_path")
parser.add_argument("--run-name", help="Name of the run in which the stats were generated.")
parser.add_argument("--sample-name", help="Name of the sample from which the stats were generated.")
parser.add_argument("--pipeline-version", help="Version string of the pipeline.")
parser.add_argument("--module", action="append", help="JSON outputs from various modules")
Expand Down
7 changes: 1 addition & 6 deletions scripts/generate_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def __init__(self, summaryd: dict,
sdm = summaryd["metadata"]
self.summary = summaryd
self.sample_name = sdm["sample_name"]
self.run_name = sdm["run_name"]
self.pipeline_version = sdm["pipeline_version"]
self.cover_tpl_fname = cover_tpl_fname
self.contents_tpl_fname = contents_tpl_fname
Expand All @@ -41,7 +40,6 @@ def __init__(self, summaryd: dict,

hf_ctx = {
"sample_name": self.sample_name,
"run_name": self.run_name,
"timestamp": self.timestamp,
}
pdfkit_opts = pdfkit_opts or {
Expand Down Expand Up @@ -168,7 +166,6 @@ def write(self, html, pdf) -> None:
tmp_prefix = str(Path.cwd()) + "/"
cover_ctx = {
"sample_name": self.sample_name,
"run_name": self.run_name,
"pipeline_version": self.pipeline_version,
"timestamp": self.timestamp,
"css_fname": self.css_fname,
Expand Down Expand Up @@ -205,10 +202,8 @@ def main(input_summary_path, css_path, templates_dir,

sdm = sd["metadata"]
sample_name = sdm["sample_name"]
run_name = sdm["run_name"]
pipeline_version = sdm["pipeline_version"]
header_caption = ("Hamlet Report -"
f" Sample {sample_name!r} of Run {run_name!r}")
header_caption = f"Hamlet Report - Sample {sample_name!r}"
footer_lcaption = "Generated on {timestamp:%A, %d %B %Y at %H:%M}"
footer_rcaption = "[page]/[toPage]"

Expand Down
1 change: 0 additions & 1 deletion test/data/output/v2/SRR8615409.vardict.summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
}
],
"pipeline_version": "v1.0.2-dev-1",
"run_name": "hamlet-3080e5df",
"sample_name": "SRR8615409"
},
"modules": {
Expand Down
1 change: 0 additions & 1 deletion test/data/output/v2/full-report.summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
}
],
"pipeline_version": "v1.0.2-dev-1",
"run_name": "hamlet-072d3448",
"sample_name": "SRR8615409"
},
"modules": {
Expand Down
3 changes: 1 addition & 2 deletions utilities/output-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
"metadata": {
"type": "object",
"additionalProperties": false,
"minProperties": 4,
"minProperties": 3,
"properties": {
"genes_of_interest": {
"type": "array",
"items": { "$ref": "#/definitions/metadata/gene_of_interest" }
},
"pipeline_version": { "type": "string" },
"run_name": { "type": "string" },
"sample_name": { "type": "string" }
},
"gene_of_interest": {
Expand Down

0 comments on commit d75f27e

Please sign in to comment.