2 # BioPerl module for Bio::SeqFeature::CollectionI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Jason Stajich <jason@bioperl.org>
8 # Copyright Jason Stajich
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::SeqFeature::CollectionI - An interface for a collection of SeqFeatureI objects.
21 # get a Bio::SeqFeature::CollectionI somehow
22 # perhaps a Bio::SeqFeature::Collection
25 use Bio::SeqFeature::Collection;
26 my $collection = Bio::SeqFeature::Collection->new();
27 $collection->add_features(\@featurelist);
30 $collection->features(-attributes =>
31 [ { 'location' => Bio::Location::Simple->new
32 (-start=> 1, -end => 300) ,
37 This interface describes the basic methods needed for a collection of Sequence Features.
43 User feedback is an integral part of the evolution of this and other
44 Bioperl modules. Send your comments and suggestions preferably to
45 the Bioperl mailing list. Your participation is much appreciated.
47 bioperl-l@bioperl.org - General discussion
48 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
52 Please direct usage questions or support issues to the mailing list:
54 I<bioperl-l@bioperl.org>
56 rather than to the module maintainer directly. Many experienced and
57 reponsive experts will be able look at the problem and quickly
58 address it. Please include a thorough description of the problem
59 with code and data examples if at all possible.
63 Report bugs to the Bioperl bug tracking system to help us keep track
64 of the bugs and their resolution. Bug reports can be submitted via the
67 https://redmine.open-bio.org/projects/bioperl/
69 =head1 AUTHOR - Jason Stajich
71 Email jason@bioperl.org
75 The rest of the documentation details each of the object methods.
76 Internal methods are usually preceded with a _
81 # Let the code begin...
84 package Bio
::SeqFeature
::CollectionI
;
88 use base
qw(Bio::Root::RootI);
94 Usage : $collection->add_features(\@features);
96 Returns : number of features added
97 Args : arrayref of Bio::SeqFeatureI objects to index
102 shift->throw_not_implemented();
109 Usage : my @f = $collection->features(@args);
110 Returns : a list of Bio::SeqFeatureI objects
114 This routine will retrieve features associated with this collection
115 object. It can be used to return all features, or a subset based on
116 their type, location, or attributes.
118 -types List of feature types to return. Argument is an array
119 of Bio::Das::FeatureTypeI objects or a set of strings
120 that can be converted into FeatureTypeI objects.
122 -callback A callback to invoke on each feature. The subroutine
123 will be passed to each Bio::SeqFeatureI object in turn.
125 -attributes A hash reference containing attributes to match.
127 The -attributes argument is a hashref containing one or more attributes
130 -attributes => { Gene => 'abc-1',
131 Note => 'confirmed' }
133 Attribute matching is simple exact string matching, and multiple
134 attributes are ANDed together. See L<Bio::DB::ConstraintsI> for a
135 more sophisticated take on this.
137 If one provides a callback, it will be invoked on each feature in
138 turn. If the callback returns a false value, iteration will be
139 interrupted. When a callback is provided, the method returns undef.
144 shift->throw_not_implemented();