htsjdk.samtools.util.zip.DeflaterFactory Java Examples
The following examples show how to use
htsjdk.samtools.util.zip.DeflaterFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FilterBamTest.java From Drop-seq with MIT License | 5 votes |
@BeforeMethod public void setDeflaterFactory() { if (TestUtils.isMacOs()) { deflaterFactory = BlockCompressedOutputStream.getDefaultDeflaterFactory(); BlockCompressedOutputStream.setDefaultDeflaterFactory(new DeflaterFactory()); } }
Example #2
Source File: TestUtils.java From Drop-seq with MIT License | 5 votes |
/** * CommandLineProgram only replaces default inflater/deflater with Intel versions, which don't work on Mac. * Once they've been set to Intel versions in a JVM, they need to be reverted explicitly by any unit test. * that is failing on Mac. */ public static void setInflaterDeflaterIfMacOs() { if (isMacOs()) { BlockCompressedOutputStream.setDefaultDeflaterFactory(new DeflaterFactory()); BlockGunzipper.setDefaultInflaterFactory(new InflaterFactory()); } }
Example #3
Source File: IntelInflaterDeflaterIntegrationTest.java From gatk with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Test(dataProvider = "JdkFlags") public void testIntelInflaterDeflaterWithPrintReads(final boolean use_jdk_inflater, final boolean use_jdk_deflater) throws Exception { if (!isIntelInflaterDeflaterSupported()) { throw new SkipException("IntelInflater/IntelDeflater not available on this platform"); } final File ORIG_BAM = new File(largeFileTestDir, INPUT_FILE); final File outFile = GATKBaseTest.createTempFile(INPUT_FILE, ".bam"); final ArrayList<String> args = new ArrayList<>(); args.add("--input"); args.add(ORIG_BAM.getAbsolutePath()); args.add("--output"); args.add(outFile.getAbsolutePath()); args.add("--use-jdk-inflater"); args.add(String.valueOf(use_jdk_inflater)); args.add("--use-jdk-deflater"); args.add(String.valueOf(use_jdk_deflater)); // store current default factories, so they can be restored later InflaterFactory currentInflaterFactory = BlockGunzipper.getDefaultInflaterFactory(); DeflaterFactory currentDeflaterFactory = BlockCompressedOutputStream.getDefaultDeflaterFactory(); // set default factories to jdk version // because PrintReads cannot change the factory to Jdk if it was already set to Intel BlockGunzipper.setDefaultInflaterFactory(new InflaterFactory()); BlockCompressedOutputStream.setDefaultDeflaterFactory(new DeflaterFactory()); // run PrintReads runCommandLine(args); // restore default factories BlockGunzipper.setDefaultInflaterFactory(currentInflaterFactory); BlockCompressedOutputStream.setDefaultDeflaterFactory(currentDeflaterFactory); // validate input and output files are the same SamAssertionUtils.assertSamsEqual(outFile, ORIG_BAM); }
Example #4
Source File: IntelGKLAccessor.java From Hadoop-BAM with MIT License | 4 votes |
static DeflaterFactory newDeflaterFactory() { return new IntelDeflaterFactory(); }