comparison variant_effect_predictor/Bio/EnsEMBL/Funcgen/InputSubset.pm @ 0:21066c0abaf5 draft

Uploaded
author willmclaren
date Fri, 03 Aug 2012 10:04:48 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:21066c0abaf5
1 #
2 # Ensembl module for Bio::EnsEMBL::Funcgen::InputSubset
3 #
4
5
6 =head1 LICENSE
7
8 Copyright (c) 1999-2012 The European Bioinformatics Institute and
9 Genome Research Limited. All rights reserved.
10
11 This software is distributed under a modified Apache license.
12 For license details, please see
13
14 http://www.ensembl.org/info/about/code_licence.html
15
16 =head1 CONTACT
17
18 Please email comments or questions to the public Ensembl
19 developers list at <ensembl-dev@ebi.ac.uk>.
20
21 Questions may also be sent to the Ensembl help desk at
22 <helpdesk@ensembl.org>.
23
24
25 =head1 NAME
26
27 Bio::EnsEMBL::InputSubset - A module to represent InputSubset object.
28
29
30 =head1 SYNOPSIS
31
32 use Bio::EnsEMBL::Funcgen::InputSubset;
33
34 my $input_subset = Bio::EnsEMBL::Funcgen::InputSubset->new
35 (
36 -DBID => $dbID,
37 -ADAPTOR => $self,
38 -NAME => $name,
39 -INPUT_SET => $iset,
40 -archive_id => $archive_id,
41 -display_url => $display_url,
42 -replicate => $iss_rep,
43 -is_control => $is_control,
44 );
45
46
47
48 =head1 DESCRIPTION
49
50 An InputSubset object represents an individual distinct input within a given InputSet. This
51 normally translates to single file or replicate. There is no dedicated InputSubsetAdaptor,
52 store and fetch functionality is embedded within the InputSetAdaptor.
53
54 =cut
55
56 use strict;
57 use warnings;
58
59 package Bio::EnsEMBL::Funcgen::InputSubset;
60
61 use Bio::EnsEMBL::Utils::Argument qw( rearrange );
62 use Bio::EnsEMBL::Utils::Exception qw( throw );
63 use Bio::EnsEMBL::Funcgen::Storable;
64
65 use vars qw(@ISA);
66 @ISA = qw(Bio::EnsEMBL::Funcgen::Storable);
67
68
69 =head2 new
70
71 Example : my $eset = Bio::EnsEMBL::Funcgen::InputSubset->new
72 (
73 -DBID => $dbID,
74 -ADAPTOR => $self,
75 -NAME => $name,
76 -INPUT_SET => $iset,
77 -archive_id => $archive_id,
78 -display_url => $display_url,
79 -replicate => $iss_rep,
80 -is_control => $is_control,
81 );
82
83
84 Description: Constructor for InputSubset objects.
85 Returntype : Bio::EnsEMBL::Funcgen::InputSubset
86 Exceptions : Throws if no name defined
87 Caller : InputSetAdaptor
88 Status : At risk
89
90 =cut
91
92 sub new {
93 my $caller = shift;
94
95 my $class = ref($caller) || $caller;
96
97 my $self = $class->SUPER::new(@_);
98
99 #do we need to add $fg_ids to this? Currently maintaining one feature_group focus.(combi exps?)
100 my ($name, $eset, $archive_id,
101 $display_url, $rep, $is_control)
102 = rearrange(['NAME', 'INPUT_SET', 'ARCHIVE_ID',
103 'DISPLAY_URL', 'REPLICATE', 'IS_CONTROL'], @_);
104
105
106 throw('Must provide a name argument') if ! defined $name;
107
108 if(!(ref($eset) &&
109 $eset->isa('Bio::EnsEMBL::Funcgen::InputSet')
110 && $eset->dbID())){
111 throw('Must provide a valid stored input_set argument');
112 }
113
114
115 $self->{name} = $name;
116 $self->{input_set} = $eset;
117 $self->{archive_id} = $archive_id;
118 $self->{display_url} = $display_url;
119 $self->{replicate} = $rep;
120 $self->{is_control} = $is_control;
121
122 return $self;
123 }
124
125
126 =head2 name
127
128 Example : my $name = $exp_sset->name();
129 Description: Getter for the name of this InputSubset.
130 Returntype : String
131 Exceptions : None
132 Caller : General
133 Status : At Risk
134
135 =cut
136
137 sub name { return $_[0]->{name}; }
138
139
140 =head2 input_set
141
142 Example : my $input_set = $input_sset->input_set;
143 Description: Getter for the input_set attribute of this InputSubset.
144 Returntype : Bio::EnsEMBL::Funcgen::InputSet
145 Exceptions : None
146 Caller : General
147 Status : At Risk
148
149 =cut
150
151 sub input_set { return $_[0]->{input_set}; }
152
153
154 =head2 archive_id
155
156 Example : my $archive_id = $inp_sset->archive_id;
157 Description: Getter for the archive of this InputSubset.
158 Returntype : String
159 Exceptions : None
160 Caller : General
161 Status : At Risk
162
163 =cut
164
165 sub archive_id { return $_[0]->{archive_id}; }
166
167
168 =head2 display_url
169
170 Example : my $url = $inp_sset->displau_url;
171 Description: Getter for the display_url of this InputSubset.
172 Returntype : String
173 Exceptions : None
174 Caller : General
175 Status : At Risk
176
177 =cut
178
179 sub display_url{ return $_[0]->{display_url}; }
180
181
182 =head2 replicate
183
184 Example : my $rep = $inp_sset->replicate;
185 Description: Getter for the replicate attribute of this InputSubset.
186 Returntype : Integer
187 Exceptions : None
188 Caller : General
189 Status : At Risk
190
191 =cut
192
193 sub replicate { return $_[0]->{replicate}; }
194
195
196 =head2 is_control
197
198 Example : if($input_sset->is_control){ # Do some control specific stuff here }
199 Description: Getter for the is_control attribute of this InputSubset.
200 Returntype : Boolean
201 Exceptions : None
202 Caller : General
203 Status : At Risk
204
205 =cut
206
207 sub is_control { return $_[0]->{is_control}; }
208
209 1;
210