@@ -11,14 +11,9 @@ class WorkflowRnaseq {
11
11
//
12
12
// Check and validate parameters
13
13
//
14
- public static void initialise (params , log , valid_params ) {
14
+ public static void initialise (params , log ) {
15
15
genomeExistsError(params, log)
16
16
17
-
18
- if (! params. fasta) {
19
- Nextflow . error(" Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file." )
20
- }
21
-
22
17
if (! params. gtf && ! params. gff) {
23
18
Nextflow . error(" No GTF or GFF3 annotation specified! The pipeline requires at least one of these files." )
24
19
}
@@ -54,27 +49,13 @@ class WorkflowRnaseq {
54
49
}
55
50
}
56
51
57
- if (! params. skip_trimming) {
58
- if (! valid_params[' trimmers' ]. contains(params. trimmer)) {
59
- Nextflow . error(" Invalid option: '${ params.trimmer} '. Valid options for '--trimmer': ${ valid_params['trimmers'].join(', ')} ." )
60
- }
61
- }
62
-
63
- if (! params. skip_alignment) {
64
- if (! valid_params[' aligners' ]. contains(params. aligner)) {
65
- Nextflow . error(" Invalid option: '${ params.aligner} '. Valid options for '--aligner': ${ valid_params['aligners'].join(', ')} ." )
66
- }
67
- } else {
52
+ if (params. skip_alignment) {
68
53
skipAlignmentWarn(log)
69
54
}
70
55
71
56
if (! params. skip_pseudo_alignment && params. pseudo_aligner) {
72
- if (! valid_params[' pseudoaligners' ]. contains(params. pseudo_aligner)) {
73
- Nextflow . error(" Invalid option: '${ params.pseudo_aligner} '. Valid options for '--pseudo_aligner': ${ valid_params['pseudoaligners'].join(', ')} ." )
74
- } else {
75
- if (! (params. salmon_index || params. transcript_fasta || (params. fasta && (params. gtf || params. gff)))) {
76
- Nextflow . error(" To use `--pseudo_aligner 'salmon'`, you must provide either --salmon_index or --transcript_fasta or both --fasta and --gtf / --gff." )
77
- }
57
+ if (! (params. salmon_index || params. transcript_fasta || (params. fasta && (params. gtf || params. gff)))) {
58
+ Nextflow . error(" To use `--pseudo_aligner 'salmon'`, you must provide either --salmon_index or --transcript_fasta or both --fasta and --gtf / --gff." )
78
59
}
79
60
}
80
61
@@ -109,12 +90,34 @@ class WorkflowRnaseq {
109
90
}
110
91
111
92
// Check which RSeQC modules we are running
93
+ def valid_rseqc_modules = [' bam_stat' , ' inner_distance' , ' infer_experiment' , ' junction_annotation' , ' junction_saturation' , ' read_distribution' , ' read_duplication' , ' tin' ]
112
94
def rseqc_modules = params. rseqc_modules ? params. rseqc_modules. split(' ,' ). collect{ it. trim(). toLowerCase() } : []
113
- if ((valid_params[ ' rseqc_modules ' ] + rseqc_modules). unique(). size() != valid_params[ ' rseqc_modules ' ] . size()) {
114
- Nextflow . error(" Invalid option: ${ params.rseqc_modules} . Valid options for '--rseqc_modules': ${ valid_params['rseqc_modules'] .join(', ')} " )
95
+ if ((valid_rseqc_modules + rseqc_modules). unique(). size() != valid_rseqc_modules . size()) {
96
+ Nextflow . error(" Invalid option: ${ params.rseqc_modules} . Valid options for '--rseqc_modules': ${ valid_rseqc_modules .join(', ')} " )
115
97
}
116
98
}
117
99
100
+ //
101
+ // Function to validate channels from input samplesheet
102
+ //
103
+ public static ArrayList validateInput (input ) {
104
+ def (metas, fastqs) = input[1 .. 2 ]
105
+
106
+ // Check that multiple runs of the same sample are of the same strandedness
107
+ def strandedness_ok = metas. collect{ it. strandedness }. unique(). size == 1
108
+ if (! strandedness_ok) {
109
+ Nextflow . error(" Please check input samplesheet -> Multiple runs of a sample must have the same strandedness!: ${ metas[0].id} " )
110
+ }
111
+
112
+ // Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end
113
+ def endedness_ok = metas. collect{ it. single_end }. unique(). size == 1
114
+ if (! endedness_ok) {
115
+ Nextflow . error(" Please check input samplesheet -> Multiple runs of a sample must be of the same datatype i.e. single-end or paired-end: ${ metas[0].id} " )
116
+ }
117
+
118
+ return [ metas[0 ], fastqs ]
119
+ }
120
+
118
121
//
119
122
// Function to check whether biotype field exists in GTF file
120
123
//
0 commit comments