/** * Check for the presence of a format line with the deprecated key {@link VCFConstants#GENOTYPE_LIKELIHOODS_KEY}. * If one is present, and there isn't a format line with the key {@link VCFConstants#GENOTYPE_PL_KEY}, adds * a new format line with the key {@link VCFConstants#GENOTYPE_PL_KEY}. */ private void checkForDeprecatedGenotypeLikelihoodsKey() { if ( hasFormatLine(VCFConstants.GENOTYPE_LIKELIHOODS_KEY) && ! hasFormatLine(VCFConstants.GENOTYPE_PL_KEY) ) { if ( GeneralUtils.DEBUG_MODE_ENABLED ) { System.err.println("Found " + VCFConstants.GENOTYPE_LIKELIHOODS_KEY + " format, but no " + VCFConstants.GENOTYPE_PL_KEY + " field. We now only manage PL fields internally" + " automatically adding a corresponding PL field to your VCF header"); } addMetaDataLine(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_PL_KEY, VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification")); } }
/** * Check for the presence of a format line with the deprecated key {@link VCFConstants#GENOTYPE_LIKELIHOODS_KEY}. * If one is present, and there isn't a format line with the key {@link VCFConstants#GENOTYPE_PL_KEY}, adds * a new format line with the key {@link VCFConstants#GENOTYPE_PL_KEY}. */ private void checkForDeprecatedGenotypeLikelihoodsKey() { if ( hasFormatLine(VCFConstants.GENOTYPE_LIKELIHOODS_KEY) && ! hasFormatLine(VCFConstants.GENOTYPE_PL_KEY) ) { if ( GeneralUtils.DEBUG_MODE_ENABLED ) { System.err.println("Found " + VCFConstants.GENOTYPE_LIKELIHOODS_KEY + " format, but no " + VCFConstants.GENOTYPE_PL_KEY + " field. We now only manage PL fields internally" + " automatically adding a corresponding PL field to your VCF header"); } addMetaDataLine(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_PL_KEY, VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification")); } }
/** * load the format/info meta data maps (these are used for quick lookup by key name) */ private void loadMetaDataMaps() { for (final VCFHeaderLine line : mMetaData) { if ( line instanceof VCFInfoHeaderLine ) { final VCFInfoHeaderLine infoLine = (VCFInfoHeaderLine)line; addMetaDataMapBinding(mInfoMetaData, infoLine); } else if ( line instanceof VCFFormatHeaderLine ) { final VCFFormatHeaderLine formatLine = (VCFFormatHeaderLine)line; addMetaDataMapBinding(mFormatMetaData, formatLine); } else if ( line instanceof VCFFilterHeaderLine ) { final VCFFilterHeaderLine filterLine = (VCFFilterHeaderLine)line; mFilterMetaData.put(filterLine.getID(), filterLine); } else if ( line instanceof VCFContigHeaderLine ) { contigMetaData.add((VCFContigHeaderLine)line); } else { mOtherMetaData.put(line.getKey(), line); } } if ( hasFormatLine(VCFConstants.GENOTYPE_LIKELIHOODS_KEY) && ! hasFormatLine(VCFConstants.GENOTYPE_PL_KEY) ) { if ( GeneralUtils.DEBUG_MODE_ENABLED ) { System.err.println("Found " + VCFConstants.GENOTYPE_LIKELIHOODS_KEY + " format, but no " + VCFConstants.GENOTYPE_PL_KEY + " field. We now only manage PL fields internally" + " automatically adding a corresponding PL field to your VCF header"); } addMetaDataLine(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_PL_KEY, VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification")); } }
if ( ! genotypeAttributeKeys.isEmpty()) { for (final String format : genotypeAttributeKeys) if ( ! this.header.hasFormatLine(format)) fieldIsMissingFromHeaderError(context, format, "FORMAT");
if ( ! genotypeAttributeKeys.isEmpty()) { for (final String format : genotypeAttributeKeys) if ( ! this.header.hasFormatLine(format)) fieldIsMissingFromHeaderError(context, format, "FORMAT");
if ( ! genotypeAttributeKeys.isEmpty()) { for (final String format : genotypeAttributeKeys) if ( ! this.header.hasFormatLine(format)) fieldIsMissingFromHeaderError(context, format, "FORMAT");
for (final Map.Entry<String, Object> attribute : genotype.getExtendedAttributes().entrySet()) { final String id = attribute.getKey(); if (!existingHeader.hasFormatLine(id) && !formatHeaderLines.containsKey(id)) { log.info("Will add FORMAT line with id: " + id); formatHeaderLines.put(id, new VCFFormatHeaderLine(id, VCFHeaderLineCount.UNBOUNDED, VCFHeaderLineType.String, "Missing description: this FORMAT line was added by Picard's FixVCFHeader"));
for (final Map.Entry<String, Object> attribute : genotype.getExtendedAttributes().entrySet()) { final String id = attribute.getKey(); if (!existingHeader.hasFormatLine(id) && !formatHeaderLines.containsKey(id)) { log.info("Will add FORMAT line with id: " + id); formatHeaderLines.put(id, new VCFFormatHeaderLine(id, VCFHeaderLineCount.UNBOUNDED, VCFHeaderLineType.String, "Missing description: this FORMAT line was added by Picard's FixVCFHeader"));
if (!header.hasFormatLine("FT")) header.addMetaDataLine(new VCFFormatHeaderLine("FT", 1, VCFHeaderLineType.String, "Filters applied to genotype call"));