Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant symbolic alt to so term hash #1075

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
24 changes: 24 additions & 0 deletions modules/Bio/EnsEMBL/Variation/Utils/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ our @EXPORT_OK = qw(
$OVERLAP_CONSEQUENCE_CLASS
$MAX_ATTRIB_CODE_LENGTH
%SO_ACC_MAPPER
%SV_SO_TERMS
);

our $OVERLAP_CONSEQUENCE_CLASS = 'Bio::EnsEMBL::Variation::OverlapConsequence';
Expand Down Expand Up @@ -1382,5 +1383,28 @@ our %SO_ACC_MAPPER = (
}
);

# Used to convert symbolic alternative allele to SO term
our %SV_SO_TERMS = (
INS => 'insertion',
INS_ME => 'mobile_element_insertion',
INS_ALU => 'Alu_insertion',
INS_HERV => 'HERV_insertion',
INS_LINE1 => 'LINE1_insertion',
INS_SVA => 'SVA_insertion',

DEL => 'deletion',
DEL_ME => 'mobile_element_deletion',
DEL_ALU => 'Alu_deletion',
DEL_HERV => 'HERV_deletion',
DEL_LINE1 => 'LINE1_deletion',
DEL_SVA => 'SVA_deletion',

nakib103 marked this conversation as resolved.
Show resolved Hide resolved
TDUP => 'tandem_duplication',
DUP => 'duplication',
CNV => 'copy_number_variation',
INV => 'inversion',
BND => 'chromosome_breakpoint'
);


1;
22 changes: 4 additions & 18 deletions modules/Bio/EnsEMBL/Variation/Utils/VEP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ use Bio::EnsEMBL::Variation::DBSQL::VariationFeatureAdaptor;
use Bio::EnsEMBL::Variation::Utils::VariationEffect qw(overlap);
use Bio::EnsEMBL::Utils::Sequence qw(reverse_comp);
use Bio::EnsEMBL::Variation::Utils::Sequence qw(unambiguity_code SO_variation_class);
use Bio::EnsEMBL::Variation::Utils::Config qw(%SV_SO_TERMS);
use Bio::EnsEMBL::Variation::Utils::EnsEMBL2GFF3;
use Bio::EnsEMBL::Variation::StructuralVariationFeature;
use Bio::EnsEMBL::Variation::DBSQL::StructuralVariationFeatureAdaptor;
Expand Down Expand Up @@ -478,12 +479,7 @@ sub parse_ensembl {
my $so_term;

# convert to SO term
my %terms = (
INS => 'insertion',
DEL => 'deletion',
TDUP => 'tandem_duplication',
DUP => 'duplication'
);
my %terms = %SV_SO_TERMS;
nuno-agostinho marked this conversation as resolved.
Show resolved Hide resolved

$so_term = defined $terms{$allele_string} ? $terms{$allele_string} : $allele_string;

Expand Down Expand Up @@ -631,12 +627,7 @@ sub parse_vcf {

if(defined($type)) {
# convert to SO term
my %terms = (
INS => 'insertion',
DEL => 'deletion',
TDUP => 'tandem_duplication',
DUP => 'duplication'
);
my %terms = %SV_SO_TERMS;
nuno-agostinho marked this conversation as resolved.
Show resolved Hide resolved

$so_term = defined $terms{$type} ? $terms{$type} : $type;
}
Expand Down Expand Up @@ -933,12 +924,7 @@ sub convert_to_vcf {
else {

# convert to SO term
my %terms = (
'insertion' => 'INS',
'deletion' => 'DEL',
'tandem_duplication' => 'TDUP',
'duplication' => 'DUP'
);
my %terms = reverse %SV_SO_TERMS;
nakib103 marked this conversation as resolved.
Show resolved Hide resolved

my $alt = '<'.($terms{$vf->class_SO_term} || $vf->class_SO_term).'>';

Expand Down