-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e6be28
commit 2474718
Showing
11 changed files
with
277 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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 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 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 @@ | ||
manifest { | ||
homePage = 'https://github.com/viash-hub/demultiplex' | ||
description = 'Demultiplexing pipeline for sequencing data' | ||
mainScript = 'target/nextflow/demultiplex/main.nf' | ||
} | ||
|
||
process { | ||
withName: publishStatesProc { | ||
publishDir = [ enabled: false ] | ||
} | ||
} | ||
|
This file contains 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 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 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 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,30 @@ | ||
#!/bin/bash | ||
|
||
echo "Publishing $par_input -> $par_output" | ||
echo "Publishing $par_input_falco -> $par_output_falco" | ||
echo "Publishing $par_input_multiqc -> $par_output_multiqc" | ||
|
||
echo | ||
echo "Creating directory if it does not exist:" | ||
mkdir -p $(dirname "$par_output") && echo "Containing directory $par_output created" | ||
mkdir -p $(dirname "$par_output_falco") && echo "Containing directory $par_output_falco created" | ||
mkdir -p $(dirname "$par_output_multiqc") && echo "Containing directory $par_output_multiqc created" | ||
|
||
echo | ||
echo "Copying files..." | ||
cp -rL "$par_input" "$par_output" | ||
cp -rL "$par_input_falco" "$par_output_falco" | ||
cp -rL "$par_input_multiqc" "$par_output_multiqc" | ||
|
||
echo | ||
echo "Output files:" | ||
echo "par_output:" | ||
ls "$par_output" | ||
|
||
echo | ||
echo "par_output_falco:" | ||
ls "$par_output_falco" | ||
|
||
echo | ||
echo "par_output_multiqc:" | ||
ls "$par_output_multiqc" |
This file contains 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: "publish" | ||
namespace: "io" | ||
description: "Publish the processed results of the run" | ||
argument_groups: | ||
- name: Input arguments | ||
arguments: | ||
- name: --input | ||
description: Directory to write fastq data to | ||
type: file | ||
required: true | ||
- name: "--input_falco" | ||
description: Directory to write falco output to | ||
type: file | ||
required: true | ||
- name: "--input_multiqc" | ||
description: Directory to write falco output to | ||
type: file | ||
required: true | ||
- name: Output arguments | ||
arguments: | ||
- name: --output | ||
type: file | ||
direction: output | ||
default: "fastq" | ||
- name: --output_falco | ||
type: file | ||
direction: output | ||
default: "qc/fastqc" | ||
- name: --output_multiqc | ||
type: file | ||
direction: output | ||
default: "qc/multiqc_report.html" | ||
|
||
resources: | ||
- type: bash_script | ||
path: ./code.sh | ||
|
||
engines: | ||
- type: docker | ||
image: debian:stable-slim | ||
setup: | ||
- type: apt | ||
packages: | ||
- procps | ||
|
||
runners: | ||
- type: executable | ||
- type: nextflow |
This file contains 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,52 @@ | ||
name: runner | ||
description: Runner for demultiplexing of raw sequencing data | ||
argument_groups: | ||
- name: Input arguments | ||
arguments: | ||
- name: --input | ||
description: Base directory of the form `s3:/<bucket>/Sequencing/<Sequencer>/<RunID>/` | ||
type: file | ||
required: true | ||
- name: Annotation flags | ||
arguments: | ||
- name: --add_date_time | ||
description: | | ||
Add date and time to the output directory name. This is useful | ||
when running the same pipeline multiple times on the same input | ||
directory. | ||
type: boolean_true | ||
- name: --add_workflow_id | ||
description: | | ||
Add a workflow identifier to the output directory name. | ||
type: boolean_true | ||
- name: Output arguments | ||
arguments: | ||
- name: --fastq_output | ||
type: file | ||
direction: output | ||
default: "fastq" | ||
- name: --falco_output | ||
type: file | ||
direction: output | ||
default: "qc/fastqc" | ||
- name: --multiqc_output | ||
type: file | ||
direction: output | ||
default: "qc/multiqc_report.html" | ||
|
||
resources: | ||
- type: nextflow_script | ||
path: main.nf | ||
entrypoint: run_wf | ||
|
||
dependencies: | ||
- name: demultiplex | ||
repository: local | ||
- name: io/publish | ||
repository: local | ||
|
||
runners: | ||
- type: nextflow | ||
|
||
engines: | ||
- type: native |
This file contains 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,67 @@ | ||
def date = new Date().format('yyyyMMdd_hhmmss') | ||
|
||
def viash_config = java.nio.file.Paths.get("$projectDir/../../../").toAbsolutePath().normalize().toString() + "/_viash.yaml" | ||
def version = get_version(viash_config) | ||
|
||
workflow run_wf { | ||
take: | ||
input_ch | ||
|
||
main: | ||
output_ch = input_ch | ||
| demultiplex.run( | ||
fromState: [ | ||
"input": "input", | ||
"output": "fastq", | ||
"output_falco": "qc/fastqc", | ||
"output_multiqc": "qc/multiqc_report.html", | ||
], | ||
toState: { id, result, state -> | ||
state + result | ||
}, | ||
) | ||
| publish.run( | ||
fromState: { id, state -> | ||
def id1 = (params.add_date_time) ? "${id}_${date}" : id | ||
def id2 = (params.add_workflow_id) ? "${id1}_demultiplex_${version}" : id1 | ||
|
||
def fastq_output_1 = (id == "run") ? state.fastq_output : "${id2}/" + state.fastq_output | ||
def falco_output_1 = (id == "run") ? state.falco_output : "${id2}/" + state.falco_output | ||
def multiqc_output_1 = (id == "run") ? state.multiqc_output : "${id2}/" + state.multiqc_output | ||
|
||
if (id == "run") { | ||
println("Publising to ${params.publish_dir}") | ||
} else { | ||
println("Publising to ${params.publish_dir}/${id2}") | ||
} | ||
|
||
[ | ||
input: state.output, | ||
input_falco: state.output_falco, | ||
input_multiqc: state.output_multiqc, | ||
output: fastq_output_1, | ||
output_falco: falco_output_1, | ||
output_multiqc: multiqc_output_1 | ||
] | ||
}, | ||
toState: { id, result, state -> [:] }, | ||
directives: [ | ||
publishDir: [ | ||
path: "${params.publish_dir}", | ||
overwrite: false, | ||
mode: "copy" | ||
] | ||
] | ||
) | ||
|
||
emit: | ||
output_ch | ||
} | ||
|
||
def get_version(inputFile) { | ||
def yamlSlurper = new groovy.yaml.YamlSlurper() | ||
def loaded_viash_config = yamlSlurper.parse(file(inputFile)) | ||
def version = (loaded_viash_config.version) ? loaded_viash_config.version : "unknown_version" | ||
println("Version to be used: ${version}") | ||
return version | ||
} |
This file contains 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 @@ | ||
manifest { | ||
nextflowVersion = '!>=20.12.1-edge' | ||
} | ||
|
||
process { | ||
withName: publishStatesProc { | ||
publishDir = [ enabled: false ] | ||
} | ||
} | ||
|
||
// include common settings | ||
includeConfig("${params.rootDir}/src/config/labels.config") |