Fix bug in gffread (#686)

* Fix bug in gffread that would cause it to fail if the input has .gtf as extension

* Update test.yml

* Update meta file

* Update main.nf

* Apply suggestions from code review

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
This commit is contained in:
José Fernández Navarro 2021-09-15 20:55:08 +02:00 committed by GitHub
parent f4ec33ebc4
commit e9c57083a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 17 deletions

View file

@ -27,8 +27,12 @@ process GFFREAD {
script: script:
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${gff.baseName}${options.suffix}" : "${gff.baseName}"
""" """
gffread $gff $options.args -o ${gff.baseName}.gtf gffread \\
$gff \\
$options.args \\
-o ${prefix}.gtf
echo \$(gffread --version 2>&1) > ${software}.version.txt echo \$(gffread --version 2>&1) > ${software}.version.txt
""" """
} }

View file

@ -14,26 +14,16 @@ tools:
licence: ['MIT'] licence: ['MIT']
input: input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- gff: - gff:
type: file type: file
description: A GFF file in either the GFF3 or GFF2 format. description: A reference file in either the GFF3, GFF2 or GTF format.
patter: "*.gff" pattern: "*.{gff, gtf}"
output: output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- gtf: - gtf:
type: file type: file
description: GTF file resulting from the conversion of the GFF input file description: GTF file resulting from the conversion of the GFF input file
pattern: "*.gtf" pattern: "*.{gtf}"
- version: - version:
type: file type: file
description: File containing software version description: File containing software version

View file

@ -2,7 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { GFFREAD } from '../../../modules/gffread/main.nf' addParams( options: [:] ) include { GFFREAD } from '../../../modules/gffread/main.nf' addParams( options: [suffix: '.out'] )
workflow test_gffread { workflow test_gffread {
input = file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true) input = file(params.test_data['sarscov2']['genome']['genome_gff3'], checkIfExists: true)

View file

@ -3,5 +3,5 @@
tags: tags:
- gffread - gffread
files: files:
- path: ./output/gffread/genome.gtf - path: ./output/gffread/genome.out.gtf
md5sum: f184f856b7fe3e159d21b052b5dd3954 md5sum: fcbf5744ed806e47768bc456fa043263