-
Notifications
You must be signed in to change notification settings - Fork 2
/
01_run_quality_check.nf
87 lines (62 loc) · 2.14 KB
/
01_run_quality_check.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
/*
* This is a nextflow workflow to do a first quality check of metagenomic datasets.
* The steps involve running fastqc, multiqc, and an analysis of sequencing depth using nonpareil.
*/
/*
* pipeline input parameters
*/
log.info """\
TALOS - a metagenomics shotgun pipeline
===================================
This current workflow generates a multiqc report
and it calculates the coverage of the metagenomic samples.
input - reads : ${params.reads}
files in read set : ${params.setsize}
output - directory : ${params.outdir}
temporary - directory : ${workDir}
"""
.stripIndent()
// Needed to run on the SAGA CLUSTER !!!! NO LONGER NEEDED
// preCmd = """
// if [ -f /cluster/bin/jobsetup ];
// then set +u; source /cluster/bin/jobsetup; set -u; fi
// """
// Creating the channels needed for the first analysis step
Channel
.fromFilePairs( params.reads, size:params.setsize, checkIfExists: true )
.into { read_pairs_ch; read_pairs2_ch }
// first process is to run fastqc on the raw datasets
// using the fastqc conda environment
process fastqc {
conda 'conda_yml/fastqc_env.yml'
publishDir "${params.outdir}/01_fastqc", mode: "${params.savemode}"
tag "FASTQC on $sample_id"
executor='slurm'
label 'small'
input:
set sample_id, file(reads) from read_pairs_ch
output:
file("fastqc_${sample_id}_logs") into fastqc_raw_ch
script:
"""
mkdir fastqc_${sample_id}_logs
fastqc -o fastqc_${sample_id}_logs -f fastq -q ${reads}
"""
}
// running multiqc on the fastqc files from the channel: fastqc_raw_ch
process multiqc {
conda 'conda_yml/multiqc_env.yml'
publishDir "${params.outdir}/02_multiqc", mode: "${params.savemode}"
tag "multiqc on fastqc"
executor='slurm'
label 'small'
input:
file('*') from fastqc_raw_ch.collect()
output:
file('raw_data.multiqc_report.html')
script:
"""
multiqc .
mv multiqc_report.html raw_data.multiqc_report.html
"""
}