String svContigFasta = tempDir + "/" + "sv_contigs.fasta";
svContigWriter = new BufferedWriter(new FileWriter(svContigFasta, false));
tempDirs = new String[inputSams.length];
SAMFileWriterFactory writerFactory = new SAMFileWriterFactory();
// writerFactory.setUseAsyncIo(true);
writerFactory.setUseAsyncIo(false);
writers = new SAMFileWriter[inputSams.length];
for (int i=0; i<inputSams.length; i++) {
// init temp dir
String temp = tempDir + "/temp" + (i+1);
mkdir(temp);
tempDirs[i] = temp;
// init BAM writer
writers[i] = writerFactory.makeSAMOrBAMWriter(
samHeaders[i], false, new File(outputFiles[i]));
}
// Start pre-processing reads on separate thread for each input file.
// This happens in parallel with assembly, provided there are enough threads.