comparison variant_effect_predictor/Bio/EnsEMBL/Variation/DBSQL/MetaContainer.pm @ 0:1f6dce3d34e0

Uploaded
author mahtabm
date Thu, 11 Apr 2013 02:01:53 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1f6dce3d34e0
1 =head1 LICENSE
2
3 Copyright (c) 1999-2012 The European Bioinformatics Institute and
4 Genome Research Limited. All rights reserved.
5
6 This software is distributed under a modified Apache license.
7 For license details, please see
8
9 http://www.ensembl.org/info/about/code_licence.html
10
11 =head1 CONTACT
12
13 Please email comments or questions to the public Ensembl
14 developers list at <dev@ensembl.org>.
15
16 Questions may also be sent to the Ensembl help desk at
17 <helpdesk@ensembl.org>.
18
19 =cut
20
21 #
22 # EnsEMBL module for Bio::EnsEMBL::Variation::DBSQL::MetaContainer
23 #
24 # Cared for by Daniel Rios
25 #
26 #
27 # You may distribute this module under the same terms as perl itself
28
29 # POD documentation - main docs before the code
30
31 =head1 NAME
32
33 Bio::EnsEMBL::Variation::DBSQL::MetaContainer -
34 Encapsulates all access to variation database meta information
35
36 =head1 SYNOPSIS
37
38 my $meta_container = $db_adaptor->get_MetaContainer();
39
40 my $default_population = $meta_container->get_default_LDPopulation();
41
42 =head1 DESCRIPTION
43
44 An object that encapsulates specific access to variation db meta data
45
46 =head1 METHODS
47
48 =cut
49
50 package Bio::EnsEMBL::Variation::DBSQL::MetaContainer;
51
52 use vars qw(@ISA);
53 use strict;
54
55 use Bio::EnsEMBL::DBSQL::BaseMetaContainer;
56 use Bio::EnsEMBL::Utils::Exception;
57
58
59 @ISA = qw(Bio::EnsEMBL::DBSQL::BaseMetaContainer);
60
61
62 sub get_schema_version {
63 my $self = shift;
64
65 my $arrRef = $self->list_value_by_key( 'schema_version' );
66
67 if( @$arrRef ) {
68 my ($ver) = ($arrRef->[0] =~ /^\s*(\d+)\s*$/);
69 if(!defined($ver)){ # old style format
70 return 0;
71 }
72 return $ver;
73 } else {
74 warning("Please insert meta_key 'schema_version' " .
75 "in meta table at variation db.\n");
76 }
77 return 0;
78 }
79
80 sub ploidy {
81 my $self = shift;
82
83 my $values = $self->list_value_by_key('ploidy');
84
85 # default to 2
86 return scalar @$values ? $values->[0] : 2;
87 }
88
89 1;