| 1 | # | ||||||||||||||||||||||||||||
| 2 | # BioPerl module for Bio::Ontology::InterProTerm | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||
| 6 | # Cared for by Peter Dimitrov <dimitrov@gnf.org> | ||||||||||||||||||||||||||||
| 7 | # | ||||||||||||||||||||||||||||
| 8 | # Copyright Peter Dimitrov | ||||||||||||||||||||||||||||
| 9 | # (c) Peter Dimitrov, dimitrov@gnf.org, 2002. | ||||||||||||||||||||||||||||
| 10 | # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002. | ||||||||||||||||||||||||||||
| 11 | # | ||||||||||||||||||||||||||||
| 12 | # You may distribute this module under the same terms as perl itself. | ||||||||||||||||||||||||||||
| 13 | # Refer to the Perl Artistic License (see the license accompanying this | ||||||||||||||||||||||||||||
| 14 | # software package, or see http://www.perl.com/language/misc/Artistic.html) | ||||||||||||||||||||||||||||
| 15 | # for the terms under which you may use, modify, and redistribute this module. | ||||||||||||||||||||||||||||
| 16 | # | ||||||||||||||||||||||||||||
| 17 | # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED | ||||||||||||||||||||||||||||
| 18 | # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | ||||||||||||||||||||||||||||
| 19 | # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||||||||||||||||||||||||||||
| 20 | # | ||||||||||||||||||||||||||||
| 21 | # POD documentation - main docs before the code | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | =head1 NAME | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | Bio::Ontology::InterProTerm - Implementation of InterProI term interface | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | my $term = Bio::Ontology::InterProTerm->new( | ||||||||||||||||||||||||||||
| 30 | -interpro_id => "IPR000001", | ||||||||||||||||||||||||||||
| 31 | -name => "Kringle", | ||||||||||||||||||||||||||||
| 32 | -definition => "Kringles are autonomous structural domains ...", | ||||||||||||||||||||||||||||
| 33 | -ontology => "Domain" | ||||||||||||||||||||||||||||
| 34 | ); | ||||||||||||||||||||||||||||
| 35 | print $term->interpro_id(), "\n"; | ||||||||||||||||||||||||||||
| 36 | print $term->name(), "\n"; | ||||||||||||||||||||||||||||
| 37 | print $term->definition(), "\n"; | ||||||||||||||||||||||||||||
| 38 | print $term->is_obsolete(), "\n"; | ||||||||||||||||||||||||||||
| 39 | print $term->ontology->name(), "\n"; | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | This is a simple extension of L<Bio::Ontology::Term> for InterPro terms. | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =head1 FEEDBACK | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | =head2 Mailing Lists | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | User feedback is an integral part of the evolution of this and other | ||||||||||||||||||||||||||||
| 50 | Bioperl modules. Send your comments and suggestions preferably to | ||||||||||||||||||||||||||||
| 51 | the Bioperl mailing list. Your participation is much appreciated. | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | bioperl-l@bioperl.org - General discussion | ||||||||||||||||||||||||||||
| 54 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | =head2 Support | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | Please direct usage questions or support issues to the mailing list: | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | I<bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | rather than to the module maintainer directly. Many experienced and | ||||||||||||||||||||||||||||
| 63 | reponsive experts will be able look at the problem and quickly | ||||||||||||||||||||||||||||
| 64 | address it. Please include a thorough description of the problem | ||||||||||||||||||||||||||||
| 65 | with code and data examples if at all possible. | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | =head2 Reporting Bugs | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | Report bugs to the Bioperl bug tracking system to help us keep track | ||||||||||||||||||||||||||||
| 70 | of the bugs and their resolution. Bug reports can be submitted via | ||||||||||||||||||||||||||||
| 71 | the web: | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | https://github.com/bioperl/bioperl-live/issues | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | =head1 AUTHOR - Peter Dimitrov | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | Email dimitrov@gnf.org | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | =head1 APPENDIX | ||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | The rest of the documentation details each of the object methods. | ||||||||||||||||||||||||||||
| 82 | Internal methods are usually preceded with a _ | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | =cut | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | # Let the code begin... | ||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | package Bio::Ontology::InterProTerm; | ||||||||||||||||||||||||||||
| 91 | 1 | $Bio::Ontology::InterProTerm::VERSION = '1.7.8'; | |||||||||||||||||||||||||||
| 92 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | 1 | ▶ | use Bio::Annotation::Reference; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | 1 | ▶ | use constant INTERPRO_ID_DEFAULT => "IPR000000"; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | 1 | ▶ | use base qw(Bio::Ontology::Term); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | =head2 new | ||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | Title : new | ||||||||||||||||||||||||||||
| 103 | Usage : $term = Bio::Ontology::InterProTerm->new( -interpro_id => "IPR000002", | ||||||||||||||||||||||||||||
| 104 | -name => "Cdc20/Fizzy", | ||||||||||||||||||||||||||||
| 105 | -definition => "The Cdc20/Fizzy region is almost always ...", | ||||||||||||||||||||||||||||
| 106 | -ontology => "Domain" | ||||||||||||||||||||||||||||
| 107 | ); | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | Function: Creates a new Bio::Ontology::InterProTerm. | ||||||||||||||||||||||||||||
| 110 | Example : | ||||||||||||||||||||||||||||
| 111 | Returns : A new Bio::Ontology::InterProTerm object. | ||||||||||||||||||||||||||||
| 112 | Args : | ||||||||||||||||||||||||||||
| 113 | -interpro_id => the InterPro ID of the term. Has the form IPRdddddd, where dddddd is a zero-padded six digit number | ||||||||||||||||||||||||||||
| 114 | -name => the name of this InterPro term [scalar] | ||||||||||||||||||||||||||||
| 115 | -definition => the definition/abstract of this InterPro term [scalar] | ||||||||||||||||||||||||||||
| 116 | -ontology => ontology of InterPro terms [Bio::Ontology::OntologyI] | ||||||||||||||||||||||||||||
| 117 | -comment => a comment [scalar] | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | =cut | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | 0 | ▶ | sub new{ | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 122 | 0 | my ($class, @args) = @_; | |||||||||||||||||||||||||||
| 123 | 0 | my $self = $class->SUPER::new(@args); | |||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | 0 | my ( $interpro_id, | |||||||||||||||||||||||||||
| 126 | $short_name) | ||||||||||||||||||||||||||||
| 127 | = $self->_rearrange( [qw( INTERPRO_ID | ||||||||||||||||||||||||||||
| 128 | SHORT_NAME | ||||||||||||||||||||||||||||
| 129 | ) | ||||||||||||||||||||||||||||
| 130 | ], @args ); | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | 0 | ▶ | $interpro_id && $self->interpro_id( $interpro_id ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 133 | 0 | ▶ | $short_name && $self->short_name( $short_name ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||
| 135 | 0 | return $self; | |||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||
| 138 | =head2 init | ||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | Title : init | ||||||||||||||||||||||||||||
| 141 | Usage : $term->init(); | ||||||||||||||||||||||||||||
| 142 | Function: Initializes this InterProTerm to all "" and empty lists. | ||||||||||||||||||||||||||||
| 143 | Example : | ||||||||||||||||||||||||||||
| 144 | Returns : | ||||||||||||||||||||||||||||
| 145 | Args : | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | =cut | ||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||
| 150 | 0 | ▶ | sub init{ | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 151 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | # first call the inherited version to properly chain up the hierarchy | ||||||||||||||||||||||||||||
| 154 | 0 | $self->SUPER::init(@_); | |||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | # then only initialize what we implement ourselves here | ||||||||||||||||||||||||||||
| 157 | 0 | $self->interpro_id( INTERPRO_ID_DEFAULT ); | |||||||||||||||||||||||||||
| 158 | 0 | $self->short_name(""); | |||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||
| 162 | =head2 _check_interpro_id | ||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||
| 164 | Title : _check_interpro_id | ||||||||||||||||||||||||||||
| 165 | Usage : | ||||||||||||||||||||||||||||
| 166 | Function: Performs simple check in order to validate that its argument has the form IPRdddddd, where dddddd is a zero-padded six digit number. | ||||||||||||||||||||||||||||
| 167 | Example : | ||||||||||||||||||||||||||||
| 168 | Returns : Returns its argument if valid, otherwise throws exception. | ||||||||||||||||||||||||||||
| 169 | Args : String | ||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||
| 172 | =cut | ||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||
| 174 | 0 | ▶ | sub _check_interpro_id{ | ||||||||||||||||||||||||||
|
Subroutine
_check_interpro_id: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 175 | 0 | my ($self, $value) = @_; | |||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||
| 177 | 0 | ▶ | $self->throw( "InterPro ID ".$value." is incorrect\n" ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$value =~ /^IPR\d{6}$/ or $value eq "IPR000000"
MC/DC0%0/2
$value =~ /^IPR\d{6}$/ or $value eq "IPR000000"
$value =~ /^IPR\d{6}$/
$value eq "IPR000000"
Truth table0%0/3
A or B
A= $value =~ /^IPR\d{6}$/B= $value eq "IPR000000"
| |||||||||||||||||||||||||||||
| 178 | unless ( $value =~ /^IPR\d{6}$/ || | ||||||||||||||||||||||||||||
| 179 | $value eq INTERPRO_ID_DEFAULT ); | ||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | 0 | return $value; | |||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||
| 184 | =head2 interpro_id | ||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | Title : interpro_id | ||||||||||||||||||||||||||||
| 187 | Usage : $obj->interpro_id($newval) | ||||||||||||||||||||||||||||
| 188 | Function: Set/get for the interpro_id of this InterProTerm | ||||||||||||||||||||||||||||
| 189 | Example : | ||||||||||||||||||||||||||||
| 190 | Returns : value of interpro_id (a scalar) | ||||||||||||||||||||||||||||
| 191 | Args : new value (a scalar, optional) | ||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||
| 194 | =cut | ||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | 0 | ▶ | sub interpro_id{ | ||||||||||||||||||||||||||
|
Subroutine
interpro_id: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 197 | 0 | my ($self, $value) = @_; | |||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||
| 199 | 0 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 200 | 0 | $value = $self->_check_interpro_id($value); | |||||||||||||||||||||||||||
| 201 | 0 | return $self->identifier($value); | |||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | 0 | return $self->identifier(); | |||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||
| 207 | =head2 short_name | ||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||
| 209 | Title : short_name | ||||||||||||||||||||||||||||
| 210 | Usage : $obj->short_name($newval) | ||||||||||||||||||||||||||||
| 211 | Function: Set/get for the short name of this InterProTerm. | ||||||||||||||||||||||||||||
| 212 | Example : | ||||||||||||||||||||||||||||
| 213 | Returns : value of short_name (a scalar) | ||||||||||||||||||||||||||||
| 214 | Args : new value (a scalar, optional) | ||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | =cut | ||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | 0 | ▶ | sub short_name{ | ||||||||||||||||||||||||||
|
Subroutine
short_name: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 220 | 0 | my ($self, $value) = @_; | |||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||
| 222 | 0 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 223 | 0 | ▶ | $self->{'short_name'} = $value ? $value : undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | 0 | return $self->{'short_name'}; | |||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | =head2 protein_count | ||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||
| 231 | Title : protein_count | ||||||||||||||||||||||||||||
| 232 | Usage : $obj->protein_count($newval) | ||||||||||||||||||||||||||||
| 233 | Function: Set/get for the protein count of this InterProTerm. | ||||||||||||||||||||||||||||
| 234 | Example : | ||||||||||||||||||||||||||||
| 235 | Returns : value of protein_count (a scalar) | ||||||||||||||||||||||||||||
| 236 | Args : new value (a scalar, optional) | ||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||
| 239 | =cut | ||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||
| 241 | 0 | ▶ | sub protein_count{ | ||||||||||||||||||||||||||
|
Subroutine
protein_count: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 242 | 0 | my ($self,$value) = @_; | |||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||
| 244 | 0 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 245 | 0 | ▶ | $self->{'protein_count'} = $value ? $value : undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | 0 | return $self->{'protein_count'}; | |||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||
| 251 | =head2 get_references | ||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||
| 253 | Title : get_references | ||||||||||||||||||||||||||||
| 254 | Usage : | ||||||||||||||||||||||||||||
| 255 | Function: Get the references for this InterPro term. | ||||||||||||||||||||||||||||
| 256 | Example : | ||||||||||||||||||||||||||||
| 257 | Returns : An array of L<Bio::Annotation::Reference> objects | ||||||||||||||||||||||||||||
| 258 | Args : | ||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||
| 261 | =cut | ||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||
| 263 | # Defined in parent class | ||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||
| 265 | #sub get_references{ | ||||||||||||||||||||||||||||
| 266 | # my $self = shift; | ||||||||||||||||||||||||||||
| 267 | # | ||||||||||||||||||||||||||||
| 268 | # return @{$self->{"_references"}} if exists($self->{"_references"}); | ||||||||||||||||||||||||||||
| 269 | # return (); | ||||||||||||||||||||||||||||
| 270 | #} | ||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||
| 272 | =head2 add_reference | ||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||
| 274 | Title : add_reference | ||||||||||||||||||||||||||||
| 275 | Usage : | ||||||||||||||||||||||||||||
| 276 | Function: Add one or more references to this InterPro term. | ||||||||||||||||||||||||||||
| 277 | Example : | ||||||||||||||||||||||||||||
| 278 | Returns : | ||||||||||||||||||||||||||||
| 279 | Args : One or more L<Bio::Annotation::Reference> objects. | ||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||
| 282 | =cut | ||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||
| 284 | # Defined in parent class | ||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||
| 286 | #sub add_reference{ | ||||||||||||||||||||||||||||
| 287 | # my $self = shift; | ||||||||||||||||||||||||||||
| 288 | # | ||||||||||||||||||||||||||||
| 289 | # $self->{"_references"} = [] unless exists($self->{"_references"}); | ||||||||||||||||||||||||||||
| 290 | # push(@{$self->{"_references"}}, @_); | ||||||||||||||||||||||||||||
| 291 | #} | ||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||
| 293 | =head2 remove_references | ||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||
| 295 | Title : remove_references | ||||||||||||||||||||||||||||
| 296 | Usage : | ||||||||||||||||||||||||||||
| 297 | Function: Remove all references for this InterPro term. | ||||||||||||||||||||||||||||
| 298 | Example : | ||||||||||||||||||||||||||||
| 299 | Returns : The list of previous references as an array of | ||||||||||||||||||||||||||||
| 300 | L<Bio::Annotation::Reference> objects. | ||||||||||||||||||||||||||||
| 301 | Args : | ||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||
| 304 | =cut | ||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||
| 306 | # Defined in parent class | ||||||||||||||||||||||||||||
| 307 | #sub remove_references{ | ||||||||||||||||||||||||||||
| 308 | # my $self = shift; | ||||||||||||||||||||||||||||
| 309 | # | ||||||||||||||||||||||||||||
| 310 | # my @arr = $self->get_references(); | ||||||||||||||||||||||||||||
| 311 | # $self->{"_references"} = []; | ||||||||||||||||||||||||||||
| 312 | # return @arr; | ||||||||||||||||||||||||||||
| 313 | #} | ||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||
| 315 | =head2 get_members | ||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||
| 317 | Title : get_members | ||||||||||||||||||||||||||||
| 318 | Usage : @arr = get_members() | ||||||||||||||||||||||||||||
| 319 | Function: Get the list of member(s) for this object. | ||||||||||||||||||||||||||||
| 320 | Example : | ||||||||||||||||||||||||||||
| 321 | Returns : An array of Bio::Annotation::DBLink objects | ||||||||||||||||||||||||||||
| 322 | Args : | ||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||
| 325 | =cut | ||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||
| 327 | 0 | ▶ | sub get_members{ | ||||||||||||||||||||||||||
|
Subroutine
get_members: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 328 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 329 | 0 | return $self->get_dbxrefs('member_list'); | |||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||
| 332 | =head2 add_member | ||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||
| 334 | Title : add_member | ||||||||||||||||||||||||||||
| 335 | Usage : | ||||||||||||||||||||||||||||
| 336 | Function: Add one or more member(s) to this object. | ||||||||||||||||||||||||||||
| 337 | Example : | ||||||||||||||||||||||||||||
| 338 | Returns : | ||||||||||||||||||||||||||||
| 339 | Args : One or more Bio::Annotation::DBLink objects. | ||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||
| 342 | =cut | ||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||
| 344 | 0 | ▶ | sub add_member{ | ||||||||||||||||||||||||||
|
Subroutine
add_member: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 345 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 346 | 0 | $self->add_dbxref(-dbxrefs => \@_, -context => 'member_list'); | |||||||||||||||||||||||||||
| 347 | } | ||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||
| 349 | =head2 remove_members | ||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||
| 351 | Title : remove_members | ||||||||||||||||||||||||||||
| 352 | Usage : | ||||||||||||||||||||||||||||
| 353 | Function: Remove all members for this class. | ||||||||||||||||||||||||||||
| 354 | Example : | ||||||||||||||||||||||||||||
| 355 | Returns : The list of previous members as an array of | ||||||||||||||||||||||||||||
| 356 | Bio::Annotation::DBLink objects. | ||||||||||||||||||||||||||||
| 357 | Args : | ||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||
| 360 | =cut | ||||||||||||||||||||||||||||
| 361 | |||||||||||||||||||||||||||||
| 362 | 0 | ▶ | sub remove_members{ | ||||||||||||||||||||||||||
|
Subroutine
remove_members: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 363 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 364 | 0 | return $self->remove_dbxrefs('member_list'); | |||||||||||||||||||||||||||
| 365 | } | ||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||
| 367 | =head2 get_examples | ||||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||
| 369 | Title : get_examples | ||||||||||||||||||||||||||||
| 370 | Usage : @arr = get_examples() | ||||||||||||||||||||||||||||
| 371 | Function: Get the list of example(s) for this object. | ||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||
| 373 | This is an element of the InterPro xml schema. | ||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||
| 375 | Example : | ||||||||||||||||||||||||||||
| 376 | Returns : An array of Bio::Annotation::DBLink objects | ||||||||||||||||||||||||||||
| 377 | Args : | ||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||
| 379 | |||||||||||||||||||||||||||||
| 380 | =cut | ||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||
| 382 | 0 | ▶ | sub get_examples{ | ||||||||||||||||||||||||||
|
Subroutine
get_examples: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 383 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 384 | 0 | return $self->get_dbxrefs('example_list'); | |||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||
| 387 | =head2 add_example | ||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||
| 389 | Title : add_example | ||||||||||||||||||||||||||||
| 390 | Usage : | ||||||||||||||||||||||||||||
| 391 | Function: Add one or more example(s) to this object. | ||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||
| 393 | This is an element of the InterPro xml schema. | ||||||||||||||||||||||||||||
| 394 | |||||||||||||||||||||||||||||
| 395 | Example : | ||||||||||||||||||||||||||||
| 396 | Returns : | ||||||||||||||||||||||||||||
| 397 | Args : One or more Bio::Annotation::DBLink objects. | ||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||
| 399 | |||||||||||||||||||||||||||||
| 400 | =cut | ||||||||||||||||||||||||||||
| 401 | |||||||||||||||||||||||||||||
| 402 | 0 | ▶ | sub add_example{ | ||||||||||||||||||||||||||
|
Subroutine
add_example: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 403 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 404 | 0 | return $self->add_dbxref(-dbxrefs => \@_, -context => 'example_list'); | |||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||
| 407 | =head2 remove_examples | ||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||
| 409 | Title : remove_examples | ||||||||||||||||||||||||||||
| 410 | Usage : | ||||||||||||||||||||||||||||
| 411 | Function: Remove all examples for this class. | ||||||||||||||||||||||||||||
| 412 | |||||||||||||||||||||||||||||
| 413 | This is an element of the InterPro xml schema. | ||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||
| 415 | Example : | ||||||||||||||||||||||||||||
| 416 | Returns : The list of previous examples as an array of | ||||||||||||||||||||||||||||
| 417 | Bio::Annotation::DBLink objects. | ||||||||||||||||||||||||||||
| 418 | Args : | ||||||||||||||||||||||||||||
| 419 | |||||||||||||||||||||||||||||
| 420 | |||||||||||||||||||||||||||||
| 421 | =cut | ||||||||||||||||||||||||||||
| 422 | |||||||||||||||||||||||||||||
| 423 | 0 | ▶ | sub remove_examples{ | ||||||||||||||||||||||||||
|
Subroutine
remove_examples: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 424 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 425 | 0 | return $self->remove_dbxrefs('example_list'); | |||||||||||||||||||||||||||
| 426 | } | ||||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||
| 428 | =head2 get_external_documents | ||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||
| 430 | Title : get_external_documents | ||||||||||||||||||||||||||||
| 431 | Usage : @arr = get_external_documents() | ||||||||||||||||||||||||||||
| 432 | Function: Get the list of external_document(s) for this object. | ||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||
| 434 | This is an element of the InterPro xml schema. | ||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||
| 436 | Example : | ||||||||||||||||||||||||||||
| 437 | Returns : An array of Bio::Annotation::DBLink objects | ||||||||||||||||||||||||||||
| 438 | Args : | ||||||||||||||||||||||||||||
| 439 | |||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||
| 441 | =cut | ||||||||||||||||||||||||||||
| 442 | |||||||||||||||||||||||||||||
| 443 | 0 | ▶ | sub get_external_documents{ | ||||||||||||||||||||||||||
|
Subroutine
get_external_documents: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 444 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 445 | 0 | return $self->get_dbxrefs('external_doc_list'); | |||||||||||||||||||||||||||
| 446 | } | ||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||
| 448 | =head2 add_external_document | ||||||||||||||||||||||||||||
| 449 | |||||||||||||||||||||||||||||
| 450 | Title : add_external_document | ||||||||||||||||||||||||||||
| 451 | Usage : | ||||||||||||||||||||||||||||
| 452 | Function: Add one or more external_document(s) to this object. | ||||||||||||||||||||||||||||
| 453 | |||||||||||||||||||||||||||||
| 454 | This is an element of the InterPro xml schema. | ||||||||||||||||||||||||||||
| 455 | |||||||||||||||||||||||||||||
| 456 | Example : | ||||||||||||||||||||||||||||
| 457 | Returns : | ||||||||||||||||||||||||||||
| 458 | Args : One or more Bio::Annotation::DBLink objects. | ||||||||||||||||||||||||||||
| 459 | |||||||||||||||||||||||||||||
| 460 | |||||||||||||||||||||||||||||
| 461 | =cut | ||||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||
| 463 | 0 | ▶ | sub add_external_document{ | ||||||||||||||||||||||||||
|
Subroutine
add_external_document: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 464 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 465 | 0 | return $self->add_dbxref(-dbxrefs => \@_, -context => 'external_doc_list'); | |||||||||||||||||||||||||||
| 466 | } | ||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||
| 468 | =head2 remove_external_documents | ||||||||||||||||||||||||||||
| 469 | |||||||||||||||||||||||||||||
| 470 | Title : remove_external_documents | ||||||||||||||||||||||||||||
| 471 | Usage : | ||||||||||||||||||||||||||||
| 472 | Function: Remove all external_documents for this class. | ||||||||||||||||||||||||||||
| 473 | |||||||||||||||||||||||||||||
| 474 | This is an element of the InterPro xml schema. | ||||||||||||||||||||||||||||
| 475 | |||||||||||||||||||||||||||||
| 476 | Example : | ||||||||||||||||||||||||||||
| 477 | Returns : The list of previous external_documents as an array of | ||||||||||||||||||||||||||||
| 478 | Bio::Annotation::DBLink objects. | ||||||||||||||||||||||||||||
| 479 | Args : | ||||||||||||||||||||||||||||
| 480 | |||||||||||||||||||||||||||||
| 481 | |||||||||||||||||||||||||||||
| 482 | =cut | ||||||||||||||||||||||||||||
| 483 | |||||||||||||||||||||||||||||
| 484 | 0 | ▶ | sub remove_external_documents{ | ||||||||||||||||||||||||||
|
Subroutine
remove_external_documents: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 485 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 486 | 0 | return $self->remove_dbxrefs('external_doc_list'); | |||||||||||||||||||||||||||
| 487 | } | ||||||||||||||||||||||||||||
| 488 | |||||||||||||||||||||||||||||
| 489 | =head2 class_list | ||||||||||||||||||||||||||||
| 490 | |||||||||||||||||||||||||||||
| 491 | Title : class_list | ||||||||||||||||||||||||||||
| 492 | Usage : $obj->class_list($newval) | ||||||||||||||||||||||||||||
| 493 | Function: Set/get for class list element of the InterPro xml schema | ||||||||||||||||||||||||||||
| 494 | Example : | ||||||||||||||||||||||||||||
| 495 | Returns : reference to an array of Bio::Annotation::DBLink objects | ||||||||||||||||||||||||||||
| 496 | Args : reference to an array of Bio::Annotation::DBLink objects | ||||||||||||||||||||||||||||
| 497 | |||||||||||||||||||||||||||||
| 498 | =cut | ||||||||||||||||||||||||||||
| 499 | |||||||||||||||||||||||||||||
| 500 | # this is inconsistent with the above, but we work around it and hope nothing | ||||||||||||||||||||||||||||
| 501 | # breaks | ||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||
| 503 | 0 | ▶ | sub class_list{ | ||||||||||||||||||||||||||
|
Subroutine
class_list: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 504 | 0 | my ($self, $value) = @_; | |||||||||||||||||||||||||||
| 505 | 0 | ▶ | if( defined $value && ref $value eq 'ARRAY') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $value and ref $value eq "ARRAY"
MC/DC0%0/2
defined $value and ref $value eq "ARRAY"
defined $value
ref $value eq "ARRAY"
Truth table0%0/3
A and B
A= defined $valueB= ref $value eq "ARRAY"
| |||||||||||||||||||||||||||||
| 506 | 0 | ▶ | if (!@$value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 507 | # passing an empty array ref is essentially same as remove_dbxrefs, | ||||||||||||||||||||||||||||
| 508 | # so do that | ||||||||||||||||||||||||||||
| 509 | 0 | $self->remove_dbxrefs('class_list'); | |||||||||||||||||||||||||||
| 510 | } else { | ||||||||||||||||||||||||||||
| 511 | 0 | $self->add_dbxref(-dbxrefs => $value, -context => 'class_list'); | |||||||||||||||||||||||||||
| 512 | } | ||||||||||||||||||||||||||||
| 513 | } | ||||||||||||||||||||||||||||
| 514 | 0 | return [$self->get_dbxrefs('class_list')]; | |||||||||||||||||||||||||||
| 515 | } | ||||||||||||||||||||||||||||
| 516 | |||||||||||||||||||||||||||||
| 517 | =head2 to_string | ||||||||||||||||||||||||||||
| 518 | |||||||||||||||||||||||||||||
| 519 | Title : to_string() | ||||||||||||||||||||||||||||
| 520 | Usage : print $term->to_string(); | ||||||||||||||||||||||||||||
| 521 | Function: to_string method for InterPro terms. | ||||||||||||||||||||||||||||
| 522 | Returns : A string representation of this InterPro term. | ||||||||||||||||||||||||||||
| 523 | Args : | ||||||||||||||||||||||||||||
| 524 | |||||||||||||||||||||||||||||
| 525 | =cut | ||||||||||||||||||||||||||||
| 526 | |||||||||||||||||||||||||||||
| 527 | 0 | ▶ | sub to_string { | ||||||||||||||||||||||||||
|
Subroutine
to_string: not called CC=20 SCAR=60.4
Pod
documented
| |||||||||||||||||||||||||||||
| 528 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 529 | 0 | my $s = ""; | |||||||||||||||||||||||||||
| 530 | |||||||||||||||||||||||||||||
| 531 | 0 | $s .= "-- InterPro id:\n"; | |||||||||||||||||||||||||||
| 532 | 0 | $s .= $self->interpro_id() . "\n"; | |||||||||||||||||||||||||||
| 533 | 0 | ▶ | if ( defined $self->name ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 534 | 0 | $s .= "-- Name:\n"; | |||||||||||||||||||||||||||
| 535 | 0 | $s .= $self->name() . "\n"; | |||||||||||||||||||||||||||
| 536 | 0 | $s .= "-- Definition:\n"; | |||||||||||||||||||||||||||
| 537 | 0 | ▶ | $s .= ( $self->definition() || '' ) . "\n"; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->definition || ''
MC/DC0%0/1
$self->definition || ''
$self->definition
Truth table0%0/2
A
A= $self->definition
| |||||||||||||||||||||||||||||
| 538 | 0 | $s .= "-- Category:\n"; | |||||||||||||||||||||||||||
| 539 | 0 | ▶ | if ( defined( $self->ontology() ) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 540 | 0 | $s .= $self->ontology()->name() . "\n"; | |||||||||||||||||||||||||||
| 541 | } | ||||||||||||||||||||||||||||
| 542 | else { | ||||||||||||||||||||||||||||
| 543 | 0 | $s .= "\n"; | |||||||||||||||||||||||||||
| 544 | } | ||||||||||||||||||||||||||||
| 545 | 0 | $s .= "-- Version:\n"; | |||||||||||||||||||||||||||
| 546 | 0 | ▶ | $s .= ( $self->version() || '' ) . "\n"; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->version || ''
MC/DC0%0/1
$self->version || ''
$self->version
Truth table0%0/2
A
A= $self->version
| |||||||||||||||||||||||||||||
| 547 | 0 | $s .= "-- Is obsolete:\n"; | |||||||||||||||||||||||||||
| 548 | 0 | $s .= $self->is_obsolete() . "\n"; | |||||||||||||||||||||||||||
| 549 | 0 | $s .= "-- Comment:\n"; | |||||||||||||||||||||||||||
| 550 | 0 | ▶ | $s .= ( $self->comment() || '' ) . "\n"; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->comment || ''
MC/DC0%0/1
$self->comment || ''
$self->comment
Truth table0%0/2
A
A= $self->comment
| |||||||||||||||||||||||||||||
| 551 | 0 | ▶ | if ( defined $self->get_references ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 552 | 0 | $s .= "-- References:\n"; | |||||||||||||||||||||||||||
| 553 | 0 | foreach my $ref ( $self->get_references ) { | |||||||||||||||||||||||||||
| 554 | 0 | $s .= | |||||||||||||||||||||||||||
| 555 | $ref->authors . "\n" | ||||||||||||||||||||||||||||
| 556 | . $ref->title . "\n" | ||||||||||||||||||||||||||||
| 557 | . $ref->location . "\n\n"; | ||||||||||||||||||||||||||||
| 558 | } | ||||||||||||||||||||||||||||
| 559 | 0 | $s .= "\n"; | |||||||||||||||||||||||||||
| 560 | } | ||||||||||||||||||||||||||||
| 561 | 0 | ▶ | if ( defined $self->get_members ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 562 | 0 | $s .= "-- Member List:\n"; | |||||||||||||||||||||||||||
| 563 | 0 | foreach my $ref ( $self->get_members ) { | |||||||||||||||||||||||||||
| 564 | 0 | $s .= $ref->database . "\t" . $ref->primary_id . "\n"; | |||||||||||||||||||||||||||
| 565 | } | ||||||||||||||||||||||||||||
| 566 | 0 | $s .= "\n"; | |||||||||||||||||||||||||||
| 567 | } | ||||||||||||||||||||||||||||
| 568 | 0 | ▶ | if ( defined $self->get_external_documents ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 569 | 0 | $s .= "-- External Document List:\n"; | |||||||||||||||||||||||||||
| 570 | 0 | foreach my $ref ( $self->get_external_documents ) { | |||||||||||||||||||||||||||
| 571 | 0 | $s .= $ref->database . "\t" . $ref->primary_id . "\n"; | |||||||||||||||||||||||||||
| 572 | } | ||||||||||||||||||||||||||||
| 573 | 0 | $s .= "\n"; | |||||||||||||||||||||||||||
| 574 | } | ||||||||||||||||||||||||||||
| 575 | 0 | ▶ | if ( defined $self->get_examples ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 576 | 0 | $s .= "-- Examples:\n"; | |||||||||||||||||||||||||||
| 577 | 0 | foreach my $ref ( $self->get_examples ) { | |||||||||||||||||||||||||||
| 578 | $s .= join( "\t", | ||||||||||||||||||||||||||||
| 579 | 0 | ▶ | map { $ref->$_ || '' } qw(database primary_id comment) ) | ||||||||||||||||||||||||||
|
Condition0%0/2
$ref->$_ || ''
MC/DC0%0/1
$ref->$_ || ''
$ref->$_
Truth table0%0/2
A
A= $ref->$_
| |||||||||||||||||||||||||||||
| 580 | . "\n"; | ||||||||||||||||||||||||||||
| 581 | } | ||||||||||||||||||||||||||||
| 582 | 0 | $s .= "\n"; | |||||||||||||||||||||||||||
| 583 | } | ||||||||||||||||||||||||||||
| 584 | 0 | ▶ | if ( defined $self->class_list ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 585 | 0 | $s .= "-- Class List:\n"; | |||||||||||||||||||||||||||
| 586 | 0 | foreach my $ref ( @{ $self->class_list } ) { | |||||||||||||||||||||||||||
| 587 | 0 | $s .= $ref->primary_id . "\n"; | |||||||||||||||||||||||||||
| 588 | } | ||||||||||||||||||||||||||||
| 589 | 0 | $s .= "\n"; | |||||||||||||||||||||||||||
| 590 | } | ||||||||||||||||||||||||||||
| 591 | 0 | ▶ | if ( $self->get_secondary_ids ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 592 | 0 | $s .= "-- Secondary IDs:\n"; | |||||||||||||||||||||||||||
| 593 | 0 | foreach my $ref ( $self->get_secondary_ids() ) { | |||||||||||||||||||||||||||
| 594 | # TODO: getting undef here in some cases, needs to be checked | ||||||||||||||||||||||||||||
| 595 | 0 | ▶ | next unless defined ($ref); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 596 | 0 | $s .= $ref . "\n"; | |||||||||||||||||||||||||||
| 597 | } | ||||||||||||||||||||||||||||
| 598 | 0 | $s .= "\n"; | |||||||||||||||||||||||||||
| 599 | } | ||||||||||||||||||||||||||||
| 600 | } | ||||||||||||||||||||||||||||
| 601 | else { | ||||||||||||||||||||||||||||
| 602 | 0 | $s .= "InterPro term not fully instantiated\n"; | |||||||||||||||||||||||||||
| 603 | } | ||||||||||||||||||||||||||||
| 604 | 0 | return $s; | |||||||||||||||||||||||||||
| 605 | } | ||||||||||||||||||||||||||||
| 606 | |||||||||||||||||||||||||||||
| 607 | =head1 Deprecated methods | ||||||||||||||||||||||||||||
| 608 | |||||||||||||||||||||||||||||
| 609 | These are here for backwards compatibility. | ||||||||||||||||||||||||||||
| 610 | |||||||||||||||||||||||||||||
| 611 | =cut | ||||||||||||||||||||||||||||
| 612 | |||||||||||||||||||||||||||||
| 613 | =head2 secondary_ids | ||||||||||||||||||||||||||||
| 614 | |||||||||||||||||||||||||||||
| 615 | Title : secondary_ids | ||||||||||||||||||||||||||||
| 616 | Usage : $obj->secondary_ids($newval) | ||||||||||||||||||||||||||||
| 617 | Function: This is deprecated. Use get_secondary_ids() or | ||||||||||||||||||||||||||||
| 618 | add_secondary_id() instead. | ||||||||||||||||||||||||||||
| 619 | Example : | ||||||||||||||||||||||||||||
| 620 | Returns : reference to an array of strings | ||||||||||||||||||||||||||||
| 621 | Args : reference to an array of strings | ||||||||||||||||||||||||||||
| 622 | |||||||||||||||||||||||||||||
| 623 | |||||||||||||||||||||||||||||
| 624 | =cut | ||||||||||||||||||||||||||||
| 625 | |||||||||||||||||||||||||||||
| 626 | 0 | ▶ | sub secondary_ids{ | ||||||||||||||||||||||||||
|
Subroutine
secondary_ids: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 627 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 628 | 0 | my @ids; | |||||||||||||||||||||||||||
| 629 | |||||||||||||||||||||||||||||
| 630 | 0 | $self->warn("secondary_ids is deprecated. Use ". | |||||||||||||||||||||||||||
| 631 | "get_secondary_ids/add_secondary_id instead."); | ||||||||||||||||||||||||||||
| 632 | |||||||||||||||||||||||||||||
| 633 | # set mode? | ||||||||||||||||||||||||||||
| 634 | 0 | ▶ | if(@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 635 | 0 | my $sids = shift; | |||||||||||||||||||||||||||
| 636 | 0 | ▶ | if($sids) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 637 | 0 | $self->add_secondary_id(@$sids); | |||||||||||||||||||||||||||
| 638 | 0 | @ids = @$sids; | |||||||||||||||||||||||||||
| 639 | } else { | ||||||||||||||||||||||||||||
| 640 | # we interpret setting to undef as removing the array | ||||||||||||||||||||||||||||
| 641 | 0 | $self->remove_secondary_ids(); | |||||||||||||||||||||||||||
| 642 | } | ||||||||||||||||||||||||||||
| 643 | } else { | ||||||||||||||||||||||||||||
| 644 | # no; get mode | ||||||||||||||||||||||||||||
| 645 | 0 | @ids = $self->get_secondary_ids(); | |||||||||||||||||||||||||||
| 646 | } | ||||||||||||||||||||||||||||
| 647 | 0 | return \@ids; | |||||||||||||||||||||||||||
| 648 | } | ||||||||||||||||||||||||||||
| 649 | |||||||||||||||||||||||||||||
| 650 | 1 | 1; | |||||||||||||||||||||||||||