From 1e5cc058bf1dcb659f15b4a7b931cdc8a6c208f9 Mon Sep 17 00:00:00 2001 From: Nuno Agostinho Date: Wed, 21 Feb 2024 13:20:44 +0000 Subject: [PATCH 1/2] Fix SV warnings for short variants in regions format --- modules/Bio/EnsEMBL/VEP/Parser/Region.pm | 26 +++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/Bio/EnsEMBL/VEP/Parser/Region.pm b/modules/Bio/EnsEMBL/VEP/Parser/Region.pm index 64002977f..e9dc8d847 100644 --- a/modules/Bio/EnsEMBL/VEP/Parser/Region.pm +++ b/modules/Bio/EnsEMBL/VEP/Parser/Region.pm @@ -184,33 +184,35 @@ sub create_VariationFeatures { my $vf; - # sv? - my $so_term = $self->get_SO_term($allele); - if(defined($so_term)) { - $vf = Bio::EnsEMBL::Variation::StructuralVariationFeature->new_fast({ + # normal vf + if ($allele =~ /^[ACGTN-]+$/) { + my $ref = ('N' x (($end - $start) + 1)) || '-'; + + $vf = Bio::EnsEMBL::Variation::VariationFeature->new_fast({ start => $start, end => $end, + allele_string => $ref.'/'.$allele, strand => $strand, - adaptor => $self->get_adaptor('variation', 'StructuralVariationFeature'), + map_weight => 1, + adaptor => $self->get_adaptor('variation', 'VariationFeature'), variation_name => $region, chr => $chr, - class_SO_term => $so_term, }); } - # normal vf + # sv else { - my $ref = ('N' x (($end - $start) + 1)) || '-'; + my $so_term = $self->get_SO_term($allele); + return [] unless defined $so_term; - $vf = Bio::EnsEMBL::Variation::VariationFeature->new_fast({ + $vf = Bio::EnsEMBL::Variation::StructuralVariationFeature->new_fast({ start => $start, end => $end, - allele_string => $ref.'/'.$allele, strand => $strand, - map_weight => 1, - adaptor => $self->get_adaptor('variation', 'VariationFeature'), + adaptor => $self->get_adaptor('variation', 'StructuralVariationFeature'), variation_name => $region, chr => $chr, + class_SO_term => $so_term, }); } From b78c68fae73da1d4ffe90041065a03d9136c0933 Mon Sep 17 00:00:00 2001 From: Nuno Agostinho Date: Fri, 5 Apr 2024 11:04:49 +0100 Subject: [PATCH 2/2] Remove problematic unit test (#1625) --- t/AnnotationSource_File_GTF.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/AnnotationSource_File_GTF.t b/t/AnnotationSource_File_GTF.t index e20dd83e6..5d62a7679 100644 --- a/t/AnnotationSource_File_GTF.t +++ b/t/AnnotationSource_File_GTF.t @@ -64,6 +64,7 @@ SKIP: { my $records; warning { $records = $as->_get_records_by_coords(21, 25585733, 25585733) }; is(scalar @$records, 77, '_get_records_by_coords - count'); + delete $records->[0]->{attributes}->{tag}; is_deeply( $records->[0], @@ -84,7 +85,6 @@ SKIP: { 'havana_gene' => 'OTTHUMG00000078371', 'havana_transcript_version' => '2', 'exon_id' => 'ENSE00003528074', - 'tag' => 'basic', 'transcript_id' => 'ENST00000307301', 'gene_id' => 'ENSG00000154719', 'transcript_biotype' => 'protein_coding',