Skip to content

Commit d8b1980

Browse files
authored
Merge pull request #40 from atrigila/add_tool_stitch
Add tool stitch
2 parents 411233e + 7a6c61d commit d8b1980

File tree

34 files changed

+1173
-388
lines changed

34 files changed

+1173
-388
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- "test"
3232
- "test_sim"
3333
- "test_quilt"
34+
- "test_stitch"
3435
steps:
3536
- name: Check out pipeline code
3637
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

.nf-core.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
repository_type: pipeline
2+
lint:
3+
subworkflow_changes: false

assets/schema_posfile.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "https://raw.githubusercontent.com/nf-core/phaseimpute/master/assets/schema_posfile.json",
4+
"title": "nf-core/phaseimpute pipeline - params.posfile schema",
5+
"description": "Schema for the file provided with params.posfile",
6+
"type": "array",
7+
"items": {
8+
"type": "object",
9+
"properties": {
10+
"chr": {
11+
"type": "string",
12+
"pattern": "^\\S+$",
13+
"errorMessage": "Chromosome name must be provided as a string and cannot contain spaces",
14+
"meta": ["chr"]
15+
},
16+
"file": {
17+
"type": "string",
18+
"pattern": "^\\S+\\.txt$",
19+
"errorMessage": "Posfile per chromosome must be provided. Must have .txt extension"
20+
}
21+
},
22+
"required": ["chr", "file"]
23+
}
24+
}

conf/steps/imputation_glimpse1.config

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,26 @@ process {
8181
path: { "${params.outdir}/imputation/glimpse1" }
8282
]
8383
}
84+
85+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_GLIMPSE1:.*' {
86+
publishDir = [
87+
[
88+
path: { "${params.outdir}/imputation/glimpse1/concat" },
89+
mode: params.publish_dir_mode,
90+
],
91+
]
92+
}
93+
94+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_GLIMPSE1:BCFTOOLS_CONCAT' {
95+
ext.args = {[
96+
"--ligate",
97+
"--output-type z",
98+
].join(" ").trim()}
99+
ext.prefix = { "${meta.id}_glimpse1" }
100+
}
101+
102+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_GLIMPSE1:BCFTOOLS_INDEX' {
103+
ext.args = "--tbi"
104+
ext.prefix = { "${meta.id}_glimpse1" }
105+
}
84106
}

conf/steps/imputation_quilt.config

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -39,50 +39,6 @@ process {
3939
ext.prefix = { "${meta.id}_${meta.chr}" }
4040
}
4141

42-
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_INDEX' {
43-
cpus = 2
44-
memory = 400.MB
45-
maxRetries = 2
46-
}
47-
48-
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_INDEX_2' {
49-
ext.args = '--tbi'
50-
cpus = 2
51-
memory = 400.MB
52-
maxRetries = 2
53-
}
54-
55-
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_INDEX_3' {
56-
ext.args = '--tbi'
57-
cpus = 2
58-
memory = 400.MB
59-
maxRetries = 2
60-
}
61-
62-
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_VIEW' {
63-
ext.args = '-v snps -Oz'
64-
ext.prefix = { "${meta.id}_${meta.chr}_biallelic" }
65-
cpus = 2
66-
memory = 400.MB
67-
maxRetries = 2
68-
}
69-
70-
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_NORM' {
71-
ext.args = '-m +any --output-type z'
72-
ext.prefix = { "${meta.id}_${meta.chr}_multiallelic" }
73-
cpus = 2
74-
memory = 400.MB
75-
maxRetries = 2
76-
}
77-
78-
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_CONVERT' {
79-
ext.args = '--haplegendsample test'
80-
ext.prefix = { "${meta.id}_${meta.chr}_convert" }
81-
cpus = 2
82-
memory = 400.MB
83-
maxRetries = 2
84-
}
85-
8642
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:IMPUTE_QUILT:.*' {
8743
publishDir = [
8844
[
@@ -97,7 +53,7 @@ process {
9753
publishDir = [enabled: false]
9854
}
9955

100-
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:IMPUTE_QUILT:INDEX1' {
56+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:IMPUTE_QUILT:BCFTOOLS_INDEX_1' {
10157
ext.args = "--tbi"
10258
publishDir = [enabled: false]
10359
}
@@ -107,8 +63,30 @@ process {
10763
ext.prefix = { "${meta.id}_R${meta.region.replace(':','_')}.impute.annotate" }
10864
}
10965

110-
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:IMPUTE_QUILT:INDEX2' {
66+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:IMPUTE_QUILT:BCFTOOLS_INDEX_2' {
67+
ext.args = "--tbi"
68+
}
69+
70+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_QUILT:.*' {
71+
publishDir = [
72+
[
73+
path: { "${params.outdir}/imputation/quilt/concat" },
74+
mode: params.publish_dir_mode,
75+
],
76+
]
77+
}
78+
79+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_QUILT:BCFTOOLS_CONCAT' {
80+
ext.args = {[
81+
"--ligate",
82+
"--output-type z",
83+
].join(" ").trim()}
84+
ext.prefix = { "${meta.id}_quilt" }
85+
}
86+
87+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_QUILT:BCFTOOLS_INDEX' {
11188
ext.args = "--tbi"
89+
ext.prefix = { "${meta.id}_quilt" }
11290
}
11391

