You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Fails when wrongfull extension for intervals file
63
62
if (params.wes &&!params.step =='annotate') {
64
-
if (params.intervals &&!params.intervals.endsWith("bed")) Nextflow.error("Target file specified with `--intervals` must be in BED format for targeted data")
63
+
if (params.intervals &&!params.intervals.endsWith("bed")) error("Target file specified with `--intervals` must be in BED format for targeted data")
65
64
else log.warn("Intervals file was provided without parameter `--wes`: Pipeline will assume this is Whole-Genome-Sequencing data.")
66
-
} elseif (params.intervals &&!params.intervals.endsWith("bed") &&!params.intervals.endsWith("list")) Nextflow.error("Intervals file must end with .bed, .list, or .interval_list")
65
+
} elseif (params.intervals &&!params.intervals.endsWith("bed") &&!params.intervals.endsWith("list")) error("Intervals file must end with .bed, .list, or .interval_list")
67
66
68
67
if (params.step =='mapping'&& params.aligner.contains("dragmap") &&!(params.skip_tools && params.skip_tools.split(',').contains("baserecalibrator"))) {
69
68
log.warn("DragMap was specified as aligner. Base recalibration is not contained in --skip_tools. It is recommended to skip baserecalibration when using DragMap\nhttps://gatk.broadinstitute.org/hc/en-us/articles/4407897446939--How-to-Run-germline-single-sample-short-variant-discovery-in-DRAGEN-mode")
// Fails or warns when missing files or params for ascat
73
72
if (params.tools && params.tools.split(',').contains('ascat')) {
74
73
if (!params.ascat_alleles) {
75
-
Nextflow.error("No allele files were provided for running ASCAT. Please provide a zip folder with allele files.")
74
+
error("No allele files were provided for running ASCAT. Please provide a zip folder with allele files.")
76
75
}
77
76
if (!params.ascat_loci) {
78
-
Nextflow.error("No loci files were provided for running ASCAT. Please provide a zip folder with loci files.")
77
+
error("No loci files were provided for running ASCAT. Please provide a zip folder with loci files.")
79
78
}
80
79
if (!params.ascat_loci_gc &&!params.ascat_loci_rt) {
81
80
log.warn("No LogRCorrection performed in ASCAT. For LogRCorrection to run, please provide either loci gc files or both loci gc files and loci rt files.")
@@ -102,29 +101,29 @@ if (params.tools && params.tools.split(',').contains('mutect2')) {
102
101
// Warns when missing resources for haplotypecaller
103
102
if (!params.dbsnp &&!params.known_indels) {
104
103
if (params.step in ['mapping', 'markduplicates', 'prepare_recalibration', 'recalibrate'] && (!params.skip_tools || (params.skip_tools &&!params.skip_tools.split(',').contains('baserecalibrator')))) {
105
-
Nextflow.error("Base quality score recalibration requires at least one resource file. Please provide at least one of `--dbsnp` or `--known_indels`\nYou can skip this step in the workflow by adding `--skip_tools baserecalibrator` to the command.")
104
+
error("Base quality score recalibration requires at least one resource file. Please provide at least one of `--dbsnp` or `--known_indels`\nYou can skip this step in the workflow by adding `--skip_tools baserecalibrator` to the command.")
106
105
}
107
106
if (params.tools && params.tools.split(',').contains('haplotypecaller')) {
108
107
log.warn "If Haplotypecaller is specified, without `--dbsnp` or `--known_indels no filtering will be done. For filtering, please provide at least one of `--dbsnp` or `--known_indels`.\nFor more information see FilterVariantTranches (single-sample, default): https://gatk.broadinstitute.org/hc/en-us/articles/5358928898971-FilterVariantTranches\nFor more information see VariantRecalibration (--joint_germline): https://gatk.broadinstitute.org/hc/en-us/articles/5358906115227-VariantRecalibrator\nFor more information on GATK Best practice germline variant calling: https://gatk.broadinstitute.org/hc/en-us/articles/360035535932-Germline-short-variant-discovery-SNPs-Indels-"
109
108
}
110
109
}
111
110
if (params.joint_germline && (!params.tools ||!params.tools.split(',').contains('haplotypecaller'))) {
112
-
Nextflow.error("The Haplotypecaller should be specified as one of the tools when doing joint germline variant calling. (The Haplotypecaller could be specified by adding `--tools haplotypecaller` to the nextflow command.) ")
111
+
error("The Haplotypecaller should be specified as one of the tools when doing joint germline variant calling. (The Haplotypecaller could be specified by adding `--tools haplotypecaller` to the nextflow command.) ")
113
112
}
114
113
if (params.joint_germline && (!params.dbsnp ||!params.known_indels ||!params.known_snps || params.no_intervals)) {
115
114
log.warn "If Haplotypecaller is specified, without `--dbsnp`, `--known_snps`, `--known_indels` or the associated resource labels (ie `known_snps_vqsr`), no variant recalibration will be done. For recalibration you must provide all of these resources.\nFor more information see VariantRecalibration: https://gatk.broadinstitute.org/hc/en-us/articles/5358906115227-VariantRecalibrator \nJoint germline variant calling also requires intervals in order to genotype the samples. As a result, if `--no_intervals` is set to `true` the joint germline variant calling will not be performed."
116
115
}
117
116
118
117
// Fails when missing tools for variant_calling or annotate
119
118
if ((params.step =='variant_calling'|| params.step =='annotate') &&!params.tools) {
120
-
Nextflow.error("Please specify at least one tool when using `--step ${params.step}`.\nhttps://nf-co.re/sarek/parameters#tools")
119
+
error("Please specify at least one tool when using `--step ${params.step}`.\nhttps://nf-co.re/sarek/parameters#tools")
121
120
}
122
121
123
122
// Fails when missing sex information for CNV tools
124
123
if (params.tools && (params.tools.split(',').contains('ascat') || params.tools.split(',').contains('controlfreec'))) {
125
124
input_sample.map{
126
125
if (it[0].sex =='NA' ) {
127
-
Nextflow.error("Please specify sex information for each sample in your samplesheet when using '--tools' with 'ascat' or 'controlfreec'.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
126
+
error("Please specify sex information for each sample in your samplesheet when using '--tools' with 'ascat' or 'controlfreec'.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
128
127
}
129
128
}
130
129
}
@@ -1098,7 +1097,7 @@ def extract_csv(csv_file) {
1098
1097
def line, samplesheet_line_count =0;
1099
1098
while ((line = reader.readLine()) !=null) {samplesheet_line_count++}
1100
1099
if (samplesheet_line_count <2) {
1101
-
Nextflow.error("Samplesheet had less than two lines. The sample sheet must be a csv file with a header, so at least two lines.")
1100
+
error("Samplesheet had less than two lines. The sample sheet must be a csv file with a header, so at least two lines.")
if (patient_sample_lane in patient_sample_lane_combinations) {
1119
-
Nextflow.error('The patient-sample-lane combination "'+ row.patient.toString() +'", "'+ row.sample.toString() +'", and "'+ row.lane.toString() +'" is present multiple times in the sample sheet.')
1118
+
error('The patient-sample-lane combination "'+ row.patient.toString() +'", "'+ row.sample.toString() +'", and "'+ row.lane.toString() +'" is present multiple times in the sample sheet.')
Nextflow.error('The sample "'+ row.sample.toString() +'" is registered for both patient "'+ row.patient.toString() +'" and "'+ sample2patient[row.sample.toString()] +'" in the sample sheet.')
1126
+
error('The sample "'+ row.sample.toString() +'" is registered for both patient "'+ row.patient.toString() +'" and "'+ sample2patient[row.sample.toString()] +'" in the sample sheet.')
if (params.tools.split(',').contains(tool)) tools_tumor_asked.add(tool)
1182
1181
}
1183
1182
if (!tools_tumor_asked.isEmpty()) {
1184
-
Nextflow.error('The sample-sheet only contains normal-samples, but the following tools, which were requested with "--tools", expect at least one tumor-sample : '+ tools_tumor_asked.join(", "))
1183
+
error('The sample-sheet only contains normal-samples, but the following tools, which were requested with "--tools", expect at least one tumor-sample : '+ tools_tumor_asked.join(", "))
1185
1184
}
1186
1185
} elseif ((sample_count_tumor == sample_count_all) && params.tools) { // In this case, the sample-sheet contains no normal/germline-samples
if (params.tools.split(',').contains(tool_requiring_normal_samples)) requested_tools_requiring_normal_samples.add(tool_requiring_normal_samples)
1191
1190
}
1192
1191
if (!requested_tools_requiring_normal_samples.isEmpty()) {
1193
-
Nextflow.error('The sample-sheet only contains tumor-samples, but the following tools, which were requested by the option "tools", expect at least one normal-sample : '+ requested_tools_requiring_normal_samples.join(", "))
1192
+
error('The sample-sheet only contains tumor-samples, but the following tools, which were requested by the option "tools", expect at least one normal-sample : '+ requested_tools_requiring_normal_samples.join(", "))
Nextflow.error("Samplesheet contains fastq files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1215
+
error("Samplesheet contains fastq files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1217
1216
}
1218
1217
1219
1218
// start from BAM
1220
1219
} elseif (row.lane && row.bam) {
1221
1220
if (!row.bai) {
1222
-
Nextflow.error("BAM index (bai) should be provided.")
1221
+
error("BAM index (bai) should be provided.")
1223
1222
}
1224
1223
meta.id ="${row.sample}-${row.lane}".toString()
1225
1224
def bam = file(row.bam, checkIfExists: true)
@@ -1235,7 +1234,7 @@ def extract_csv(csv_file) {
1235
1234
1236
1235
if (params.step !='annotate') return [ meta, bam, bai ]
1237
1236
else {
1238
-
Nextflow.error("Samplesheet contains bam files but step is `annotate`. The pipeline is expecting vcf files for the annotation. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1237
+
error("Samplesheet contains bam files but step is `annotate`. The pipeline is expecting vcf files for the annotation. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
Nextflow.error("Samplesheet contains cram files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1251
+
error("Samplesheet contains cram files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
Nextflow.error("Samplesheet contains bam files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1265
+
error("Samplesheet contains bam files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
Nextflow.error("Samplesheet contains cram files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1278
+
error("Samplesheet contains cram files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1280
1279
}
1281
1280
1282
1281
// prepare_recalibration when skipping MarkDuplicates or `--step markduplicates`
@@ -1289,7 +1288,7 @@ def extract_csv(csv_file) {
1289
1288
1290
1289
if (!(params.step =='mapping'|| params.step =='annotate')) return [ meta, bam, bai ]
1291
1290
else {
1292
-
Nextflow.error("Samplesheet contains bam files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1291
+
error("Samplesheet contains bam files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
if (params.step =='annotate') return [ meta, vcf ]
1304
1303
else {
1305
-
Nextflow.error("Samplesheet contains vcf files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1304
+
error("Samplesheet contains vcf files but step is `$params.step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations")
1306
1305
}
1307
1306
} else {
1308
-
Nextflow.error("Missing or unknown field in csv file header. Please check your samplesheet")
1307
+
error("Missing or unknown field in csv file header. Please check your samplesheet")
0 commit comments