comparison dir_plugins/HGVSReferenceBase.pm @ 0:e545d0a25ffe draft

Uploaded
author dvanzessen
date Mon, 15 Jul 2019 05:17:17 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e545d0a25ffe
1 =head1 LICENSE
2 Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
3 Copyright [2016-2018] EMBL-European Bioinformatics Institute
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7 http://www.apache.org/licenses/LICENSE-2.0
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS,
10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 See the License for the specific language governing permissions and
12 limitations under the License.
13
14 =head1 CONTACT
15
16 Ensembl <http://www.ensembl.org/info/about/contact/index.html>
17
18 =cut
19
20 =head1 NAME
21
22 HGVSReferenceBase
23
24 =head1 SYNOPSIS
25
26 mv HGVSReferenceBase.pm ~/.vep/Plugins
27 ./vep -i variations.vcf --cache --hgvs --plugin HGVSReferenceBase
28
29 =head1 DESCRIPTION
30
31 This is a plugin for the Ensembl Variant Effect Predictor (VEP) that
32 reports the reference base for the variant, as used in the longer form.
33 of HGVS. To be used with --hgvs option.
34
35 =cut
36
37
38 package HGVSReferenceBase;
39
40 use strict;
41 use warnings;
42
43 use Bio::EnsEMBL::Variation::Utils::BaseVepPlugin;
44 use Bio::EnsEMBL::Variation::DBSQL::TranscriptVariationAdaptor;
45 use Bio::EnsEMBL::Variation::DBSQL::DBAdaptor;
46 use Bio::EnsEMBL::Variation::TranscriptVariationAllele;
47
48 use base qw(Bio::EnsEMBL::Variation::Utils::BaseVepPlugin);
49
50
51 sub feature_types {
52 return ['Transcript'];
53 }
54
55 sub variant_feature_types {
56 return ['VariationFeature'];
57 }
58
59 sub get_header_info {
60 my $self = shift;
61
62 return {
63 'HGVS_ref' => 'Reference base as may be reported in HGVS transcript level notation',
64 };
65 }
66
67 sub run {
68 my ($self, $tva) = @_;
69
70 # check var class, this is only useful for deletions
71 # or duplications - a subset of insertions
72 return {} unless $tva->variation_feature->var_class() =~ /del|ins/;
73
74 return $tva->hgvs_transcript_reference() ? {'HGVS_ref' => $tva->hgvs_transcript_reference()} : {};
75
76 }
77
78 1;