11492
}

conf/steps/imputation_stitch.config

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/*
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Config file for defining DSL2 per module options and publishing paths
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
Available keys to override module options:
6+
ext.args = Additional arguments appended to command in module.
7+
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).
8+
ext.args3 = Third set of arguments appended to command in module (multi-tool modules).
9+
ext.prefix = File name prefix for output files.
10+
----------------------------------------------------------------------------------------
11+
*/
12+
13+
process {
14+
15+
withName: CUSTOM_DUMPSOFTWAREVERSIONS {
16+
publishDir = [
17+
path: { "${params.outdir}/pipeline_info" },
18+
mode: params.publish_dir_mode,
19+
pattern: '*_versions.yml'
20+
]
21+
}
22+
23+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_POSFILE_TSV:.*' {
24+
publishDir = [
25+
path: { "${params.outdir}/prep_panel/posfile/" },
26+
mode: params.publish_dir_mode,
27+
enabled: true
28+
]
29+
}
30+
31+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_POSFILE_TSV:GAWK' {
32+
ext.args = "'{ key = \$1 FS \$2 } !seen[key]++'"
33+
ext.prefix = { "${meta.id}_${meta.chr}_posfile_stitch" }
34+
ext.suffix = ".txt"
35+
}
36+
37+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_INPUT_STITCH:BCFTOOLS_NORM' {
38+
ext.args = '-m +any --output-type z'
39+
ext.prefix = { "${meta.id}_${meta.chr}_multiallelic" }
40+
maxRetries = 2
41+
publishDir = [enabled: false]
42+
}
43+
44+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_INPUT_STITCH:BCFTOOLS_VIEW' {
45+
ext.args = '-v snps -Oz'
46+
ext.prefix = { "${meta.id}_${meta.chr}_biallelic" }
47+
maxRetries = 2
48+
publishDir = [enabled: false]
49+
50+
}
51+
52+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_INPUT_STITCH:BCFTOOLS_INDEX' {
53+
maxRetries = 2
54+
publishDir = [enabled: false]
55+
56+
}
57+
58+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_INPUT_STITCH:BCFTOOLS_INDEX_2' {
59+
ext.args = '--tbi'
60+
maxRetries = 2
61+
publishDir = [enabled: false]
62+
63+
}
64+
65+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_POSFILE_TSV:BCFTOOLS_QUERY' {
66+
ext.args = [
67+
"-f'%CHROM\t%POS\t%REF\t%ALT\\n'",
68+
].join(' ')
69+
ext.prefix = { "${meta.id}_${meta.chr}_posfile_stitch" }
70+
publishDir = [enabled: false]
71+
}
72+
73+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:BAM_IMPUTE_STITCH:.*' {
74+
publishDir = [
75+
path: { "${params.outdir}/imputation/stitch/" },
76+
mode: params.publish_dir_mode,
77+
enabled: true
78+
]
79+
}
80+
81+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:BAM_IMPUTE_STITCH:BCFTOOLS_INDEX' {
82+
ext.args = '--tbi'
83+
maxRetries = 2
84+
publishDir = [enabled: false]
85+
}
86+
87+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_STITCH:.*' {
88+
publishDir = [
89+
[
90+
path: { "${params.outdir}/imputation/stitch/concat" },
91+
mode: params.publish_dir_mode,
92+
],
93+
]
94+
}
95+
96+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_STITCH:BCFTOOLS_CONCAT' {
97+
ext.args = {[
98+
"--ligate",
99+
"--output-type z",
100+
].join(" ").trim()}
101+
ext.prefix = { "${meta.id}_stitch" }
102+
}
103+
104+
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_STITCH:BCFTOOLS_INDEX' {
105+
ext.args = "--tbi"
106+
ext.prefix = { "${meta.id}_stitch" }
107+
}
108+
109+
110+
111+
}

0 commit comments

Comments
 (0)