public String attribute() { return header != null ? header.getID() : null; } /**
public void makeHeaderInfoMap(final Set<VCFHeaderLine> hInfo ){ for ( VCFHeaderLine hLine : hInfo ) { if ( hLine instanceof VCFInfoHeaderLine ) hInfoMap.put( ((VCFInfoHeaderLine)hLine).getID(), (VCFInfoHeaderLine)hLine); } }
private static void addInfoLine(final VCFInfoHeaderLine line) { infoLines.put(line.getID(), line); }
String key= headerLine.getID(); if(jsScript.contains('{' + key + '}') || jsScript.contains("{INFO/" + key + '}')){ Object unkValue= ctx.getAttributes().get(key);
if (headerLine instanceof VCFInfoHeaderLine ) { if (((VCFInfoHeaderLine) headerLine).getCountType() == VCFHeaderLineCount.A) { infoHeaderAltAllelesLineNames.add(((VCFInfoHeaderLine) headerLine).getID());
/** * Setup the FieldWriters appropriate to each INFO and FORMAT in the VCF header * * Must be called before any of the getter methods will work * * @param header a VCFHeader containing description for every INFO and FORMAT field we'll attempt to write out to BCF * @param encoder the encoder we are going to use to write out the BCF2 data * @param stringDictionary a map from VCFHeader strings to their offsets for encoding */ public void setup(final VCFHeader header, final BCF2Encoder encoder, final Map<String, Integer> stringDictionary) { for (final VCFInfoHeaderLine line : header.getInfoHeaderLines()) { final String field = line.getID(); final BCF2FieldWriter.SiteWriter writer = createInfoWriter(header, line, encoder, stringDictionary); add(siteWriters, field, writer); } for (final VCFFormatHeaderLine line : header.getFormatHeaderLines()) { final String field = line.getID(); final BCF2FieldWriter.GenotypesWriter writer = createGenotypesWriter(header, line, encoder, stringDictionary); add(genotypesWriters, field, writer); } }
/** * Setup the FieldWriters appropriate to each INFO and FORMAT in the VCF header * * Must be called before any of the getter methods will work * * @param header a VCFHeader containing description for every INFO and FORMAT field we'll attempt to write out to BCF * @param encoder the encoder we are going to use to write out the BCF2 data * @param stringDictionary a map from VCFHeader strings to their offsets for encoding */ public void setup(final VCFHeader header, final BCF2Encoder encoder, final Map<String, Integer> stringDictionary) { for (final VCFInfoHeaderLine line : header.getInfoHeaderLines()) { final String field = line.getID(); final BCF2FieldWriter.SiteWriter writer = createInfoWriter(header, line, encoder, stringDictionary); add(siteWriters, field, writer); } for (final VCFFormatHeaderLine line : header.getFormatHeaderLines()) { final String field = line.getID(); final BCF2FieldWriter.GenotypesWriter writer = createGenotypesWriter(header, line, encoder, stringDictionary); add(genotypesWriters, field, writer); } }
/** * Setup the FieldWriters appropriate to each INFO and FORMAT in the VCF header * * Must be called before any of the getter methods will work * * @param header a VCFHeader containing description for every INFO and FORMAT field we'll attempt to write out to BCF * @param encoder the encoder we are going to use to write out the BCF2 data * @param stringDictionary a map from VCFHeader strings to their offsets for encoding */ public void setup(final VCFHeader header, final BCF2Encoder encoder, final Map<String, Integer> stringDictionary) { for (final VCFInfoHeaderLine line : header.getInfoHeaderLines()) { final String field = line.getID(); final BCF2FieldWriter.SiteWriter writer = createInfoWriter(header, line, encoder, stringDictionary); add(siteWriters, field, writer); } for (final VCFFormatHeaderLine line : header.getFormatHeaderLines()) { final String field = line.getID(); final BCF2FieldWriter.GenotypesWriter writer = createGenotypesWriter(header, line, encoder, stringDictionary); add(genotypesWriters, field, writer); } }
public static void assertHeadersEquals(VCFHeader header0, VCFHeader header1) { assertEquals(header0.getColumnCount(), header1.getColumnCount()); assertEquals(header0.getGenotypeSamples(), header1.getGenotypeSamples()); assertEquals(header0.getContigLines(), header1.getContigLines()); for (VCFInfoHeaderLine line0 : header0.getInfoHeaderLines()) { VCFInfoHeaderLine line1 = header1.getInfoHeaderLine(line0.getID()); assertEquals(line0.getCount(), line1.getCount()); assertEquals(line0.getType(), line1.getType()); assertEquals(line0.getDescription(), line1.getDescription()); assertEquals(0, line0.compareTo(line1)); } } }
if ( line instanceof VCFInfoHeaderLine ) { final VCFInfoHeaderLine infoline = (VCFInfoHeaderLine)line; if ( infoline.getID().equals(expression.fieldName) ) { targetHeaderLine = infoline; break;
+infoHeaderLine.getID()); continue; .setName(infoHeaderLine.getID()) .setType(infoHeaderLine.getType().toString()) .setLength(infoHeaderLine.getType() == VCFHeaderLineType.String ? "var" : getLength(infoHeaderLine)); if (infoHeaderLine.getID().equals("DP") && dpIndex != -1) { GenomicsDBVidMapProto.InfoField prevDPield = remove(infoFields, dpIndex); if (infoHeaderLine.getID().equals("DP")) { dpIndex = infoFields.indexOf(infoField);
/** * Add a single header line to the appropriate type-specific lookup table (but NOT to the master * list of lines in mMetaData -- this must be done separately if desired). * * If a header line is present that has the same key as an existing line, it will not be added. A warning * will be shown if this occurs when GeneralUtils.DEBUG_MODE_ENABLED is true, otherwise this will occur * silently. * * @param line header line to attempt to add to its type-specific lookup table * @return true if the line was added to the appropriate lookup table, false if there was an existing * line with the same key and the new line was not added */ private boolean addMetadataLineLookupEntry(final VCFHeaderLine line) { if ( line instanceof VCFInfoHeaderLine ) { final VCFInfoHeaderLine infoLine = (VCFInfoHeaderLine)line; return addMetaDataLineMapLookupEntry(mInfoMetaData, infoLine.getID(), infoLine); } else if ( line instanceof VCFFormatHeaderLine ) { final VCFFormatHeaderLine formatLine = (VCFFormatHeaderLine)line; return addMetaDataLineMapLookupEntry(mFormatMetaData, formatLine.getID(), formatLine); } else if ( line instanceof VCFFilterHeaderLine ) { final VCFFilterHeaderLine filterLine = (VCFFilterHeaderLine)line; return addMetaDataLineMapLookupEntry(mFilterMetaData, filterLine.getID(), filterLine); } else if ( line instanceof VCFContigHeaderLine ) { return addContigMetaDataLineLookupEntry((VCFContigHeaderLine) line); } else { return addMetaDataLineMapLookupEntry(mOtherMetaData, line.getKey(), line); } }
/** * Add a single header line to the appropriate type-specific lookup table (but NOT to the master * list of lines in mMetaData -- this must be done separately if desired). * * If a header line is present that has the same key as an existing line, it will not be added. A warning * will be shown if this occurs when GeneralUtils.DEBUG_MODE_ENABLED is true, otherwise this will occur * silently. * * @param line header line to attempt to add to its type-specific lookup table * @return true if the line was added to the appropriate lookup table, false if there was an existing * line with the same key and the new line was not added */ private boolean addMetadataLineLookupEntry(final VCFHeaderLine line) { if ( line instanceof VCFInfoHeaderLine ) { final VCFInfoHeaderLine infoLine = (VCFInfoHeaderLine)line; return addMetaDataLineMapLookupEntry(mInfoMetaData, infoLine.getID(), infoLine); } else if ( line instanceof VCFFormatHeaderLine ) { final VCFFormatHeaderLine formatLine = (VCFFormatHeaderLine)line; return addMetaDataLineMapLookupEntry(mFormatMetaData, formatLine.getID(), formatLine); } else if ( line instanceof VCFFilterHeaderLine ) { final VCFFilterHeaderLine filterLine = (VCFFilterHeaderLine)line; return addMetaDataLineMapLookupEntry(mFilterMetaData, filterLine.getID(), filterLine); } else if ( line instanceof VCFContigHeaderLine ) { return addContigMetaDataLineLookupEntry((VCFContigHeaderLine) line); } else { return addMetaDataLineMapLookupEntry(mOtherMetaData, line.getKey(), line); } }