}\r
\r
/** */\r
+ static boolean sortIdAscending = true;\r
public static void sortByID(AlignmentI align) {\r
int nSeq = align.getHeight();\r
\r
\r
QuickSort.sort(ids,seqs);\r
\r
- setReverseOrder(align,seqs);\r
+ if(sortIdAscending)\r
+ setReverseOrder(align,seqs);\r
+ else\r
+ setOrder(align, seqs);\r
+\r
+ sortIdAscending = !sortIdAscending;\r
}\r
\r
+ static boolean sortGroupAscending = true;\r
public static void sortByGroup(AlignmentI align) {\r
int nSeq = align.getHeight();\r
Vector groups = align.getGroups();\r
}\r
}\r
\r
- setOrder(align,seqs);\r
+ if(sortGroupAscending)\r
+ setOrder(align,seqs);\r
+ else\r
+ setReverseOrder( align, vectorToArray(seqs));\r
+\r
+ sortGroupAscending = ! sortGroupAscending;\r
}\r
\r
private static SequenceI [] vectorToArray(Vector tmp) {\r
return seqs;\r
}\r
\r
+ static boolean sortTreeAscending = true;\r
public static void sortByTree(AlignmentI align, NJTree tree) {\r
int nSeq = align.getHeight();\r
\r
}\r
}\r
\r
- setOrder(align,tmp);\r
+ if(sortTreeAscending)\r
+ setOrder(align,tmp);\r
+ else\r
+ setReverseOrder(align, vectorToArray(tmp));\r
+\r
+ sortTreeAscending = !sortTreeAscending;\r
}\r
\r
private static void addStrays(AlignmentI align, Vector seqs) {\r