| 1 | # $Id $ | ||
| 2 | # | ||
| 3 | # BioPerl module for Bio::Matrix::MatrixI | ||
| 4 | # | ||
| 5 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||
| 6 | # | ||
| 7 | # Cared for by Jason Stajich <jason-at-bioperl.org> | ||
| 8 | # | ||
| 9 | # Copyright Jason Stajich | ||
| 10 | # | ||
| 11 | # You may distribute this module under the same terms as perl itself | ||
| 12 | |||
| 13 | # POD documentation - main docs before the code | ||
| 14 | |||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | Bio::Matrix::MatrixI - An interface for describing a Matrix | ||
| 18 | |||
| 19 | =head1 SYNOPSIS | ||
| 20 | |||
| 21 | # Get a Matrix object | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | This is an interface describing how one should be able to interact | ||
| 26 | with a matrix. One can have a lot of information I suppose and this | ||
| 27 | outline won't really work for PWM or PSSMs. We will have to derive a | ||
| 28 | particular interface for those. | ||
| 29 | |||
| 30 | =head1 FEEDBACK | ||
| 31 | |||
| 32 | =head2 Mailing Lists | ||
| 33 | |||
| 34 | User feedback is an integral part of the evolution of this and other | ||
| 35 | Bioperl modules. Send your comments and suggestions preferably to | ||
| 36 | the Bioperl mailing list. Your participation is much appreciated. | ||
| 37 | |||
| 38 | bioperl-l@bioperl.org - General discussion | ||
| 39 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||
| 40 | |||
| 41 | =head2 Support | ||
| 42 | |||
| 43 | Please direct usage questions or support issues to the mailing list: | ||
| 44 | |||
| 45 | I<bioperl-l@bioperl.org> | ||
| 46 | |||
| 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. | ||
| 51 | |||
| 52 | =head2 Reporting Bugs | ||
| 53 | |||
| 54 | Report bugs to the Bioperl bug tracking system to help us keep track | ||
| 55 | of the bugs and their resolution. Bug reports can be submitted via | ||
| 56 | email or the web: | ||
| 57 | |||
| 58 | https://github.com/bioperl/bioperl-live/issues | ||
| 59 | |||
| 60 | =head1 AUTHOR - Jason Stajich | ||
| 61 | |||
| 62 | Email jason-at-bioperl.org | ||
| 63 | |||
| 64 | =head1 APPENDIX | ||
| 65 | |||
| 66 | The rest of the documentation details each of the object methods. | ||
| 67 | Internal methods are usually preceded with a _ | ||
| 68 | |||
| 69 | =cut | ||
| 70 | |||
| 71 | |||
| 72 | # Let the code begin... | ||
| 73 | |||
| 74 | |||
| 75 | package Bio::Matrix::MatrixI; | ||
| 76 | 15 | $Bio::Matrix::MatrixI::VERSION = '1.7.8'; | |
| 77 | 15 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 78 | |||
| 79 | |||
| 80 | 15 | ▶ | use base qw(Bio::Root::RootI); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 81 | |||
| 82 | |||
| 83 | =head2 matrix_id | ||
| 84 | |||
| 85 | Title : matrix_id | ||
| 86 | Usage : my $id = $matrix->matrix_id | ||
| 87 | Function: Get the matrix ID | ||
| 88 | Returns : string value | ||
| 89 | Args : | ||
| 90 | |||
| 91 | |||
| 92 | =cut | ||
| 93 | |||
| 94 | 0 | ▶ | sub matrix_id{ |
|
Subroutine
matrix_id: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 95 | 0 | my ($self) = @_; | |
| 96 | 0 | $self->throw_not_implemented(); | |
| 97 | } | ||
| 98 | |||
| 99 | =head2 matrix_name | ||
| 100 | |||
| 101 | Title : matrix_name | ||
| 102 | Usage : my $name = $matrix->matrix_name(); | ||
| 103 | Function: Get the matrix name | ||
| 104 | Returns : string value | ||
| 105 | Args : | ||
| 106 | |||
| 107 | |||
| 108 | =cut | ||
| 109 | |||
| 110 | 0 | ▶ | sub matrix_name{ |
|
Subroutine
matrix_name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 111 | 0 | my ($self) = @_; | |
| 112 | |||
| 113 | 0 | $self->throw_not_implemented(); | |
| 114 | } | ||
| 115 | |||
| 116 | =head2 get_entry | ||
| 117 | |||
| 118 | Title : get_entry | ||
| 119 | Usage : my $entry = $matrix->get_entry($rowname,$columname) | ||
| 120 | Function: Get the entry for a given row,column pair | ||
| 121 | Returns : scalar | ||
| 122 | Args : $row name | ||
| 123 | $column name | ||
| 124 | |||
| 125 | |||
| 126 | =cut | ||
| 127 | |||
| 128 | 0 | ▶ | sub get_entry{ |
|
Subroutine
get_entry: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 129 | 0 | my ($self) = @_; | |
| 130 | |||
| 131 | 0 | $self->throw_not_implemented(); | |
| 132 | } | ||
| 133 | |||
| 134 | |||
| 135 | =head2 get_column | ||
| 136 | |||
| 137 | Title : get_column | ||
| 138 | Usage : my @row = $matrix->get_column('ALPHA'); | ||
| 139 | Function: Get a particular column | ||
| 140 | Returns : Array (in array context) or arrayref (in scalar context) | ||
| 141 | of values | ||
| 142 | Args : name of the column | ||
| 143 | |||
| 144 | |||
| 145 | =cut | ||
| 146 | |||
| 147 | 0 | ▶ | sub get_column{ |
|
Subroutine
get_column: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 148 | 0 | my ($self) = @_; | |
| 149 | 0 | $self->throw_not_implemented(); | |
| 150 | } | ||
| 151 | |||
| 152 | =head2 get_row | ||
| 153 | |||
| 154 | Title : get_row | ||
| 155 | Usage : my @row = $matrix->get_row('ALPHA'); | ||
| 156 | Function: Get a particular row | ||
| 157 | Returns : Array (in array context) or arrayref (in scalar context) | ||
| 158 | of values | ||
| 159 | Args : name of the row | ||
| 160 | |||
| 161 | =cut | ||
| 162 | |||
| 163 | 0 | ▶ | sub get_row{ |
|
Subroutine
get_row: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 164 | 0 | my ($self) = @_; | |
| 165 | 0 | $self->throw_not_implemented(); | |
| 166 | } | ||
| 167 | |||
| 168 | |||
| 169 | =head2 get_diagonal | ||
| 170 | |||
| 171 | Title : get_diagonal | ||
| 172 | Usage : my @diagonal = $matrix->get_diagonal; | ||
| 173 | Function: Get the diagonal of the matrix | ||
| 174 | Returns : Array (in array context) or arrayref (in scalar context) | ||
| 175 | Args : none | ||
| 176 | |||
| 177 | |||
| 178 | =cut | ||
| 179 | |||
| 180 | 0 | ▶ | sub get_diagonal{ |
|
Subroutine
get_diagonal: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 181 | 0 | my ($self) = @_; | |
| 182 | 0 | $self->throw_not_implemented(); | |
| 183 | } | ||
| 184 | |||
| 185 | =head2 column_num_for_name | ||
| 186 | |||
| 187 | Title : column_num_for_name | ||
| 188 | Usage : my $num = $matrix->column_num_for_name($name) | ||
| 189 | Function: Gets the column number for a particular column name | ||
| 190 | Returns : integer | ||
| 191 | Args : string | ||
| 192 | |||
| 193 | |||
| 194 | =cut | ||
| 195 | |||
| 196 | 0 | ▶ | sub column_num_for_name{ |
|
Subroutine
column_num_for_name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 197 | 0 | my ($self) = @_; | |
| 198 | |||
| 199 | 0 | $self->throw_not_implemented(); | |
| 200 | } | ||
| 201 | |||
| 202 | =head2 row_num_for_name | ||
| 203 | |||
| 204 | Title : row_num_for_name | ||
| 205 | Usage : my $num = $matrix->row_num_for_name($name) | ||
| 206 | Function: Gets the row number for a particular row name | ||
| 207 | Returns : integer | ||
| 208 | Args : string | ||
| 209 | |||
| 210 | |||
| 211 | =cut | ||
| 212 | |||
| 213 | 0 | ▶ | sub row_num_for_name{ |
|
Subroutine
row_num_for_name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 214 | 0 | my ($self) = @_; | |
| 215 | 0 | $self->throw_not_implemented(); | |
| 216 | } | ||
| 217 | |||
| 218 | =head2 num_rows | ||
| 219 | |||
| 220 | Title : num_rows | ||
| 221 | Usage : my $rowcount = $matrix->num_rows; | ||
| 222 | Function: Get the number of rows | ||
| 223 | Returns : integer | ||
| 224 | Args : none | ||
| 225 | |||
| 226 | |||
| 227 | =cut | ||
| 228 | |||
| 229 | 0 | ▶ | sub num_rows{ |
|
Subroutine
num_rows: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 230 | 0 | my ($self) = @_; | |
| 231 | 0 | $self->throw_not_implemented(); | |
| 232 | } | ||
| 233 | |||
| 234 | |||
| 235 | =head2 num_columns | ||
| 236 | |||
| 237 | Title : num_columns | ||
| 238 | Usage : my $colcount = $matrix->num_columns | ||
| 239 | Function: Get the number of columns | ||
| 240 | Returns : integer | ||
| 241 | Args : none | ||
| 242 | |||
| 243 | |||
| 244 | =cut | ||
| 245 | |||
| 246 | 0 | ▶ | sub num_columns{ |
|
Subroutine
num_columns: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 247 | 0 | my ($self) = @_; | |
| 248 | 0 | $self->throw_not_implemented(); | |
| 249 | } | ||
| 250 | |||
| 251 | |||
| 252 | # inverse? | ||
| 253 | =head2 reverse | ||
| 254 | |||
| 255 | Title : reverse | ||
| 256 | Usage : my $matrix = $matrix->reverse | ||
| 257 | Function: Get the reverse of a matrix | ||
| 258 | Returns : | ||
| 259 | Args : | ||
| 260 | |||
| 261 | |||
| 262 | =cut | ||
| 263 | |||
| 264 | 0 | ▶ | sub reverse{ |
|
Subroutine
reverse: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 265 | 0 | my ($self) = @_; | |
| 266 | 0 | $self->throw_not_implemented(); | |
| 267 | } | ||
| 268 | |||
| 269 | =head2 row_names | ||
| 270 | |||
| 271 | Title : row_names | ||
| 272 | Usage : my @rows = $matrix->row_names | ||
| 273 | Function: The names of all the rows | ||
| 274 | Returns : array in array context, arrayref in scalar context | ||
| 275 | Args : none | ||
| 276 | |||
| 277 | |||
| 278 | =cut | ||
| 279 | |||
| 280 | 0 | ▶ | sub row_names{ |
|
Subroutine
row_names: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 281 | 0 | my ($self) = @_; | |
| 282 | 0 | $self->throw_not_implemented(); | |
| 283 | } | ||
| 284 | |||
| 285 | |||
| 286 | =head2 column_names | ||
| 287 | |||
| 288 | Title : column_names | ||
| 289 | Usage : my @columns = $matrix->column_names | ||
| 290 | Function: The names of all the columns | ||
| 291 | Returns : array in array context, arrayref in scalar context | ||
| 292 | Args : none | ||
| 293 | |||
| 294 | |||
| 295 | =cut | ||
| 296 | |||
| 297 | 0 | ▶ | sub column_names{ |
|
Subroutine
column_names: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 298 | 0 | my ($self) = @_; | |
| 299 | 0 | $self->throw_not_implemented(); | |
| 300 | } | ||
| 301 | |||
| 302 | 15 | 1; | |