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
922b3949
Commit
922b3949
authored
Feb 16, 2015
by
bow
Browse files
Open and close handlers properly
parent
074a4fc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSync.scala
View file @
922b3949
...
...
@@ -165,8 +165,6 @@ object FastqSync extends ToolCommand {
}
syncIter
(
pre
.
iterator
.
asScala
.
toStream
,
seqA
.
iterator
.
asScala
.
toStream
,
seqB
.
iterator
.
asScala
.
toStream
)
seqOutA
.
close
()
seqOutB
.
close
()
(
numDiscA
,
numDiscB
,
numKept
)
}
...
...
@@ -252,15 +250,23 @@ object FastqSync extends ToolCommand {
val
commandArgs
:
Args
=
parseArgs
(
args
)
val
(
numDiscA
,
numDiscB
,
numKept
)
=
syncFastq
(
new
FastqReader
(
commandArgs
.
refFastq
),
new
FastqReader
(
commandArgs
.
inputFastq1
),
new
FastqReader
(
commandArgs
.
inputFastq2
),
new
AsyncFastqWriter
(
new
BasicFastqWriter
(
commandArgs
.
outputFastq1
),
3000
),
new
AsyncFastqWriter
(
new
BasicFastqWriter
(
commandArgs
.
outputFastq2
),
3000
))
println
(
s
"Filtered $numDiscA reads from first read file."
)
println
(
s
"Filtered $numDiscB reads from second read file."
)
println
(
s
"Synced files contain $numKept reads."
)
val
refReader
=
new
FastqReader
(
commandArgs
.
refFastq
)
val
AReader
=
new
FastqReader
(
commandArgs
.
inputFastq1
)
val
BReader
=
new
FastqReader
(
commandArgs
.
inputFastq2
)
val
AWriter
=
new
AsyncFastqWriter
(
new
BasicFastqWriter
(
commandArgs
.
outputFastq1
),
3000
)
val
BWriter
=
new
AsyncFastqWriter
(
new
BasicFastqWriter
(
commandArgs
.
outputFastq2
),
3000
)
try
{
val
(
numDiscA
,
numDiscB
,
numKept
)
=
syncFastq
(
refReader
,
AReader
,
BReader
,
AWriter
,
BWriter
)
println
(
s
"Filtered $numDiscA reads from first read file."
)
println
(
s
"Filtered $numDiscB reads from second read file."
)
println
(
s
"Synced files contain $numKept reads."
)
}
finally
{
refReader
.
close
()
AReader
.
close
()
BReader
.
close
()
AWriter
.
close
()
BWriter
.
close
()
}
}
}
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