Commit 33f6e6d7 authored by bow's avatar bow
Browse files

Use AsyncFastqWriter instead of BasicFastqWriter

parent 0d3e053a
......@@ -17,7 +17,7 @@ import scala.collection.JavaConverters._
import argonaut._, Argonaut._
import scalaz._, Scalaz._
import htsjdk.samtools.fastq.{ BasicFastqWriter, FastqReader, FastqRecord }
import htsjdk.samtools.fastq.{ AsyncFastqWriter, BasicFastqWriter, FastqReader, FastqRecord }
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import nl.lumc.sasc.biopet.core.BiopetJavaCommandLineFunction
......@@ -185,8 +185,8 @@ object FastqSync extends ToolCommand {
def writeSyncedFastq(sync: Stream[(FastqRecord, FastqRecord)],
counts: SyncCounts,
outputFastq1: BasicFastqWriter,
outputFastq2: BasicFastqWriter): Unit = {
outputFastq1: AsyncFastqWriter,
outputFastq2: AsyncFastqWriter): Unit = {
sync.foreach {
case (rec1, rec2) =>
outputFastq1.write(rec1)
......@@ -281,8 +281,9 @@ object FastqSync extends ToolCommand {
new FastqReader(commandArgs.inputFastq2))
writeSyncedFastq(synced, counts,
new BasicFastqWriter(commandArgs.outputFastq1),
new BasicFastqWriter(commandArgs.outputFastq2)
// using 3000 for queue size to approximate NFS buffer
new AsyncFastqWriter(new BasicFastqWriter(commandArgs.outputFastq1), 3000),
new AsyncFastqWriter(new BasicFastqWriter(commandArgs.outputFastq2), 3000)
)
}
}
......@@ -8,7 +8,7 @@ import java.io.File
import java.nio.file.Paths
import scala.collection.JavaConverters._
import htsjdk.samtools.fastq.{ BasicFastqWriter, FastqReader, FastqRecord }
import htsjdk.samtools.fastq.{ AsyncFastqWriter, FastqReader, FastqRecord }
import org.mockito.Mockito.{ inOrder => inOrd, when }
import org.scalatest.Matchers
import org.scalatest.mock.MockitoSugar
......@@ -191,8 +191,8 @@ class FastqSyncTest extends TestNGSuite with MockitoSugar with Matchers {
}
@Test def testWriteSynced() = {
val aMock = mock[BasicFastqWriter]
val bMock = mock[BasicFastqWriter]
val aMock = mock[AsyncFastqWriter]
val bMock = mock[AsyncFastqWriter]
val sync = Stream(
(new FastqRecord("1", "A", "", "H"), new FastqRecord("1", "T", "", "E")),
(new FastqRecord("2", "A", "", "H"), new FastqRecord("2", "T", "", "E")))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment