Bio/SeqFeature/CollectionI.pm

filter: Statementstmt 84.6% 11 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 80.0% 16 / 20 CC 1 SCAR 3.4
CC
1
Cov
85%
add_features
2.0
features
2.0
BEGIN
1.0
CRAP 1.4
« Bio/Ontology/DocumentRegistry.pm ↑ Summary Bio/Ontology/RelationshipFactory.pm »
1 #
2 # BioPerl module for Bio::SeqFeature::CollectionI
3 #
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
5 #
6 # Cared for by Jason Stajich <jason@bioperl.org>
7 #
8 # Copyright Jason Stajich
9 #
10 # You may distribute this module under the same terms as perl itself
11  
12 # POD documentation - main docs before the code
13  
14 =head1 NAME
15  
16 Bio::SeqFeature::CollectionI - An interface for a collection of SeqFeatureI objects.
17  
18 =head1 SYNOPSIS
19  
20  
21 # get a Bio::SeqFeature::CollectionI somehow
22 # perhaps a Bio::SeqFeature::Collection
23  
24  
25 use Bio::SeqFeature::Collection;
26 my $collection = Bio::SeqFeature::Collection->new();
27 $collection->add_features(\@featurelist);
28  
29  
30 $collection->features(-attributes =>
31 [ { 'location' => Bio::Location::Simple->new
32 (-start=> 1, -end => 300) ,
33 'overlaps' }]);
34  
35 =head1 DESCRIPTION
36  
37 This interface describes the basic methods needed for a collection of Sequence Features.
38  
39 =head1 FEEDBACK
40  
41 =head2 Mailing Lists
42  
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.
46  
47 bioperl-l@bioperl.org - General discussion
48 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
49  
50 =head2 Support
51  
52 Please direct usage questions or support issues to the mailing list:
53  
54 I<bioperl-l@bioperl.org>
55  
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.
60  
61 =head2 Reporting Bugs
62  
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
65 web:
66  
67 https://github.com/bioperl/bioperl-live/issues
68  
69 =head1 AUTHOR - Jason Stajich
70  
71 Email jason@bioperl.org
72  
73 =head1 APPENDIX
74  
75 The rest of the documentation details each of the object methods.
76 Internal methods are usually preceded with a _
77  
78 =cut
79  
80  
81 # Let the code begin...
82  
83  
84 package Bio::SeqFeature::CollectionI;
85 2 $Bio::SeqFeature::CollectionI::VERSION = '1.7.8';
86 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
87 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
88  
89 2 ▶use base qw(Bio::Root::RootI);
Subroutine BEGIN: called CC=1 SCAR=0.0
90  
91  
92 =head2 add_features
93  
94 Title : add_features
95 Usage : $collection->add_features(\@features);
96 Function:
97 Returns : number of features added
98 Args : arrayref of Bio::SeqFeatureI objects to index
99  
100 =cut
101  
102 0 ▶sub add_features{
Subroutine add_features: not called CC=1 SCAR=6.9
Pod documented
103 0 shift->throw_not_implemented();
104 }
105  
106  
107 =head2 features
108  
109 Title : features
110 Usage : my @f = $collection->features(@args);
111 Returns : a list of Bio::SeqFeatureI objects
112 Args : see below
113 Status : public
114  
115 This routine will retrieve features associated with this collection
116 object. It can be used to return all features, or a subset based on
117 their type, location, or attributes.
118  
119 -types List of feature types to return. Argument is an array
120 of Bio::Das::FeatureTypeI objects or a set of strings
121 that can be converted into FeatureTypeI objects.
122  
123 -callback A callback to invoke on each feature. The subroutine
124 will be passed to each Bio::SeqFeatureI object in turn.
125  
126 -attributes A hash reference containing attributes to match.
127  
128 The -attributes argument is a hashref containing one or more attributes
129 to match against:
130  
131 -attributes => { Gene => 'abc-1',
132 Note => 'confirmed' }
133  
134 Attribute matching is simple exact string matching, and multiple
135 attributes are ANDed together. See L<Bio::DB::ConstraintsI> for a
136 more sophisticated take on this.
137  
138 If one provides a callback, it will be invoked on each feature in
139 turn. If the callback returns a false value, iteration will be
140 interrupted. When a callback is provided, the method returns undef.
141  
142 =cut
143  
144 0 ▶sub features{
Subroutine features: not called CC=1 SCAR=6.9
Pod documented
145 0 shift->throw_not_implemented();
146 }
147  
148 2 1;
« Bio/Ontology/DocumentRegistry.pm ↑ Summary Bio/Ontology/RelationshipFactory.pm »