Skip to content

Commit 5169c05

Browse files
committed
Use file().getName() instead of custom function
1 parent a8e4e8f commit 5169c05

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

lib/Utils.groovy

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,4 @@ class Utils {
3737
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
3838
}
3939
}
40-
41-
//
42-
// Get basename of file after removing optional extension
43-
//
44-
public static String getFileBasename(file_string, extension='') {
45-
def file_no_extension = file_string - extension
46-
def last_path = file_no_extension.lastIndexOf(File.separator)
47-
def basename = file_no_extension.substring(last_path+1)
48-
return basename
49-
}
5040
}

workflows/rnaseq.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ ch_dummy_file = file("$projectDir/assets/dummy_file.txt", checkIfExists: true)
6969
// Check if an AWS iGenome has been provided to use the appropriate version of STAR
7070
def is_aws_igenome = false
7171
if (params.fasta && params.gtf) {
72-
if (Utils.getFileBasename(params.fasta, ext='.gz') == 'genome.fa' && Utils.getFileBasename(params.gtf, ext='.gz') == 'genes.gtf') {
72+
if ((file(params.fasta).getName() - '.gz' == 'genome.fa') && (file(params.gtf).getName() - '.gz' == 'genes.gtf')) {
7373
is_aws_igenome = true
74-
}
74+
}
7575
}
7676

7777
/*

0 commit comments

Comments
 (0)