[Bioperl-l] sorting and indexing matricies

Marc Logghe Marc.Logghe at devgen.com
Wed Jun 25 10:48:49 EDT 2003


I did not try it myself, but you might try out Sort::ArrayOfArrays on cpan:
http://search.cpan.org/author/EARL/Sort-ArrayOfArrays-1.00/ArrayOfArrays.pm
Hope this helps,
Marc

> -----Original Message-----
> From: PD Schloss [mailto:pds at plantpath.wisc.edu]
> Sent: Tuesday, June 24, 2003 10:17 PM
> To: bioperl-l at portal.open-bio.org
> Subject: [Bioperl-l] sorting and indexing matricies
> 
> 
> Hello,
> 
> I have a distance matrix that I am working with and I would 
> like to sort
> it so that the columns and rows containing the smallest 
> distance are in
> the first and second rows and columns.  I understand how to sort a
> simple array, however, I am confused as to how I do it with 
> an array of
> arrays.  I'm a beginner so I realize that constructing a 
> matrix this way
> may not be the most efficient, but at this point I think I 
> would prefer
> to do it this way.  If you have any thoughts on how to do this type of
> sort, I'd appreciate it.
> 
> Also, the only way I can figure out how to write out the 
> contents of my
> matrix is by nesting for loops.  Is there a way to write out 
> individual
> columns and rows without doing these for loops?  I guess I'm 
> thinking of
> MatLab that let's you do something like @matrix[0][:] (for the first
> row/column of the matrix).
> 
> Thanks for your help,
> Pat Schloss
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 


More information about the Bioperl-l mailing list