Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
biopet.biopet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Mirrors
biopet.biopet
Commits
527d43b8
Commit
527d43b8
authored
Mar 09, 2017
by
Peter van 't Hof
Committed by
GitHub
Mar 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34 from biopet/Fix_BIOPET_557
Changed VCFstats to check whether outputDir is a valid directory.
parents
5da52a7b
c55f3de2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/vcfstats/VcfStats.scala
...n/scala/nl/lumc/sasc/biopet/tools/vcfstats/VcfStats.scala
+1
-1
biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/VcfStatsTest.scala
...c/test/scala/nl/lumc/sasc/biopet/tools/VcfStatsTest.scala
+13
-2
No files found.
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/vcfstats/VcfStats.scala
View file @
527d43b8
...
...
@@ -74,7 +74,7 @@ object VcfStats extends ToolCommand {
opt
[
File
](
'o'
,
"outputDir"
)
required
()
unbounded
()
maxOccurs
1
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
outputDir
=
x
)
}
validate
{
x
=>
if
(
x
==
null
)
failure
(
"
Output directory required"
)
else
success
x
=>
if
(
x
==
null
)
failure
(
"
Valid output directory required"
)
else
if
(
x
.
exists
)
success
else
failure
(
s
"Output directory does not exist: $x"
)
}
text
"Path to directory for output (required)"
opt
[
File
](
'i'
,
"intervals"
)
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
intervals
=
Some
(
x
))
...
...
biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/VcfStatsTest.scala
View file @
527d43b8
...
...
@@ -15,15 +15,16 @@
package
nl.lumc.sasc.biopet.tools
import
java.io.File
import
java.nio.file.
{
Files
,
Paths
}
import
java.nio.file.
{
Files
,
Paths
}
import
htsjdk.variant.vcf.VCFFileReader
import
nl.lumc.sasc.biopet.tools.vcfstats.
{
SampleStats
,
SampleToSampleStats
,
Stats
,
VcfStats
}
import
nl.lumc.sasc.biopet.tools.vcfstats.
{
SampleStats
,
SampleToSampleStats
,
Stats
,
VcfStats
}
import
nl.lumc.sasc.biopet.tools.vcfstats.VcfStats._
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
import
nl.lumc.sasc.biopet.utils.sortAnyAny
import
org.apache.commons.io.FileUtils
import
scala.collection.mutable
...
...
@@ -162,6 +163,16 @@ class VcfStatsTest extends TestNGSuite with Matchers {
valueFromTsv
(
i
,
"Sample_ID_3"
,
"bam"
)
should
be
(
empty
)
}
@Test
def
testNoExistOutputDir
:
Unit
=
{
val
tmp
=
Files
.
createTempDirectory
(
"vcfStats"
)
FileUtils
.
deleteDirectory
(
new
File
(
tmp
.
toAbsolutePath
.
toString
))
val
vcf
=
resourcePath
(
"/chrQ.vcf.gz"
)
val
ref
=
resourcePath
(
"/fake_chrQ.fa"
)
an
[
IllegalArgumentException
]
should
be
thrownBy
main
(
Array
(
"-I"
,
vcf
,
"-R"
,
ref
,
"-o"
,
tmp
.
toAbsolutePath
.
toString
))
}
@Test
def
testMain
()
=
{
val
tmp
=
Files
.
createTempDirectory
(
"vcfStats"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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