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
1bd1056d
Commit
1bd1056d
authored
Mar 14, 2016
by
Peter van 't Hof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed unit tests
parent
636158a5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
17 deletions
+27
-17
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
.../nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
+12
-5
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetFifoPipe.scala
.../main/scala/nl/lumc/sasc/biopet/core/BiopetFifoPipe.scala
+2
-2
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetPipe.scala
.../src/main/scala/nl/lumc/sasc/biopet/core/BiopetPipe.scala
+2
-2
public/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
...sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
+11
-8
No files found.
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
View file @
1bd1056d
...
...
@@ -83,13 +83,14 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
/** Set default output file, threads and vmem for current job */
final
def
internalBeforeGraph
()
:
Unit
=
{
pipesJobs
.
foreach
(
_
.
beforeGraph
())
pipesJobs
.
foreach
(
_
.
internalBeforeGraph
())
_
pipesJobs
.
foreach
(
_
.
beforeGraph
())
_
pipesJobs
.
foreach
(
_
.
internalBeforeGraph
())
}
/**
* Can override this value is executable may not be converted to CanonicalPath
*
* @deprecated
*/
val
executableToCanonicalPath
=
true
...
...
@@ -121,6 +122,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
/**
* This operator sends stdout to `that` and combine this into 1 command line function
*
* @param that Function that will read from stdin
* @return BiopetPipe function
*/
...
...
@@ -141,6 +143,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
/**
* This operator can be used to give a program a file as stdin
*
* @param file File that will become stdin for this program
* @return It's own class
*/
...
...
@@ -152,6 +155,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
/**
* This operator can be used to give a program a file write it's atdout
*
* @param file File that will become stdout for this program
* @return It's own class
*/
...
...
@@ -169,6 +173,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
/**
* This function needs to be implemented to define the command that is executed
*
* @return Command to run
*/
protected
[
core
]
def
cmdLine
:
String
...
...
@@ -176,6 +181,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
/**
* implementing a final version of the commandLine from org.broadinstitute.gatk.queue.function.CommandLineFunction
* User needs to implement cmdLine instead
*
* @return Command to run
*/
override
final
def
commandLine
:
String
=
{
...
...
@@ -187,10 +193,11 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
cmd
}
private
[
core
]
var
pipesJobs
:
List
[
BiopetCommandLineFunction
]
=
Nil
private
[
core
]
var
_pipesJobs
:
List
[
BiopetCommandLineFunction
]
=
Nil
def
pipesJobs
=
_pipesJobs
def
addPipeJob
(
job
:
BiopetCommandLineFunction
)
{
pipesJobs
:+=
job
pipesJobs
=
pipesJobs
.
distinct
_
pipesJobs
:+=
job
_pipesJobs
=
_
pipesJobs
.
distinct
}
}
...
...
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetFifoPipe.scala
View file @
1bd1056d
...
...
@@ -67,8 +67,8 @@ class BiopetFifoPipe(val root: Configurable,
deps
:::=
inputs
.
values
.
toList
.
flatten
.
filter
(!
fifoFiles
.
contains
(
_
))
deps
=
deps
.
distinct
pipesJobs
:::=
commands
pipesJobs
=
pipesJobs
.
distinct
_
pipesJobs
:::=
commands
_pipesJobs
=
_
pipesJobs
.
distinct
}
override
def
beforeCmd
()
:
Unit
=
{
...
...
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetPipe.scala
View file @
1bd1056d
...
...
@@ -41,7 +41,7 @@ class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCo
case
e
:
Exception
=>
Nil
}
pipesJobs
:::=
commands
_
pipesJobs
:::=
commands
override
def
beforeGraph
()
{
super
.
beforeGraph
()
...
...
@@ -61,7 +61,7 @@ class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCo
}
override
def
setResources
()
:
Unit
=
{
combineResources
(
pipesJobs
)
combineResources
(
_
pipesJobs
)
}
override
def
setupRetry
()
:
Unit
=
{
...
...
public/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
View file @
1bd1056d
...
...
@@ -18,16 +18,17 @@ package nl.lumc.sasc.biopet.pipelines.shiva
import
java.io.
{
File
,
FileOutputStream
}
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.
utils.config.Config
import
nl.lumc.sasc.biopet.
core.BiopetPipe
import
nl.lumc.sasc.biopet.extensions.Freebayes
import
nl.lumc.sasc.biopet.extensions.bcftools.
{
BcftoolsCall
,
BcftoolsMerge
}
import
nl.lumc.sasc.biopet.extensions.gatk.CombineVariants
import
nl.lumc.sasc.biopet.extensions.tools.
VcfFilter
import
nl.lumc.sasc.biopet.extensions.tools.
{
MpileupToVcf
,
VcfFilter
}
import
nl.lumc.sasc.biopet.utils.ConfigUtils
import
org.apache.commons.io.FileUtils
import
nl.lumc.sasc.biopet.utils.config.Config
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.
{
DataProvider
,
Test
}
import
scala.collection.mutable.ListBuffer
...
...
@@ -88,11 +89,13 @@ class ShivaVariantcallingTest extends TestNGSuite with Matchers {
pipeline
.
init
()
pipeline
.
script
()
val
pipesJobs
=
pipeline
.
functions
.
filter
(
_
.
isInstanceOf
[
BiopetPipe
]).
flatMap
(
_
.
asInstanceOf
[
BiopetPipe
].
pipesJobs
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
CombineVariants
])
shouldBe
(
1
+
(
if
(
raw
)
1
else
0
)
+
(
if
(
varscanCnsSinglesample
)
1
else
0
))
//pipeline.functions.count(_.isInstanceOf[Bcftools]) shouldBe (if (bcftools) 1
else 0)
//FIXME: Can not check for bcftools because of piping
pipe
line
.
function
s
.
count
(
_
.
isInstanceOf
[
Freebayes
])
shouldBe
(
if
(
freebayes
)
1
else
0
)
//pipeline.function
s.count(_.isInstanceOf[MpileupToVcf]) shouldBe (if (raw) bams else 0)
pipesJobs
.
count
(
_
.
isInstanceOf
[
BcftoolsCall
])
shouldBe
(
if
(
bcftools
)
1
else
0
)
+
(
if
(
bcftoolsSinglesample
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
BcftoolsMerge
])
shouldBe
(
if
(
bcftoolsSinglesample
&&
bams
>
1
)
1
else
0
)
pipe
sJob
s
.
count
(
_
.
isInstanceOf
[
Freebayes
])
shouldBe
(
if
(
freebayes
)
1
else
0
)
pipesJob
s
.
count
(
_
.
isInstanceOf
[
MpileupToVcf
])
shouldBe
(
if
(
raw
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
VcfFilter
])
shouldBe
(
if
(
raw
)
bams
else
0
)
}
}
...
...
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