private void validateGenotypes() { if ( this.genotypes == null ) throw new IllegalStateException("Genotypes is null"); for ( final Genotype g : this.genotypes ) { if ( g.isAvailable() ) { for ( Allele gAllele : g.getAlleles() ) { if ( ! hasAllele(gAllele) && gAllele.isCalled() ) throw new IllegalStateException("Allele in genotype " + gAllele + " not in the variant context " + alleles); } } } }
private void validateGenotypes() { if ( this.genotypes == null ) throw new IllegalStateException("Genotypes is null"); for ( int i = 0; i < genotypes.size(); i++ ) { Genotype genotype = genotypes.get(i); if ( genotype.isAvailable() ) { final List<Allele> alleles = genotype.getAlleles(); for ( int j = 0, size = alleles.size(); j < size; j++ ) { final Allele gAllele = alleles.get(j); if ( ! hasAllele(gAllele) && gAllele.isCalled() ) throw new IllegalStateException("Allele in genotype " + gAllele + " not in the variant context " + alleles); } } } }
public boolean hasAnyAttribute(final String key) { if (key.equals(VCFConstants.GENOTYPE_KEY)) { return isAvailable(); } else if (key.equals(VCFConstants.GENOTYPE_QUALITY_KEY)) { return hasGQ(); } else if (key.equals(VCFConstants.GENOTYPE_ALLELE_DEPTHS)) { return hasAD(); } else if (key.equals(VCFConstants.GENOTYPE_PL_KEY)) { return hasPL(); } else if (key.equals(VCFConstants.DEPTH_KEY)) { return hasDP(); } else { return hasExtendedAttribute(key); } }
public boolean hasAnyAttribute(final String key) { if (key.equals(VCFConstants.GENOTYPE_KEY)) { return isAvailable(); } else if (key.equals(VCFConstants.GENOTYPE_QUALITY_KEY)) { return hasGQ(); } else if (key.equals(VCFConstants.GENOTYPE_ALLELE_DEPTHS)) { return hasAD(); } else if (key.equals(VCFConstants.GENOTYPE_PL_KEY)) { return hasPL(); } else if (key.equals(VCFConstants.DEPTH_KEY)) { return hasDP(); } else if (key.equals(VCFConstants.GENOTYPE_FILTER_KEY)) { return true; //always available } else { return hasExtendedAttribute(key); } }
public boolean hasAnyAttribute(final String key) { if (key.equals(VCFConstants.GENOTYPE_KEY)) { return isAvailable(); } else if (key.equals(VCFConstants.GENOTYPE_QUALITY_KEY)) { return hasGQ(); } else if (key.equals(VCFConstants.GENOTYPE_ALLELE_DEPTHS)) { return hasAD(); } else if (key.equals(VCFConstants.GENOTYPE_PL_KEY)) { return hasPL(); } else if (key.equals(VCFConstants.DEPTH_KEY)) { return hasDP(); } else if (key.equals(VCFConstants.GENOTYPE_FILTER_KEY)) { return true; //always available } else { return hasExtendedAttribute(key); } }
private void validateGenotypes() { if ( this.genotypes == null ) throw new IllegalStateException("Genotypes is null"); for ( int i = 0; i < genotypes.size(); i++ ) { Genotype genotype = genotypes.get(i); if ( genotype.isAvailable() ) { final List<Allele> alleles = genotype.getAlleles(); for ( int j = 0, size = alleles.size(); j < size; j++ ) { final Allele gAllele = alleles.get(j); if ( ! hasAllele(gAllele) && gAllele.isCalled() ) throw new IllegalStateException("Allele in genotype " + gAllele + " not in the variant context " + alleles); } } } }
for (final Genotype g : this.getGenotypes()) { keys.addAll(g.getExtendedAttributes().keySet()); if ( g.isAvailable() ) sawGoodGT = true; if ( g.hasGQ() ) sawGoodQual = true; if ( g.hasDP() ) sawDP = true;
for (final Genotype g : this.getGenotypes()) { keys.addAll(g.getExtendedAttributes().keySet()); if ( g.isAvailable() ) sawGoodGT = true; if ( g.hasGQ() ) sawGoodQual = true; if ( g.hasDP() ) sawDP = true;
for (final Genotype g : this.getGenotypes()) { keys.addAll(g.getExtendedAttributes().keySet()); if ( g.isAvailable() ) sawGoodGT = true; if ( g.hasGQ() ) sawGoodQual = true; if ( g.hasDP() ) sawDP = true;
for (final String field : genotypeFormatKeys) { if (field.equals(VCFConstants.GENOTYPE_KEY)) { if ( ! g.isAvailable()) { throw new IllegalStateException("GTs cannot be missing for some samples if they are available for others in the record");
infoMap.put("isNoCall", g.isNoCall()? "1" : "0"); infoMap.put("isMixed", g.isMixed()? "1" : "0"); infoMap.put("isAvailable", g.isAvailable()? "1" : "0");
for (final String field : genotypeFormatKeys) { if (field.equals(VCFConstants.GENOTYPE_KEY)) { if (!g.isAvailable()) { throw new IllegalStateException("GTs cannot be missing for some samples if they are available for others in the record");
for (final String field : genotypeFormatKeys) { if (field.equals(VCFConstants.GENOTYPE_KEY)) { if (!g.isAvailable()) { throw new IllegalStateException("GTs cannot be missing for some samples if they are available for others in the record");