JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / analysis / ParseProperties.java
index 3347800..9937a47 100644 (file)
  */
 package jalview.analysis;
 
-import com.stevesoft.pat.Regex;
-
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
+import jalview.util.Platform;
+
+import com.stevesoft.pat.Regex;
 
 public class ParseProperties
 {
@@ -57,9 +58,9 @@ public class ParseProperties
   public int getScoresFromDescription(String ScoreName,
           String ScoreDescriptions, String regex, boolean repeat)
   {
-    return getScoresFromDescription(new String[]
-    { ScoreName }, new String[]
-    { ScoreDescriptions }, regex, repeat);
+    return getScoresFromDescription(new String[] { ScoreName },
+            new String[]
+            { ScoreDescriptions }, regex, repeat);
   }
 
   public int getScoresFromDescription(String[] ScoreNames,
@@ -86,12 +87,11 @@ public class ParseProperties
    *          description string of each sequence
    * @return total number of sequences that matched the regex
    */
-  public int getScoresFromDescription(SequenceI[] seqs,
-          String[] ScoreNames, String[] ScoreDescriptions, String regex,
-          boolean repeat)
+  public int getScoresFromDescription(SequenceI[] seqs, String[] ScoreNames,
+          String[] ScoreDescriptions, String regex, boolean repeat)
   {
     int count = 0;
-    Regex pattern = new Regex(regex);
+    Regex pattern = Platform.newRegex(regex, null);
     if (pattern.numSubs() > ScoreNames.length)
     {
       // Check that we have enough labels and descriptions for any parsed
@@ -142,8 +142,8 @@ public class ParseProperties
             continue;
           }
           // add score to sequence annotation.
-          AlignmentAnnotation an = new AlignmentAnnotation(ScoreNames[cols]
-                  + ((reps > 0) ? "_" + reps : ""),
+          AlignmentAnnotation an = new AlignmentAnnotation(
+                  ScoreNames[cols] + ((reps > 0) ? "_" + reps : ""),
                   ScoreDescriptions[cols], null);
           an.setScore(score);
           System.out.println(seqs[i].getName() + " score: '"