Skip to content

Commit

Permalink
Merge pull request nf-core#40 from atrigila/add_tool_stitch
Browse files Browse the repository at this point in the history
Add tool stitch
  • Loading branch information
atrigila authored May 6, 2024
2 parents 411233e + 7a6c61d commit d8b1980
Show file tree
Hide file tree
Showing 34 changed files with 1,173 additions and 388 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- "test"
- "test_sim"
- "test_quilt"
- "test_stitch"
steps:
- name: Check out pipeline code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
Expand Down
2 changes: 2 additions & 0 deletions .nf-core.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
repository_type: pipeline
lint:
subworkflow_changes: false
24 changes: 24 additions & 0 deletions assets/schema_posfile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/nf-core/phaseimpute/master/assets/schema_posfile.json",
"title": "nf-core/phaseimpute pipeline - params.posfile schema",
"description": "Schema for the file provided with params.posfile",
"type": "array",
"items": {
"type": "object",
"properties": {
"chr": {
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "Chromosome name must be provided as a string and cannot contain spaces",
"meta": ["chr"]
},
"file": {
"type": "string",
"pattern": "^\\S+\\.txt$",
"errorMessage": "Posfile per chromosome must be provided. Must have .txt extension"
}
},
"required": ["chr", "file"]
}
}
22 changes: 22 additions & 0 deletions conf/steps/imputation_glimpse1.config
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,26 @@ process {
path: { "${params.outdir}/imputation/glimpse1" }
]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_GLIMPSE1:.*' {
publishDir = [
[
path: { "${params.outdir}/imputation/glimpse1/concat" },
mode: params.publish_dir_mode,
],
]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_GLIMPSE1:BCFTOOLS_CONCAT' {
ext.args = {[
"--ligate",
"--output-type z",
].join(" ").trim()}
ext.prefix = { "${meta.id}_glimpse1" }
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_GLIMPSE1:BCFTOOLS_INDEX' {
ext.args = "--tbi"
ext.prefix = { "${meta.id}_glimpse1" }
}
}
70 changes: 24 additions & 46 deletions conf/steps/imputation_quilt.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,50 +39,6 @@ process {
ext.prefix = { "${meta.id}_${meta.chr}" }
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_INDEX' {
cpus = 2
memory = 400.MB
maxRetries = 2
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_INDEX_2' {
ext.args = '--tbi'
cpus = 2
memory = 400.MB
maxRetries = 2
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_INDEX_3' {
ext.args = '--tbi'
cpus = 2
memory = 400.MB
maxRetries = 2
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_VIEW' {
ext.args = '-v snps -Oz'
ext.prefix = { "${meta.id}_${meta.chr}_biallelic" }
cpus = 2
memory = 400.MB
maxRetries = 2
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_NORM' {
ext.args = '-m +any --output-type z'
ext.prefix = { "${meta.id}_${meta.chr}_multiallelic" }
cpus = 2
memory = 400.MB
maxRetries = 2
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:MAKE_CHUNKS:BCFTOOLS_CONVERT' {
ext.args = '--haplegendsample test'
ext.prefix = { "${meta.id}_${meta.chr}_convert" }
cpus = 2
memory = 400.MB
maxRetries = 2
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:IMPUTE_QUILT:.*' {
publishDir = [
[
Expand All @@ -97,7 +53,7 @@ process {
publishDir = [enabled: false]
}

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

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:IMPUTE_QUILT:INDEX2' {
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:IMPUTE_QUILT:BCFTOOLS_INDEX_2' {
ext.args = "--tbi"
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_QUILT:.*' {
publishDir = [
[
path: { "${params.outdir}/imputation/quilt/concat" },
mode: params.publish_dir_mode,
],
]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_QUILT:BCFTOOLS_CONCAT' {
ext.args = {[
"--ligate",
"--output-type z",
].join(" ").trim()}
ext.prefix = { "${meta.id}_quilt" }
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_QUILT:BCFTOOLS_INDEX' {
ext.args = "--tbi"
ext.prefix = { "${meta.id}_quilt" }
}

}
111 changes: 111 additions & 0 deletions conf/steps/imputation_stitch.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Config file for defining DSL2 per module options and publishing paths
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Available keys to override module options:
ext.args = Additional arguments appended to command in module.
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).
ext.args3 = Third set of arguments appended to command in module (multi-tool modules).
ext.prefix = File name prefix for output files.
----------------------------------------------------------------------------------------
*/

process {

withName: CUSTOM_DUMPSOFTWAREVERSIONS {
publishDir = [
path: { "${params.outdir}/pipeline_info" },
mode: params.publish_dir_mode,
pattern: '*_versions.yml'
]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_POSFILE_TSV:.*' {
publishDir = [
path: { "${params.outdir}/prep_panel/posfile/" },
mode: params.publish_dir_mode,
enabled: true
]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_POSFILE_TSV:GAWK' {
ext.args = "'{ key = \$1 FS \$2 } !seen[key]++'"
ext.prefix = { "${meta.id}_${meta.chr}_posfile_stitch" }
ext.suffix = ".txt"
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_INPUT_STITCH:BCFTOOLS_NORM' {
ext.args = '-m +any --output-type z'
ext.prefix = { "${meta.id}_${meta.chr}_multiallelic" }
maxRetries = 2
publishDir = [enabled: false]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_INPUT_STITCH:BCFTOOLS_VIEW' {
ext.args = '-v snps -Oz'
ext.prefix = { "${meta.id}_${meta.chr}_biallelic" }
maxRetries = 2
publishDir = [enabled: false]

}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_INPUT_STITCH:BCFTOOLS_INDEX' {
maxRetries = 2
publishDir = [enabled: false]

}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_INPUT_STITCH:BCFTOOLS_INDEX_2' {
ext.args = '--tbi'
maxRetries = 2
publishDir = [enabled: false]

}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:PREPARE_POSFILE_TSV:BCFTOOLS_QUERY' {
ext.args = [
"-f'%CHROM\t%POS\t%REF\t%ALT\\n'",
].join(' ')
ext.prefix = { "${meta.id}_${meta.chr}_posfile_stitch" }
publishDir = [enabled: false]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:BAM_IMPUTE_STITCH:.*' {
publishDir = [
path: { "${params.outdir}/imputation/stitch/" },
mode: params.publish_dir_mode,
enabled: true
]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:BAM_IMPUTE_STITCH:BCFTOOLS_INDEX' {
ext.args = '--tbi'
maxRetries = 2
publishDir = [enabled: false]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_STITCH:.*' {
publishDir = [
[
path: { "${params.outdir}/imputation/stitch/concat" },
mode: params.publish_dir_mode,
],
]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_STITCH:BCFTOOLS_CONCAT' {
ext.args = {[
"--ligate",
"--output-type z",
].join(" ").trim()}
ext.prefix = { "${meta.id}_stitch" }
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:CONCAT_STITCH:BCFTOOLS_INDEX' {
ext.args = "--tbi"
ext.prefix = { "${meta.id}_stitch" }
}



}
Loading

0 comments on commit d8b1980

Please sign in to comment.