forked from Ensembl/VEP_plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpliceRegion.pm
184 lines (136 loc) · 4.95 KB
/
SpliceRegion.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
=head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2019] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=head1 CONTACT
Ensembl <[email protected]>
=cut
=head1 NAME
SpliceRegion
=head1 SYNOPSIS
mv SpliceRegion.pm ~/.vep/Plugins
./vep -i variations.vcf --plugin SpliceRegion
To only show the additional consequence extended_intronic_splice_region_variant, use:
./vep -i variations.vcf --plugin SpliceRegion,Extended
=head1 DESCRIPTION
This is a plugin for the Ensembl Variant Effect Predictor (VEP) that
provides more granular predictions of splicing effects.
Three additional terms may be added:
# splice_donor_5th_base_variant : variant falls in the 5th base after the splice donor junction (5' end of intron)
v
...EEEEEIIIIIIIIII...
(E = exon, I = intron, v = variant location)
# splice_donor_region_variant : variant falls in region between 3rd and 6th base after splice junction (5' end of intron)
vv vvv
...EEEEEIIIIIIIIII...
# splice_polypyrimidine_tract_variant : variant falls in polypyrimidine tract at 3' end of intron, between 17 and 3 bases from the end
vvvvvvvvvvvvvvv
...IIIIIIIIIIIIIIIIIIIIEEEEE...
=cut
package SpliceRegion;
use strict;
use warnings;
use Bio::EnsEMBL::Variation::Utils::VariationEffect qw(overlap);
use Bio::EnsEMBL::Variation::Utils::Constants qw(%OVERLAP_CONSEQUENCES);
use base qw(Bio::EnsEMBL::Variation::Utils::BaseVepPlugin);
my %TERM_RANK = (
splice_donor_5th_base_variant => 1,
splice_donor_region_variant => 2,
splice_polypyrimidine_tract_variant => 3,
extended_intronic_splice_region_variant_5prime => 4,
extended_intronic_splice_region_variant_3prime => 5,
);
sub feature_types {
return ['Transcript'];
}
sub get_header_info {
return {
SpliceRegion => "SpliceRegion predictions",
};
}
sub run {
my ($self, $tva) = @_;
my $vf = $tva->variation_feature;
my ($vf_start, $vf_end) = ($vf->{start}, $vf->{end});
my $is_insertion = 0;
if($vf_start > $vf_end) {
($vf_start, $vf_end) = ($vf_end, $vf_start);
$is_insertion = 1;
}
my $tv = $tva->transcript_variation;
my $tr = $tv->transcript;
my $vf_tr_seq = $tva->feature_seq;
# define some variables depending on transcript strand
my ($strand_mod, $donor_coord, $acc_coord);
if($tr->strand > 0) {
$strand_mod = 1;
$donor_coord = 'start';
$acc_coord = 'end';
}
else {
$strand_mod = -1;
$donor_coord = 'end';
$acc_coord = 'start';
}
my %results;
my @terms;
my $extended_flag = lc($self->params->[0] || "") eq 'extended';
for my $intron(@{$tv->_overlapped_introns($vf_start, $vf_end)}) {
# define terms to check for and their regions
@terms = (
{
term => 'splice_donor_5th_base_variant',
region => [$intron->{$donor_coord} + (4 * $strand_mod), $intron->{$donor_coord} + (4 * $strand_mod)]
},
{
term => 'splice_donor_region_variant',
region => [$intron->{$donor_coord} + (2 * $strand_mod), $intron->{$donor_coord} + (5 * $strand_mod)]
},
{
term => 'splice_polypyrimidine_tract_variant',
region => [$intron->{$acc_coord} + (-16 * $strand_mod), $intron->{$acc_coord} + (-2 * $strand_mod)],
# allele_specific_mod => {
# A => '_to_purine',
# G => '_to_purine',
# }
},
) unless $extended_flag;
@terms = (
{
term => 'extended_intronic_splice_region_variant_5prime',
region => [$intron->{$donor_coord}, $intron->{$donor_coord} + (9 * $strand_mod)]
},
{
term => 'extended_intronic_splice_region_variant_3prime',
region => [$intron->{$acc_coord} + (-9 * $strand_mod), $intron->{$acc_coord} ],
# allele_specific_mod => {
# A => '_to_purine',
# G => '_to_purine',
# }
},
) if $extended_flag;
foreach my $term_hash(@terms) {
my $pass = overlap($vf_start, $vf_end, sort {$a <=> $b} @{$term_hash->{region}});
if($pass) {
my $term = $term_hash->{term};
$term = 'extended_intronic_splice_region_variant' if $extended_flag;
# if(my $allele_specific_mods = $term_hash->{allele_specific_mod}) {
# $term .= $allele_specific_mods->{$vf_tr_seq} || '';
# }
$results{$term}++;
last;
}
}
}
return {} unless %results;
return { SpliceRegion => [sort {$TERM_RANK{$a} <=> $TERM_RANK{$b}} keys %results]};
}
1;