/** * Genotype-specific functions -- how many hom ref calls are there in the genotypes? * * @return number of hom ref calls */ public int getHomRefCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.HOM_REF.ordinal()]; }
/** * Genotype-specific functions -- how many het calls are there in the genotypes? * * @return number of het calls */ public int getHetCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.HET.ordinal()]; }
/** * Genotype-specific functions -- how many het calls are there in the genotypes? * * @return number of het calls */ public int getHetCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.HET.ordinal()]; }
public EnumMap<GenotypeType,Double> getAsMap(boolean normalizeFromLog10){ //Make sure that the log10likelihoods are set double[] likelihoods = normalizeFromLog10 ? GeneralUtils.normalizeFromLog10(getAsVector()) : getAsVector(); if(likelihoods == null) return null; EnumMap<GenotypeType,Double> likelihoodsMap = new EnumMap<GenotypeType, Double>(GenotypeType.class); likelihoodsMap.put(GenotypeType.HOM_REF,likelihoods[GenotypeType.HOM_REF.ordinal()-1]); likelihoodsMap.put(GenotypeType.HET,likelihoods[GenotypeType.HET.ordinal()-1]); likelihoodsMap.put(GenotypeType.HOM_VAR, likelihoods[GenotypeType.HOM_VAR.ordinal() - 1]); return likelihoodsMap; }
/** * Genotype-specific functions -- how many mixed calls are there in the genotypes? * * @return number of mixed calls */ public int getMixedCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.MIXED.ordinal()]; }
public EnumMap<GenotypeType,Double> getAsMap(boolean normalizeFromLog10){ //Make sure that the log10likelihoods are set double[] likelihoods = normalizeFromLog10 ? GeneralUtils.normalizeFromLog10(getAsVector()) : getAsVector(); if(likelihoods == null) return null; EnumMap<GenotypeType,Double> likelihoodsMap = new EnumMap<GenotypeType, Double>(GenotypeType.class); likelihoodsMap.put(GenotypeType.HOM_REF,likelihoods[GenotypeType.HOM_REF.ordinal()-1]); likelihoodsMap.put(GenotypeType.HET,likelihoods[GenotypeType.HET.ordinal()-1]); likelihoodsMap.put(GenotypeType.HOM_VAR, likelihoods[GenotypeType.HOM_VAR.ordinal() - 1]); return likelihoodsMap; }
public EnumMap<GenotypeType,Double> getAsMap(boolean normalizeFromLog10){ //Make sure that the log10likelihoods are set double[] likelihoods = normalizeFromLog10 ? GeneralUtils.normalizeFromLog10(getAsVector()) : getAsVector(); if(likelihoods == null) return null; EnumMap<GenotypeType,Double> likelihoodsMap = new EnumMap<GenotypeType, Double>(GenotypeType.class); likelihoodsMap.put(GenotypeType.HOM_REF,likelihoods[GenotypeType.HOM_REF.ordinal()-1]); likelihoodsMap.put(GenotypeType.HET,likelihoods[GenotypeType.HET.ordinal()-1]); likelihoodsMap.put(GenotypeType.HOM_VAR, likelihoods[GenotypeType.HOM_VAR.ordinal() - 1]); return likelihoodsMap; }
/** * Genotype-specific functions -- how many no-calls are there in the genotypes? * * @return number of no calls */ public int getNoCallCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.NO_CALL.ordinal()]; }
/** * Genotype-specific functions -- how many hom var calls are there in the genotypes? * * @return number of hom var calls */ public int getHomVarCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.HOM_VAR.ordinal()]; }
/** * Genotype-specific functions -- how many hom var calls are there in the genotypes? * * @return number of hom var calls */ public int getHomVarCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.HOM_VAR.ordinal()]; }
/** * Genotype-specific functions -- how many mixed calls are there in the genotypes? * * @return number of mixed calls */ public int getMixedCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.MIXED.ordinal()]; }
/** * Genotype-specific functions -- how many no-calls are there in the genotypes? * * @return number of no calls */ public int getNoCallCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.NO_CALL.ordinal()]; }
/** * Genotype-specific functions -- how many no-calls are there in the genotypes? * * @return number of no calls */ public int getNoCallCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.NO_CALL.ordinal()]; }
/** * Genotype-specific functions -- how many het calls are there in the genotypes? * * @return number of het calls */ public int getHetCount() { calculateGenotypeCounts(); return genotypeCounts[GenotypeType.HET.ordinal()]; }
/** * This is really dangerous and returns completely wrong results for genotypes from a multi-allelic context. * Use getLog10GQ(Genotype,VariantContext) or getLog10GQ(Genotype,List<Allele>) in place of it. * * If you **know** you're biallelic, use getGQLog10FromLikelihoods directly. * @param genotype - actually a genotype type (no call, hom ref, het, hom var) * @return an unsafe quantity that could be negative. In the bi-allelic case, the GQ resulting from best minus next best (if the type is the best). */ @Deprecated public double getLog10GQ(GenotypeType genotype){ return getGQLog10FromLikelihoods(genotype.ordinal() - 1 /* NO_CALL IS FIRST */, getAsVector()); }
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 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; }