in reply to Re: Sort a matrix by row
in thread Sort a matrix by row
Thanks a lot! it works fine to sort according to transcripts (t1 and then t2). And in my example, it reorders "de facto" alleles. But it won't always be the case in my file...
Sorting according to transcripts is the first step I want to achieve. But then I want to sort alleles according to another array, let's say :
my @alleles_origin = (a3,a2,a1);The number of members in @alleles_origin is the same for each transcript (t1 and t2). So I could generate an array of the same length as the others to integrate it to the matrix, so that my new matrix would be :
my @new_matrix = ( [t1 t1 t1 t2 t2 t2], [a1 a2 a3 a1 a2 a3], <- what we have [a3 a2 a1 a3 a2 a1], <- what we want for each transcript [mis mis del mis mis syn], );
But then, how coud I reorder my effects comparing the two lines of alleles, for each transcript (because effects can be different according to t1 or t2..)??
Thank you so much in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sort a matrix by row
by haukex (Archbishop) on Aug 30, 2022 at 17:21 UTC | |
by soblanc (Acolyte) on Aug 31, 2022 at 13:45 UTC |