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
978b8381
Commit
978b8381
authored
Feb 05, 2015
by
Peter van 't Hof
Browse files
Added more scala docs
parent
ba287a2d
Changes
6
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetJavaCommandLineFunction.scala
View file @
978b8381
...
...
@@ -17,16 +17,28 @@ package nl.lumc.sasc.biopet.core
import
org.broadinstitute.gatk.queue.function.JavaCommandLineFunction
/**
* Biopet commandline class for java based programs
*/
trait
BiopetJavaCommandLineFunction
extends
JavaCommandLineFunction
with
BiopetCommandLineFunctionTrait
{
executable
=
"java"
executable
=
config
(
"java"
,
default
=
"java"
,
submodule
=
"java"
,
freeVar
=
false
)
javaGCThreads
=
config
(
"java_gc_threads"
)
javaGCHeapFreeLimit
=
config
(
"java_gc_heap_freelimit"
)
javaGCTimeLimit
=
config
(
"java_gc_timelimit"
)
override
def
javaOpts
=
super
.
javaOpts
+
optional
(
"-Dscala.concurrent.context.numThreads="
,
threads
,
spaceSeparated
=
false
,
escape
=
false
)
/**
* Constructs java opts, this adds scala threads
* @return
*/
override
def
javaOpts
=
super
.
javaOpts
+
optional
(
"-Dscala.concurrent.context.numThreads="
,
threads
,
spaceSeparated
=
false
,
escape
=
false
)
/**
* Sets memory limit
*/
override
def
afterGraph
{
super
.
afterGraph
memoryLimit
=
config
(
"memory_limit"
)
}
...
...
@@ -38,7 +50,6 @@ trait BiopetJavaCommandLineFunction extends JavaCommandLineFunction with BiopetC
preCmdInternal
val
cmd
=
super
.
commandLine
val
finalCmd
=
executable
+
cmd
.
substring
(
cmd
.
indexOf
(
" "
))
// addJobReportBinding("command", cmd)
return
cmd
}
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
View file @
978b8381
...
...
@@ -24,6 +24,9 @@ import org.broadinstitute.gatk.queue.function.QFunction
import
org.broadinstitute.gatk.queue.function.scattergather.ScatterGatherableFunction
import
org.broadinstitute.gatk.queue.util.
{
Logging
=>
GatkLogging
}
/**
* Base for biopet pipeline
*/
trait
BiopetQScript
extends
Configurable
with
GatkLogging
{
@Argument
(
doc
=
"JSON config file(s)"
,
fullName
=
"config_file"
,
shortName
=
"config"
,
required
=
false
)
...
...
@@ -43,13 +46,21 @@ trait BiopetQScript extends Configurable with GatkLogging {
var
outputFiles
:
Map
[
String
,
File
]
=
Map
()
/** Get implemented from org.broadinstitute.gatk.queue.QScript */
var
qSettings
:
QSettings
/** Get implemented from org.broadinstitute.gatk.queue.QScript */
var
functions
:
Seq
[
QFunction
]
/** Init for pipeline */
def
init
def
biopetScript
var
functions
:
Seq
[
QFunction
]
/** Pipeline itself */
def
biopetScript
/**
* Script from queue itself, final to force some checks for each pipeline and write report
*/
final
def
script
()
{
outputDir
=
config
(
"output_dir"
,
required
=
true
)
if
(!
outputDir
.
endsWith
(
"/"
))
outputDir
+=
"/"
...
...
@@ -68,10 +79,16 @@ trait BiopetQScript extends Configurable with GatkLogging {
Config
.
global
.
writeReport
(
qSettings
.
runName
,
outputDir
+
".log/"
+
qSettings
.
runName
)
}
def
add
(
functions
:
QFunction*
)
// Gets implemeted at org.broadinstitute.sting.queue.QScript
/** Get implemented from org.broadinstitute.gatk.queue.QScript */
def
add
(
functions
:
QFunction*
)
/**
* Function to set isIntermediate and add in 1 line
* @param function
* @param isIntermediate
*/
def
add
(
function
:
QFunction
,
isIntermediate
:
Boolean
=
false
)
{
function
.
isIntermediate
=
isIntermediate
add
(
function
)
}
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/MainCommand.scala
View file @
978b8381
...
...
@@ -15,6 +15,9 @@
*/
package
nl.lumc.sasc.biopet.core
/**
* This trait is used in the biopet executable
*/
trait
MainCommand
{
lazy
val
commandName
=
this
.
getClass
.
getSimpleName
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/PipelineCommand.scala
View file @
978b8381
...
...
@@ -20,10 +20,21 @@ import java.io.File
import
nl.lumc.sasc.biopet.core.config.Config
import
nl.lumc.sasc.biopet.core.workaround.BiopetQCommandLine
/**
* Wrapper around executable from Queue
*/
trait
PipelineCommand
extends
MainCommand
with
GatkLogging
{
/**
* Gets location of compiled class of pipeline
* @return path from classPath to class file
*/
def
pipeline
=
"/"
+
getClass
.
getName
.
stripSuffix
(
"$"
).
replaceAll
(
"\\."
,
"/"
)
+
".class"
/**
* Class can be used directly from java with -cp option
* @param args
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsSize
=
args
.
size
for
(
t
<-
0
until
argsSize
)
{
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/ToolCommand.scala
View file @
978b8381
...
...
@@ -15,10 +15,16 @@
*/
package
nl.lumc.sasc.biopet.core
/**
* Trait for biopet tools, sets some default args
*/
trait
ToolCommand
extends
MainCommand
with
Logging
{
protected
abstract
class
AbstractA
rgs
{
}
/** Placeholder for a
rgs
*/
protected
abstract
class
AbstractArgs
{
}
/**
* Abstract opt parser to add efault args to each biopet tool
*/
protected
abstract
class
AbstractOptParser
extends
scopt
.
OptionParser
[
Args
](
commandName
)
{
opt
[
String
](
'l'
,
"log_level"
)
foreach
{
x
=>
x
.
toLowerCase
match
{
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/workaround/BiopetQCommandLine.scala
View file @
978b8381
...
...
@@ -39,14 +39,16 @@
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* This is a modifed version of org.broadinstitute.gatk.queue.QCommandLine, works without compiling a scala files but used build in class files to skip compile step
*/
package
nl.lumc.sasc.biopet.core.workaround
import
java.io.File
import
org.broadinstitute.gatk.utils.commandline._
import
org.broadinstitute.gatk.queue.util._
import
org.broadinstitute.gatk.queue.QCommandPlugin
import
org.broadinstitute.gatk.queue.QScript
import
org.broadinstitute.gatk.queue.QScriptManager
import
org.broadinstitute.gatk.queue.
{
QCommandPlugin
,
QScript
,
QScriptManager
}
import
org.broadinstitute.gatk.queue.util.
{
Logging
=>
GatkLogging
}
import
org.broadinstitute.gatk.queue.engine.
{
QStatusMessenger
,
QGraphSettings
,
QGraph
}
import
collection.JavaConversions._
...
...
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