MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / getValidGt

Method getValidGt

src/main/java/com/rtg/vcf/VcfUtils.java:755–761  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 15

testGtPropertiesMethod · 0.95
acceptMethod · 0.95
acceptMethod · 0.95
acceptMethod · 0.95
acceptMethod · 0.95
isHomozygousAltMethod · 0.95
isHeterozygousMethod · 0.95
isHaploidMethod · 0.95
isDiploidMethod · 0.95
hasDefinedVariantGtMethod · 0.95
getValueMethod · 0.95
getValueMethod · 0.95

Calls 4

splitGtMethod · 0.95
getValidGtStrMethod · 0.95
isValidGtMethod · 0.95
toStringMethod · 0.65

Tested by 5

testGtPropertiesMethod · 0.76
acceptMethod · 0.76
acceptMethod · 0.76
acceptMethod · 0.76
acceptMethod · 0.76