public static String getChrom(String chromName) { Matcher m = chromPattern.matcher(chromName); if (!m.matches()) { return chromName; } return m.group(1); }
public static String removePrimerLR(String pname) { Matcher m = primerLRPattern.matcher(pname); if (!m.matches()) { throw new IllegalArgumentException(pname); } return m.group(1); }
public static int[] decodePrimerName(String pname) { Matcher m = primerNamePattern.matcher(pname); if (!m.matches()) { throw new IllegalArgumentException(pname); } int[] a = new int[3]; a[0] = Integer.parseInt(m.group(1)); a[1] = Integer.parseInt(m.group(2)); a[2] = Integer.parseInt(m.group(3)); return a; }