in reply to Re: Complex sort of array of hashes into an array of arrays
in thread Complex sort of array of hashes into an array of arrays
Thank you all for are your answers, I think all of them works for me but more important I learned a lot about sorting and data structures.
I am working now on adapting that code to my (bigger) program.
I will post that part of the code once done if you think it may be useful for anyone.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Complex sort of array of hashes into an array of arrays
by BioJL (Initiate) on Nov 24, 2010 at 11:42 UTC | |
I have a previous code reading the matrix from a file and storing it in the @matrix array of hashes with the structure I showed in the previous post. Sorting each row of the original matrix by nucleotide frequency and copying it to another matrix keeping the original position of the row, the nucleotides frequencies and then the nucleotides corresponding to the frequencies in the same order. [OriPos, F1, F2, F3, F4, N1, N2, N3, N4]where F1 is the most frequent nucleotide and N1 is his corresponding letter.
Sorting the rows of the matrix by the most frequent nucleotide column, then the 2nd, 3rd, 4th and last by original position
And here i get my matrix completely sorted :)
| [reply] [d/l] [select] |