/** * Walks over the VCF header and repairs the standard VCF header lines in it, returning a freshly * allocated {@link VCFHeader} with standard VCF header lines repaired as necessary. */ public static VCFHeader repairStandardHeaderLines(final VCFHeader header) { final Set<VCFHeaderLine> newLines = new LinkedHashSet<VCFHeaderLine>(header.getMetaDataInInputOrder().size()); for (VCFHeaderLine line : header.getMetaDataInInputOrder()) { if (line instanceof VCFFormatHeaderLine) { line = formatStandards.repair((VCFFormatHeaderLine) line); } else if (line instanceof VCFInfoHeaderLine) { line = infoStandards.repair((VCFInfoHeaderLine) line); } newLines.add(line); } return new VCFHeader(newLines, header.getGenotypeSamples()); }
/** * Adds header lines for each of the format fields in IDs to header, returning the set of {@code * IDs} without standard descriptions, unless {@code throwErrorForMissing} is true, in which case * this situation results in a {@link TribbleException} */ public static Set<String> addStandardFormatLines( final Set<VCFHeaderLine> headerLines, final boolean throwErrorForMissing, final Collection<String> IDs) { return formatStandards.addToHeader(headerLines, IDs, throwErrorForMissing); }
private static void registerStandard(final VCFFormatHeaderLine line) { formatStandards.add(line); }
private static void registerStandard(final VCFInfoHeaderLine line) { infoStandards.add(line); }
/** * Returns the standard info line for {@code ID}. If none exists, return {@code null} or throw a * {@link TribbleException}, depending on {@code throwErrorForMissing}. */ public static VCFInfoHeaderLine getInfoLine(final String ID, final boolean throwErrorForMissing) { return infoStandards.get(ID, throwErrorForMissing); }
/** * Returns the standard format line for {@code ID}. If none exists, throw an {@link * TribbleException} */ public static VCFFormatHeaderLine getFormatLine(final String ID) { return formatStandards.get(ID, true); }
/** * Returns the standard format line for {@code ID}. If none exists, return null or throw an * exception, depending on {@code throwErrorForMissing}. */ public static VCFFormatHeaderLine getFormatLine( final String ID, final boolean throwErrorForMissing) { return formatStandards.get(ID, throwErrorForMissing); }