/** * Can we safely write on the raw (undecoded) genotypes of an input VC? * * The cache depends on the undecoded lazy data header == lastVCFHeaderOfUnparsedGenotypes, in * which case we return the previous result. If it's not cached, we use the BCF2Util to * compare the VC header with our header (expensive) and cache it. * * @param lazyData * @return */ private boolean canSafelyWriteRawGenotypesBytes(final BCF2Codec.LazyData lazyData) { if ( lazyData.header != lastVCFHeaderOfUnparsedGenotypes ) { // result is already cached canPassOnUnparsedGenotypeDataForLastVCFHeader = BCF2Utils.headerLinesAreOrderedConsistently(this.header,lazyData.header); lastVCFHeaderOfUnparsedGenotypes = lazyData.header; } return canPassOnUnparsedGenotypeDataForLastVCFHeader; }
/** * Can we safely write on the raw (undecoded) genotypes of an input VC? * * The cache depends on the undecoded lazy data header == lastVCFHeaderOfUnparsedGenotypes, in * which case we return the previous result. If it's not cached, we use the BCF2Util to * compare the VC header with our header (expensive) and cache it. * * @param lazyData * @return */ private boolean canSafelyWriteRawGenotypesBytes(final BCF2Codec.LazyData lazyData) { if ( lazyData.header != lastVCFHeaderOfUnparsedGenotypes ) { // result is already cached canPassOnUnparsedGenotypeDataForLastVCFHeader = BCF2Utils.headerLinesAreOrderedConsistently(this.header,lazyData.header); lastVCFHeaderOfUnparsedGenotypes = lazyData.header; } return canPassOnUnparsedGenotypeDataForLastVCFHeader; }
/** * Can we safely write on the raw (undecoded) genotypes of an input VC? * * The cache depends on the undecoded lazy data header == lastVCFHeaderOfUnparsedGenotypes, in * which case we return the previous result. If it's not cached, we use the BCF2Util to * compare the VC header with our header (expensive) and cache it. * * @param lazyData * @return */ private boolean canSafelyWriteRawGenotypesBytes(final BCF2Codec.LazyData lazyData) { if ( lazyData.header != lastVCFHeaderOfUnparsedGenotypes ) { // result is already cached canPassOnUnparsedGenotypeDataForLastVCFHeader = BCF2Utils.headerLinesAreOrderedConsistently(this.header,lazyData.header); lastVCFHeaderOfUnparsedGenotypes = lazyData.header; } return canPassOnUnparsedGenotypeDataForLastVCFHeader; }
@Test(dataProvider = "HeaderOrderTestProvider") public void testHeaderOrder( final HeaderOrderTestCase testCase ) { final boolean actualOrderConsistency = BCF2Utils.headerLinesAreOrderedConsistently(testCase.testHeader, testCase.inputHeader); Assert.assertEquals(actualOrderConsistency, testCase.expectedConsistent); }