Skip to content

Commit

Permalink
add test for param deflate_attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Juke34 committed Dec 3, 2024
1 parent a9168e6 commit 2a8ef72
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
1 change: 1 addition & 0 deletions t/config.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ system("$script config -e \\
--gff_output_version 2 \\
--gtf_output_version 2 \\
--debug \\
--deflate_attribute \\
--no-check_all_level1_locations \\
--no-check_identical_isoforms \\
--no-check_utrs \\
Expand Down
1 change: 1 addition & 0 deletions t/config/out/agat_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ check_utrs: false
clean_attributes_from_template: true
create_l3_for_l2_orphan: false
debug: true
deflate_attribute: true
force_gff_input_version: 3
gff_output_version: 2
gtf_output_version: 2
Expand Down
20 changes: 16 additions & 4 deletions t/gff_other.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use strict;
use warnings;
use Test::More tests => 8;
use Test::More tests => 9;

=head1 DESCRIPTION
Expand Down Expand Up @@ -101,13 +101,25 @@ $correct_output = "$output_folder/issue448.gtf";
system("$script_agat config --expose --output_format gtf 2>&1 1>/dev/null");
system("$script --g $input_folder/issue448.gtf -o $pathtmp 2>&1 1>/dev/null");

ok( system("diff $pathtmp $correct_output") == 0, "issue441 check");
ok( system("diff $pathtmp $correct_output") == 0, "issue448 check");

unlink $pathtmp;
unlink $config;

$correct_output = "$output_folder/issue448.gff";
system("$script --g $input_folder/issue448.gtf -o $pathtmp 2>&1 1>/dev/null");

ok( system("diff $pathtmp $correct_output") == 0, "issue441 check");
unlink $pathtmp;
ok( system("diff $pathtmp $correct_output") == 0, "issue448 check");
unlink $pathtmp;

# --------- Issue 457 multi-values attributes (gene_name "26266" "MT-TL1";) can be deflated to be compliant with GTF and CellRanger

$script = $script_prefix."bin/agat_convert_sp_gff2gtf.pl";
$correct_output = "$output_folder/issue457.gtf";

system("$script_agat config --expose --deflate_attribute 2>&1 1>/dev/null");
system("$script --gff $input_folder/issue457.gff -o $pathtmp 2>&1 1>/dev/null");

ok( system("diff $pathtmp $correct_output") == 0, "issue457 check");
unlink $pathtmp;
unlink $config;
4 changes: 4 additions & 0 deletions t/gff_other/in/issue457.gff
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
##gff-version 3
chrM AGAT gene 3230 3304 . + . ID=agat-gene-1;gene_id=26266;gene_name=26266,MT-TL1;gene_type=misc_RNA;hgnc_id=HGNC:7490;level=3;merged_ID=ENSG00000209082.1;merged_gene_id=ENSG00000209082.1,26266;tag=basic,Ensembl_canonical;transcript_name=26266,MT-TL1-201;transcript_support_level=NA;transcript_type=misc_RNA
chrM ENSEMBL transcript 3230 3304 . + . ID=26266;Parent=agat-gene-1;gene_id=26266;gene_name=26266;gene_type=misc_RNA;level=3;merged_ID=ENST00000386347.1;merged_Parent=ENSG00000209082.1;merged_gene_id=ENSG00000209082.1,26266;merged_gene_name=MT-TL1,26266;merged_gene_type=misc_RNA;merged_hgnc_id=HGNC:7490;merged_level=3;merged_tag=basic,Ensembl_canonical;merged_transcript_id=ENST00000386347.1,26266;merged_transcript_name=MT-TL1-201,26266;merged_transcript_support_level=NA;merged_transcript_type=misc_RNA;transcript_id=26266;transcript_name=26266;transcript_type=misc_RNA
chrM ENSEMBL exon 3230 3304 . + . ID=agat-exon-1;Parent=26266;gene_id=26266;gene_name=26266;gene_type=misc_RNA;level=3;transcript_id=26266;transcript_name=26266;transcript_type=misc_RNA
5 changes: 5 additions & 0 deletions t/gff_other/out/issue457.gtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##gtf-version X
# GFF-like GTF i.e. not checked against any GTF specification. Conversion based on GFF input, standardised by AGAT.
chrM AGAT gene 3230 3304 . + . gene_id "26266"; ID "agat-gene-1"; gene_name "26266"; gene_name_1 "MT-TL1"; gene_type "misc_RNA"; hgnc_id "HGNC:7490"; level "3"; merged_ID "ENSG00000209082.1"; merged_gene_id "ENSG00000209082.1"; merged_gene_id_1 "26266"; tag "basic"; tag_1 "Ensembl_canonical"; transcript_name "26266"; transcript_name_1 "MT-TL1-201"; transcript_support_level "NA"; transcript_type "misc_RNA";
chrM ENSEMBL transcript 3230 3304 . + . gene_id "26266"; transcript_id "26266"; ID "26266"; Parent "agat-gene-1"; gene_name "26266"; gene_type "misc_RNA"; level "3"; merged_ID "ENST00000386347.1"; merged_Parent "ENSG00000209082.1"; merged_gene_id "ENSG00000209082.1"; merged_gene_id_1 "26266"; merged_gene_name "MT-TL1"; merged_gene_name_1 "26266"; merged_gene_type "misc_RNA"; merged_hgnc_id "HGNC:7490"; merged_level "3"; merged_tag "basic"; merged_tag_1 "Ensembl_canonical"; merged_transcript_id "ENST00000386347.1"; merged_transcript_id_1 "26266"; merged_transcript_name "MT-TL1-201"; merged_transcript_name_1 "26266"; merged_transcript_support_level "NA"; merged_transcript_type "misc_RNA"; transcript_name "26266"; transcript_type "misc_RNA";
chrM ENSEMBL exon 3230 3304 . + . gene_id "26266"; transcript_id "26266"; ID "agat-exon-1"; Parent "26266"; gene_name "26266"; gene_type "misc_RNA"; level "3"; transcript_name "26266"; transcript_type "misc_RNA";

0 comments on commit 2a8ef72

Please sign in to comment.