Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
33f6e6d7
Commit
33f6e6d7
authored
Jan 30, 2015
by
bow
Browse files
Use AsyncFastqWriter instead of BasicFastqWriter
parent
0d3e053a
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSync.scala
View file @
33f6e6d7
...
...
@@ -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
:
Basi
cFastqWriter
,
outputFastq2
:
Basi
cFastqWriter
)
:
Unit
=
{
outputFastq1
:
Asyn
cFastqWriter
,
outputFastq2
:
Asyn
cFastqWriter
)
:
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
)
)
}
}
public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/FastqSyncTest.scala
View file @
33f6e6d7
...
...
@@ -8,7 +8,7 @@ import java.io.File
import
java.nio.file.Paths
import
scala.collection.JavaConverters._
import
htsjdk.samtools.fastq.
{
Basi
cFastqWriter
,
FastqReader
,
FastqRecord
}
import
htsjdk.samtools.fastq.
{
Asyn
cFastqWriter
,
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
[
Basi
cFastqWriter
]
val
bMock
=
mock
[
Basi
cFastqWriter
]
val
aMock
=
mock
[
Asyn
cFastqWriter
]
val
bMock
=
mock
[
Asyn
cFastqWriter
]
val
sync
=
Stream
(
(
new
FastqRecord
(
"1"
,
"A"
,
""
,
"H"
),
new
FastqRecord
(
"1"
,
"T"
,
""
,
"E"
)),
(
new
FastqRecord
(
"2"
,
"A"
,
""
,
"H"
),
new
FastqRecord
(
"2"
,
"T"
,
""
,
"E"
)))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment