Skip to content

Commit 3cc109e

Browse files
committed
add custom/fingerprintcorrelation
1 parent 0c3c341 commit 3cc109e

30 files changed

Lines changed: 803 additions & 227 deletions

File tree

modules/msk/custom/fingerprintcombine/main.nf

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@ process CUSTOM_FINGERPRINTCOMBINE {
1010

1111

1212
input:
13-
tuple val(meta),
14-
path(fp_tsv), // list of paths to fingerprint TSV files
15-
val(sample), // list of sample identifiers, one per TSV file, in the same order
16-
val(genome_build) // list of genome builds, one per TSV file, in the same order
13+
tuple val(meta), path(fp_tsv), val(sample), val(genome_build)
1714
path(liftover_loci_mapping)
1815

1916
output:
20-
tuple val(meta), path("*DPfilter_ALL_FP.txt"), emit: combined_fp_tsv
21-
path "versions.yml" , emit: versions
17+
tuple val(meta), path("*DPfilter_ALL_FP.txt") , emit: combined_fp_tsv
18+
tuple val("${task.process}"), val('complete_FP_table.R'), val('0.1.0'), emit: versions_fingerprintcombine, topic: versions
2219

2320
when:
2421
task.ext.when == null || task.ext.when
@@ -44,11 +41,6 @@ process CUSTOM_FINGERPRINTCOMBINE {
4441
-i input.tsv \\
4542
-l $liftover_loci_mapping \\
4643
$args
47-
48-
cat <<-END_VERSIONS > versions.yml
49-
"${task.process}":
50-
complete_FP_table.R: 0.1.0
51-
END_VERSIONS
5244
"""
5345

5446
stub:
@@ -58,10 +50,5 @@ process CUSTOM_FINGERPRINTCOMBINE {
5850
echo $args
5951
6052
touch XDPfilter_ALL_FP.txt
61-
62-
cat <<-END_VERSIONS > versions.yml
63-
"${task.process}":
64-
complete_FP_table.R: 0.1.0
65-
END_VERSIONS
6653
"""
6754
}
Lines changed: 60 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,82 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
2-
# # TODO nf-core: Add a description of the module and list keywords
32
name: "custom_fingerprintcombine"
43
description: |
54
A module to combine multiple fingerprint TSV files into a single comprehensive
65
table, with optional liftover of loci coordinates.
76
keywords:
8-
- fingerprint
9-
- qc
10-
- loci
11-
- tsv
12-
- correlation
7+
- fingerprint
8+
- qc
9+
- loci
10+
- tsv
11+
- correlation
1312
tools:
14-
## TODO nf-core: Add a description and other details for the software below
15-
- "custom":
16-
description: "A custom R script to combine fingerprint TSV files"
17-
homepage: "https://github.com/mskcc-omics-workflows/modules/tree/main/modules/msk/custom/fingerprintcombine/meta.yml"
18-
13+
- "custom":
14+
description: "A custom R script to combine fingerprint TSV files"
15+
homepage: "https://github.com/mskcc-omics-workflows/modules/tree/main/modules/msk/custom/fingerprintcombine/meta.yml"
16+
identifier: ""
1917
input:
20-
- - fp_tsv:
18+
- - meta:
19+
type: map
20+
description: |
21+
Groovy Map containing sample information
22+
e.g. [ id:'test' ]
23+
- fp_tsv:
2124
type: file
2225
description: |
2326
Fingerprint TSV files to be combined.
2427
Structure: [ val(sample), val(genome_build), path(fp_tsv) ]
28+
ontologies: []
2529
- sample:
2630
type: string
2731
description: Sample identifier corresponding to each fingerprint TSV file.
2832
- genome_build:
2933
type: string
30-
description: Genome build (e.g., hg19, hg38) corresponding to each fingerprint TSV file.
31-
- liftover_loci_mapping:
32-
type: file
33-
description: |
34-
A TSV file mapping original loci to liftover loci.
35-
Format: original_chr, original_pos, liftover_chr, liftover_pos
36-
pattern: "*.tsv"
37-
output:
38-
combined_fp_tsv:
39-
- "*DPfilter_ALL_FP.txt":
34+
description:
35+
Genome build (e.g., hg19, hg38) corresponding to each fingerprint
36+
TSV file.
37+
- - liftover_loci_mapping:
4038
type: file
41-
description: Wide table combining all input fingerprint TSV files.
42-
pattern: '*DPfilter_ALL_FP.txt'
39+
description: |
40+
A TSV file mapping original loci to liftover loci.
41+
Format: original_chr, original_pos, liftover_chr, liftover_pos
42+
pattern: "*.tsv"
4343
ontologies:
44-
- edam: http://edamontology.org/format_3750 # TSV
44+
- edam: http://edamontology.org/format_3475 # TSV
45+
output:
46+
combined_fp_tsv:
47+
- - meta:
48+
type: map
49+
description: |
50+
Groovy Map containing sample information
51+
e.g. [ id:'test' ]
52+
- "*DPfilter_ALL_FP.txt":
53+
type: file
54+
description: Wide table combining all input fingerprint TSV files.
55+
pattern: "*DPfilter_ALL_FP.txt"
56+
ontologies:
57+
- edam: http://edamontology.org/format_3750 # TSV
58+
versions_fingerprintcombine:
59+
- - ${task.process}:
60+
type: string
61+
description: The name of the process
62+
- complete_FP_table.R:
63+
type: string
64+
description: The name of the tool
65+
- 0.1.0:
66+
type: string
67+
description: Version of the custom script
68+
topics:
4569
versions:
46-
- versions.yml:
47-
type: file
48-
description: File containing software versions
49-
pattern: versions.yml
50-
ontologies:
51-
- edam: http://edamontology.org/format_3750 # YAML
70+
- - ${task.process}:
71+
type: string
72+
description: The name of the process
73+
- complete_FP_table.R:
74+
type: string
75+
description: The name of the tool
76+
- 0.1.0:
77+
type: string
78+
description: Version of the custom script
5279
authors:
53-
- "@anoronh4"
80+
- "@anoronh4"
5481
maintainers:
55-
- "@anoronh4"
82+
- "@anoronh4"

modules/msk/custom/fingerprintcombine/resources/usr/bin/complete_FP_table.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ hg19_hg38_mapper$Loci_hg38 = paste(hg19_hg38_mapper$GRCH38_CHROM,hg19_hg38_mappe
4949
hg19_hg38_mapper = hg19_hg38_mapper %>% select(Loci_hg19, Loci_hg38) %>% unique()
5050

5151
message("Loading Samples")
52-
input_table = fread(args$input_table, header = T)
52+
input_table = fread(args$input_table, header = T) %>% arrange(sample_id)
5353
for (i in 1:nrow(input_table)){
5454
sample = input_table$sample_id[i]
5555
genome_build = input_table$genome_build[i]

modules/msk/custom/fingerprintcombine/tests/main.nf.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ nextflow_process {
5656
"""
5757
input[0] = CUSTOM_FINGERPRINTVCFPARSER.out.tsv
5858
.map{ meta, tsv ->
59-
def meta2 = [id:meta.pool]
59+
println meta
6060
[[id:meta.pool], tsv, meta.id, "hg19"]
6161
}.groupTuple(by:[0])
6262
input[1] = file("$baseDir/modules/msk/custom/fingerprintcombine/tests/loci_mapping.tsv", checkIfExists:true)
@@ -82,6 +82,7 @@ nextflow_process {
8282
process {
8383
"""
8484
input[0] = [
85+
[id:"testsample"],
8586
[file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true)],
8687
["testsample"],
8788
["hg19"]

modules/msk/custom/fingerprintcombine/tests/main.nf.test.snap

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,82 @@
33
"content": [
44
{
55
"0": [
6-
"XDPfilter_ALL_FP.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
6+
[
7+
{
8+
"id": "testsample"
9+
},
10+
"XDPfilter_ALL_FP.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
11+
]
712
],
813
"1": [
9-
"versions.yml:md5,3bd40a0fd11a907f31110dd113fd88c2"
14+
[
15+
"CUSTOM_FINGERPRINTCOMBINE",
16+
"complete_FP_table.R",
17+
"0.1.0"
18+
]
1019
],
1120
"combined_fp_tsv": [
12-
"XDPfilter_ALL_FP.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
21+
[
22+
{
23+
"id": "testsample"
24+
},
25+
"XDPfilter_ALL_FP.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
26+
]
1327
],
14-
"versions": [
15-
"versions.yml:md5,3bd40a0fd11a907f31110dd113fd88c2"
28+
"versions_fingerprintvcfparser": [
29+
[
30+
"CUSTOM_FINGERPRINTCOMBINE",
31+
"complete_FP_table.R",
32+
"0.1.0"
33+
]
1634
]
1735
}
1836
],
1937
"meta": {
20-
"nf-test": "0.9.2",
21-
"nextflow": "25.04.6"
38+
"nf-test": "0.9.3",
39+
"nextflow": "25.10.2"
2240
},
23-
"timestamp": "2025-09-25T22:47:09.499353594"
41+
"timestamp": "2025-12-17T13:28:48.061258305"
2442
},
2543
"sarscov2 - bam": {
2644
"content": [
2745
{
2846
"0": [
29-
"0DPfilter_ALL_FP.txt:md5,509d9f7c1d89b9f8e2825bcc4793da3a"
47+
[
48+
{
49+
"id": "mypool"
50+
},
51+
"0DPfilter_ALL_FP.txt:md5,66113c255cf1f52e27802183764a406d"
52+
]
3053
],
3154
"1": [
32-
"versions.yml:md5,3bd40a0fd11a907f31110dd113fd88c2"
55+
[
56+
"CUSTOM_FINGERPRINTCOMBINE",
57+
"complete_FP_table.R",
58+
"0.1.0"
59+
]
3360
],
3461
"combined_fp_tsv": [
35-
"0DPfilter_ALL_FP.txt:md5,509d9f7c1d89b9f8e2825bcc4793da3a"
62+
[
63+
{
64+
"id": "mypool"
65+
},
66+
"0DPfilter_ALL_FP.txt:md5,66113c255cf1f52e27802183764a406d"
67+
]
3668
],
37-
"versions": [
38-
"versions.yml:md5,3bd40a0fd11a907f31110dd113fd88c2"
69+
"versions_fingerprintvcfparser": [
70+
[
71+
"CUSTOM_FINGERPRINTCOMBINE",
72+
"complete_FP_table.R",
73+
"0.1.0"
74+
]
3975
]
4076
}
4177
],
4278
"meta": {
43-
"nf-test": "0.9.2",
44-
"nextflow": "25.04.6"
79+
"nf-test": "0.9.3",
80+
"nextflow": "25.10.2"
4581
},
46-
"timestamp": "2025-09-25T22:47:03.219089934"
82+
"timestamp": "2025-12-17T13:28:39.908034467"
4783
}
4884
}

modules/msk/custom/fingerprintcontamination/main.nf

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ process CUSTOM_FINGERPRINTCONTAMINATION {
1212
tuple val(meta), path(fp_tumor), path(fp_normal)
1313

1414
output:
15-
tuple val(meta), path("*.contamination.tsv"), emit: contamination_tsv
16-
path "versions.yml" , emit: versions
15+
tuple val(meta), path("*.contamination.tsv") , emit: contamination_tsv
16+
tuple val("${task.process}"), val('calculate_contamination.py'), eval('calculate_contamination.py -v | cut -f 2 -d" "'), emit: versions_fingerprintvcfparser, topic: versions
1717

1818
when:
1919
task.ext.when == null || task.ext.when
@@ -28,20 +28,12 @@ process CUSTOM_FINGERPRINTCONTAMINATION {
2828
-o ${prefix}.contamination.tsv \\
2929
${args}
3030
31-
cat <<-END_VERSIONS > versions.yml
32-
"${task.process}":
33-
calculate_contamination.py: \$( calculate_contamination.py --version | rev | cut -f 1 -d " " | rev )
34-
END_VERSIONS
3531
"""
3632

3733
stub:
3834
def prefix = task.ext.prefix ?: "${meta.id}"
3935
"""
4036
touch ${prefix}.contamination.tsv
4137
42-
cat <<-END_VERSIONS > versions.yml
43-
"${task.process}":
44-
calculate_contamination.py: \$( calculate_contamination.py --version | rev | cut -f 1 -d " " | rev )
45-
END_VERSIONS
4638
"""
4739
}

modules/msk/custom/fingerprintcontamination/meta.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ tools:
1111
description: "Python Data Analysis Library"
1212
homepage: "https://pandas.pydata.org/"
1313
documentation: "https://pandas.pydata.org/docs/"
14+
identifier: biotools:pandas
1415
- "numpy":
1516
description: "Scientific computing library for Python"
1617
homepage: "https://numpy.org/"
1718
documentation: "https://numpy.org/doc/"
1819

20+
identifier: biotools:numpy
1921
input:
2022
- - meta:
2123
type: map
@@ -27,17 +29,19 @@ input:
2729
description: Fingerprint table file for tumor sample
2830
pattern: "*.fp.tsv"
2931
ontologies:
30-
- edam: "http://edamontology.org/format_3750" # TSV
32+
- edam: "http://edamontology.org/format_3750" # TSV
33+
- edam: http://edamontology.org/format_3475 # TSV
3134
- fp_normal:
3235
type: file
3336
description: Fingerprint table file for normal sample
3437
pattern: "*.fp.tsv"
3538
ontologies:
3639
- edam: "http://edamontology.org/format_3750"
3740

41+
- edam: http://edamontology.org/format_3475 # TSV
3842
output:
39-
- contamination_tsv:
40-
- meta:
43+
contamination_tsv:
44+
- - meta:
4145
type: map
4246
description: |
4347
Groovy Map containing sample information
@@ -48,12 +52,11 @@ output:
4852
pattern: "*.contamination.tsv"
4953
ontologies:
5054
- edam: "http://edamontology.org/format_3750" # TSV
51-
- versions:
52-
- versions.yml:
53-
type: file
54-
description: File containing software versions
55-
pattern: "versions.yml"
56-
55+
- edam: http://edamontology.org/format_3475 # TSV
56+
versions_fingerprintvcfparser:
57+
- - ${task.process}: {}
58+
- calculate_contamination.py: {}
59+
- 'calculate_contamination.py -v | cut -f 2 -d" ': {}
5760
authors:
5861
- "@anoronh4"
5962
maintainers:

0 commit comments

Comments
 (0)