.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::Matrix::Generic 3pm" .TH Bio::Matrix::Generic 3pm "2021-08-15" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Matrix::Generic \- A generic matrix implementation .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& # A matrix has columns and rows \& my $matrix = Bio::Matrix::Generic\->new; \& $matrix\->add_column(1,$column1); \& $matrix\->add_column(2,$column2); \& \& my $element = $matrix\->entry_by_num(1,2); \& $matrix\->entry_by_num(1,2,$newval); \& \& my $entry = $matrix\->entry(\*(Aqhuman\*(Aq, \*(Aqmouse\*(Aq); \& \& $matrix\->entry(\*(Aqhuman\*(Aq,\*(Aqmouse\*(Aq, $newval); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a general purpose matrix object for dealing with row+column data which is typical when enumerating all the pairwise combinations and desiring to get slices of the data. .PP Data can be accessed by column and row names or indexes. Matrix indexes start at 0. .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "Mailing Lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting Bugs" .IX Subsection "Reporting Bugs" Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR \- Jason Stajich" .IX Header "AUTHOR - Jason Stajich" Email jason-at-bioperl-dot-org .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "new" .IX Subsection "new" .Vb 10 \& Title : new \& Usage : my $obj = Bio::Matrix::Generic\->new(); \& Function: Builds a new Bio::Matrix::Generic object \& Returns : an instance of Bio::Matrix::Generic \& Args : \-values => arrayref of arrayrefs of data initialization \& \-rownames => arrayref of row names \& \-colnames => arrayref of col names \& \-matrix_id => id of the matrix \& \-matrix_name=> name of the matrix \& \-matrix_init_value => default value to initialize empty cells .Ve .SS "matrix_id" .IX Subsection "matrix_id" .Vb 5 \& Title : matrix_id \& Usage : my $id = $matrix\->matrix_id \& Function: Get/Set the matrix ID \& Returns : scalar value \& Args : [optional] new id value to store .Ve .SS "matrix_name" .IX Subsection "matrix_name" .Vb 5 \& Title : matrix_name \& Usage : my $name = $matrix\->matrix_name(); \& Function: Get/Set the matrix name \& Returns : scalar value \& Args : [optional] new matrix name value .Ve .SS "entry" .IX Subsection "entry" .Vb 9 \& Title : entry \& Usage : my $entry = $matrix\->entry($row,$col,$value) \& Function: Get the value for a specific cell as specified \& by the row and column names \& Returns : scalar value or undef if row or col does not \& exist \& Args : $rowname \- name of the row \& $colname \- column name \& $value \- [optional] New value for the entry .Ve .SS "get_entry" .IX Subsection "get_entry" .Vb 7 \& Title : get_entry \& Usage : my $entry = $matrix\->get_entry($rowname,$columname,$value) \& Function: Get the entry for a given row,column pair \& Returns : scalar \& Args : $row name \& $column name \& $value .Ve .SS "entry_by_num" .IX Subsection "entry_by_num" .Vb 9 \& Title : entry_by_num \& Usage : my $entry = $matrix\->entry_by_num($rownum,$colnum) \& Function: Get an entry by row and column numbers instead of by name \& (rows and columns start at 0) \& Returns : scalar value or undef if row or column name does not \& exist \& Args : $row \- row number \& $col \- column number \& [optional] $newvalue to store at this cell .Ve .SS "column" .IX Subsection "column" .Vb 11 \& Title : column \& Usage : my @col = $matrix\->column(\*(AqALPHA\*(Aq); \& OR \& $matrix\->column(\*(AqALPHA\*(Aq, \e@col); \& Function: Get/Set a particular column \& Returns : Array (in array context) or arrayref (in scalar context) \& of values. \& For setting will warn if the new column is of a different \& length from the rest of the columns. \& Args : name of the column \& [optional] new column to store here .Ve .SS "get_column" .IX Subsection "get_column" .Vb 6 \& Title : get_column \& Usage : my @row = $matrix\->get_column(\*(AqALPHA\*(Aq); \& Function: Get a particular column \& Returns : Array (in array context) or arrayref (in scalar context) \& of values \& Args : name of the column .Ve .SS "column_by_num" .IX Subsection "column_by_num" .Vb 10 \& Title : column_by_num \& Usage : my @col = $matrix\->column_by_num(1); \& OR \& $matrix\->column_by_num(1,\e@newcol); \& Function: Get/Set a column by its number instead of name \& (cols/rows start at 0) \& Returns : Array (in array context) or arrayref (in scalar context) \& of values \& Args : name of the column \& [optional] new value to store for a particular column .Ve .SS "row" .IX Subsection "row" .Vb 8 \& Title : row \& Usage : my @row = $matrix\->row($rowname); \& OR \& $matrix\->row($rowname,\e@rowvalues); \& Function: Get/Set the row of the matrix \& Returns : Array (in array context) or arrayref (in scalar context) \& Args : rowname \& [optional] new value of row to store .Ve .SS "get_row" .IX Subsection "get_row" .Vb 6 \& Title : get_row \& Usage : my @row = $matrix\->get_row(\*(AqALPHA\*(Aq); \& Function: Get a particular row \& Returns : Array (in array context) or arrayref (in scalar context) \& of values \& Args : name of the row .Ve .SS "row_by_num" .IX Subsection "row_by_num" .Vb 8 \& Title : row_by_num \& Usage : my @row = $matrix\->row_by_num($rownum); \& OR \& $matrix\->row($rownum,\e@rowvalues); \& Function: Get/Set the row of the matrix \& Returns : Array (in array context) or arrayref (in scalar context) \& Args : rowname \& [optional] new value of row to store .Ve .SS "diagonal" .IX Subsection "diagonal" .Vb 6 \& Title : diagonal \& Usage : my @diagonal = $matrix\->get_diagonal() \& Function: Get the diagonal of a matrix \& Returns : Array (in array context) or arrayref (in scalar context) \& of values which lie along the diagonal \& Args : none .Ve .SS "add_row" .IX Subsection "add_row" .Vb 12 \& Title : add_row \& Usage : $matrix\->add_row($index,\e@newrow); \& Function: Adds a row at particular location in the matrix. \& If $index < the rowcount will shift all the rows down \& by the number of new rows. \& To add a single empty row, simply call \& $matrix\->add_row($index,undef); \& Returns : the updated number of total rows in the matrix \& Args : index to store \& name of the row (header) \& newrow to add, if this is undef will add a single \& row with all values set to undef .Ve .SS "remove_row" .IX Subsection "remove_row" .Vb 6 \& Title : remove_row \& Usage : $matrix\->remove_row($colnum) \& Function: remove a row from the matrix shifting all the rows \& up by one \& Returns : Updated number of rows in the matrix \& Args : row index .Ve .SS "add_column" .IX Subsection "add_column" .Vb 12 \& Title : add_column \& Usage : $matrix\->add_column($index,$colname,\e@newcol); \& Function: Adds a column at particular location in the matrix. \& If $index < the colcount will shift all the columns right \& by the number of new columns. \& To add a single empty column, simply call \& $matrix\->add_column($index,undef); \& Returns : the updated number of total columns in the matrix \& Args : index to store \& name of the column (header) \& newcolumn to add, if this is undef will add a single \& column with all values set to undef .Ve .SS "remove_column" .IX Subsection "remove_column" .Vb 6 \& Title : remove_column \& Usage : $matrix\->remove_column($colnum) \& Function: remove a column from the matrix shifting all the columns \& to the left by one \& Returns : Updated number of columns in the matrix \& Args : column index .Ve .SS "column_num_for_name" .IX Subsection "column_num_for_name" .Vb 5 \& Title : column_num_for_name \& Usage : my $num = $matrix\->column_num_for_name($name) \& Function: Gets the column number for a particular column name \& Returns : integer \& Args : string .Ve .SS "row_num_for_name" .IX Subsection "row_num_for_name" .Vb 5 \& Title : row_num_for_name \& Usage : my $num = $matrix\->row_num_for_name \& Function: Gets the row number for a particular row name \& Returns : integer \& Args : string .Ve .SS "column_header" .IX Subsection "column_header" .Vb 5 \& Title : column_header \& Usage : my $name = $matrix\->column_header(0) \& Function: Gets the column header for a particular column number \& Returns : string \& Args : integer .Ve .SS "row_header" .IX Subsection "row_header" .Vb 5 \& Title : row_header \& Usage : my $name = $matrix\->row_header(0) \& Function: Gets the row header for a particular row number \& Returns : string \& Args : integer .Ve .SS "num_rows" .IX Subsection "num_rows" .Vb 5 \& Title : num_rows \& Usage : my $rowcount = $matrix\->num_rows; \& Function: Get the number of rows \& Returns : integer \& Args : none .Ve .SS "num_columns" .IX Subsection "num_columns" .Vb 5 \& Title : num_columns \& Usage : my $colcount = $matrix\->num_columns \& Function: Get the number of columns \& Returns : integer \& Args : none .Ve .SS "row_names" .IX Subsection "row_names" .Vb 5 \& Title : row_names \& Usage : my @rows = $matrix\->row_names \& Function: The names of all the rows \& Returns : array in array context, arrayref in scalar context \& Args : none .Ve .SS "column_names" .IX Subsection "column_names" .Vb 5 \& Title : column_names \& Usage : my @columns = $matrix\->column_names \& Function: The names of all the columns \& Returns : array in array context, arrayref in scalar context \& Args : none .Ve .SS "private methods" .IX Subsection "private methods" Private methods for a Generic Matrix .SS "_values" .IX Subsection "_values" .Vb 6 \& Title : _values \& Usage : $matrix\->_values(); \& Function: get/set for array ref of the matrix containing \& distance values \& Returns : an array reference \& Args : an array reference .Ve