From adda847757640210b2d197ddf844b7c65f91b9a7 Mon Sep 17 00:00:00 2001 From: Leila011 Date: Wed, 7 Aug 2024 16:29:44 +0200 Subject: [PATCH 01/13] add help --- .../agat_sp_complement_annotations/help.txt | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/agat/agat_sp_complement_annotations/help.txt diff --git a/src/agat/agat_sp_complement_annotations/help.txt b/src/agat/agat_sp_complement_annotations/help.txt new file mode 100644 index 00000000..5db5e40a --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/help.txt @@ -0,0 +1,91 @@ +```sh +agat_sp_complement_annotations.pl --help +``` + + ------------------------------------------------------------------------------ +| Another GFF Analysis Toolkit (AGAT) - Version: v1.4.0 | +| https://github.com/NBISweden/AGAT | +| National Bioinformatics Infrastructure Sweden (NBIS) - www.nbis.se | + ------------------------------------------------------------------------------ + + +Name: + agat_sp_complement_annotations.pl + +Description: + The script allows to complement a reference annotation with other + annotations. A l1 feature from the addfile.gff that does not overlap a + l1 feature from the reference annotation will be added. A l1 feature + from the addfile.gff without a CDS that overlaps a l1 feature with a CDS + from the reference annotation will be added. A l1 feature from the + addfile.gff with a CDS that overlaps a l1 feature without a CDS from the + reference annotation will be added. A l1 feature from the addfile.gff + with a CDS that overlaps a l1 feature with a CDS from the reference + annotation will be added only if the CDSs don't overlap. A l1 feature + from the addfile.gff without a CDS that overlaps a l1 feature without a + CDS from the reference annotation will be added only if none of the l3 + features overlap. /!\ It is sufficiant that only one isoform is + overlapping to prevent the whole gene (l1 feature) from the addfile.gff + to be added in the output. + +Usage: + agat_sp_complement_annotations.pl --ref annotation_ref.gff --add addfile1.gff --add addfile2.gff --out outFile + agat_sp_complement_annotations.pl --help + +Options: + --ref, -r or -i + Input GTF/GFF file used as reference. + + --add or -a + Annotation(s) file you would like to use to complement the + reference annotation. You can specify as much file you want like + so: -a addfile1 -a addfile2 -a addfile3 /!\ The order you + provide these files matter. Once the reference file has been + complemented by file1, this new annotation becomes the new + reference that will be complemented by file2 etc. /!\ The result + with -a addfile1 -a addfile2 will differ to the result from -a + addfile2 -a addfile1. So, be aware of what you want if you use + several addfiles. + + --size_min or -s + Option to keep the non-overlping gene only if the CDS size (in + nucleotide) is over the minimum size defined. Default = 0 that + means all of them are kept. + + --out, --output, --outfile or -o + Output gff3 containing the reference annotation with all the + non-overlapping newly added genes from addfiles.gff. + + -c or --config + 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). + + --help or -h + Display this helpful text. + +Feedback: + Did you find a bug?: + Do not hesitate to report bugs to help us keep track of the bugs and + their resolution. Please use the GitHub issue tracking system available + at this address: + + https://github.com/NBISweden/AGAT/issues + + Ensure that the bug was not already reported by searching under Issues. + If you're unable to find an (open) issue addressing the problem, open a new one. + Try as much as possible to include in the issue when relevant: + - a clear description, + - as much relevant information as possible, + - the command used, + - a data sample, + - an explanation of the expected behaviour that is not occurring. + + Do you want to contribute?: + You are very welcome, visit this address for the Contributing + guidelines: + https://github.com/NBISweden/AGAT/blob/master/CONTRIBUTING.md From 19a921114cbb2cc80fefbde87db96d671062e9f0 Mon Sep 17 00:00:00 2001 From: Leila011 Date: Wed, 7 Aug 2024 16:37:50 +0200 Subject: [PATCH 02/13] add config --- .../config.vsh.yaml | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 src/agat/agat_sp_complement_annotations/config.vsh.yaml diff --git a/src/agat/agat_sp_complement_annotations/config.vsh.yaml b/src/agat/agat_sp_complement_annotations/config.vsh.yaml new file mode 100644 index 00000000..c46f2e55 --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/config.vsh.yaml @@ -0,0 +1,128 @@ +name: agat_sp_complement_annotations +namespace: agat +description: | + The script allows to complement a reference annotation with other + annotations. + + * A l1 feature from the addfile.gff that does not overlap a l1 feature from the reference annotation will be added. + * A l1 feature from the addfile.gff without a CDS that overlaps a l1 feature with a CDS from the reference annotation will be added. + * A l1 feature from the addfile.gff with a CDS that overlaps a l1 feature without a CDS from the reference annotation will be added. + * A l1 feature from the addfile.gff with a CDS that overlaps a l1 feature with a CDS from the reference annotation will be added only if the CDSs don't overlap. + * A l1 feature from the addfile.gff without a CDS that overlaps a l1 feature without a CDS from the reference annotation will be added only if none of the l3 features overlap. + + /!\ It is sufficient that only one isoform is overlapping to prevent the whole gene (l1 feature) from the addfile.gff to be added in the output. +keywords: [gene annotations] +links: + homepage: https://github.com/NBISweden/AGAT + documentation: https://agat.readthedocs.io/en/latest/tools/agat_sp_complement_annotations.html + issue_tracker: https://github.com/NBISweden/AGAT/issues + repository: https://github.com/NBISweden/AGAT +references: + doi: 10.5281/zenodo.3552717 +license: GPL-3.0 +authors: + - __merge__: /src/_authors/leila_paquay.yaml + roles: [ author, maintainer ] +name: agat_sp_complement_annotations +namespace: agat +description: | + The script allows to complement a reference annotation with other + annotations. + + * A l1 feature from the addfile.gff that does not overlap a l1 feature from the reference annotation will be added. + * A l1 feature from the addfile.gff without a CDS that overlaps a l1 feature with a CDS from the reference annotation will be added. + * A l1 feature from the addfile.gff with a CDS that overlaps a l1 feature without a CDS from the reference annotation will be added. + * A l1 feature from the addfile.gff with a CDS that overlaps a l1 feature with a CDS from the reference annotation will be added only if the CDSs don't overlap. + * A l1 feature from the addfile.gff without a CDS that overlaps a l1 feature without a CDS from the reference annotation will be added only if none of the l3 features overlap. + + /!\ It is sufficient that only one isoform is overlapping to prevent the whole gene (l1 feature) from the addfile.gff to be added in the output. +keywords: [gene annotations] +links: + homepage: https://github.com/NBISweden/AGAT + documentation: https://agat.readthedocs.io/en/latest/tools/agat_sp_complement_annotations.html + issue_tracker: https://github.com/NBISweden/AGAT/issues + repository: https://github.com/NBISweden/AGAT +references: + doi: 10.5281/zenodo.3552717 +license: GPL-3.0 +authors: + - __merge__: /src/_authors/leila_paquay.yaml + roles: [ author, maintainer ] +argument_groups: + - name: Inputs + arguments: + - name: --ref + alternatives: [-r, -i] + description: Input GTF/GFF file used as reference. + type: file + required: true + direction: input + example: reference.gff + - name: --add + alternatives: [-a] + description: | + Annotation(s) file you would like to use to complement the + reference annotation. You can specify as much file you want like + so: -a addfile1 -a addfile2 -a addfile3 /!\ The order you + provide these files matter. Once the reference file has been + complemented by file1, this new annotation becomes the new + reference that will be complemented by file2 etc. /!\ The result + with -a addfile1 -a addfile2 will differ to the result from -a + addfile2 -a addfile1. So, be aware of what you want if you use + several addfiles. + type: file + required: true + direction: input + multiple: true + example: addfile1.gff + - name: Outputs + arguments: + - name: --output + alternatives: [-o, --out, --outfile] + description: Output gff3 containing the reference annotation with all the non-overlapping newly added genes from addfiles.gff. + type: file + direction: output + required: true + example: output.gff + - name: Arguments + arguments: + - name: --size_min + alternatives: [-s] + description: | + Option to keep the non-overlapping gene only if the CDS size (in + nucleotide) is over the minimum size defined. Default = 0 that + means all of them are kept. + type: integer + required: false + example: 100 + - name: --config + alternatives: [-c] + description: | + Input agat config file. By default AGAT takes as input + agat_config.yaml file from the working directory if any, + otherwise it takes the original 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). + type: file + required: false + example: custom_config.yaml +resources: + - type: bash_script + path: script.sh +test_resources: + - type: bash_script + path: test.sh + - type: file + path: test_data +engines: + - type: docker + image: quay.io/biocontainers/agat:1.4.0--pl5321hdfd78af_0 + setup: + - type: docker + run: | + agat --version | sed 's/AGAT\s\(.*\)/agat: "\1"/' > /var/software_versions.txt +runners: + - type: executable + - type: nextflow \ No newline at end of file From 0dbc6236eb76f2869832e01a747e0caef394f87f Mon Sep 17 00:00:00 2001 From: Leila011 Date: Wed, 7 Aug 2024 16:49:58 +0200 Subject: [PATCH 03/13] add run script --- .../agat_sp_complement_annotations/script.sh | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/agat/agat_sp_complement_annotations/script.sh diff --git a/src/agat/agat_sp_complement_annotations/script.sh b/src/agat/agat_sp_complement_annotations/script.sh new file mode 100644 index 00000000..9d06756a --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/script.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +## VIASH START +## VIASH END + +# unset flags +[[ "$par_verbose" == "false" ]] && unset par_verbose + +# Convert a list of file names to multiple -gff arguments +input_files="" +IFS=";" read -ra file_names <<< "$par_gff" +for file in "${file_names[@]}"; do + input_files+="--gff $file " +done +unset IFS + + +# run agat_sp_complement_annotations.pl +agat_sp_complement_annotations.pl \ + --ref "$par_ref" \ + $input_files \ + -o "$par_output" \ + ${par_size_min:+--size_min "${par_size_min}"} \ + ${par_config:+--config "${par_config}"} \ + ${par_verbose:+--verbose} From 8d1b485b8b8aaa9973112ab96ed0d116f1a51f68 Mon Sep 17 00:00:00 2001 From: Leila011 Date: Wed, 7 Aug 2024 16:57:25 +0200 Subject: [PATCH 04/13] add test data 7 expected output + script to fetch them --- .../test_data/25_test.gff | 32 +++++++++++ .../test_data/9_test.gff | 20 +++++++ .../agat_sp_complement_annotations_1.gff | 56 +++++++++++++++++++ .../agat_sp_complement_annotations_2.gff | 7 +++ .../agat_sp_complement_annotations_add.gff | 6 ++ .../agat_sp_complement_annotations_ref.gff | 6 ++ .../test_data/script.sh | 14 +++++ 7 files changed, 141 insertions(+) create mode 100644 src/agat/agat_sp_complement_annotations/test_data/25_test.gff create mode 100644 src/agat/agat_sp_complement_annotations/test_data/9_test.gff create mode 100644 src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_1.gff create mode 100644 src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_2.gff create mode 100644 src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_add.gff create mode 100644 src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_ref.gff create mode 100755 src/agat/agat_sp_complement_annotations/test_data/script.sh diff --git a/src/agat/agat_sp_complement_annotations/test_data/25_test.gff b/src/agat/agat_sp_complement_annotations/test_data/25_test.gff new file mode 100644 index 00000000..906b8e81 --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/test_data/25_test.gff @@ -0,0 +1,32 @@ +# gffread all_merged.stringtie.gtf -E -F -o - +# gffread v0.9.9 +##gff-version 3 +scaffold1 StringTie transcript 2551 2965 1000.00 . . ID=MSTRG.1.1;geneID=MSTRG.1 +scaffold1 StringTie exon 2551 2965 1000.00 . . Parent=MSTRG.1.1;cov=68.607231 +scaffold1 StringTie transcript 8147 13353 1000.00 - . ID=MSTRG.6.1;geneID=MSTRG.6 +scaffold1 StringTie exon 8147 8981 1000.00 - . Parent=MSTRG.6.1;cov=529.868042 +scaffold1 StringTie exon 9082 9171 1000.00 - . Parent=MSTRG.6.1;cov=451.066681 +scaffold1 StringTie exon 9328 9433 1000.00 - . Parent=MSTRG.6.1;cov=548.889893 +scaffold1 StringTie exon 9682 9875 1000.00 - . Parent=MSTRG.6.1;cov=416.032471 +scaffold1 StringTie exon 10018 10228 1000.00 - . Parent=MSTRG.6.1;cov=268.398773 +scaffold1 StringTie exon 10436 10511 1000.00 - . Parent=MSTRG.6.1;cov=263.012329 +scaffold1 StringTie exon 10665 10744 1000.00 - . Parent=MSTRG.6.1;cov=262.177094 +scaffold1 StringTie exon 10901 10996 1000.00 - . Parent=MSTRG.6.1;cov=285.484375 +scaffold1 StringTie exon 11277 11348 1000.00 - . Parent=MSTRG.6.1;cov=272.513885 +scaffold1 StringTie exon 11521 11718 1000.00 - . Parent=MSTRG.6.1;cov=323.955170 +scaffold1 StringTie exon 11802 12004 1000.00 - . Parent=MSTRG.6.1;cov=258.021729 +scaffold1 StringTie exon 12106 13353 1000.00 - . Parent=MSTRG.6.1;cov=192.039612 +scaffold1 StringTie transcript 21499 23178 1000.00 . . ID=MSTRG.7.1;geneID=MSTRG.7 +scaffold1 StringTie exon 21499 23178 1000.00 . . Parent=MSTRG.7.1;cov=207.398804 +scaffold1 StringTie transcript 44218 47964 1000.00 - . ID=MSTRG.11.1;geneID=MSTRG.11 +scaffold1 StringTie exon 44218 45365 1000.00 - . Parent=MSTRG.11.1;cov=3001.629883 +scaffold1 StringTie exon 47660 47706 1000.00 - . Parent=MSTRG.11.1;cov=4399.870117 +scaffold1 StringTie exon 47827 47964 1000.00 - . Parent=MSTRG.11.1;cov=2103.559082 +scaffold1 StringTie transcript 44218 47964 1000.00 - . ID=MSTRG.11.2;geneID=MSTRG.11 +scaffold1 StringTie exon 44218 45365 1000.00 - . Parent=MSTRG.11.2;cov=487.085846 +scaffold1 StringTie exon 47660 47718 1000.00 - . Parent=MSTRG.11.2;cov=557.812744 +scaffold1 StringTie exon 47824 47964 1000.00 - . Parent=MSTRG.11.2;cov=242.265823 +scaffold1 StringTie transcript 44427 47958 1000.00 - . ID=MSTRG.11.3;geneID=MSTRG.11 +scaffold1 StringTie exon 44427 45365 1000.00 - . Parent=MSTRG.11.3;cov=2892.249023 +scaffold1 StringTie exon 47660 47723 1000.00 - . Parent=MSTRG.11.3;cov=2083.479492 +scaffold1 StringTie exon 47827 47958 1000.00 - . Parent=MSTRG.11.3;cov=734.545044 diff --git a/src/agat/agat_sp_complement_annotations/test_data/9_test.gff b/src/agat/agat_sp_complement_annotations/test_data/9_test.gff new file mode 100644 index 00000000..0e82a0ca --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/test_data/9_test.gff @@ -0,0 +1,20 @@ +##gff-version 3 +#!gff-spec-version 1.14 +#!source-version NCBI C++ formatter 0.2 +##Type DNA NC_003070.9 +NC_003070.9 RefSeq source 1 30427671 . + . organism=Arabidopsis thaliana;mol_type=genomic DNA;db_xref=taxon:3702;chromosome=1;ecotype=Columbia +NC_003070.9 RefSeq gene 3631 5899 . + . ID=NC_003070.9:NAC001;locus_tag=AT1G01010; +NC_003070.9 RefSeq exon 3631 3913 . + . ID=NM_099983.2;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010; +NC_003070.9 RefSeq exon 3996 4276 . + . ID=NM_099983.2;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010; +NC_003070.9 RefSeq exon 4486 4605 . + . ID=NM_099983.2;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010; +NC_003070.9 RefSeq exon 4706 5095 . + . ID=NM_099983.2;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010; +NC_003070.9 RefSeq exon 5174 5326 . + . ID=NM_099983.2;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010; +NC_003070.9 RefSeq exon 5439 5899 . + . ID=NM_099983.2;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010; +NC_003070.9 RefSeq CDS 3760 3913 . + 0 ID=NM_099983.2;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010; +NC_003070.9 RefSeq CDS 3996 4276 . + 2 ID=NM_099983.2;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010; +NC_003070.9 RefSeq CDS 4486 4605 . + 0 ID=NM_099983.2;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010; +NC_003070.9 RefSeq CDS 4706 5095 . + 0 ID=NM_099983.2;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010; +NC_003070.9 RefSeq CDS 5174 5326 . + 0 ID=NM_099983.2;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010; +NC_003070.9 RefSeq CDS 5439 5627 . + 0 ID=NM_099983.2;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010; +NC_003070.9 RefSeq start_codon 3760 3762 . + 0 ID=NM_099983.2;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010; +NC_003070.9 RefSeq stop_codon 5628 5630 . + 0 ID=NM_099983.2;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010; diff --git a/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_1.gff b/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_1.gff new file mode 100644 index 00000000..486495da --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_1.gff @@ -0,0 +1,56 @@ +##gff-version 3 +# gffread all_merged.stringtie.gtf -E -F -o - +# gffread v0.9.9 +NC_003070.9 RefSeq gene 3631 5899 . + . ID=IDmodified-gene-1;locus_tag=AT1G01010 +NC_003070.9 AGAT mRNA 3631 5899 . + . ID=NC_003070.9:NAC001;Parent=IDmodified-gene-1;locus_tag=AT1G01010 +NC_003070.9 RefSeq exon 3631 3913 . + . ID=NM_099983.2;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010 +NC_003070.9 RefSeq exon 3996 4276 . + . ID=IDmodified-exon-1;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010 +NC_003070.9 RefSeq exon 4486 4605 . + . ID=IDmodified-exon-2;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010 +NC_003070.9 RefSeq exon 4706 5095 . + . ID=IDmodified-exon-3;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010 +NC_003070.9 RefSeq exon 5174 5326 . + . ID=IDmodified-exon-4;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010 +NC_003070.9 RefSeq exon 5439 5899 . + . ID=IDmodified-exon-5;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010 +NC_003070.9 RefSeq CDS 3760 3913 . + 0 ID=agat-cds-1;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010 +NC_003070.9 RefSeq CDS 3996 4276 . + 2 ID=IDmodified-cds-1;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010 +NC_003070.9 RefSeq CDS 4486 4605 . + 0 ID=IDmodified-cds-2;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010 +NC_003070.9 RefSeq CDS 4706 5095 . + 0 ID=IDmodified-cds-3;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010 +NC_003070.9 RefSeq CDS 5174 5326 . + 0 ID=IDmodified-cds-4;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010 +NC_003070.9 RefSeq CDS 5439 5630 . + 0 ID=IDmodified-cds-5;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010 +NC_003070.9 AGAT five_prime_UTR 3631 3759 . + . ID=agat-five_prime_utr-1;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010 +NC_003070.9 RefSeq start_codon 3760 3762 . + 0 ID=agat-start_codon-1;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010 +NC_003070.9 RefSeq stop_codon 5628 5630 . + 0 ID=agat-stop_codon-1;Parent=NC_003070.9:NAC001;locus_tag=AT1G01010 +NC_003070.9 AGAT three_prime_UTR 5631 5899 . + . ID=agat-three_prime_utr-1;Parent=NC_003070.9:NAC001;gbkey=mRNA;locus_tag=AT1G01010 +scaffold1 AGAT gene 2551 2965 . . . ID=agat-gene-1;geneID=MSTRG.1 +scaffold1 StringTie transcript 2551 2965 1000.00 . . ID=MSTRG.1.1;Parent=agat-gene-1;geneID=MSTRG.1 +scaffold1 StringTie exon 2551 2965 1000.00 . . ID=agat-exon-1;Parent=MSTRG.1.1;cov=68.607231 +scaffold1 AGAT gene 8147 13353 . - . ID=agat-gene-2;geneID=MSTRG.6 +scaffold1 StringTie transcript 8147 13353 1000.00 - . ID=MSTRG.6.1;Parent=agat-gene-2;geneID=MSTRG.6 +scaffold1 StringTie exon 8147 8981 1000.00 - . ID=agat-exon-2;Parent=MSTRG.6.1;cov=529.868042 +scaffold1 StringTie exon 9082 9171 1000.00 - . ID=agat-exon-3;Parent=MSTRG.6.1;cov=451.066681 +scaffold1 StringTie exon 9328 9433 1000.00 - . ID=agat-exon-4;Parent=MSTRG.6.1;cov=548.889893 +scaffold1 StringTie exon 9682 9875 1000.00 - . ID=agat-exon-5;Parent=MSTRG.6.1;cov=416.032471 +scaffold1 StringTie exon 10018 10228 1000.00 - . ID=agat-exon-6;Parent=MSTRG.6.1;cov=268.398773 +scaffold1 StringTie exon 10436 10511 1000.00 - . ID=agat-exon-7;Parent=MSTRG.6.1;cov=263.012329 +scaffold1 StringTie exon 10665 10744 1000.00 - . ID=agat-exon-8;Parent=MSTRG.6.1;cov=262.177094 +scaffold1 StringTie exon 10901 10996 1000.00 - . ID=agat-exon-9;Parent=MSTRG.6.1;cov=285.484375 +scaffold1 StringTie exon 11277 11348 1000.00 - . ID=agat-exon-10;Parent=MSTRG.6.1;cov=272.513885 +scaffold1 StringTie exon 11521 11718 1000.00 - . ID=agat-exon-11;Parent=MSTRG.6.1;cov=323.955170 +scaffold1 StringTie exon 11802 12004 1000.00 - . ID=agat-exon-12;Parent=MSTRG.6.1;cov=258.021729 +scaffold1 StringTie exon 12106 13353 1000.00 - . ID=agat-exon-13;Parent=MSTRG.6.1;cov=192.039612 +scaffold1 AGAT gene 21499 23178 . . . ID=agat-gene-3;geneID=MSTRG.7 +scaffold1 StringTie transcript 21499 23178 1000.00 . . ID=MSTRG.7.1;Parent=agat-gene-3;geneID=MSTRG.7 +scaffold1 StringTie exon 21499 23178 1000.00 . . ID=agat-exon-14;Parent=MSTRG.7.1;cov=207.398804 +scaffold1 AGAT gene 44218 47964 . - . ID=agat-gene-4;geneID=MSTRG.11 +scaffold1 StringTie transcript 44218 47964 1000.00 - . ID=MSTRG.11.1;Parent=agat-gene-4;geneID=MSTRG.11 +scaffold1 StringTie exon 44218 45365 1000.00 - . ID=agat-exon-15;Parent=MSTRG.11.1;cov=3001.629883 +scaffold1 StringTie exon 47660 47706 1000.00 - . ID=agat-exon-16;Parent=MSTRG.11.1;cov=4399.870117 +scaffold1 StringTie exon 47827 47964 1000.00 - . ID=agat-exon-17;Parent=MSTRG.11.1;cov=2103.559082 +scaffold1 AGAT gene 44218 47964 . - . ID=agat-gene-5;geneID=MSTRG.11 +scaffold1 StringTie transcript 44218 47964 1000.00 - . ID=MSTRG.11.2;Parent=agat-gene-5;geneID=MSTRG.11 +scaffold1 StringTie exon 44218 45365 1000.00 - . ID=agat-exon-18;Parent=MSTRG.11.2;cov=487.085846 +scaffold1 StringTie exon 47660 47718 1000.00 - . ID=agat-exon-19;Parent=MSTRG.11.2;cov=557.812744 +scaffold1 StringTie exon 47824 47964 1000.00 - . ID=agat-exon-20;Parent=MSTRG.11.2;cov=242.265823 +scaffold1 AGAT gene 44427 47958 . - . ID=agat-gene-6;geneID=MSTRG.11 +scaffold1 StringTie transcript 44427 47958 1000.00 - . ID=MSTRG.11.3;Parent=agat-gene-6;geneID=MSTRG.11 +scaffold1 StringTie exon 44427 45365 1000.00 - . ID=agat-exon-21;Parent=MSTRG.11.3;cov=2892.249023 +scaffold1 StringTie exon 47660 47723 1000.00 - . ID=agat-exon-22;Parent=MSTRG.11.3;cov=2083.479492 +scaffold1 StringTie exon 47827 47958 1000.00 - . ID=agat-exon-23;Parent=MSTRG.11.3;cov=734.545044 diff --git a/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_2.gff b/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_2.gff new file mode 100644 index 00000000..784a39c9 --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_2.gff @@ -0,0 +1,7 @@ +##gff-version 3 +Chr1 Helixer gene 41064 54753 . + . ID=Chr1_000001 +Chr1 Helixer mRNA 41064 54753 . + . ID=Chr1_000001.1;Parent=Chr1_000001 +Chr1 Helixer exon 41064 54753 . + . ID=Chr1_000001.1.exon.1;Parent=Chr1_000001.1 +Chr1 Helixer CDS 41311 54435 . + 0 ID=Chr1_000001.1.CDS.1;Parent=Chr1_000001.1 +Chr1 Helixer five_prime_UTR 41064 41310 . + . ID=Chr1_000001.1.five_prime_UTR.1;Parent=Chr1_000001.1 +Chr1 Helixer three_prime_UTR 54436 54753 . + . ID=Chr1_000001.1.three_prime_UTR.1;Parent=Chr1_000001.1 diff --git a/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_add.gff b/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_add.gff new file mode 100644 index 00000000..fb03df17 --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_add.gff @@ -0,0 +1,6 @@ +Chr1 Liftoff gene 41075 54676 . + . ID=gene-gene1 +Chr1 Liftoff mRNA 41075 54676 . + . ID=rna-transcript1;Parent=gene-gene1 +Chr1 Liftoff exon 41075 54676 . + . ID=exon-transcript1-1;Parent=rna-transcript1 +Chr1 Liftoff CDS 41311 54435 . + 0 ID=cds-codingsequence-1.1;Parent=rna-transcript1 +Chr1 Liftoff five_prime_UTR 41075 41310 . + . ID=nbis-five_prime_utr-19342;Parent=rna-transcript1 +Chr1 Liftoff three_prime_UTR 54436 54676 . + . ID=nbis-three_prime_utr-18368;Parent=rna-transcript1 diff --git a/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_ref.gff b/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_ref.gff new file mode 100644 index 00000000..a3791da2 --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/test_data/agat_sp_complement_annotations_ref.gff @@ -0,0 +1,6 @@ +Chr1 Helixer gene 41064 54753 . + . ID=Chr1_000001 +Chr1 Helixer mRNA 41064 54753 . + . ID=Chr1_000001.1;Parent=Chr1_000001 +Chr1 Helixer exon 41064 54753 . + . ID=Chr1_000001.1.exon.1;Parent=Chr1_000001.1 +Chr1 Helixer five_prime_UTR 41064 41310 . + . ID=Chr1_000001.1.five_prime_UTR.1;Parent=Chr1_000001.1 +Chr1 Helixer CDS 41311 54435 . + 0 ID=Chr1_000001.1.CDS.1;Parent=Chr1_000001.1 +Chr1 Helixer three_prime_UTR 54436 54753 . + . ID=Chr1_000001.1.three_prime_UTR.1;Parent=Chr1_000001.1 diff --git a/src/agat/agat_sp_complement_annotations/test_data/script.sh b/src/agat/agat_sp_complement_annotations/test_data/script.sh new file mode 100755 index 00000000..139540f9 --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/test_data/script.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# clone repo +if [ ! -d /tmp/agat_source ]; then + git clone --depth 1 --single-branch --branch master https://github.com/NBISweden/AGAT /tmp/agat_source +fi + +# copy test data +cp -r /tmp/agat_source/t/gff_syntax/in/25_test.gff src/agat/agat_sp_complement_annotations/test_data +cp -r /tmp/agat_source/t/gff_syntax/in/9_test.gff src/agat/agat_sp_complement_annotations/test_data +cp -r /tmp/agat_source/t/scripts_output/in/agat_sp_complement_annotations/agat_sp_complement_annotations_ref.gff src/agat/agat_sp_complement_annotations/test_data +cp -r /tmp/agat_source/t/scripts_output/in/agat_sp_complement_annotations/agat_sp_complement_annotations_add.gff src/agat/agat_sp_complement_annotations/test_data +cp -r /tmp/agat_source/t/scripts_output/out/agat_sp_complement_annotations_1.gff src/agat/agat_sp_complement_annotations/test_data +cp -r /tmp/agat_source/t/scripts_output/out/agat_sp_complement_annotations_2.gff src/agat/agat_sp_complement_annotations/test_data \ No newline at end of file From 89aff1ac222f163ad01006a7ccdfce1e7afbf4c3 Mon Sep 17 00:00:00 2001 From: Leila011 Date: Wed, 7 Aug 2024 17:06:49 +0200 Subject: [PATCH 05/13] run script: handle multiple input --- src/agat/agat_sp_complement_annotations/script.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agat/agat_sp_complement_annotations/script.sh b/src/agat/agat_sp_complement_annotations/script.sh index 9d06756a..2673fc56 100644 --- a/src/agat/agat_sp_complement_annotations/script.sh +++ b/src/agat/agat_sp_complement_annotations/script.sh @@ -8,9 +8,9 @@ # Convert a list of file names to multiple -gff arguments input_files="" -IFS=";" read -ra file_names <<< "$par_gff" +IFS=";" read -ra file_names <<< "$par_add" for file in "${file_names[@]}"; do - input_files+="--gff $file " + input_files+="--add $file " done unset IFS From 400d84d6b6692363ba3d2b490616fa0fc080b11c Mon Sep 17 00:00:00 2001 From: Leila011 Date: Wed, 7 Aug 2024 17:06:56 +0200 Subject: [PATCH 06/13] add test --- .../agat_sp_complement_annotations/test.sh | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/agat/agat_sp_complement_annotations/test.sh diff --git a/src/agat/agat_sp_complement_annotations/test.sh b/src/agat/agat_sp_complement_annotations/test.sh new file mode 100644 index 00000000..cf5446f3 --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/test.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +## VIASH START +## VIASH END + +test_dir="${meta_resources_dir}/test_data" +out_dir="${meta_resources_dir}/out_data" + +echo "> Run $meta_name with test data" +"$meta_executable" \ + --ref "$test_dir/25_test.gff" \ + --add "$test_dir/9_test.gff";"$test_dir/9_test.gff" \ + --output "$out_dir/output.gff" + +echo ">> Checking output" +[ ! -f "$out_dir/output.gff" ] && echo "Output file output.gff 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 + +echo ">> Check if output matches expected output" +diff "$out_dir/output.gff" "$test_dir/agat_sp_complement_annotations_1.gff" +if [ $? -ne 0 ]; then + echo "Output file output.gff does not match expected output" + exit 1 +fi + +rm -rf "$out_dir/output.gff" + +echo "> Run $meta_name with test data" +"$meta_executable" \ + --ref "$test_dir/agat_sp_complement_annotations_ref.gff" \ + --add "$test_dir/agat_sp_complement_annotations_add.gff" \ + --output "$out_dir/output.gff" + +echo ">> Checking output" +[ ! -f "$out_dir/output.gff" ] && echo "Output file output.gff 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 + +echo ">> Check if output matches expected output" +diff "$out_dir/output.gff" "$test_dir/agat_sp_complement_annotations_2.gff" +if [ $? -ne 0 ]; then + echo "Output file output.gff does not match expected output" + exit 1 +fi +echo "> Test successful" \ No newline at end of file From 49ef55f121e0ecd9c1dd3da9284ed01366a2c43a Mon Sep 17 00:00:00 2001 From: Leila011 Date: Wed, 7 Aug 2024 17:10:06 +0200 Subject: [PATCH 07/13] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dd2389c..f4ef7b48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ * `agat`: - `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_sp_complement_annotations`: complement a reference annotation with other annotations (PR #129). * `bedtools`: - `bedtools/bedtools_intersect`: Allows one to screen for overlaps between two sets of genomic features (PR #94). From 5c1b098def9b4a3cfbdfc1e4e6028b25581fb7f5 Mon Sep 17 00:00:00 2001 From: Leila011 Date: Wed, 7 Aug 2024 17:15:08 +0200 Subject: [PATCH 08/13] cleanup --- .../config.vsh.yaml | 28 +------------------ .../agat_sp_complement_annotations/script.sh | 2 +- .../agat_sp_complement_annotations/test.sh | 2 +- 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/agat/agat_sp_complement_annotations/config.vsh.yaml b/src/agat/agat_sp_complement_annotations/config.vsh.yaml index c46f2e55..65d4fe7e 100644 --- a/src/agat/agat_sp_complement_annotations/config.vsh.yaml +++ b/src/agat/agat_sp_complement_annotations/config.vsh.yaml @@ -1,33 +1,7 @@ name: agat_sp_complement_annotations namespace: agat description: | - The script allows to complement a reference annotation with other - annotations. - - * A l1 feature from the addfile.gff that does not overlap a l1 feature from the reference annotation will be added. - * A l1 feature from the addfile.gff without a CDS that overlaps a l1 feature with a CDS from the reference annotation will be added. - * A l1 feature from the addfile.gff with a CDS that overlaps a l1 feature without a CDS from the reference annotation will be added. - * A l1 feature from the addfile.gff with a CDS that overlaps a l1 feature with a CDS from the reference annotation will be added only if the CDSs don't overlap. - * A l1 feature from the addfile.gff without a CDS that overlaps a l1 feature without a CDS from the reference annotation will be added only if none of the l3 features overlap. - - /!\ It is sufficient that only one isoform is overlapping to prevent the whole gene (l1 feature) from the addfile.gff to be added in the output. -keywords: [gene annotations] -links: - homepage: https://github.com/NBISweden/AGAT - documentation: https://agat.readthedocs.io/en/latest/tools/agat_sp_complement_annotations.html - issue_tracker: https://github.com/NBISweden/AGAT/issues - repository: https://github.com/NBISweden/AGAT -references: - doi: 10.5281/zenodo.3552717 -license: GPL-3.0 -authors: - - __merge__: /src/_authors/leila_paquay.yaml - roles: [ author, maintainer ] -name: agat_sp_complement_annotations -namespace: agat -description: | - The script allows to complement a reference annotation with other - annotations. + The script allows to complement a reference annotation with other annotations. * A l1 feature from the addfile.gff that does not overlap a l1 feature from the reference annotation will be added. * A l1 feature from the addfile.gff without a CDS that overlaps a l1 feature with a CDS from the reference annotation will be added. diff --git a/src/agat/agat_sp_complement_annotations/script.sh b/src/agat/agat_sp_complement_annotations/script.sh index 2673fc56..578447a1 100644 --- a/src/agat/agat_sp_complement_annotations/script.sh +++ b/src/agat/agat_sp_complement_annotations/script.sh @@ -6,7 +6,7 @@ # unset flags [[ "$par_verbose" == "false" ]] && unset par_verbose -# Convert a list of file names to multiple -gff arguments +# Convert a list of file names to multiple --add arguments input_files="" IFS=";" read -ra file_names <<< "$par_add" for file in "${file_names[@]}"; do diff --git a/src/agat/agat_sp_complement_annotations/test.sh b/src/agat/agat_sp_complement_annotations/test.sh index cf5446f3..4d28b924 100644 --- a/src/agat/agat_sp_complement_annotations/test.sh +++ b/src/agat/agat_sp_complement_annotations/test.sh @@ -9,7 +9,7 @@ out_dir="${meta_resources_dir}/out_data" echo "> Run $meta_name with test data" "$meta_executable" \ --ref "$test_dir/25_test.gff" \ - --add "$test_dir/9_test.gff";"$test_dir/9_test.gff" \ + --add "$test_dir/9_test.gff" \ --output "$out_dir/output.gff" echo ">> Checking output" From 05a9292f1d1deba5d7381028592c89b1ab9c1ba4 Mon Sep 17 00:00:00 2001 From: Leila011 Date: Mon, 19 Aug 2024 17:16:19 +0200 Subject: [PATCH 09/13] cleanup changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddfe5419..b3eeea96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ - `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_sp_complement_annotations`: complement a reference annotation with other annotations (PR #129). + - `agat/agat_sp_complement_annotations`: complement a reference annotation with other annotations (PR #129). * `bedtools`: - `bedtools/bedtools_intersect`: Allows one to screen for overlaps between two sets of genomic features (PR #94). From 0ad50eb154f4204db9aab2dab2ce73bfcceeae01 Mon Sep 17 00:00:00 2001 From: Leila011 Date: Mon, 19 Aug 2024 17:17:02 +0200 Subject: [PATCH 10/13] add set -eo pipefail to test and script files --- src/agat/agat_sp_complement_annotations/script.sh | 2 ++ src/agat/agat_sp_complement_annotations/test.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/agat/agat_sp_complement_annotations/script.sh b/src/agat/agat_sp_complement_annotations/script.sh index 578447a1..969a1329 100644 --- a/src/agat/agat_sp_complement_annotations/script.sh +++ b/src/agat/agat_sp_complement_annotations/script.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + ## VIASH START ## VIASH END diff --git a/src/agat/agat_sp_complement_annotations/test.sh b/src/agat/agat_sp_complement_annotations/test.sh index 4d28b924..cd23bf2b 100644 --- a/src/agat/agat_sp_complement_annotations/test.sh +++ b/src/agat/agat_sp_complement_annotations/test.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + ## VIASH START ## VIASH END From e78d4cfc2cd99b40bee591d026ea9f064ef08743 Mon Sep 17 00:00:00 2001 From: Leila011 Date: Mon, 19 Aug 2024 17:20:34 +0200 Subject: [PATCH 11/13] update config: add keywords, add requirements, update --config description --- .../config.vsh.yaml | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/agat/agat_sp_complement_annotations/config.vsh.yaml b/src/agat/agat_sp_complement_annotations/config.vsh.yaml index 65d4fe7e..aff815f7 100644 --- a/src/agat/agat_sp_complement_annotations/config.vsh.yaml +++ b/src/agat/agat_sp_complement_annotations/config.vsh.yaml @@ -9,8 +9,8 @@ description: | * A l1 feature from the addfile.gff with a CDS that overlaps a l1 feature with a CDS from the reference annotation will be added only if the CDSs don't overlap. * A l1 feature from the addfile.gff without a CDS that overlaps a l1 feature without a CDS from the reference annotation will be added only if none of the l3 features overlap. - /!\ It is sufficient that only one isoform is overlapping to prevent the whole gene (l1 feature) from the addfile.gff to be added in the output. -keywords: [gene annotations] + ! It is sufficient that only one isoform is overlapping to prevent the whole gene (l1 feature) from the addfile.gff to be added in the output. +keywords: [gene annotations, GFF] links: homepage: https://github.com/NBISweden/AGAT documentation: https://agat.readthedocs.io/en/latest/tools/agat_sp_complement_annotations.html @@ -19,6 +19,8 @@ links: references: doi: 10.5281/zenodo.3552717 license: GPL-3.0 +requirements: + - commands: [agat] authors: - __merge__: /src/_authors/leila_paquay.yaml roles: [ author, maintainer ] @@ -36,14 +38,11 @@ argument_groups: alternatives: [-a] description: | Annotation(s) file you would like to use to complement the - reference annotation. You can specify as much file you want like - so: -a addfile1 -a addfile2 -a addfile3 /!\ The order you - provide these files matter. Once the reference file has been + reference annotation. You can specify as much file you want like. + The order you provide these files matter. Once the reference file has been complemented by file1, this new annotation becomes the new - reference that will be complemented by file2 etc. /!\ The result - with -a addfile1 -a addfile2 will differ to the result from -a - addfile2 -a addfile1. So, be aware of what you want if you use - several addfiles. + reference that will be complemented by file2 etc. + So, be aware of what you want if you use several addfiles. type: file required: true direction: input @@ -72,13 +71,7 @@ argument_groups: - name: --config alternatives: [-c] description: | - Input agat config file. By default AGAT takes as input - agat_config.yaml file from the working directory if any, - otherwise it takes the original 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_config.yaml From 3827b0cd4835754a9925d59e281cf2895d43dcf0 Mon Sep 17 00:00:00 2001 From: Leila011 Date: Mon, 19 Aug 2024 17:20:47 +0200 Subject: [PATCH 12/13] create temporary directory and clean up on exit --- .../agat_sp_complement_annotations/test.sh | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/agat/agat_sp_complement_annotations/test.sh b/src/agat/agat_sp_complement_annotations/test.sh index cd23bf2b..14e03713 100644 --- a/src/agat/agat_sp_complement_annotations/test.sh +++ b/src/agat/agat_sp_complement_annotations/test.sh @@ -6,43 +6,49 @@ set -eo pipefail ## 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" \ --ref "$test_dir/25_test.gff" \ --add "$test_dir/9_test.gff" \ - --output "$out_dir/output.gff" + --output "$TMPDIR/output.gff" echo ">> Checking output" -[ ! -f "$out_dir/output.gff" ] && echo "Output file output.gff does not exist" && exit 1 +[ ! -f "$TMPDIR/output.gff" ] && echo "Output file output.gff 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.gff" ] && echo "Output file output.gff is empty" && exit 1 echo ">> Check if output matches expected output" -diff "$out_dir/output.gff" "$test_dir/agat_sp_complement_annotations_1.gff" +diff "$TMPDIR/output.gff" "$test_dir/agat_sp_complement_annotations_1.gff" if [ $? -ne 0 ]; then echo "Output file output.gff does not match expected output" exit 1 fi -rm -rf "$out_dir/output.gff" +rm -rf "$TMPDIR/output.gff" echo "> Run $meta_name with test data" "$meta_executable" \ --ref "$test_dir/agat_sp_complement_annotations_ref.gff" \ --add "$test_dir/agat_sp_complement_annotations_add.gff" \ - --output "$out_dir/output.gff" + --output "$TMPDIR/output.gff" echo ">> Checking output" -[ ! -f "$out_dir/output.gff" ] && echo "Output file output.gff does not exist" && exit 1 +[ ! -f "$TMPDIR/output.gff" ] && echo "Output file output.gff 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.gff" ] && echo "Output file output.gff is empty" && exit 1 echo ">> Check if output matches expected output" -diff "$out_dir/output.gff" "$test_dir/agat_sp_complement_annotations_2.gff" +diff "$TMPDIR/output.gff" "$test_dir/agat_sp_complement_annotations_2.gff" if [ $? -ne 0 ]; then echo "Output file output.gff does not match expected output" exit 1 From bf10c753a951aba6388e0c1c919cd7d6ba4dca1c Mon Sep 17 00:00:00 2001 From: Leila011 Date: Mon, 19 Aug 2024 17:21:25 +0200 Subject: [PATCH 13/13] remove UNSET IFS --- src/agat/agat_sp_complement_annotations/script.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/agat/agat_sp_complement_annotations/script.sh b/src/agat/agat_sp_complement_annotations/script.sh index 969a1329..36a668a8 100644 --- a/src/agat/agat_sp_complement_annotations/script.sh +++ b/src/agat/agat_sp_complement_annotations/script.sh @@ -14,8 +14,6 @@ IFS=";" read -ra file_names <<< "$par_add" for file in "${file_names[@]}"; do input_files+="--add $file " done -unset IFS - # run agat_sp_complement_annotations.pl agat_sp_complement_annotations.pl \