JAL-98 ProfileI interface for Profile
[jalview.git] / src / jalview / analysis / AAFrequency.java
index 30d5373..6bdffe1 100755 (executable)
@@ -25,6 +25,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.Profile;
+import jalview.datamodel.ProfileI;
 import jalview.datamodel.ResidueCount;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.ResidueCount.SymbolCounts;
@@ -64,13 +65,13 @@ public class AAFrequency
     }
   }
 
-  public static final Profile[] calculate(List<SequenceI> list,
+  public static final ProfileI[] calculate(List<SequenceI> list,
           int start, int end)
   {
     return calculate(list, start, end, false);
   }
 
-  public static final Profile[] calculate(List<SequenceI> sequences,
+  public static final ProfileI[] calculate(List<SequenceI> sequences,
           int start, int end, boolean profile)
   {
     SequenceI[] seqs = new SequenceI[sequences.size()];
@@ -86,7 +87,7 @@ public class AAFrequency
         }
       }
 
-      Profile[] reply = new Profile[width];
+      ProfileI[] reply = new ProfileI[width];
 
       if (end >= width)
       {
@@ -112,7 +113,7 @@ public class AAFrequency
    *          if true, store all symbol counts
    */
   public static final void calculate(final SequenceI[] sequences,
-          int start, int end, Profile[] result, boolean saveFullProfile)
+          int start, int end, ProfileI[] result, boolean saveFullProfile)
   {
     // long now = System.currentTimeMillis();
     int seqCount = sequences.length;
@@ -172,7 +173,7 @@ public class AAFrequency
       int maxCount = residueCounts.getModalCount();
       String maxResidue = residueCounts.getResiduesForCount(maxCount);
       int gapCount = residueCounts.getGapCount();
-      Profile profile = new Profile(seqCount, gapCount, maxCount,
+      ProfileI profile = new Profile(seqCount, gapCount, maxCount,
               maxResidue);
 
       if (saveFullProfile)
@@ -233,7 +234,7 @@ public class AAFrequency
    *          number of sequences
    */
   public static void completeConsensus(AlignmentAnnotation consensus,
-          Profile[] profiles, int iStart, int width, boolean ignoreGaps,
+          ProfileI[] profiles, int iStart, int width, boolean ignoreGaps,
           boolean showSequenceLogo, long nseq)
   {
     // long now = System.currentTimeMillis();
@@ -251,7 +252,7 @@ public class AAFrequency
 
     for (int i = iStart; i < width; i++)
     {
-      Profile profile;
+      ProfileI profile;
       if (i >= profiles.length || ((profile = profiles[i]) == null))
       {
         /*
@@ -301,7 +302,7 @@ public class AAFrequency
    *          the number of decimal places to format percentages to
    * @return
    */
-  static String getTooltip(Profile profile, float pid,
+  static String getTooltip(ProfileI profile, float pid,
           boolean showSequenceLogo, boolean ignoreGaps, int dp)
   {
     ResidueCount counts = profile.getCounts();
@@ -352,7 +353,7 @@ public class AAFrequency
    *          calculations
    * @return
    */
-  public static int[] extractProfile(Profile profile,
+  public static int[] extractProfile(ProfileI profile,
           boolean ignoreGaps)
   {
     int[] rtnval = new int[64];