-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.nf
More file actions
47 lines (36 loc) · 1.58 KB
/
main.nf
File metadata and controls
47 lines (36 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { GATHER_READS } from "./workflows/gather_reads"
include { PREPROCESS_READS } from "./workflows/preprocess_reads"
include { STAT_BLAST_WORKFLOW } from "./workflows/stat_blast_workflow"
include { GOTTCHA2_WORKFLOW } from "./workflows/gottcha2_workflow"
include { CLUMPIFY_WORKFLOW } from "./workflows/clumpify"
workflow {
assert params.samplesheet && file(params.samplesheet).isFile()
ch_input_samplesheet = channel.fromPath(params.samplesheet)
.splitCsv(header: true, strip: true)
.map { row -> tuple(row.sample_id, row.srr, row.platform, row.fastq1, row.fastq2) }
.filter { it -> !it[0].startsWith("#") }
.unique()
GATHER_READS(ch_input_samplesheet)
PREPROCESS_READS(GATHER_READS.out)
// STAT+BLAST workflow (human virus detection via STAT + two-phase BLAST)
// Aliases: nvd, stat, blast, stat_blast, stast (for backward compatibility)
def stat_blast_results = STAT_BLAST_WORKFLOW(PREPROCESS_READS.out)
def stat_blast_token = stat_blast_results.completion
// Collect all LabKey logs as final process
if (params.labkey) {
stat_blast_results.labkey_log.collectFile(
name: 'final_labkey_upload.log',
storeDir: params.results,
)
}
// GOTTCHA2 workflow
def gottcha_token = GOTTCHA2_WORKFLOW(PREPROCESS_READS.out).completion
def start_clumpify = stat_blast_token.mix(gottcha_token).collect().map { true }
// CLUMPIFY workflow
CLUMPIFY_WORKFLOW(
GATHER_READS.out,
start_clumpify,
)
}