Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/postreleasefix/112' into bug/f…
Browse files Browse the repository at this point in the history
…ix-version-data
  • Loading branch information
nuno-agostinho committed Apr 8, 2024
2 parents 966467a + b78c68f commit cab17c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions modules/Bio/EnsEMBL/VEP/Parser/Region.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

Expand Down
2 changes: 1 addition & 1 deletion t/AnnotationSource_File_GTF.t
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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',
Expand Down

0 comments on commit cab17c4

Please sign in to comment.