/** * Get index of first occurence of codon after given startCodonNum * * @param sequence * @param startCodonNum * @return codon number of first occurence, -1 if no match or null sequence input */ public static int indexOfCodon(String sequence, String codon, int startCodonNum) { if (sequence == null || codon == null) return -1; int codonPos = StringUtils.indexOf(sequence, codon, startCodonNum * 3) + 1; // NT // pos // starts // at // 1 // not // 0 return SequenceUtils.getCodonNum(codonPos); }