@Override public String filter(final VariantContext ctx, final Genotype gt) { if (gt.getDP() < minDepth) return "LowDP"; else return null; } }
@Override public String filter(final VariantContext ctx, final Genotype gt) { if (gt.getDP() < minDepth) return "LowDP"; else return null; } }
/** * Does the DP field have a value? * @return true if there's a DP field value */ public boolean hasDP() { return getDP() != -1; }
/** * Does the DP field have a value? * @return true if there's a DP field value */ public boolean hasDP() { return getDP() != -1; }
@Override public int getCoverage(Genotype gt) { return gt.getDP(); }
@Override public int getCoverage(Genotype gt) { return gt.getDP(); }
@Override public int getCoverage(Genotype gt) { return gt.getDP(); }
@Override public int getValue(final Genotype g) { return g.getDP(); } }
@Override public int getValue(final Genotype g) { return g.getDP(); } }
@Override public int getValue(final Genotype g) { return g.getDP(); } }
@Override public double getAlternativeAlleleFraction(Genotype gt) { int[] ads = gt.getAD(); if (ads == null) return 0.0; int sum = 0; for (int i = 1; i < ads.length; ++i) sum += ads[i]; return ((double) sum) / gt.getDP(); }
/** * Does the DP field have a value? * @return true if there's a DP field value */ @Ensures("(result == false && getDP() == -1) || (result == true && getDP() >= 0)") public boolean hasDP() { return getDP() != -1; }
private static GenotypeConcordanceStateCodes getStateCode(final VariantContext ctx, final String sample, final int minGq, final int minDp) { // Site level checks // Added potential to include missing sites as hom ref. if (ctx == null) return MISSING_CODE; else if (ctx.isMixed()) return IS_MIXED_CODE; else if (ctx.isFiltered()) return VC_FILTERED_CODE; else { // Genotype level checks final Genotype genotype = ctx.getGenotype(sample); if (genotype.isNoCall()) return NO_CALL_CODE; else if (genotype.isFiltered()) return GT_FILTERED_CODE; else if ((genotype.getGQ() != -1) && (genotype.getGQ() < minGq)) return LOW_GQ_CODE; else if ((genotype.getDP() != -1) && (genotype.getDP() < minDp)) return LOW_DP_CODE; // Note. Genotype.isMixed means that it is called on one chromosome and NOT on the other else if ((genotype.isMixed())) return NO_CALL_CODE; } return null; }
private static GenotypeConcordanceStateCodes getStateCode(final VariantContext ctx, final String sample, final int minGq, final int minDp) { // Site level checks // Added potential to include missing sites as hom ref. if (ctx == null) return MISSING_CODE; else if (ctx.isMixed()) return IS_MIXED_CODE; else if (ctx.isFiltered()) return VC_FILTERED_CODE; else { // Genotype level checks final Genotype genotype = ctx.getGenotype(sample); if (genotype.isNoCall()) return NO_CALL_CODE; else if (genotype.isFiltered()) return GT_FILTERED_CODE; else if ((genotype.getGQ() != -1) && (genotype.getGQ() < minGq)) return LOW_GQ_CODE; else if ((genotype.getDP() != -1) && (genotype.getDP() < minDp)) return LOW_DP_CODE; // Note. Genotype.isMixed means that it is called on one chromosome and NOT on the other else if ((genotype.isMixed())) return NO_CALL_CODE; } return null; }
public String toString() { return String.format("[%s %s%s%s%s%s%s%s]", getSampleName(), getGenotypeString(false), toStringIfExists(VCFConstants.GENOTYPE_QUALITY_KEY, getGQ()), toStringIfExists(VCFConstants.DEPTH_KEY, getDP()), toStringIfExists(VCFConstants.GENOTYPE_ALLELE_DEPTHS, getAD()), toStringIfExists(VCFConstants.GENOTYPE_PL_KEY, getPL()), toStringIfExists(VCFConstants.GENOTYPE_FILTER_KEY, getFilters()), sortedString(getExtendedAttributes())); }
public String toString() { return String.format("[%s %s%s%s%s%s%s%s]", getSampleName(), getGenotypeString(false), toStringIfExists(VCFConstants.GENOTYPE_QUALITY_KEY, getGQ()), toStringIfExists(VCFConstants.DEPTH_KEY, getDP()), toStringIfExists(VCFConstants.GENOTYPE_ALLELE_DEPTHS, getAD()), toStringIfExists(VCFConstants.GENOTYPE_PL_KEY, getPL()), toStringIfExists(VCFConstants.GENOTYPE_FILTER_KEY, getFilters()), sortedString(getExtendedAttributes())); }
public String toString() { return String.format("[%s %s%s%s%s%s%s%s]", getSampleName(), getGenotypeString(false), toStringIfExists(VCFConstants.GENOTYPE_QUALITY_KEY, getGQ()), toStringIfExists(VCFConstants.DEPTH_KEY, getDP()), toStringIfExists(VCFConstants.GENOTYPE_ALLELE_DEPTHS, getAD()), toStringIfExists(VCFConstants.GENOTYPE_PL_KEY, getPL()), toStringIfExists(VCFConstants.GENOTYPE_FILTER_KEY, getFilters()), sortedString(getExtendedAttributes())); }
/** * Copy all of the values for this builder from Genotype g * @param g * @return */ public GenotypeBuilder copy(final Genotype g) { name(g.getSampleName()); alleles(g.getAlleles()); phased(g.isPhased()); GQ(g.getGQ()); DP(g.getDP()); AD(g.getAD()); PL(g.getPL()); filter(g.getFilters()); attributes(g.getExtendedAttributes()); return this; }
/** * Copy all of the values for this builder from Genotype g * @param g * @return */ public GenotypeBuilder copy(final Genotype g) { name(g.getSampleName()); alleles(g.getAlleles()); phased(g.isPhased()); GQ(g.getGQ()); DP(g.getDP()); AD(g.getAD()); PL(g.getPL()); filter(g.getFilters()); attributes(g.getExtendedAttributes()); return this; }