Get the split GT for a sample, with validation checking @param rec record to extract the GT from @param sample the sample index @return the split GT field @throws NoTalkbackSlimException if the record does not contain GT values, the sample is invalid, or the GT itself is invalid.
(VcfRecord rec, int sample)
| 753 | * @throws NoTalkbackSlimException if the record does not contain GT values, the sample is invalid, or the GT itself is invalid. |
| 754 | */ |
| 755 | public static int[] getValidGt(VcfRecord rec, int sample) { |
| 756 | final int[] gtArr = splitGt(getValidGtStr(rec, sample)); |
| 757 | if (!isValidGt(rec, gtArr)) { |
| 758 | throw new VcfFormatException("VCF record GT contains allele ID out of range, record: " + rec.toString()); |
| 759 | } |
| 760 | return gtArr; |
| 761 | } |
| 762 | |
| 763 | /** |
| 764 | * Get the string GT for a sample, with validation checking |