Skip to content
GitLab
Menu
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
8a56e56b
Commit
8a56e56b
authored
Jun 13, 2016
by
Peter van 't Hof
Browse files
Added test for no sample to flexiprep
parent
bb9b5b6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
View file @
8a56e56b
...
...
@@ -78,28 +78,33 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
if
(
sampleId
==
null
||
sampleId
==
None
)
Logging
.
addError
(
"Missing sample ID on flexiprep module"
)
if
(
libId
==
null
||
libId
==
None
)
Logging
.
addError
(
"Missing library ID on flexiprep module"
)
paired
=
inputR2
.
isDefined
if
(
inputR1
==
null
)
Logging
.
addError
(
"Missing input R1 on flexiprep module"
)
else
{
paired
=
inputR2
.
isDefined
inputFiles
:+=
new
InputFile
(
inputR1
)
inputR2
.
foreach
(
inputFiles
:+=
new
InputFile
(
_
))
inputFiles
:+=
new
InputFile
(
inputR1
)
inputR2
.
foreach
(
inputFiles
:+=
new
InputFile
(
_
))
R1Name
=
getUncompressedFileName
(
inputR1
)
inputR2
.
foreach
{
fileR2
=>
paired
=
true
R2Name
=
getUncompressedFileName
(
fileR2
)
R1Name
=
getUncompressedFileName
(
inputR1
)
inputR2
.
foreach
{
fileR2
=>
paired
=
true
R2Name
=
getUncompressedFileName
(
fileR2
)
}
}
}
/** Script to add jobs */
def
biopetScript
()
{
runInitialJobs
()
if
(
inputR1
!=
null
)
{
runInitialJobs
()
if
(
paired
)
runTrimClip
(
inputR1
,
inputR2
,
outputDir
)
else
runTrimClip
(
inputR1
,
outputDir
)
if
(
paired
)
runTrimClip
(
inputR1
,
inputR2
,
outputDir
)
else
runTrimClip
(
inputR1
,
outputDir
)
val
R1Files
=
for
((
k
,
v
)
<-
outputFiles
if
k
.
endsWith
(
"output_R1"
))
yield
v
val
R2Files
=
for
((
k
,
v
)
<-
outputFiles
if
k
.
endsWith
(
"output_R2"
))
yield
v
runFinalize
(
R1Files
.
toList
,
R2Files
.
toList
)
val
R1Files
=
for
((
k
,
v
)
<-
outputFiles
if
k
.
endsWith
(
"output_R1"
))
yield
v
val
R2Files
=
for
((
k
,
v
)
<-
outputFiles
if
k
.
endsWith
(
"output_R2"
))
yield
v
runFinalize
(
R1Files
.
toList
,
R2Files
.
toList
)
}
}
/** Add init non chunkable jobs */
...
...
flexiprep/src/test/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/FlexiprepTest.scala
View file @
8a56e56b
...
...
@@ -17,14 +17,14 @@ package nl.lumc.sasc.biopet.pipelines.flexiprep
import
java.io.File
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.extensions.tools.
{
ValidateFastq
,
SeqStat
}
import
nl.lumc.sasc.biopet.extensions.tools.
{
SeqStat
,
ValidateFastq
}
import
nl.lumc.sasc.biopet.utils.ConfigUtils
import
nl.lumc.sasc.biopet.utils.config.Config
import
org.apache.commons.io.FileUtils
import
org.broadinstitute.gatk.queue.QSettings
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.
{
AfterClass
,
DataProvider
,
Test
}
import
org.testng.annotations.
{
AfterClass
,
DataProvider
,
Test
}
/**
* Test class for [[Flexiprep]]
...
...
@@ -83,6 +83,18 @@ class FlexiprepTest extends TestNGSuite with Matchers {
}
@Test
def
testNoSample
:
Unit
=
{
val
map
=
ConfigUtils
.
mergeMaps
(
Map
(
"output_dir"
->
FlexiprepTest
.
outputDir
),
Map
(
FlexiprepTest
.
executables
.
toSeq
:
_
*
))
val
flexiprep
:
Flexiprep
=
initPipeline
(
map
)
intercept
[
IllegalStateException
]
{
flexiprep
.
script
()
}
}
// remove temporary run directory all tests in the class have been run
@AfterClass
def
removeTempOutputDir
()
=
{
FileUtils
.
deleteDirectory
(
FlexiprepTest
.
outputDir
)
...
...
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