-
Notifications
You must be signed in to change notification settings - Fork 206
Add nf-core create subworkflow
#1835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mirpedrol
merged 22 commits into
nf-core:subworkflows
from
mashehu:add-create-subworkflow
Oct 6, 2022
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
19cd22a
add subworkflow template
mashehu 8745645
Merge branch 'dev' of https://github.com/nf-core/tools into add-subwo…
mashehu 7445764
update changelog
mashehu 76756b0
[automated] Fix linting with Prettier
nf-core-bot 0cf6c2c
add index files
mashehu 0832a52
Merge branch 'add-subworkflow-template' of https://github.com/mashehu…
mashehu 7004dd9
update test.yml
mashehu 6ed367b
add `nf-core subworkflows create`
mashehu 85f4626
subworkflow create command
ggabernet e1dc0de
run isort
ggabernet 21d3452
fix black linting
ggabernet a1f743d
add subworkflows tests
ggabernet 72f47cd
fix `create` help message
mashehu ac481b4
Merge branch 'add-create-subworkflow' of https://github.com/mashehu/t…
mashehu 7127d8a
allow `_` in subworkflow name
mashehu 4a81e81
fix tests
mashehu d627f36
fix isort
mashehu d99b215
Merge branch 'dev' into add-create-subworkflow
ggabernet d5eb924
update subworkflow template
ggabernet 9ce3e57
fix paths create
ggabernet 656a74b
fix more paths
ggabernet 9a6bb03
Merge branch 'subworkflows' into add-create-subworkflow
mirpedrol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// TODO nf-core: If in doubt look at other nf-core/subworkflows to see how we are doing things! :) | ||
// https://github.com/nf-core/modules/tree/master/subworkflows | ||
// You can also ask for help via your pull request or on the #subworkflows channel on the nf-core Slack workspace: | ||
// https://nf-co.re/join | ||
// TODO nf-core: A subworkflow SHOULD only import modules not other subworkflows | ||
// TODO nf-core: A subworkflow SHOULD import at least two modules | ||
|
||
include { SAMTOOLS_SORT } from '../../../modules/nf-core/samtools/sort/main' | ||
include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' | ||
|
||
workflow {{ subworkflow_name|upper }} { | ||
|
||
take: | ||
// TODO nf-core: edit input (take) channels | ||
ch_bam // channel: [ val(meta), [ bam ] ] | ||
|
||
main: | ||
|
||
ch_versions = Channel.empty() | ||
|
||
// TODO nf-core: substitute modules here for the modules of your subworkflow | ||
|
||
SAMTOOLS_SORT ( ch_bam ) | ||
ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) | ||
|
||
SAMTOOLS_INDEX ( SAMTOOLS_SORT.out.bam ) | ||
ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) | ||
|
||
emit: | ||
// TODO nf-core: edit emitted channels | ||
bam = SAMTOOLS_SORT.out.bam // channel: [ val(meta), [ bam ] ] | ||
bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), [ bai ] ] | ||
csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), [ csi ] ] | ||
|
||
versions = ch_versions // channel: [ versions.yml ] | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: "{{ subworkflow_name }}" | ||
## TODO nf-core: Add a description of the subworkflow and list keywords | ||
description: Sort SAM/BAM/CRAM file | ||
keywords: | ||
- sort | ||
- bam | ||
- sam | ||
- cram | ||
## TODO nf-core: Add a list of the modules used in the subworkflow | ||
modules: | ||
- samtools/sort | ||
- samtools/index | ||
## TODO nf-core: List all of the variables used as input, including their types and descriptions | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test' ] | ||
- bam: | ||
type: file | ||
description: BAM/CRAM/SAM file | ||
pattern: "*.{bam,cram,sam}" | ||
## TODO nf-core: List all of the variables used as output, including their types and descriptions | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test' ] | ||
- bam: | ||
type: file | ||
description: Sorted BAM/CRAM/SAM file | ||
pattern: "*.{bam,cram,sam}" | ||
- bai: | ||
type: file | ||
description: BAM/CRAM/SAM samtools index | ||
pattern: "*.{bai,crai,sai}" | ||
- csi: | ||
type: file | ||
description: CSI samtools index | ||
pattern: "*.csi" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "{{ author }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { {{ subworkflow_name|upper }} } from '../../../../subworkflows/nf-core/{{ subworkflow_dir }}/main.nf' | ||
|
||
workflow test_{{ subworkflow_name }} { | ||
{% if has_meta %} | ||
input = [ | ||
[ id:'test' ], // meta map | ||
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) | ||
] | ||
{%- else %} | ||
input = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) | ||
{%- endif %} | ||
|
||
{{ subworkflow_name|upper }} ( input ) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## TODO nf-core: Please run the following command to build this file: | ||
# nf-core subworkflows create-test-yml {{ subworkflow_name_underscore }} | ||
|
||
- name: "{{ subworkflow_name }}" | ||
command: nextflow run ./tests/subworkflows/nf-core/{{ subworkflow_dir }} -entry test_{{ subworkflow_name }} -c ./tests/config/nextflow.config -c ./tests/subworkflows/nf-core/{{ subworkflow_dir }}/nextflow.config | ||
tags: | ||
- "{{ subworkflow_name }}" | ||
files: | ||
- path: "output/{{ subworkflow_name }}/test.bam" | ||
md5sum: e667c7caad0bc4b7ac383fd023c654fc | ||
- path: output/{{ subworkflow_name }}/versions.yml | ||
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .create import SubworkflowCreate |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.