JAL-2505 unit test for sort by feature density, Javadoc
[jalview.git] / src / jalview / analysis / AlignmentSorter.java
index 6c46a3e..cc4c469 100755 (executable)
@@ -33,7 +33,6 @@ import jalview.util.MessageManager;
 import jalview.util.QuickSort;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -682,35 +681,6 @@ public class AlignmentSorter
 
   public static String FEATURE_DENSITY = "density";
 
-  /**
-   * sort the alignment using the features on each sequence found between start
-   * and stop with the given featureLabel (and optional group qualifier)
-   * 
-   * @param featureLabel
-   *          (may not be null)
-   * @param groupLabel
-   *          (may be null)
-   * @param start
-   *          (-1 to include non-positional features)
-   * @param stop
-   *          (-1 to only sort on non-positional features)
-   * @param alignment
-   *          - aligned sequences containing features
-   * @param method
-   *          - one of the string constants FEATURE_SCORE, FEATURE_LABEL,
-   *          FEATURE_DENSITY
-   */
-  public static void sortByFeature(String featureLabel, String groupLabel,
-          int start, int stop, AlignmentI alignment, String method)
-  {
-    sortByFeature(
-            featureLabel == null ? null
-                    : Arrays.asList(new String[] { featureLabel }),
-            groupLabel == null ? null : Arrays
-                    .asList(new String[] { groupLabel }), start, stop,
-            alignment, method);
-  }
-
   private static boolean containsIgnoreCase(final String lab,
           final List<String> labs)
   {
@@ -732,6 +702,26 @@ public class AlignmentSorter
     return false;
   }
 
+  /**
+   * Sort sequences by feature score or density, optionally restricted by
+   * feature types, feature groups, or alignment start/end positions.
+   * <p>
+   * If the sort is repeated for the same combination of types and groups, sort
+   * order is reversed.
+   * 
+   * @param featureLabels
+   *          a list of feature types to include (or null for all)
+   * @param groupLabels
+   *          a list of feature groups to include (or null for all)
+   * @param start
+   *          start column position to include (base zero)
+   * @param stop
+   *          end column position to include (base zero)
+   * @param alignment
+   *          the alignment to be sorted
+   * @param method
+   *          either "average_score" or "density" ("text" not yet implemented)
+   */
   public static void sortByFeature(List<String> featureLabels,
           List<String> groupLabels, int start, int stop,
           AlignmentI alignment, String method)