Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/EnsEMBL/Funcgen/ExperimentalGroup.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 # | |
| 2 # Ensembl module for Bio::EnsEMBL::Funcgen::ExperimentalGroup | |
| 3 # | |
| 4 | |
| 5 | |
| 6 =head1 LICENSE | |
| 7 | |
| 8 Copyright (c) 1999-2011 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 =head1 NAME | |
| 25 | |
| 26 Bio::EnsEMBL::Funcgen::ExperimentalGroup - A module to represent | |
| 27 an ExperimentalGroup. i.e. the authors of an experiment. | |
| 28 | |
| 29 =head1 SYNOPSIS | |
| 30 | |
| 31 use Bio::EnsEMBL::Funcgen::ExperimentalGroup; | |
| 32 | |
| 33 | |
| 34 | |
| 35 =head1 DESCRIPTION | |
| 36 | |
| 37 This is a simple class to represent information about an ExperimentalGroup, | |
| 38 containing a name and a more detailed description | |
| 39 This module is part of the Ensembl project: http://www.ensembl.org/ | |
| 40 | |
| 41 =cut | |
| 42 | |
| 43 use strict; | |
| 44 use warnings; | |
| 45 | |
| 46 package Bio::EnsEMBL::Funcgen::ExperimentalGroup; | |
| 47 | |
| 48 use Bio::EnsEMBL::Utils::Argument qw( rearrange ) ; | |
| 49 use Bio::EnsEMBL::Utils::Exception qw( throw warning ); | |
| 50 use Bio::EnsEMBL::Funcgen::Storable; | |
| 51 | |
| 52 use vars qw(@ISA); | |
| 53 @ISA = qw(Bio::EnsEMBL::Funcgen::Storable); | |
| 54 | |
| 55 | |
| 56 =head2 new | |
| 57 | |
| 58 Arg [-name]: string - name of ExperimentalGroup | |
| 59 Arg [-location]: (optional) string - location of ExperimentalGroup | |
| 60 Arg [-contact]: (optional) string - contact of ExperimentalGroup | |
| 61 Arg [-url]: (optional) string - url containing information for the ExperimentalGroup | |
| 62 Arg [-description]: (optional) string - descriptiom of ExperimentalGroup | |
| 63 Arg [-project]: (optional) boolean - True if this is part of a large project (eg. ENCODE) | |
| 64 Example : my $group = Bio::EnsEMBL::Funcgen::ExperimentalGroup->new( | |
| 65 -name => "EBI", | |
| 66 -location => "Hinxton", | |
| 67 -contact => "dev@ensembl.org", | |
| 68 -url => "http://www.ebi.ac.uk/", | |
| 69 -description => "European Bioinformatics Institute", | |
| 70 -is_project => 0, | |
| 71 ); | |
| 72 Description: Constructor method for ExperimentalGroup class | |
| 73 Returntype : Bio::EnsEMBL::Funcgen::ExperimentalGroup | |
| 74 Exceptions : Throws if name not defined | |
| 75 Caller : General | |
| 76 Status : At risk | |
| 77 | |
| 78 =cut | |
| 79 | |
| 80 sub new { | |
| 81 my $caller = shift; | |
| 82 | |
| 83 my $obj_class = ref($caller) || $caller; | |
| 84 my $self = $obj_class->SUPER::new(@_); | |
| 85 | |
| 86 my ( | |
| 87 $name, | |
| 88 $location, | |
| 89 $contact, | |
| 90 $url, | |
| 91 $desc, | |
| 92 $is_project | |
| 93 ) = rearrange([ | |
| 94 'NAME', 'LOCATION', 'CONTACT', 'URL', 'DESCRIPTION', 'IS_PROJECT' | |
| 95 ], @_); | |
| 96 | |
| 97 | |
| 98 if($name){ | |
| 99 $self->name($name); | |
| 100 }else{ | |
| 101 throw("Must supply a Group name\n"); | |
| 102 } | |
| 103 $self->location($location) if $location; | |
| 104 $self->contact($contact) if $contact; | |
| 105 $self->url($url) if $url; | |
| 106 $self->description($desc) if $desc; | |
| 107 $self->is_project($is_project) if $is_project; | |
| 108 | |
| 109 return $self; | |
| 110 } | |
| 111 | |
| 112 | |
| 113 | |
| 114 =head2 name | |
| 115 | |
| 116 Arg [1] : string - name | |
| 117 Example : my $name = $ft->name(); | |
| 118 Description: Getter and setter of name attribute for ExperimentalGroup objects | |
| 119 Returntype : string | |
| 120 Exceptions : None | |
| 121 Caller : General | |
| 122 Status : Low Risk | |
| 123 | |
| 124 =cut | |
| 125 | |
| 126 sub name { | |
| 127 my $self = shift; | |
| 128 $self->{'name'} = shift if @_; | |
| 129 return $self->{'name'}; | |
| 130 } | |
| 131 | |
| 132 =head2 description | |
| 133 | |
| 134 Arg [1] : (optional) string - description | |
| 135 Example : my $desc = $group->description(); | |
| 136 Description: Getter and setter of description attribute for ExperimentalGroup objects. | |
| 137 Returntype : string | |
| 138 Exceptions : None | |
| 139 Caller : General | |
| 140 Status : Low Risk | |
| 141 | |
| 142 =cut | |
| 143 | |
| 144 sub description { | |
| 145 my $self = shift; | |
| 146 $self->{'description'} = shift if @_; | |
| 147 return $self->{'description'}; | |
| 148 } | |
| 149 | |
| 150 =head2 location | |
| 151 | |
| 152 Arg [1] : (optional) string - location | |
| 153 Example : my $location = $group->location(); | |
| 154 Description: Getter and setter of location attribute for ExperimentalGroup objects. | |
| 155 Returntype : string | |
| 156 Exceptions : None | |
| 157 Caller : General | |
| 158 Status : Low Risk | |
| 159 | |
| 160 =cut | |
| 161 | |
| 162 sub location { | |
| 163 my $self = shift; | |
| 164 $self->{'location'} = shift if @_; | |
| 165 return $self->{'location'}; | |
| 166 } | |
| 167 | |
| 168 | |
| 169 =head2 contact | |
| 170 | |
| 171 Arg [1] : (optional) string - contact | |
| 172 Example : my $contact = $group->contact(); | |
| 173 Description: Getter and setter of contact attribute for ExperimentalGroup objects. | |
| 174 Returntype : string | |
| 175 Exceptions : None | |
| 176 Caller : General | |
| 177 Status : Low Risk | |
| 178 | |
| 179 =cut | |
| 180 | |
| 181 sub contact { | |
| 182 my $self = shift; | |
| 183 $self->{'contact'} = shift if @_; | |
| 184 return $self->{'contact'}; | |
| 185 } | |
| 186 | |
| 187 | |
| 188 =head2 url | |
| 189 | |
| 190 Arg [1] : (optional) string - url | |
| 191 Example : my $url = $group->url(); | |
| 192 Description: Getter and setter of url attribute for ExperimentalGroup objects. | |
| 193 Returntype : string | |
| 194 Exceptions : None | |
| 195 Caller : General | |
| 196 Status : Low Risk | |
| 197 | |
| 198 =cut | |
| 199 | |
| 200 sub url { | |
| 201 my $self = shift; | |
| 202 $self->{'url'} = shift if @_; | |
| 203 return $self->{'url'}; | |
| 204 } | |
| 205 | |
| 206 =head2 is_project | |
| 207 | |
| 208 Arg [1] : (optional) Boolean - is_project | |
| 209 Example : $group->is_project(); | |
| 210 Description: Getter and setter of is_project attribute for ExperimentalGroup objects. | |
| 211 Returntype : string | |
| 212 Exceptions : None | |
| 213 Caller : General | |
| 214 Status : High Risk | |
| 215 | |
| 216 =cut | |
| 217 | |
| 218 sub is_project { | |
| 219 my $self = shift; | |
| 220 $self->{'is_project'} = shift if @_; | |
| 221 return $self->{'is_project'}; | |
| 222 } | |
| 223 | |
| 224 1; | |
| 225 |
