The following Nextflow scripts takes the $gtf as an input and outputs a .bed file. What I want is to keep just the basename of the gtf file and add the .bed extension to it. I tried declaring a variable x and using basename from bash but it gives error.
// Declare syntax version
nextflow.enable.dsl=2
/*
* pipeline input parameters
*/
params.gtf_file = "$projectDir/data/Glycine_max.gtf"
/*
* define the `GTF2BED` process that creates a BED file
* given the params.gtf_file as input.
*/
process GTF2BED {
input:
path gtf
output:
"${gtf}/.bed"
script:
"""
gtf2bed --gtf $gtf --bed "${gtf}/.bed"
"""
}
Best wishes.