0
|
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 =head1 NAME
|
|
22
|
|
23 Bio::EnsEMBL::Compara::Method
|
|
24
|
|
25 =head1 SYNOPSIS
|
|
26
|
|
27 my $my_method = Bio::EnsEMBL::Compara::Method->new( -type => 'FAMILY', -class => 'Family.family' );
|
|
28
|
|
29 $method_adaptor->store( $my_method );
|
|
30
|
|
31 my $dbID = $my_method->dbID();
|
|
32
|
|
33 =head1 DESCRIPTION
|
|
34
|
|
35 Method is a data object that roughly represents the type of pipeline run and the corresponding type of data generated.
|
|
36
|
|
37 =head1 METHODS
|
|
38
|
|
39 =cut
|
|
40
|
|
41
|
|
42 package Bio::EnsEMBL::Compara::Method;
|
|
43
|
|
44 use strict;
|
|
45 use Bio::EnsEMBL::Utils::Argument qw(rearrange);
|
|
46
|
|
47 use base ('Bio::EnsEMBL::Storable'); # inherit dbID(), adaptor() and new() methods
|
|
48
|
|
49
|
|
50 =head2 new
|
|
51
|
|
52 Arg [..] : Takes a set of named arguments
|
|
53 Example : my $my_method = Bio::EnsEMBL::Compara::Method->new(
|
|
54 -dbID => $dbID,
|
|
55 -type => 'SYNTENY',
|
|
56 -class => 'SyntenyRegion.synteny',
|
|
57 -adaptor => $method_adaptor );
|
|
58 Description: Creates a new Method object
|
|
59 Returntype : Bio::EnsEMBL::Compara::Method
|
|
60
|
|
61 =cut
|
|
62
|
|
63
|
|
64 sub new {
|
|
65 my $caller = shift @_;
|
|
66 my $class = ref($caller) || $caller;
|
|
67
|
|
68 my $self = $class->SUPER::new(@_);
|
|
69
|
|
70 my ($type, $mclass) =
|
|
71 rearrange([qw(TYPE CLASS)], @_);
|
|
72
|
|
73 $self->type($type) if (defined ($type));
|
|
74 $self->class($mclass) if (defined ($mclass));
|
|
75
|
|
76 return $self;
|
|
77 }
|
|
78
|
|
79
|
|
80 =head2 type
|
|
81
|
|
82 Arg [1] : (opt.) string type
|
|
83 Example : my $type = $method->type();
|
|
84 Example : $method->type('BLASTZ_NET');
|
|
85 Description: Getter/Setter for the type of this method
|
|
86 Returntype : string type
|
|
87
|
|
88 =cut
|
|
89
|
|
90 sub type {
|
|
91 my $self = shift;
|
|
92
|
|
93 $self->{'_type'} = shift if(@_);
|
|
94
|
|
95 return $self->{'_type'};
|
|
96 }
|
|
97
|
|
98
|
|
99 =head2 class
|
|
100
|
|
101 Arg [1] : (opt.) string class
|
|
102 Example : my $class = $method->class();
|
|
103 Example : $method->class('GenomicAlignBlock.pairwise_alignment');
|
|
104 Description: Getter/Setter for the class of this method
|
|
105 Returntype : string class
|
|
106
|
|
107 =cut
|
|
108
|
|
109 sub class {
|
|
110 my $self = shift;
|
|
111
|
|
112 $self->{'_class'} = shift if(@_);
|
|
113
|
|
114 return $self->{'_class'};
|
|
115 }
|
|
116
|
|
117
|
|
118 =head2 toString
|
|
119
|
|
120 Args : (none)
|
|
121 Example : print $method->toString()."\n";
|
|
122 Description: returns a stringified representation of the method
|
|
123 Returntype : string
|
|
124
|
|
125 =cut
|
|
126
|
|
127 sub toString {
|
|
128 my $self = shift;
|
|
129
|
|
130 return ref($self).": dbID=".($self->dbID || '?').", type='".$self->type."', class='".$self->class."'";
|
|
131 }
|
|
132
|
|
133 1;
|
|
134
|