I have the following input data, showing only a few lines:
Pos A C G T 0 4 0 13 0 1 5 0 12 0 2 15 0 2 0 3 0 17 0 0
I stored that data into an array of hashes called @matrix. For instance $matrix[0]{A}=4 and so on.
I want to sort each line from highest frequency to lowest frequency and store it in another array of arrays, but I also need to remember wich letter corresponds to each number
I thought it would be a good idea to store the nucleotide order at the end of the array, here is an example with the first lines that i would like to obtain:
First number is original position. I put it there because then i would like to sort the matrix by the top most score of each row.
[0 13 4 0 0 G A C T] [1 12 5 0 0 G A C T] [2 15 2 0 0 A G C T] [3 17 0 0 0 C A G T]
I hope it's more clear now...
In reply to Re^2: Complex sort of array of hashes into an array of arrays
by BioJL
in thread Complex sort of array of hashes into an array of arrays
by BioJL
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |