Skip to content

Commit 3a74b3b

Browse files
Merge pull request #50 from caravagnalab/dev
Add stub nf-test + minor
2 parents 0a0538b + 34dbbff commit 3a74b3b

File tree

14 files changed

+594
-17
lines changed

14 files changed

+594
-17
lines changed

docs/output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ This parser is designed to convert mutations data of joint CNAqc analysis from C
134134

135135
## Lifter
136136

137-
The Lifter subworkflow is an optional step and it is run when single sample VCF file are provided. When multiple samples from the same patient are provided, the user can specify either a single joint VCF file, containing variant calls from all tumor samples of the patient (see [joint variant calling](https://nf-co.re/sarek/3.4.2/parameters/#joint_mutect2)), or individual sample specific VCF files. In the latter case, path to tumor BAM files must be provided in order to collect all mutations from the samples and perform pile-up of sample's private mutations in all the other samples. Two intermediate steps, [get_positions](#get_positions) and [mpileup](#mpileup), are performed to identify private mutations in all the samples and retrieve their variant allele frequency. Once private mutations are properly defined, they are merged back into the original VCF file during the join_positions step. The updated VCF file is then converted into a RDS object.
137+
The Lifter subworkflow is an optional step, and it is run when, despite having multiple samples per patient, variant calling is performed separately on each sample. In this case, instead of a VCF file with a column per sample (multi-sample variant calling), a single VCF file is provided per sample. When multiple samples from the same patient are provided, the user can specify either a single joint VCF file, containing variant calls from all tumor samples of the patient (see [joint variant calling](https://nf-co.re/sarek/3.4.2/parameters/#joint_mutect2)), or individual sample specific VCF files. In the latter case, path to tumor BAM files must be provided in order to collect all mutations from the samples and perform pile-up of sample's private mutations in all the other samples. Two intermediate steps, [get_positions](#get_positions) and [mpileup](#mpileup), are performed to identify private mutations in all the samples and retrieve their variant allele frequency. Once private mutations are properly defined, they are merged back into the original VCF file during the join_positions step. The updated VCF file is then converted into a RDS object.
138138

139139
### mpileup
140140

modules/local/annotate_driver/main.nf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ process ANNOTATE_DRIVER {
7878
writeLines(paste(" dplyr:", dplyr_version), f)
7979
writeLines(paste(" tidyr:", tidyr_version), f)
8080
close(f)
81+
"""
82+
83+
stub:
84+
def prefix = task.ext.prefix ?: "${meta.id}"
85+
"""
86+
touch ${prefix}_driver.rds
8187
88+
cat <<-END_VERSIONS > versions.yml
89+
"${task.process}":
90+
readr: \$(Rscript -e "cat(as.character(packageVersion('readr')))")
91+
dplyr: \$(Rscript -e "cat(as.character(packageVersion('dplyr')))")
92+
tidyr: \$(Rscript -e "cat(as.character(packageVersion('tidyr')))")
93+
END_VERSIONS
8294
"""
8395
}

modules/local/cna2cnaqc/main.nf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,15 @@ process CNA2CNAQC {
2020

2121
script:
2222
template "main_script.R"
23+
24+
stub:
25+
def prefix = task.ext.prefix ?: "${meta.id}"
26+
"""
27+
touch ${prefix}.rds
28+
29+
cat <<-END_VERSIONS > versions.yml
30+
"${task.process}":
31+
cnaqc: \$(Rscript -e "cat(as.character(packageVersion('CNAqc')))")
32+
END_VERSIONS
33+
"""
2334
}

modules/local/cnaqc2tsv/main.nf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,17 @@ process CNAQC2TSV {
1717

1818
script:
1919
template "main_script.R"
20+
21+
stub:
22+
def prefix = task.ext.prefix ?: "${meta.id}"
23+
"""
24+
touch ${prefix}_joint_table.tsv
25+
26+
cat <<-END_VERSIONS > versions.yml
27+
"${task.process}":
28+
cnaqc: \$(Rscript -e "cat(as.character(packageVersion('CNAqc')))")
29+
readr: \$(Rscript -e "cat(as.character(packageVersion('readr')))")
30+
dplyr: \$(Rscript -e "cat(as.character(packageVersion('dplyr')))")
31+
END_VERSIONS
32+
"""
2033
}

modules/local/get_positions/main.nf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,15 @@ process GET_POSITIONS_ALL {
4040
close(f)
4141
4242
"""
43+
44+
stub:
45+
def prefix = task.ext.prefix ?: "${meta.id}"
46+
"""
47+
touch ${prefix}_all_positions.rds
48+
49+
cat <<-END_VERSIONS > versions.yml
50+
"${task.process}":
51+
dplyr: \$(Rscript -e "cat(as.character(packageVersion('dplyr')))")
52+
END_VERSIONS
53+
"""
4354
}

modules/local/get_positions/main_rel.nf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,14 @@ process GET_POSITIONS_REL {
4545
close(f)
4646
4747
"""
48+
49+
stub:
50+
"""
51+
touch ${meta.tumour_sample}_positions_missing
52+
53+
cat <<-END_VERSIONS > versions.yml
54+
"${task.process}":
55+
dplyr: \$(Rscript -e "cat(as.character(packageVersion('dplyr')))")
56+
END_VERSIONS
57+
"""
4858
}

modules/local/join_cnaqc/main.nf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,17 @@ process JOIN_CNAQC {
6262
close(f)
6363
6464
"""
65+
66+
stub:
67+
def prefix = task.ext.prefix ?: "${meta.id}"
68+
"""
69+
touch ${prefix}_multi_cnaqc_ALL.rds
70+
touch ${prefix}_multi_cnaqc_PASS.rds
71+
72+
cat <<-END_VERSIONS > versions.yml
73+
"${task.process}":
74+
CNAqc: \$(Rscript -e "cat(as.character(packageVersion('CNAqc')))")
75+
dplyr: \$(Rscript -e "cat(as.character(packageVersion('dplyr')))")
76+
END_VERSIONS
77+
"""
6578
}

modules/local/join_positions/main.nf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,17 @@ process JOIN_POSITIONS {
8888
writeLines(paste(" vcfR:", vcfR_version), f)
8989
close(f)
9090
"""
91+
92+
stub:
93+
def prefix = task.ext.prefix ?: "${meta.id}"
94+
"""
95+
touch ${prefix}_pileup_VCF.rds
96+
97+
cat <<-END_VERSIONS > versions.yml
98+
"${task.process}":
99+
dplyr: \$(Rscript -e "cat(as.character(packageVersion('dplyr')))")
100+
tidyr: \$(Rscript -e "cat(as.character(packageVersion('tidyr')))")
101+
vcfR: \$(Rscript -e "cat(as.character(packageVersion('vcfR')))")
102+
END_VERSIONS
103+
"""
91104
}

modules/local/vcf2cnaqc/main.nf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,17 @@ process VCF2CNAQC {
2020

2121
script:
2222
template "main_script.R"
23+
24+
stub:
25+
def prefix = task.ext.prefix ?: "${meta.id}"
26+
"""
27+
touch ${prefix}.rds
28+
29+
cat <<-END_VERSIONS > versions.yml
30+
"${task.process}":
31+
cnaqc: \$(Rscript -e "cat(as.character(packageVersion('CNAqc')))")
32+
vcfR: \$(Rscript -e "cat(as.character(packageVersion('vcfR')))")
33+
dplyr: \$(Rscript -e "cat(as.character(packageVersion('dplyr')))")
34+
END_VERSIONS
35+
"""
2336
}

nextflow_schema.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
},
4444
"genome": {
4545
"type": "string",
46-
"description": "Reference genome name."
46+
"description": "Reference genome name.",
47+
"enum": ["GRCh38", "GRCh37"]
4748
},
4849
"tools": {
4950
"type": "string",
@@ -447,7 +448,8 @@
447448
"publish_dir_mode_genome_sigprofiler": {
448449
"type": "string",
449450
"default": "move",
450-
"description": "Mode of publishing the SigProfiler genome."
451+
"description": "Mode of publishing the SigProfiler genome.",
452+
"enum": ["symlink", "rellink", "copy", "copyNoFollow", "move"]
451453
},
452454
"download_sigprofiler_genome": {
453455
"type": "boolean",

0 commit comments

Comments
 (0)