diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bd21a1e..9096bdc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,11 +20,11 @@ based on a provided sequence IDs or region coordinates file (PR #85). * `agat`: - - `agat/agat_convert_sp_gff2gtf`: convert any GTF/GFF file into a proper GTF file (PR #76). - - `agat/agat_convert_bed2gff`: convert bed file to gff format (PR #97). - - `agat/agat_convert_embl2gff`: convert an EMBL file into GFF format (PR #99). - - `agat/agat_convert_sp_gff2tsv`: convert gtf/gff file into tabulated file (PR #102). - - `agat/agat_convert_sp_gxf2gxf`: fixes and/or standardizes any GTF/GFF file into full sorted GTF/GFF file (PR #103). + - `agat_convert_sp_gff2gtf`: convert any GTF/GFF file into a proper GTF file (PR #76). + - `agat_convert_bed2gff`: convert bed file to gff format (PR #97). + - `agat_convert_embl2gff`: convert an EMBL file into GFF format (PR #99). + - `agat_convert_sp_gff2tsv`: convert gtf/gff file into tabulated file (PR #102, PR #115). + - `agat_convert_sp_gxf2gxf`: fixes and/or standardizes any GTF/GFF file into full sorted GTF/GFF file (PR #103). * `bedtools`: - `bedtools/bedtools_intersect`: Allows one to screen for overlaps between two sets of genomic features (PR #94). diff --git a/src/agat/agat_convert_sp_gff2tsv/config.vsh.yaml b/src/agat/agat_convert_sp_gff2tsv/config.vsh.yaml index f1c78590..6ecd559c 100644 --- a/src/agat/agat_convert_sp_gff2tsv/config.vsh.yaml +++ b/src/agat/agat_convert_sp_gff2tsv/config.vsh.yaml @@ -3,7 +3,7 @@ namespace: agat description: | The script aims to convert gtf/gff file into tabulated file. Attribute's tags from the 9th column become column titles. -keywords: [gene annotations, GFF conversion] +keywords: [gene annotations, GFF conversion, TSV] links: homepage: https://github.com/NBISweden/AGAT documentation: https://agat.readthedocs.io/en/latest/tools/agat_convert_sp_gff2tsv.html @@ -12,10 +12,11 @@ links: references: doi: 10.5281/zenodo.3552717 license: GPL-3.0 +requirements: + - commands: [agat] authors: - __merge__: /src/_authors/leila_paquay.yaml roles: [ author, maintainer ] - argument_groups: - name: Inputs arguments: @@ -30,7 +31,7 @@ argument_groups: arguments: - name: --output alternatives: [-o, --out, --outfile] - description: Output GFF file. If no output file is specified, the output will be written to STDOUT. + description: Output GFF file. type: file direction: output required: true @@ -40,13 +41,7 @@ argument_groups: - name: --config alternatives: [-c] description: | - String - Input agat config file. By default AGAT takes as input - agat_config.yaml file from the working directory if any, - otherwise it takes the orignal agat_config.yaml shipped with - AGAT. To get the agat_config.yaml locally type: "agat config - --expose". The --config option gives you the possibility to use - your own AGAT config file (located elsewhere or named - differently). + AGAT config file. By default AGAT takes the original agat_config.yaml shipped with AGAT. The `--config` option gives you the possibility to use your own AGAT config file (located elsewhere or named differently). type: file required: false example: custom_agat_config.yaml diff --git a/src/agat/agat_convert_sp_gff2tsv/script.sh b/src/agat/agat_convert_sp_gff2tsv/script.sh index 6393303c..20e76be2 100644 --- a/src/agat/agat_convert_sp_gff2tsv/script.sh +++ b/src/agat/agat_convert_sp_gff2tsv/script.sh @@ -1,9 +1,11 @@ #!/bin/bash +set -eo pipefail + ## VIASH START ## VIASH END agat_convert_sp_gff2tsv.pl \ - -f "$par_gff" \ - -o "$par_output" \ + -gff "$par_gff" \ + -output "$par_output" \ ${par_config:+--config "${par_config}"} diff --git a/src/agat/agat_convert_sp_gff2tsv/test.sh b/src/agat/agat_convert_sp_gff2tsv/test.sh index fabe46b9..91bf6603 100644 --- a/src/agat/agat_convert_sp_gff2tsv/test.sh +++ b/src/agat/agat_convert_sp_gff2tsv/test.sh @@ -1,26 +1,34 @@ #!/bin/bash +set -eo pipefail + ## VIASH START ## VIASH END test_dir="${meta_resources_dir}/test_data" -out_dir="${meta_resources_dir}/out_data" + +# create temporary directory and clean up on exit +TMPDIR=$(mktemp -d "$meta_temp_dir/$meta_functionality_name-XXXXXX") +function clean_up { + [[ -d "$TMPDIR" ]] && rm -rf "$TMPDIR" +} +trap clean_up EXIT echo "> Run $meta_name with test data" "$meta_executable" \ --gff "$test_dir/1.gff" \ - --output "$out_dir/output.gff" + --output "$TMPDIR/output.tsv" echo ">> Checking output" -[ ! -f "$out_dir/output.gff" ] && echo "Output file output.gff does not exist" && exit 1 +[ ! -f "$TMPDIR/output.tsv" ] && echo "Output file output.tsv does not exist" && exit 1 echo ">> Check if output is empty" -[ ! -s "$out_dir/output.gff" ] && echo "Output file output.gff is empty" && exit 1 +[ ! -s "$TMPDIR/output.tsv" ] && echo "Output file output.tsv is empty" && exit 1 echo ">> Check if output matches expected output" -diff "$out_dir/output.gff" "$test_dir/agat_convert_sp_gff2tsv_1.tsv" +diff "$TMPDIR/output.tsv" "$test_dir/agat_convert_sp_gff2tsv_1.tsv" if [ $? -ne 0 ]; then - echo "Output file output.gff does not match expected output" + echo "Output file output.tsv does not match expected output" exit 1 fi diff --git a/src/agat/agat_convert_sp_gff2tsv/test_data/script.sh b/src/agat/agat_convert_sp_gff2tsv/test_data/script.sh index ba7ba143..63242902 100755 --- a/src/agat/agat_convert_sp_gff2tsv/test_data/script.sh +++ b/src/agat/agat_convert_sp_gff2tsv/test_data/script.sh @@ -6,5 +6,5 @@ if [ ! -d /tmp/agat_source ]; then fi # copy test data -cp -r /tmp/agat_source/t/scripts_output/out/agat_convert_sp_gff2tsv_1.tsv src/agat/agat_convert_sp_gff2tsv/test_data cp -r /tmp/agat_source/t/scripts_output/in/1.gff src/agat/agat_convert_sp_gff2tsv/test_data +cp -r /tmp/agat_source/t/scripts_output/out/agat_convert_sp_gff2tsv_1.tsv src/agat/agat_convert_sp_gff2tsv/test_data