Skip to content

Commit 9ea2973

Browse files
committed
Add ancestry information to pgs report
1 parent 3c6c572 commit 9ea2973

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
process CREATE_HTML_REPORT {
22

3-
publishDir params.output, mode: 'copy'
3+
publishDir params.output, mode: 'copy'
44

5-
input:
5+
input:
66
path(merged_score)
77
path(merged_info)
88
path(scores_meta)
9+
path(estimated_ancestry)
910

10-
11-
output:
11+
output:
1212
path "*.html", emit: html_report
1313
path "*.coverage.txt", emit: coverage_report
1414

15-
"""
16-
17-
pgs-calc report \
18-
--data ${merged_score} \
19-
--info ${merged_info} \
20-
--meta ${scores_meta} \
21-
--out scores.html
22-
23-
pgs-calc report \
24-
--data ${merged_score} \
25-
--info ${merged_info} \
26-
--meta ${scores_meta} \
27-
--template txt \
28-
--out scores.coverage.txt
29-
30-
"""
15+
script:
16+
samples = params.ancestry.enabled ? "--samples ${estimated_ancestry}" : ""
17+
18+
"""
19+
pgs-calc report \
20+
--data ${merged_score} \
21+
--info ${merged_info} \
22+
--meta ${scores_meta} \
23+
$samples \
24+
--out scores.html
25+
26+
pgs-calc report \
27+
--data ${merged_score} \
28+
--info ${merged_info} \
29+
--meta ${scores_meta} \
30+
--template txt \
31+
--out scores.coverage.txt
32+
"""
3133

3234
}

workflows/pgs_calculation.nf

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ workflow PGS_CALCULATION {
2929
CREATE_HTML_REPORT(
3030
MERGE_CHUNKS_SCORES.out.collect(),
3131
MERGE_CHUNKS_INFOS.out.collect(),
32-
file(params.pgscatalog.meta, checkIfExists:true)
32+
file(params.pgscatalog.meta, checkIfExists:true),
33+
estimated_ancestry.collect().ifEmpty([])
3334
)
3435

3536
}

0 commit comments

Comments
 (0)