-
Notifications
You must be signed in to change notification settings - Fork 55
/
context.pm
58 lines (38 loc) · 1.17 KB
/
context.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
=head1 CONTACT
Konrad Karczewski <[email protected]>
=cut
=head1 NAME
context
=head1 SYNOPSIS
mv context.pm ~/.vep/Plugins
perl variant_effect_predictor.pl -i variations.vcf --plugin context
perl variant_effect_predictor.pl -i variations.vcf --plugin context,N
=head1 DESCRIPTION
A VEP plugin that writes N base (default = 1) context around the variant.
=cut
package context;
use strict;
use warnings;
use Bio::EnsEMBL::Variation::Utils::BaseVepPlugin;
use base qw(Bio::EnsEMBL::Variation::Utils::BaseVepPlugin);
use Bio::Perl;
sub get_header_info {
return {
context => "1 base context around the variant"
};
}
sub feature_types {
return ['Feature', 'Intergenic'];
}
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->{window} = $self->params->[0] || 1;
return $self;
}
sub run {
my ($self, $transcript_variation_allele) = @_;
my $seq = $transcript_variation_allele->variation_feature->feature_Slice->expand($self->{window}, $self->{window})->seq;
return { context => $seq };
}
1;