/** Add POPMAX name */ private void addPopmaxHeader(VCFHeader header, String prefix, String idInfix, String noteInfix) { VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "POPMAX", VCFHeaderLineCount.A, VCFHeaderLineType.String, "Population with the max AF" + noteInfix); header.addMetaDataLine(line); }
/** Add POPMAX name */ private void addPopmaxHeader(VCFHeader header, String prefix, String idInfix, String noteInfix) { VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "POPMAX", VCFHeaderLineCount.A, VCFHeaderLineType.String, "Population with the max AF" + noteInfix); header.addMetaDataLine(line); }
/** Add header for highest allele frequency */ private void addBestAFHeader(VCFHeader header, String prefix, String idInfix, String noteInfix) { VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AF_POPMAX", VCFHeaderLineCount.A, VCFHeaderLineType.Float, "Highest allele frequency seen in any population" + noteInfix); header.addMetaDataLine(line); }
/** Add header for allele count with highest frequency */ private void addBestACHeader(VCFHeader header, String prefix, String idInfix, String noteInfix) { VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AC_POPMAX", VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Allele count for population with highest frequency" + noteInfix); header.addMetaDataLine(line); }
/** Add header with hom allele counts */ private void addACHomHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ThousandGenomesPopulation pop) { String popName; if (pop == ThousandGenomesPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "Hom_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Overall number of observed homozygous alleles in " + popName + noteInfix); header.addMetaDataLine(line); }
/** Add header with allele counts */ private void addACHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ExacPopulation pop) { String popName; if (pop == ExacPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AC_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Overall number of observed alleles in " + popName + noteInfix); header.addMetaDataLine(line); }
/** Add header with allele frequency */ private void addAFHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, GnomadPopulation pop) { String popName; if (pop == GnomadPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AF_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Float, "Frequency observed in ExAC data set in " + popName + noteInfix); header.addMetaDataLine(line); }
/** Add header with hom allele counts */ private void addACHomHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, GnomadPopulation pop) { String popName; if (pop == GnomadPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HOM_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Overall number of observed homozygous alleles in " + popName + noteInfix); header.addMetaDataLine(line); }
/** Add header with allele counts */ private void addACHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ThousandGenomesPopulation pop) { String popName; if (pop == ThousandGenomesPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AC_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Overall number of observed alleles in " + popName + noteInfix); header.addMetaDataLine(line); }
public static void addFormatHeaders(VCFHeader header) { header.addMetaDataLine(VCFStandardHeaderLines.getFormatLine(VCFConstants.GENOTYPE_KEY)); for (VcfFormatAttributes attr : VcfFormatAttributes.values()) { if (attr.formatHeader() != null) { header.addMetaDataLine(attr.formatHeader()); } } } }
/** Add header with allele counts */ private void addACHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, GnomadPopulation pop) { String popName; if (pop == GnomadPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AC_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Overall number of observed alleles in " + popName + noteInfix); header.addMetaDataLine(line); }
/** Add header with hemi allele counts */ private void addACHemiHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ThousandGenomesPopulation pop) { String popName; if (pop == ThousandGenomesPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "Hemi_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Overall number of observed hemizygous alleles in " + popName + noteInfix); header.addMetaDataLine(line); }
/** Add header with het allele counts */ private void addACHetHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, GnomadPopulation pop) { String popName; if (pop != GnomadPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HET_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Overall number of observed heterozygous alleles in " + popName + noteInfix); header.addMetaDataLine(line); }
/** Add header with hemi allele counts */ private void addACHemiHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, GnomadPopulation pop) { String popName; if (pop == GnomadPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HEMI_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Overall number of observed hemizygous alleles in " + popName + noteInfix); header.addMetaDataLine(line); }
/** Add header with chromosome count */ private void addANHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ExacPopulation pop) { // TODO: change counts to 1 for AN? String popName; if (pop == ExacPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "AN_" + pop, 1, VCFHeaderLineType.Integer, "Overall number of positions/chromosomes with coverage in " + popName + noteInfix); header.addMetaDataLine(line); }
/** Add header with hemi allele counts */ private void addACHemiHeader(VCFHeader header, String prefix, String idInfix, String noteInfix, ExacPopulation pop) { String popName; if (pop == ExacPopulation.ALL) popName = "all populations"; else popName = pop + " / " + pop.getLabel() + " population"; VCFInfoHeaderLine line = new VCFInfoHeaderLine(prefix + idInfix + "HEMI_" + pop, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Overall number of observed hemizygous alleles in " + popName + noteInfix); header.addMetaDataLine(line); }
public static void addFilterHeaders(VCFHeader header) { // Filter headers for (VcfFilter filter : VcfFilter.values()) { if (filter.header() != null) { header.addMetaDataLine(filter.header()); } } } public static void addInfoHeaders(VCFHeader header) {
@Test public void testVCFHeaderAddDuplicateContigLine() { File input = new File("src/test/resources/htsjdk/variant/ex2.vcf"); VCFFileReader reader = new VCFFileReader(input, false); VCFHeader header = reader.getFileHeader(); final int numContigLinesBefore = header.getContigLines().size(); // try to readd the first contig line header.addMetaDataLine(header.getContigLines().get(0)); final int numContigLinesAfter = header.getContigLines().size(); // assert that we have the same number of contig lines before and after Assert.assertEquals(numContigLinesBefore, numContigLinesAfter); }
@Test public void testVCFHeaderAddContigLine() { final VCFHeader header = getHiSeqVCFHeader(); final VCFContigHeaderLine contigLine = new VCFContigHeaderLine( "<ID=chr1,length=1234567890,assembly=FAKE,md5=f126cdf8a6e0c7f379d618ff66beb2da,species=\"Homo sapiens\">", VCFHeaderVersion.VCF4_0, VCFHeader.CONTIG_KEY, 0); header.addMetaDataLine(contigLine); Assert.assertTrue(header.getContigLines().contains(contigLine), "Test contig line not found in contig header lines"); Assert.assertTrue(header.getMetaDataInInputOrder().contains(contigLine), "Test contig line not found in set of all header lines"); Assert.assertFalse(header.getInfoHeaderLines().contains(contigLine), "Test contig line present in info header lines"); Assert.assertFalse(header.getFormatHeaderLines().contains(contigLine), "Test contig line present in format header lines"); Assert.assertFalse(header.getFilterLines().contains(contigLine), "Test contig line present in filter header lines"); Assert.assertFalse(header.getOtherHeaderLines().contains(contigLine), "Test contig line present in other header lines"); }
private static VCFHeader createTestHeader() { final VCFHeader header = new VCFHeader(); header.addMetaDataLine(new VCFInfoHeaderLine(RANDOM_ATTRIBUTE, 1, VCFHeaderLineType.Character, "random string")); return header; }