line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# BioPerl module for Bio::ClusterI |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Please direct questions and support issues to |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Cared for by Shawn Hoon |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright Shawn Hoon |
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::ClusterI - Cluster Interface |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# see the implementations of this interface for details |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $cluster= $cluster->new(-description=>"POLYUBIQUITIN", |
23
|
|
|
|
|
|
|
-members =>[$seq1,$seq2]); |
24
|
|
|
|
|
|
|
my @members = $cluster->get_members(); |
25
|
|
|
|
|
|
|
my @sub_members = $cluster->get_members(-species=>"homo sapiens"); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
This interface is the basic structure for a cluster of bioperl objects. |
31
|
|
|
|
|
|
|
In this case it is up to the implementer to check arguments |
32
|
|
|
|
|
|
|
and initialize whatever new object the implementing class is designed for. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 FEEDBACK |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 Mailing Lists |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
User feedback is an integral part of the evolution of this and other |
39
|
|
|
|
|
|
|
Bioperl modules. Send your comments and suggestions preferably to |
40
|
|
|
|
|
|
|
the Bioperl mailing list. Your participation is much appreciated. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
bioperl-l@bioperl.org - General discussion |
43
|
|
|
|
|
|
|
http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 Support |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Please direct usage questions or support issues to the mailing list: |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
I |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
rather than to the module maintainer directly. Many experienced and |
52
|
|
|
|
|
|
|
reponsive experts will be able look at the problem and quickly |
53
|
|
|
|
|
|
|
address it. Please include a thorough description of the problem |
54
|
|
|
|
|
|
|
with code and data examples if at all possible. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 Reporting Bugs |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Report bugs to the Bioperl bug tracking system to help us keep track |
59
|
|
|
|
|
|
|
of the bugs and their resolution. Bug reports can be submitted via the |
60
|
|
|
|
|
|
|
web: |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
https://github.com/bioperl/bioperl-live/issues |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR - Shawn Hoon |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Email shawnh@fugu-sg.org |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 APPENDIX |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
The rest of the documentation details each of the object methods. |
71
|
|
|
|
|
|
|
Internal methods are usually preceded with a _ |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Let the code begin... |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
package Bio::ClusterI; |
79
|
4
|
|
|
4
|
|
17
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
95
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
4
|
|
|
4
|
|
12
|
use base qw(Bio::Root::RootI); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
498
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 Implementation Specific Functions |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
These functions are the ones that a specific implementation must |
87
|
|
|
|
|
|
|
define. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 new |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
We don't mandate but encourage implementors to support at least the |
92
|
|
|
|
|
|
|
following named parameters upon object initialization. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Argument Description |
95
|
|
|
|
|
|
|
-------- ----------- |
96
|
|
|
|
|
|
|
-display_id the display ID or name for the cluster |
97
|
|
|
|
|
|
|
-description the consensus description or name of the cluster |
98
|
|
|
|
|
|
|
-members the array of objects belonging to the family |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 display_id |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Title : display_id |
105
|
|
|
|
|
|
|
Usage : |
106
|
|
|
|
|
|
|
Function: Get the display name or identifier for the cluster |
107
|
|
|
|
|
|
|
Returns : a string |
108
|
|
|
|
|
|
|
Args : |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub display_id{ |
113
|
0
|
|
|
0
|
1
|
|
shift->throw_not_implemented(); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head2 description |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Title : description |
120
|
|
|
|
|
|
|
Usage : Bio::ClusterI->description("POLYUBIQUITIN") |
121
|
|
|
|
|
|
|
Function: get/set for the consensus description of the cluster |
122
|
|
|
|
|
|
|
Returns : the description string |
123
|
|
|
|
|
|
|
Args : Optional the description string |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=cut |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub description{ |
128
|
0
|
|
|
0
|
1
|
|
shift->throw_not_implemented(); |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head2 size |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Title : size |
134
|
|
|
|
|
|
|
Usage : Bio::ClusterI->size(); |
135
|
|
|
|
|
|
|
Function: get/set for the size of the family, |
136
|
|
|
|
|
|
|
calculated from the number of members |
137
|
|
|
|
|
|
|
Returns : the size of the family |
138
|
|
|
|
|
|
|
Args : |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=cut |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub size { |
143
|
0
|
|
|
0
|
1
|
|
shift->throw_not_implemented(); |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head2 cluster_score |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Title : cluster_score |
149
|
|
|
|
|
|
|
Usage : $cluster ->cluster_score(100); |
150
|
|
|
|
|
|
|
Function: get/set for cluster_score which |
151
|
|
|
|
|
|
|
represent the score in which the clustering |
152
|
|
|
|
|
|
|
algorithm assigns to this cluster. |
153
|
|
|
|
|
|
|
Returns : a number |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=cut |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub cluster_score{ |
158
|
0
|
|
|
0
|
1
|
|
shift->throw_not_implemented(); |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head2 get_members |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Title : get_members |
164
|
|
|
|
|
|
|
Usage : Bio::ClusterI->get_members(($seq1, $seq2)); |
165
|
|
|
|
|
|
|
Function: retrieve the members of the family by some criteria, for |
166
|
|
|
|
|
|
|
example : |
167
|
|
|
|
|
|
|
$cluster->get_members(-species => 'homo sapiens'); |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
Will return all members if no criteria are provided. |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Returns : the array of members |
172
|
|
|
|
|
|
|
Args : |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=cut |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub get_members { |
177
|
0
|
|
|
0
|
1
|
|
shift->throw_not_implemented(); |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
1; |