Merge branch 'feature/JAL-2909bamfiles_features' into features/JAL-2909_bamImport2_11
[jalview.git] / src / jalview / datamodel / CigarBase.java
index 4e7e03f..a44d74b 100644 (file)
@@ -191,76 +191,6 @@ public abstract class CigarBase
   }
 
   /**
-   * turn a cigar string into a series of operation range pairs
-   * 
-   * @param cigarString
-   *          String
-   * @return object[] {char[] operation, int[] range}
-   * @throws java.lang.Exception
-   *           for improperly formated cigar strings or ones with unknown
-   *           operations
-   */
-  public static Object[] parseCigarString(String cigarString)
-          throws Exception
-  {
-    int ops = 0;
-    for (int i = 0, l = cigarString.length(); i < l; i++)
-    {
-      char c = cigarString.charAt(i);
-      if (c == M || c == (M - _case_shift) || c == I
-              || c == (I - _case_shift) || c == D || c == (D - _case_shift))
-      {
-        ops++;
-      }
-    }
-    char[] operation = new char[ops];
-    int[] range = new int[ops];
-    int op = 0;
-    int i = 0, l = cigarString.length();
-    while (i < l)
-    {
-      char c;
-      int j = i;
-      do
-      {
-        c = cigarString.charAt(j++);
-      } while (c >= '0' && c <= '9' && j < l);
-      if (j >= l && c >= '0' && c <= '9')
-      {
-        throw new Exception(MessageManager
-                .getString("exception.unterminated_cigar_string"));
-      }
-      try
-      {
-        String rangeint = cigarString.substring(i, j - 1);
-        range[op] = Integer.parseInt(rangeint);
-        i = j;
-      } catch (Exception e)
-      {
-        throw new Error(MessageManager
-                .getString("error.implementation_bug_parse_cigar_string"));
-      }
-      if (c >= 'a' && c <= 'z')
-      {
-        c -= _case_shift;
-      }
-      if ((c == M || c == I || c == D))
-      {
-        operation[op++] = c;
-      }
-      else
-      {
-        throw new Exception(MessageManager.formatMessage(
-                "exception.unexpected_operation_cigar_string_pos",
-                new String[]
-                { new StringBuffer(c).toString(),
-                    Integer.valueOf(i).toString(), cigarString }));
-      }
-    }
-    return new Object[] { operation, range };
-  }
-
-  /**
    * add an operation to cigar string
    * 
    * @param op