/** * Explicitly set the VCFHeader on this codec. This will overwrite the header read from the file * and the version state stored in this instance; conversely, reading the header from a file will * overwrite whatever is set here. The returned header may not be identical to the header argument * since the header lines may be "repaired" (i.e., rewritten) if doOnTheFlyModifications is set. */ public VCFHeader setVCFHeader(final VCFHeader header, final VCFHeaderVersion version) { this.version = version; if (this.doOnTheFlyModifications) this.header = VCFStandardHeaderLines.repairStandardHeaderLines(header); else this.header = header; return this.header; }
/** * Explicitly set the VCFHeader on this codec. This will overwrite the header read from the file * and the version state stored in this instance; conversely, reading the header from a file will * overwrite whatever is set here. The returned header may not be identical to the header argument * since the header lines may be "repaired" (i.e., rewritten) if doOnTheFlyModifications is set. */ public VCFHeader setVCFHeader(final VCFHeader header, final VCFHeaderVersion version) { this.version = version; if (this.doOnTheFlyModifications) this.header = VCFStandardHeaderLines.repairStandardHeaderLines(header); else this.header = header; return this.header; }
/** * Explicitly set the VCFHeader on this codec. This will overwrite the header read from the file * and the version state stored in this instance; conversely, reading the header from a file will * overwrite whatever is set here. The returned header may not be identical to the header argument * since the header lines may be "repaired" (i.e., rewritten) if doOnTheFlyModifications is set. */ public VCFHeader setVCFHeader(final VCFHeader header, final VCFHeaderVersion version) { this.version = version; if (this.doOnTheFlyModifications) this.header = VCFStandardHeaderLines.repairStandardHeaderLines(header); else this.header = header; return this.header; }
this.header = VCFStandardHeaderLines.repairStandardHeaderLines(this.header); return this.header;
this.header = VCFStandardHeaderLines.repairStandardHeaderLines(this.header); return this.header;
this.header = VCFStandardHeaderLines.repairStandardHeaderLines(this.header); return this.header;
@Test(dataProvider = "RepairHeaderTest") public void testRepairHeaderTest(final RepairHeaderTest cfg) { final VCFHeader toRepair = new VCFHeader(Collections.singleton((VCFHeaderLine)cfg.original)); final VCFHeader repaired = VCFStandardHeaderLines.repairStandardHeaderLines(toRepair); VCFCompoundHeaderLine repairedLine = (VCFCompoundHeaderLine)repaired.getFormatHeaderLine(cfg.original.getID()); if ( repairedLine == null ) repairedLine = (VCFCompoundHeaderLine)repaired.getInfoHeaderLine(cfg.original.getID()); Assert.assertNotNull(repairedLine, "Repaired header didn't contain the expected line"); Assert.assertEquals(repairedLine.getID(), cfg.expectedResult.getID()); Assert.assertEquals(repairedLine.getType(), cfg.expectedResult.getType()); Assert.assertEquals(repairedLine.getCountType(), cfg.expectedResult.getCountType()); if ( repairedLine.getCountType() == VCFHeaderLineCount.INTEGER ) { Assert.assertEquals(repairedLine.getCount(), cfg.expectedResult.getCount()); } } }