private GenotypeType getTypeSafeNull(Genotype genotype){ if(genotype == null) return GenotypeType.UNAVAILABLE; return genotype.getType(); }
/** * @return true if all observed alleles are ref; if any alleles are no-calls, this method will return false. */ public boolean isHomRef() { return getType() == GenotypeType.HOM_REF; }
/** * @return true if this genotype is comprised of both calls and no-calls. */ public boolean isMixed() { return getType() == GenotypeType.MIXED; }
/** * @return true if the type of this genotype is set. */ public boolean isAvailable() { return getType() != GenotypeType.UNAVAILABLE; }
/** * @return true if all observed alleles are alt; if any alleles are no-calls, this method will return false. */ public boolean isHomVar() { return getType() == GenotypeType.HOM_VAR; }
/** * @return true if this genotype is not actually a genotype but a "no call" (e.g. './.' in VCF); if any alleles are not no-calls (even if some are), this method will return false. */ public boolean isNoCall() { return getType() == GenotypeType.NO_CALL; }
/** * @return true if this genotype is not actually a genotype but a "no call" (e.g. './.' in VCF); if any alleles are not no-calls (even if some are), this method will return false. */ public boolean isNoCall() { return getType() == GenotypeType.NO_CALL; }
/** * @return true if all observed alleles are alt; if any alleles are no-calls, this method will return false. */ public boolean isHomVar() { return getType() == GenotypeType.HOM_VAR; }
/** * @return true if the type of this genotype is set. */ public boolean isAvailable() { return getType() != GenotypeType.UNAVAILABLE; }
/** * @return true if we're het (observed alleles differ); if the ploidy is less than 2 or if any alleles are no-calls, this method will return false. */ public boolean isHet() { return getType() == GenotypeType.HET; }
/** * @return true if all observed alleles are ref; if any alleles are no-calls, this method will return false. */ public boolean isHomRef() { return getType() == GenotypeType.HOM_REF; }
private int calculateTumorNNR(final VariantContext vc) { int nnr = 0; switch ( vc.getGenotype(tumorSample).getType() ) { case HET: case HOM_VAR: nnr += 1; break; case NO_CALL: case UNAVAILABLE: case HOM_REF: break; } return nnr; }
private int calculateTumorAC(final VariantContext vc) { int ac = 0; switch ( vc.getGenotype(tumorSample).getType() ) { case HET: ac += 1; break; case HOM_VAR: ac += 2; break; case NO_CALL: case UNAVAILABLE: case HOM_REF: break; } return ac; }
private void calculateGenotypeCounts() { if ( genotypeCounts == null ) { genotypeCounts = new int[GenotypeType.values().length]; for ( final Genotype g : getGenotypes() ) { genotypeCounts[g.getType().ordinal()]++; } } }
private void calculateGenotypeCounts() { if ( genotypeCounts == null ) { genotypeCounts = new int[GenotypeType.values().length]; for ( final Genotype g : getGenotypes() ) { genotypeCounts[g.getType().ordinal()]++; } } }
private void calculateGenotypeCounts() { if ( genotypeCounts == null ) { genotypeCounts = new int[GenotypeType.values().length]; for ( final Genotype g : getGenotypes() ) { genotypeCounts[g.getType().ordinal()]++; } } }
/** * @return true if we're het (observed alleles differ) and neither allele is reference; if the ploidy is less than 2 or if any alleles are no-calls, this method will return false. */ public boolean isHetNonRef() { return (getType() == GenotypeType.HET && getAllele(0).isNonReference() && getAllele(1).isNonReference()); }
private boolean checkGQIsGood(Genotype genotype) { if ( genotype.hasGQ() ) { return genotype.getGQ() >= minGenotypeQuality; } else if ( genotype.hasLikelihoods() ) { double log10gq = GenotypeLikelihoods.getGQLog10FromLikelihoods(genotype.getType().ordinal()-1,genotype.getLikelihoods().getAsVector()); return QualityUtils.phredScaleLog10ErrorRate(log10gq) >= minGenotypeQuality; } return minGenotypeQuality <= 0; }