Bio::DB::Universal: move into its own distribution
[bioperl-live.git] / Bio / IdCollectionI.pm
blob1ee53497000a51ebe44c49f4bedcc12270f04dfc
3 # This module is licensed under the same terms as Perl itself. You use,
4 # modify, and redistribute it under the terms of the Perl Artistic License.
7 =head1 NAME
9 Bio::IdCollectionI - interface for objects with multiple identifiers
11 =head1 SYNOPSIS
14 # to test this is an identifiable collection object
16 $obj->isa("Bio::IdCollectionI") ||
17 $obj->throw("$obj does not implement the Bio::IdCollectionI interface");
19 # accessors
20 @authorities = $obj->id_authorities();
21 @ids = $obj->ids();
22 $id = $obj->ids($authority);
24 =head1 DESCRIPTION
26 This interface describes methods expected on objects that have
27 multiple identifiers, each of which is controlled by a different
28 authority.
30 =head1 FEEDBACK
32 =head2 Mailing Lists
34 User feedback is an integral part of the evolution of this and other
35 Bioperl modules. Send your comments and suggestions preferably to one
36 of the Bioperl mailing lists. Your participation is much appreciated.
38 bioperl-l@bioperl.org - General discussion
39 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
41 =head2 Support
43 Please direct usage questions or support issues to the mailing list:
45 I<bioperl-l@bioperl.org>
47 rather than to the module maintainer directly. Many experienced and
48 reponsive experts will be able look at the problem and quickly
49 address it. Please include a thorough description of the problem
50 with code and data examples if at all possible.
52 =head2 Reporting Bugs
54 Report bugs to the Bioperl bug tracking system to help us keep track
55 the bugs and their resolution. Bug reports can be submitted via the
56 web:
58 https://github.com/bioperl/bioperl-live/issues
60 =head1 AUTHOR - Lincoln Stein
62 Email lstein@cshl.org
64 =cut
66 package Bio::IdCollectionI;
67 use strict;
70 use base qw(Bio::Root::RootI);
72 =head1 Implementation Specific Functions
74 These functions are the ones that a specific implementation must
75 define.
77 =head2 id_authorities
79 Title : id_authorities
80 Usage : @array = $obj->id_authorities()
81 Function: Return the authorities which have names for this object.
82 The authorities can then be used to select ids.
84 Returns : An array
85 Status : Virtual
87 =cut
89 sub id_authorities {
90 my ($self) = @_;
91 $self->throw_not_implemented();
94 =head2 ids
96 Title : ids
97 Usage : @ids = $obj->ids([$authority1,$authority2...])
98 Function: return a list of Bio::IdentifiableI objects, optionally
99 filtered by the list of authorities.
101 Returns : A list of Bio::IdentifiableI objects.
102 Status : Virtual
104 =cut
106 sub ids {
107 my ($self) = @_;
108 my @authorities = @_;
109 $self->throw_not_implemented();