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

Method isValidGt

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

Check whether the split GT array references valid allele IDs @param rec the record containing ref and alt alleles @param gt the split GT. @return false if any of the GT elements are out of range.

(VcfRecord rec, int[] gt)

Source from the content-addressed store, hash-verified

292 * @return false if any of the GT elements are out of range.
293 */
294 public static boolean isValidGt(VcfRecord rec, int[] gt) {
295 final int maxId = rec.getAltCalls().size();
296 for (int gtId : gt) {
297 if (gtId < MISSING_GT || gtId > maxId) {
298 return false;
299 }
300 }
301 return true;
302 }
303
304 /**
305 * Check if the supplied file is has an extension indicative of VCF.

Callers 4

decomposeMethod · 0.95
mainExecMethod · 0.95
tallyVariantMethod · 0.95
getValidGtMethod · 0.95

Calls 2

getAltCallsMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected