Skip to content

Commit 178ae43

Browse files
committed
Roll back some of the file>path
1 parent dc14190 commit 178ae43

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

main.nf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ if ( params.fasta.isEmpty () ){
250250
exit 1, "[nf-core/eager] error: please specify --fasta with the path to your reference"
251251
} else if("${params.fasta}".endsWith(".gz")){
252252
//Put the zip into a channel, then unzip it and forward to downstream processes. DONT unzip in all steps, this is inefficient as NXF links the files anyways from work to work dir
253-
zipped_fasta = path("${params.fasta}")
253+
zipped_fasta = file("${params.fasta}")
254254

255255
rm_gz = params.fasta - '.gz'
256256
lastPath = rm_gz.lastIndexOf(File.separator)
@@ -536,12 +536,12 @@ if (workflow.profile.contains('awsbatch')) {
536536
/* -- CONFIG FILES -- */
537537
////////////////////////////////////////////////////
538538

539-
ch_multiqc_config = path("$baseDir/assets/multiqc_config.yaml", checkIfExists: true)
539+
ch_multiqc_config = file("$baseDir/assets/multiqc_config.yaml", checkIfExists: true)
540540
ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config, checkIfExists: true) : Channel.empty()
541-
ch_eager_logo = path("$baseDir/docs/images/nf-core_eager_logo.png")
542-
ch_output_docs = path("$baseDir/docs/output.md", checkIfExists: true)
543-
ch_output_docs_images = path("$baseDir/docs/images/", checkIfExists: true)
544-
where_are_my_files = path("$baseDir/assets/where_are_my_files.txt")
541+
ch_eager_logo = file("$baseDir/docs/images/nf-core_eager_logo.png")
542+
ch_output_docs = file("$baseDir/docs/output.md", checkIfExists: true)
543+
ch_output_docs_images = file("$baseDir/docs/images/", checkIfExists: true)
544+
where_are_my_files = file("$baseDir/assets/where_are_my_files.txt")
545545

546546
///////////////////////////////////////////////////
547547
/* -- INPUT FILE LOADING AND VALIDATING -- */
@@ -559,7 +559,7 @@ if (params.input && (has_extension(params.input, "tsv"))) tsv_path = params.inpu
559559
ch_input_sample = Channel.empty()
560560
if (tsv_path) {
561561

562-
tsv_file = path(tsv_path)
562+
tsv_file = file(tsv_path)
563563
ch_input_sample = extract_data(tsv_file)
564564

565565
} else if (params.input && !has_extension(params.input, "tsv")) {
@@ -583,9 +583,9 @@ ch_input_sample
583583
ch_input_sample_check
584584
.map {
585585
it ->
586-
def r1 = path(it[8]).getName()
587-
def r2 = path(it[9]).getName()
588-
def bam = path(it[10]).getName()
586+
def r1 = file(it[8]).getName()
587+
def r2 = file(it[9]).getName()
588+
def bam = file(it[10]).getName()
589589

590590
[r1, r2, bam]
591591

@@ -1129,8 +1129,8 @@ if ( params.skip_collapse ){
11291129
def organism = it[4]
11301130
def strandedness = it[5]
11311131
def udg = it[6]
1132-
def r1 = path(it[7].sort()[0])
1133-
def r2 = seqtype == "PE" ? path(it[7].sort()[1]) : 'NA'
1132+
def r1 = file(it[7].sort()[0])
1133+
def r2 = seqtype == "PE" ? file(it[7].sort()[1]) : 'NA'
11341134

11351135
[ samplename, libraryid, lane, seqtype, organism, strandedness, udg, r1, r2 ]
11361136

@@ -1147,7 +1147,7 @@ if ( params.skip_collapse ){
11471147
def organism = it[4]
11481148
def strandedness = it[5]
11491149
def udg = it[6]
1150-
def r1 = path(it[7])
1150+
def r1 = file(it[7])
11511151
def r2 = 'NA'
11521152

11531153
[ samplename, libraryid, lane, seqtype, organism, strandedness, udg, r1, r2 ]
@@ -1710,8 +1710,8 @@ if (params.run_bam_filtering) {
17101710
def organism = it[4]
17111711
def strandedness = it[5]
17121712
def udg = it[6]
1713-
def stats = path(it[7])
1714-
def poststats = path("$baseDir/assets/dummy_postfilterflagstat.stats")
1713+
def stats = file(it[7])
1714+
def poststats = file("$baseDir/assets/dummy_postfilterflagstat.stats")
17151715

17161716
[samplename, libraryid, lane, seqtype, organism, strandedness, udg, stats, poststats ] }
17171717
.set{ ch_allflagstats_for_endorspy }
@@ -2438,7 +2438,7 @@ if (params.additional_vcf_files == '') {
24382438
// Human biological sex estimation
24392439

24402440
if (params.sexdeterrmine_bedfile == '') {
2441-
ch_bed_for_sexdeterrmine = path('NO_FILE')
2441+
ch_bed_for_sexdeterrmine = file('NO_FILE')
24422442
} else {
24432443
ch_bed_for_sexdeterrmine = Channel.fromPath(params.sexdeterrmine_bedfile)
24442444
}
@@ -2648,7 +2648,7 @@ process maltextract {
26482648
// Kraken is offered as a replacement for MALT as MALT is _very_ resource hungry
26492649

26502650
if (params.run_metagenomic_screening && params.database.endsWith(".tar.gz") && params.metagenomic_tool == 'kraken'){
2651-
comp_kraken = path(params.database)
2651+
comp_kraken = file(params.database)
26522652

26532653
process decomp_kraken {
26542654
input:
@@ -2665,7 +2665,7 @@ if (params.run_metagenomic_screening && params.database.endsWith(".tar.gz") && p
26652665
}
26662666

26672667
} else if (! params.database.endsWith(".tar.gz") && params.run_metagenomic_screening && params.metagenomic_tool == 'kraken') {
2668-
ch_krakendb = path(params.database)
2668+
ch_krakendb = file(params.database)
26692669
} else {
26702670
ch_krakendb = Channel.empty()
26712671
}
@@ -3064,8 +3064,8 @@ def checkNumberOfItem(row, number) {
30643064

30653065
// Return file if it exists
30663066
def return_file(it) {
3067-
if (!path(it).exists()) exit 1, "[nf-core/eager] error: Cannot find supplied FASTQ or BAM input file. If using input method TSV set to NA if no file required. See --help or documentation under 'running the pipeline' for more information. Check file: ${it}"
3068-
return path(it)
3067+
if (!file(it).exists()) exit 1, "[nf-core/eager] error: Cannot find supplied FASTQ or BAM input file. If using input method TSV set to NA if no file required. See --help or documentation under 'running the pipeline' for more information. Check file: ${it}"
3068+
return file(it)
30693069
}
30703070

30713071
// Check file extension

0 commit comments

Comments
 (0)