/** * Creates a new tmp file on one of the available temp filesystems, registers it for deletion * on JVM exit and then returns it. */ private File newTempFile() throws IOException { return IOUtil.newTempFile("SortingCollection2.", ".tmp", this.tmpDirs, TMP_SPACE_FREE); }
/** * Creates a new tmp file on one of the available temp filesystems, registers it for deletion * on JVM exit and then returns it. */ private File newTempFile() throws IOException { return IOUtil.newTempFile("sortingcollection.", ".tmp", this.tmpDirs, TMP_SPACE_FREE); }
/** Creates a new tmp file on one of the potential filesystems that has at least 5GB free. */ public static File newTempFile(final String prefix, final String suffix, final File[] tmpDirs) throws IOException { return newTempFile(prefix, suffix, tmpDirs, FIVE_GBS); }
/** Creates a new tmp file on one of the potential filesystems that has at least 5GB free. */ public static File newTempFile(final String prefix, final String suffix, final File[] tmpDirs) throws IOException { return newTempFile(prefix, suffix, tmpDirs, FIVE_GBS); }
/** Creates a new tmp file on one of the potential filesystems that has at least 5GB free. */ public static File newTempFile(final String prefix, final String suffix, final File[] tmpDirs) throws IOException { return newTempFile(prefix, suffix, tmpDirs, FIVE_GBS); }
/** * Creates a new tmp file on one of the available temp filesystems, registers it for deletion * on JVM exit and then returns it. */ private File newTempFile() throws IOException { return IOUtil.newTempFile("sortingcollection.", ".tmp", this.tmpDirs, TMP_SPACE_FREE); }
/** * Sort the values in memory, write them to a file, and clear the buffer of values in memory. */ private void spillToDisk() { try { Arrays.sort(this.ramValues, 0, this.numValuesInRam); final File f = IOUtil.newTempFile("sortingcollection.", ".tmp", this.tmpDir, IOUtil.FIVE_GBS); DataOutputStream os = null; try { final long numBytes = this.numValuesInRam * SIZEOF; os = new DataOutputStream(IOUtil.maybeBufferOutputStream(new FileOutputStream(f))); f.deleteOnExit(); for (int i = 0; i < this.numValuesInRam; ++i) { os.writeLong(ramValues[i]); } os.flush(); } finally { if (os != null) { os.close(); } } this.numValuesInRam = 0; this.files.add(f); } catch (IOException e) { throw new RuntimeIOException(e); } }
@Test(dataProvider = "simpleTests") public void simpleTest(final String vcf, final String bam, final Map<String, Object> fieldValueMap) throws IOException, NoSuchFieldException, IllegalAccessException { final CollectIndependentReplicateMetrics est = new CollectIndependentReplicateMetrics(); est.INPUT = bams.get(bam); est.VCF = new File(testdir, vcf); est.OUTPUT = IOUtil.newTempFile("singleHet", ".duplication_metric", new File[]{bamOutDir}); est.MATRIX_OUTPUT = IOUtil.newTempFile("singleHet", ".duplication_matrix", new File[]{bamOutDir}); est.SAMPLE = "SAMPLE1"; est.OUTPUT.deleteOnExit(); est.MATRIX_OUTPUT.deleteOnExit(); est.doWork(); final MetricsFile<IndependentReplicateMetric, Integer> retval = new MetricsFile<>(); retval.read(new FileReader(est.OUTPUT)); for (final Map.Entry<String, Object> fieldValue : fieldValueMap.entrySet()) { final String field = fieldValue.getKey(); final Object expectedValue = fieldValue.getValue(); final Field o = IndependentReplicateMetric.class.getField(field); assertEquals(o.get(retval.getMetrics().get(0)), expectedValue, field); } }