forked from bioinformatics-lab/dandrea_legionella_nf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
89 lines (69 loc) · 3.92 KB
/
main.nf
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
nextflow.enable.dsl = 2
// Modules
include { TRIMMOMATIC } from "./modules/trimmomatic/trimmomatic.nf"
include { SPADES } from "./modules/spades/spades.nf"
include { PROKKA } from "./modules/prokka/prokka.nf"
include { FASTQC as FASTQC_UNTRIMMED } from "./modules/fastqc/fastqc.nf" addParams(resultsDir: "${params.outdir}/fastqc_untrimmed")
include { FASTQC as FASTQC_TRIMMED } from "./modules/fastqc/fastqc.nf" addParams(resultsDir: "${params.outdir}/fastqc_trimmed")
include { MULTIQC as MULTIQC_TRIMMED } from "./modules/multiqc/multiqc.nf" addParams(resultsDir: "${params.outdir}/multiqc_trimmed", fastqcResultsDir: "${params.outdir}/fastqc_trimmed")
include { MULTIQC as MULTIQC_UNTRIMMED } from "./modules/multiqc/multiqc.nf" addParams(resultsDir: "${params.outdir}/multiqc_untrimmed", fastqcResultsDir: "${params.outdir}/fastqc_untrimmed")
include { SNIPPY } from "./modules/snippy/snippy.nf"
include { QUAST } from "./modules/quast/quast.nf" addParams(resultsDir: "${params.outdir}/quast")
include { QUAST as QUAST_UNICYCLER } from "./modules/quast/quast.nf" addParams(resultsDir: "${params.outdir}/quast_filtered_unicycler")
include { UTILS_FILTER_CONTIGS } from "./modules/utils/filter_contigs/filter_contigs.nf"
include { CLASSIFY_TAXONOMY } from "./workflows/classify_taxonomy/classify_taxonomy.nf"
include { FASTANI } from "./modules/fastani/fastani.nf"
include { BWA_INDEX } from "./modules/bwa/index.nf"
include { BWA_MEM } from "./modules/bwa/mem.nf"
include { SAMTOOLS_INDEX } from "./modules/samtools/index.nf"
include { SAMTOOLS_FAIDX } from "./modules/samtools/faidx.nf"
include { SAMTOOLS_SORT } from "./modules/samtools/sort.nf"
include { GATK_HAPLOTYPE_CALLER } from "./modules/gatk/haplotype_caller.nf"
include { GATK_MARK_DUPLICATES_SPARK } from "./modules/gatk/mark_duplicates_spark.nf"
include { PICARD_CREATE_SEQUENCE_DICTIONARY } from "./modules/picard/create_sequence_dictionary.nf"
// Workflows
//include { BASE_WF } from "./workflows/base_wf.nf"
//include { QUALITY_CHECK_WF } from "./workflows/quality_check_wf.nf"
//include { SNIPPY_WF } from "./workflows/snippy_wf.nf"
//include { SNIPPY_ANISA_WF } from "./workflows/snippy_anisa_wf.nf"
//include { SPADES_WF } from "./workflows/spades_wf.nf"
//include { UNICYCLER_WF } from "./workflows/unicycler_wf.nf"
//include { QUAST_WF } from "./workflows/quast_wf.nf"
workflow {
sra_ch = Channel.fromFilePairs(params.reads)
// Step-1 : QC
FASTQC_UNTRIMMED(sra_ch)
MULTIQC_UNTRIMMED(FASTQC_UNTRIMMED.out.flatten().collect())
TRIMMOMATIC(sra_ch)
FASTQC_TRIMMED(TRIMMOMATIC.out)
MULTIQC_TRIMMED(FASTQC_TRIMMED.out.flatten().collect())
// Step-2
SPADES(TRIMMOMATIC.out)
UTILS_FILTER_CONTIGS(SPADES.out[0])
// NOTE This quast command operates on all contig
// There is another one, mentioned in the module for a single contig
QUAST(UTILS_FILTER_CONTIGS.out[0].collect(), params.reference_fasta)
PROKKA(UTILS_FILTER_CONTIGS.out[1], params.reference_fasta)
SNIPPY(TRIMMOMATIC.out, params.reference_fasta)
// Step-3
FASTANI(UTILS_FILTER_CONTIGS.out[1], params.reference_fasta)
// Step-4
BWA_INDEX(params.reference_fasta)
SAMTOOLS_FAIDX(params.reference_fasta)
PICARD_CREATE_SEQUENCE_DICTIONARY(params.reference_fasta)
CLASSIFY_TAXONOMY(TRIMMOMATIC.out, params.kraken2_db, params.kraken2_gram_stain)
// Step-5
BWA_MEM(TRIMMOMATIC.out, params.reference_fasta, SAMTOOLS_FAIDX.out, BWA_INDEX.out)
// SAMTOOLS_SORT(BWA_MEM.out)
// SAMTOOLS_INDEX(SAMTOOLS_SORT.out, params.reference_fasta)
GATK_MARK_DUPLICATES_SPARK(BWA_MEM.out , params.reference_fasta)
GATK_HAPLOTYPE_CALLER(GATK_MARK_DUPLICATES_SPARK.out, params.reference_fasta, SAMTOOLS_FAIDX.out, BWA_INDEX.out, PICARD_CREATE_SEQUENCE_DICTIONARY.out
)
// Step-6
// BLAST()
}
workflow test {
sra_ch = Channel.fromFilePairs(params.reads)
TRIMMOMATIC(sra_ch)
CLASSIFY_TAXONOMY(TRIMMOMATIC.out, params.kraken2_db, params.kraken2_gram_stain)
}