Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Mirrors
biopet.biopet
Commits
02b571a4
Commit
02b571a4
authored
Jul 23, 2014
by
bow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update code style using scalariform
parent
96ccc270
Changes
51
Show whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
1276 additions
and
1282 deletions
+1276
-1282
bam-metrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetrics.scala
...nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetrics.scala
+26
-26
bam-metrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/scripts/CoverageStats.scala
...c/biopet/pipelines/bammetrics/scripts/CoverageStats.scala
+10
-10
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
.../nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
+1
-1
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
...umc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
+31
-31
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetJavaCommandLineFunction.scala
...lumc/sasc/biopet/core/BiopetJavaCommandLineFunction.scala
+2
-2
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQCommandLine.scala
...n/scala/nl/lumc/sasc/biopet/core/BiopetQCommandLine.scala
+20
-23
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
...c/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
+11
-12
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/MultiSampleQScript.scala
...n/scala/nl/lumc/sasc/biopet/core/MultiSampleQScript.scala
+16
-15
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/PipelineCommand.scala
...main/scala/nl/lumc/sasc/biopet/core/PipelineCommand.scala
+9
-9
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/apps/BedToInterval.scala
...n/scala/nl/lumc/sasc/biopet/core/apps/BedToInterval.scala
+18
-18
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/apps/BiopetFlagstat.scala
.../scala/nl/lumc/sasc/biopet/core/apps/BiopetFlagstat.scala
+55
-59
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/apps/FastqSplitter.scala
...n/scala/nl/lumc/sasc/biopet/core/apps/FastqSplitter.scala
+12
-12
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala
...c/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala
+59
-59
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/ConfigValue.scala
...n/scala/nl/lumc/sasc/biopet/core/config/ConfigValue.scala
+8
-8
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/ConfigValueIndex.scala
...la/nl/lumc/sasc/biopet/core/config/ConfigValueIndex.scala
+3
-3
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
.../scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
+57
-57
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/Cat.scala
...ork/src/main/scala/nl/lumc/sasc/biopet/function/Cat.scala
+7
-7
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/Ln.scala
...work/src/main/scala/nl/lumc/sasc/biopet/function/Ln.scala
+7
-7
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/Pbzip2.scala
.../src/main/scala/nl/lumc/sasc/biopet/function/Pbzip2.scala
+18
-18
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/PythonCommandLineFunction.scala
...lumc/sasc/biopet/function/PythonCommandLineFunction.scala
+10
-10
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/Sha1sum.scala
...src/main/scala/nl/lumc/sasc/biopet/function/Sha1sum.scala
+7
-7
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/Zcat.scala
...rk/src/main/scala/nl/lumc/sasc/biopet/function/Zcat.scala
+9
-9
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/bedtools/Bedtools.scala
...cala/nl/lumc/sasc/biopet/function/bedtools/Bedtools.scala
+1
-1
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/bedtools/BedtoolsCoverage.scala
...lumc/sasc/biopet/function/bedtools/BedtoolsCoverage.scala
+18
-18
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/bedtools/BedtoolsIntersect.scala
...umc/sasc/biopet/function/bedtools/BedtoolsIntersect.scala
+21
-21
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/picard/CalculateHsMetrics.scala
...lumc/sasc/biopet/function/picard/CalculateHsMetrics.scala
+28
-28
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/picard/CollectAlignmentSummaryMetrics.scala
...opet/function/picard/CollectAlignmentSummaryMetrics.scala
+32
-32
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/picard/CollectGcBiasMetrics.scala
...mc/sasc/biopet/function/picard/CollectGcBiasMetrics.scala
+29
-29
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/picard/CollectInsertSizeMetrics.scala
...asc/biopet/function/picard/CollectInsertSizeMetrics.scala
+32
-32
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/picard/MarkDuplicates.scala
.../nl/lumc/sasc/biopet/function/picard/MarkDuplicates.scala
+54
-54
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/picard/Picard.scala
...in/scala/nl/lumc/sasc/biopet/function/picard/Picard.scala
+29
-29
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/samtools/Samtools.scala
...cala/nl/lumc/sasc/biopet/function/samtools/Samtools.scala
+2
-2
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/samtools/SamtoolsFlagstat.scala
...lumc/sasc/biopet/function/samtools/SamtoolsFlagstat.scala
+13
-13
flexiprep/src/main/scala/nl/lumc/sasc/biopet/function/fastq/Cutadapt.scala
...n/scala/nl/lumc/sasc/biopet/function/fastq/Cutadapt.scala
+29
-29
flexiprep/src/main/scala/nl/lumc/sasc/biopet/function/fastq/Fastqc.scala
...ain/scala/nl/lumc/sasc/biopet/function/fastq/Fastqc.scala
+22
-22
flexiprep/src/main/scala/nl/lumc/sasc/biopet/function/fastq/Sickle.scala
...ain/scala/nl/lumc/sasc/biopet/function/fastq/Sickle.scala
+32
-32
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
...a/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
+80
-80
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/scripts/FastqSync.scala
...c/sasc/biopet/pipelines/flexiprep/scripts/FastqSync.scala
+15
-15
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/scripts/FastqcToContams.scala
.../biopet/pipelines/flexiprep/scripts/FastqcToContams.scala
+14
-14
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/scripts/FastqcToQualtype.scala
...biopet/pipelines/flexiprep/scripts/FastqcToQualtype.scala
+10
-10
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/scripts/Seqstat.scala
...umc/sasc/biopet/pipelines/flexiprep/scripts/Seqstat.scala
+12
-12
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/scripts/Summarize.scala
...c/sasc/biopet/pipelines/flexiprep/scripts/Summarize.scala
+14
-14
gatk/gatk-benchmark-genotyping/src/main/scala/nl/lumc/sasc/biopet/pipelines/gatk/GatkBenchmarkGenotyping.scala
.../sasc/biopet/pipelines/gatk/GatkBenchmarkGenotyping.scala
+17
-17
gatk/gatk-genotyping/src/main/scala/nl/lumc/sasc/biopet/pipelines/gatk/GatkGenotyping.scala
...a/nl/lumc/sasc/biopet/pipelines/gatk/GatkGenotyping.scala
+31
-31
gatk/gatk-old/src/main/scala/nl/lumc/sasc/biopet/pipelines/gatk/Gatk.scala
.../main/scala/nl/lumc/sasc/biopet/pipelines/gatk/Gatk.scala
+73
-73
gatk/gatk-pipeline/src/main/scala/nl/lumc/sasc/biopet/pipelines/gatk/GatkPipeline.scala
...ala/nl/lumc/sasc/biopet/pipelines/gatk/GatkPipeline.scala
+77
-77
gatk/gatk-variantcalling/src/main/scala/nl/lumc/sasc/biopet/pipelines/gatk/GatkVariantcalling.scala
.../lumc/sasc/biopet/pipelines/gatk/GatkVariantcalling.scala
+43
-43
mapping/src/main/scala/nl/lumc/sasc/biopet/function/aligners/Bwa.scala
...ain/scala/nl/lumc/sasc/biopet/function/aligners/Bwa.scala
+27
-27
mapping/src/main/scala/nl/lumc/sasc/biopet/function/aligners/Star.scala
...in/scala/nl/lumc/sasc/biopet/function/aligners/Star.scala
+38
-38
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
...scala/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
+83
-82
pipeline-template/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/PipelineTemplate.scala
...c/sasc/biopet/pipelines/bammetrics/PipelineTemplate.scala
+4
-4
No files found.
bam-metrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetrics.scala
View file @
02b571a4
...
...
@@ -2,27 +2,27 @@ package nl.lumc.sasc.biopet.pipelines.bammetrics
import
nl.lumc.sasc.biopet.pipelines.bammetrics.scripts.CoverageStats
import
org.broadinstitute.gatk.queue.QScript
import
nl.lumc.sasc.biopet.core.
{
BiopetQScript
,
PipelineCommand
}
import
nl.lumc.sasc.biopet.core.
{
BiopetQScript
,
PipelineCommand
}
import
java.io.File
import
nl.lumc.sasc.biopet.core.apps.
{
BedToInterval
,
BiopetFlagstat
}
import
nl.lumc.sasc.biopet.core.apps.
{
BedToInterval
,
BiopetFlagstat
}
import
nl.lumc.sasc.biopet.core.config.Configurable
import
nl.lumc.sasc.biopet.function.bedtools.
{
BedtoolsCoverage
,
BedtoolsIntersect
}
import
nl.lumc.sasc.biopet.function.picard.
{
CollectInsertSizeMetrics
,
CollectGcBiasMetrics
,
CalculateHsMetrics
,
CollectAlignmentSummaryMetrics
}
import
nl.lumc.sasc.biopet.function.bedtools.
{
BedtoolsCoverage
,
BedtoolsIntersect
}
import
nl.lumc.sasc.biopet.function.picard.
{
CollectInsertSizeMetrics
,
CollectGcBiasMetrics
,
CalculateHsMetrics
,
CollectAlignmentSummaryMetrics
}
import
nl.lumc.sasc.biopet.function.samtools.SamtoolsFlagstat
class
BamMetrics
(
val
root
:
Configurable
)
extends
QScript
with
BiopetQScript
{
class
BamMetrics
(
val
root
:
Configurable
)
extends
QScript
with
BiopetQScript
{
def
this
()
=
this
(
null
)
@Input
(
doc
=
"Bam File"
,
shortName
=
"BAM"
,
required
=
true
)
@Input
(
doc
=
"Bam File"
,
shortName
=
"BAM"
,
required
=
true
)
var
inputBam
:
File
=
_
@Input
(
doc
=
"Bed tracks targets"
,
shortName
=
"target"
,
required
=
false
)
@Input
(
doc
=
"Bed tracks targets"
,
shortName
=
"target"
,
required
=
false
)
var
bedFiles
:
List
[
File
]
=
Nil
@Input
(
doc
=
"Bed tracks bait"
,
shortName
=
"bait"
,
required
=
false
)
@Input
(
doc
=
"Bed tracks bait"
,
shortName
=
"bait"
,
required
=
false
)
var
baitBedFile
:
File
=
_
@Argument
(
doc
=
""
,
required
=
false
)
@Argument
(
doc
=
""
,
required
=
false
)
var
wholeGenome
=
false
def
init
()
{
...
...
@@ -50,12 +50,12 @@ class BamMetrics(val root:Configurable) extends QScript with BiopetQScript {
else
targetInterval
.
output
,
targetInterval
.
output
,
targetDir
))
val
strictOutputBam
=
new
File
(
targetDir
,
inputBam
.
getName
.
stripSuffix
(
".bam"
)
+
".overlap.strict.bam"
)
add
(
BedtoolsIntersect
(
this
,
inputBam
,
bedFile
,
strictOutputBam
,
minOverlap
=
config
(
"strictintersectoverlap"
,
default
=
1.0
)),
true
)
add
(
BedtoolsIntersect
(
this
,
inputBam
,
bedFile
,
strictOutputBam
,
minOverlap
=
config
(
"strictintersectoverlap"
,
default
=
1.0
)),
true
)
add
(
SamtoolsFlagstat
(
this
,
strictOutputBam
))
add
(
BiopetFlagstat
(
this
,
strictOutputBam
,
targetDir
))
val
looseOutputBam
=
new
File
(
targetDir
,
inputBam
.
getName
.
stripSuffix
(
".bam"
)
+
".overlap.loose.bam"
)
add
(
BedtoolsIntersect
(
this
,
inputBam
,
bedFile
,
looseOutputBam
,
minOverlap
=
config
(
"looseintersectoverlap"
,
default
=
0.01
)),
true
)
add
(
BedtoolsIntersect
(
this
,
inputBam
,
bedFile
,
looseOutputBam
,
minOverlap
=
config
(
"looseintersectoverlap"
,
default
=
0.01
)),
true
)
add
(
SamtoolsFlagstat
(
this
,
looseOutputBam
))
add
(
BiopetFlagstat
(
this
,
looseOutputBam
,
targetDir
))
...
...
@@ -69,7 +69,7 @@ class BamMetrics(val root:Configurable) extends QScript with BiopetQScript {
object
BamMetrics
extends
PipelineCommand
{
override
val
pipeline
=
"/nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetrics.class"
def
apply
(
root
:
Configurable
,
bamFile
:
File
,
outputDir
:
String
)
:
BamMetrics
=
{
def
apply
(
root
:
Configurable
,
bamFile
:
File
,
outputDir
:
String
)
:
BamMetrics
=
{
val
bamMetrics
=
new
BamMetrics
(
root
)
bamMetrics
.
inputBam
=
bamFile
bamMetrics
.
outputDir
=
outputDir
...
...
bam-metrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/scripts/CoverageStats.scala
View file @
02b571a4
...
...
@@ -2,19 +2,19 @@ package nl.lumc.sasc.biopet.pipelines.bammetrics.scripts
import
nl.lumc.sasc.biopet.core.config.Configurable
import
nl.lumc.sasc.biopet.function.PythonCommandLineFunction
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
class
CoverageStats
(
val
root
:
Configurable
)
extends
PythonCommandLineFunction
{
class
CoverageStats
(
val
root
:
Configurable
)
extends
PythonCommandLineFunction
{
setPythonScript
(
"bedtools_cov_stats.py"
)
@Input
(
doc
=
"Input file"
)
@Input
(
doc
=
"Input file"
)
var
input
:
File
=
_
@Output
(
doc
=
"output File"
)
@Output
(
doc
=
"output File"
)
var
output
:
File
=
_
@Output
(
doc
=
"plot File (png)"
)
@Output
(
doc
=
"plot File (png)"
)
var
plot
:
File
=
_
def
cmdLine
=
getPythonCommand
+
...
...
@@ -22,7 +22,7 @@ class CoverageStats(val root:Configurable) extends PythonCommandLineFunction {
}
object
CoverageStats
{
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
CoverageStats
=
{
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
CoverageStats
=
{
val
coverageStats
=
new
CoverageStats
(
root
)
coverageStats
.
input
=
input
coverageStats
.
output
=
new
File
(
outputDir
,
input
.
getName
+
".stats"
)
...
...
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
View file @
02b571a4
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
View file @
02b571a4
...
...
@@ -11,18 +11,18 @@ import scala.util.matching.Regex
trait
BiopetCommandLineFunctionTrait
extends
CommandLineFunction
with
Configurable
{
analysisName
=
getClass
.
getSimpleName
@Input
(
doc
=
"deps"
,
required
=
false
)
@Input
(
doc
=
"deps"
,
required
=
false
)
var
deps
:
List
[
File
]
=
Nil
@Argument
(
doc
=
"Threads"
,
required
=
false
)
@Argument
(
doc
=
"Threads"
,
required
=
false
)
var
threads
=
0
val
defaultThreads
=
1
@Argument
(
doc
=
"Vmem"
,
required
=
false
)
@Argument
(
doc
=
"Vmem"
,
required
=
false
)
var
vmem
:
String
=
_
val
defaultVmem
:
String
=
""
@Argument
(
doc
=
"Executable"
)
@Argument
(
doc
=
"Executable"
)
var
executable
:
String
=
_
protected
def
beforeCmd
{
...
...
@@ -81,7 +81,7 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
protected
def
versionCommand
:
String
=
null
protected
val
versionRegex
:
Regex
=
null
protected
val
versionExitcode
=
List
(
0
)
// Can select multiple
def
getVersion
:
String
=
{
def
getVersion
:
String
=
{
if
(
versionCommand
==
null
||
versionRegex
==
null
)
return
"N/A"
val
buffer
=
new
StringBuffer
()
val
process
=
Process
(
versionCommand
).
run
(
ProcessLogger
(
buffer
append
_
))
...
...
@@ -100,16 +100,16 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
return
"N/A"
}
def
getThreads
(
default
:
Int
)
:
Int
=
{
val
maxThreads
:
Int
=
config
(
"maxthreads"
,
default
=
8
)
val
threads
:
Int
=
config
(
"threads"
,
default
=
default
)
def
getThreads
(
default
:
Int
)
:
Int
=
{
val
maxThreads
:
Int
=
config
(
"maxthreads"
,
default
=
8
)
val
threads
:
Int
=
config
(
"threads"
,
default
=
default
)
if
(
maxThreads
>
threads
)
return
threads
else
return
maxThreads
}
def
getThreads
(
default
:
Int
,
module
:
String
)
:
Int
=
{
val
maxThreads
:
Int
=
config
(
"maxthreads"
,
default
=
8
,
submodule
=
module
)
val
threads
:
Int
=
config
(
"threads"
,
default
=
default
,
submodule
=
module
)
def
getThreads
(
default
:
Int
,
module
:
String
)
:
Int
=
{
val
maxThreads
:
Int
=
config
(
"maxthreads"
,
default
=
8
,
submodule
=
module
)
val
threads
:
Int
=
config
(
"threads"
,
default
=
default
,
submodule
=
module
)
if
(
maxThreads
>
threads
)
return
threads
else
return
maxThreads
}
...
...
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetJavaCommandLineFunction.scala
View file @
02b571a4
...
...
@@ -9,7 +9,7 @@ abstract class BiopetJavaCommandLineFunction extends JavaCommandLineFunction wit
preCmdInternal
val
cmd
=
super
.
commandLine
val
finalCmd
=
executable
+
cmd
.
substring
(
cmd
.
indexOf
(
" "
))
// addJobReportBinding("command", cmd)
// addJobReportBinding("command", cmd)
return
cmd
}
}
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQCommandLine.scala
View file @
02b571a4
...
...
@@ -32,7 +32,7 @@ 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.engine.
{
QStatusMessenger
,
QGraphSettings
,
QGraph
}
import
org.broadinstitute.gatk.queue.engine.
{
QStatusMessenger
,
QGraphSettings
,
QGraph
}
import
collection.JavaConversions._
import
org.broadinstitute.gatk.utils.classloader.PluginManager
import
org.broadinstitute.gatk.utils.exceptions.UserException
...
...
@@ -40,7 +40,7 @@ import org.broadinstitute.gatk.utils.io.IOUtils
import
org.broadinstitute.gatk.utils.help.ApplicationDetails
import
java.io.FileOutputStream
import
java.net.URL
import
java.util.
{
ResourceBundle
,
Arrays
}
import
java.util.
{
ResourceBundle
,
Arrays
}
import
org.broadinstitute.gatk.utils.text.TextFormattingUtils
import
org.apache.commons.io.FilenameUtils
...
...
@@ -84,7 +84,7 @@ object BiopetQCommandLine extends Logging {
* Entry point of Queue. Compiles and runs QScripts passed in to the command line.
*/
class
BiopetQCommandLine
extends
CommandLineProgram
with
Logging
{
@Input
(
fullName
=
"script"
,
shortName
=
"S"
,
doc
=
"QScript scala file"
,
required
=
false
)
@Input
(
fullName
=
"script"
,
shortName
=
"S"
,
doc
=
"QScript scala file"
,
required
=
false
)
@ClassType
(
classOf
[
File
])
var
scripts
:
Seq
[
File
]
=
Nil
var
pipelineName
:
String
=
_
...
...
@@ -155,8 +155,7 @@ class BiopetQCommandLine extends CommandLineProgram with Logging {
// TODO: Default command plugin argument?
val
remoteFileConverter
=
(
for
(
commandPlugin
<-
allCommandPlugins
if
(
commandPlugin
.
remoteFileConverter
!=
null
))
yield
commandPlugin
.
remoteFileConverter
).
headOption
.
getOrElse
(
null
)
yield
commandPlugin
.
remoteFileConverter
).
headOption
.
getOrElse
(
null
)
if
(
remoteFileConverter
!=
null
)
loadArgumentsIntoObject
(
remoteFileConverter
)
...
...
@@ -267,37 +266,35 @@ class BiopetQCommandLine extends CommandLineProgram with Logging {
override
def
getArgumentTypeDescriptors
=
Arrays
.
asList
(
new
ScalaCompoundArgumentTypeDescriptor
)
override
def
getApplicationDetails
:
ApplicationDetails
=
{
override
def
getApplicationDetails
:
ApplicationDetails
=
{
new
ApplicationDetails
(
createQueueHeader
(),
Seq
.
empty
[
String
],
ApplicationDetails
.
createDefaultRunningInstructions
(
getClass
.
asInstanceOf
[
Class
[
CommandLineProgram
]]),
""
)
}
private
def
createQueueHeader
()
:
Seq
[
String
]
=
{
private
def
createQueueHeader
()
:
Seq
[
String
]
=
{
Seq
(
String
.
format
(
"Queue v%s, Compiled %s"
,
getQueueVersion
,
getBuildTimestamp
),
"Copyright (c) 2012 The Broad Institute"
,
"For support and documentation go to http://www.broadinstitute.org/gatk"
)
}
private
def
getQueueVersion
:
String
=
{
val
stingResources
:
ResourceBundle
=
TextFormattingUtils
.
loadResourceBundle
(
"StingText"
)
private
def
getQueueVersion
:
String
=
{
val
stingResources
:
ResourceBundle
=
TextFormattingUtils
.
loadResourceBundle
(
"StingText"
)
if
(
stingResources
.
containsKey
(
"org.broadinstitute.sting.queue.QueueVersion.version"
)
)
{
if
(
stingResources
.
containsKey
(
"org.broadinstitute.sting.queue.QueueVersion.version"
))
{
stingResources
.
getString
(
"org.broadinstitute.sting.queue.QueueVersion.version"
)
}
else
{
}
else
{
"<unknown>"
}
}
private
def
getBuildTimestamp
:
String
=
{
val
stingResources
:
ResourceBundle
=
TextFormattingUtils
.
loadResourceBundle
(
"StingText"
)
private
def
getBuildTimestamp
:
String
=
{
val
stingResources
:
ResourceBundle
=
TextFormattingUtils
.
loadResourceBundle
(
"StingText"
)
if
(
stingResources
.
containsKey
(
"build.timestamp"
)
)
{
if
(
stingResources
.
containsKey
(
"build.timestamp"
))
{
stingResources
.
getString
(
"build.timestamp"
)
}
else
{
}
else
{
"<unknown>"
}
}
...
...
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
View file @
02b571a4
...
...
@@ -8,13 +8,13 @@ import org.broadinstitute.gatk.queue.QSettings
import
org.broadinstitute.gatk.queue.function.QFunction
trait
BiopetQScript
extends
Configurable
{
@Argument
(
doc
=
"Config Json file"
,
shortName
=
"config"
,
required
=
false
)
@Argument
(
doc
=
"Config Json file"
,
shortName
=
"config"
,
required
=
false
)
val
configfiles
:
List
[
File
]
=
Nil
@Argument
(
doc
=
"Output directory"
,
shortName
=
"outputDir"
,
required
=
true
)
@Argument
(
doc
=
"Output directory"
,
shortName
=
"outputDir"
,
required
=
true
)
var
outputDir
:
String
=
_
var
outputFiles
:
Map
[
String
,
File
]
=
Map
()
var
outputFiles
:
Map
[
String
,
File
]
=
Map
()
var
qSettings
:
QSettings
...
...
@@ -35,10 +35,9 @@ trait BiopetQScript extends Configurable {
}
def
add
(
functions
:
QFunction*
)
// Gets implemeted at org.broadinstitute.sting.queue.QScript
def
add
(
function
:
QFunction
,
isIntermediate
:
Boolean
=
false
)
{
def
add
(
function
:
QFunction
,
isIntermediate
:
Boolean
=
false
)
{
function
.
isIntermediate
=
isIntermediate
add
(
function
)
}
}
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/MultiSampleQScript.scala
View file @
02b571a4
...
...
@@ -4,33 +4,34 @@ import java.io.File
import
nl.lumc.sasc.biopet.core.config.Configurable
trait
MultiSampleQScript
extends
BiopetQScript
{
var
samples
:
Map
[
String
,
Any
]
=
Map
()
var
samples
:
Map
[
String
,
Any
]
=
Map
()
final
def
runSamplesJobs
:
Map
[
String
,
Map
[
String
,
File
]]
=
{
var
output
:
Map
[
String
,
Map
[
String
,
File
]]
=
Map
()
final
def
runSamplesJobs
:
Map
[
String
,
Map
[
String
,
File
]]
=
{
var
output
:
Map
[
String
,
Map
[
String
,
File
]]
=
Map
()
samples
=
config
(
"samples"
)
if
(
samples
==
null
)
samples
=
Map
()
if
(
globalConfig
.
contains
(
"samples"
))
for
((
key
,
value
)
<-
samples
)
{
if
(
globalConfig
.
contains
(
"samples"
))
for
((
key
,
value
)
<-
samples
)
{
var
sample
=
Configurable
.
any2map
(
value
)
if
(!
sample
.
contains
(
"ID"
))
sample
+=
(
"ID"
->
key
)
if
(
sample
(
"ID"
)
==
key
)
{
var
files
:
Map
[
String
,
List
[
File
]]
=
runSingleSampleJobs
(
sample
)
var
files
:
Map
[
String
,
List
[
File
]]
=
runSingleSampleJobs
(
sample
)
}
else
logger
.
warn
(
"Key is not the same as ID on value for sample"
)
}
else
logger
.
warn
(
"No Samples found in config"
)
}
else
logger
.
warn
(
"No Samples found in config"
)
return
output
}
def
runSingleSampleJobs
(
sampleConfig
:
Map
[
String
,
Any
])
:
Map
[
String
,
List
[
File
]]
def
runSingleSampleJobs
(
sample
:
String
)
:
Map
[
String
,
List
[
File
]]
={
def
runSingleSampleJobs
(
sampleConfig
:
Map
[
String
,
Any
])
:
Map
[
String
,
List
[
File
]]
def
runSingleSampleJobs
(
sample
:
String
)
:
Map
[
String
,
List
[
File
]]
=
{
return
runSingleSampleJobs
(
Configurable
.
any2map
(
samples
(
sample
)))
}
final
def
runRunsJobs
(
sampleConfig
:
Map
[
String
,
Any
])
:
Map
[
String
,
Map
[
String
,
File
]]
=
{
var
output
:
Map
[
String
,
Map
[
String
,
File
]]
=
Map
()
final
def
runRunsJobs
(
sampleConfig
:
Map
[
String
,
Any
])
:
Map
[
String
,
Map
[
String
,
File
]]
=
{
var
output
:
Map
[
String
,
Map
[
String
,
File
]]
=
Map
()
val
sampleID
=
sampleConfig
(
"ID"
)
if
(
sampleConfig
.
contains
(
"runs"
))
{
val
runs
=
Configurable
.
any2map
(
sampleConfig
(
"runs"
))
for
((
key
,
value
)
<-
runs
)
{
for
((
key
,
value
)
<-
runs
)
{
var
run
=
Configurable
.
any2map
(
value
)
if
(!
run
.
contains
(
"ID"
))
run
+=
(
"ID"
->
key
)
if
(
run
(
"ID"
)
==
key
)
{
...
...
@@ -40,5 +41,5 @@ trait MultiSampleQScript extends BiopetQScript {
}
else
logger
.
warn
(
"No runs found in config for sample: "
+
sampleID
)
return
output
}
def
runSingleRunJobs
(
runConfig
:
Map
[
String
,
Any
],
sampleConfig
:
Map
[
String
,
Any
])
:
Map
[
String
,
File
]
def
runSingleRunJobs
(
runConfig
:
Map
[
String
,
Any
],
sampleConfig
:
Map
[
String
,
Any
])
:
Map
[
String
,
File
]
}
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/PipelineCommand.scala
View file @
02b571a4
...
...
@@ -11,16 +11,16 @@ import java.io.FileOutputStream
import
org.broadinstitute.gatk.queue.util.Logging
trait
PipelineCommand
extends
Logging
{
// val src = ""
// val extension = ".scala"
// val src = ""
// val extension = ".scala"
val
pipeline
=
""
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
// val tempFile = java.io.File.createTempFile(src + ".", extension)
// val is = getClass.getResourceAsStream(src + extension)
// val os = new FileOutputStream(tempFile)
// org.apache.commons.io.IOUtils.copy(is, os)
// os.close()
// val tempFile = java.io.File.createTempFile(src + ".", extension)
// val is = getClass.getResourceAsStream(src + extension)
// val os = new FileOutputStream(tempFile)
// org.apache.commons.io.IOUtils.copy(is, os)
// os.close()
var
argv
:
Array
[
String
]
=
Array
()
//argv ++= Array("-S", tempFile.getAbsolutePath)
...
...
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/apps/BedToInterval.scala
View file @
02b571a4
...
...
@@ -5,20 +5,20 @@ import htsjdk.samtools.SAMSequenceRecord
import
java.io.File
import
nl.lumc.sasc.biopet.core.BiopetJavaCommandLineFunction
import
nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.PrintWriter
import
scala.io.Source
class
BedToInterval
(
val
root
:
Configurable
)
extends
BiopetJavaCommandLineFunction
{
class
BedToInterval
(
val
root
:
Configurable
)
extends
BiopetJavaCommandLineFunction
{
javaMainClass
=
getClass
.
getName
@Input
(
doc
=
"Input Bed file"
,
required
=
true
)
@Input
(
doc
=
"Input Bed file"
,
required
=
true
)
var
input
:
File
=
_
@Input
(
doc
=
"Bam File"
,
required
=
true
)
var
bamFile
:
File
=
_
@Input
(
doc
=
"Bam File"
,
required
=
true
)
var
bamFile
:
File
=
_
@Output
(
doc
=
"Output interval list"
,
required
=
true
)
@Output
(
doc
=
"Output interval list"
,
required
=
true
)
var
output
:
File
=
_
override
val
defaultVmem
=
"8G"
...
...
@@ -28,7 +28,7 @@ class BedToInterval(val root:Configurable) extends BiopetJavaCommandLineFunction
}
object
BedToInterval
{
def
apply
(
root
:
Configurable
,
inputBed
:
File
,
inputBam
:
File
,
outputDir
:
String
)
:
BedToInterval
=
{
def
apply
(
root
:
Configurable
,
inputBed
:
File
,
inputBam
:
File
,
outputDir
:
String
)
:
BedToInterval
=
{
val
bedToInterval
=
new
BedToInterval
(
root
)
bedToInterval
.
input
=
inputBed
bedToInterval
.
bamFile
=
inputBam
...
...
@@ -36,7 +36,7 @@ object BedToInterval {
return
bedToInterval
}
def
apply
(
root
:
Configurable
,
inputBed
:
File
,
inputBam
:
File
,
output
:
File
)
:
BedToInterval
=
{
def
apply
(
root
:
Configurable
,
inputBed
:
File
,
inputBam
:
File
,
output
:
File
)
:
BedToInterval
=
{
val
bedToInterval
=
new
BedToInterval
(
root
)
bedToInterval
.
input
=
inputBed
bedToInterval
.
bamFile
=
inputBam
...
...
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/apps/BiopetFlagstat.scala
View file @
02b571a4
...
...
@@ -2,22 +2,22 @@ package nl.lumc.sasc.biopet.core.apps
import
htsjdk.samtools.SAMFileReader
import
htsjdk.samtools.SAMRecord
import
java.io.
{
BufferedInputStream
,
File
,
FileInputStream
,
PrintWriter
}
import
java.io.
{
BufferedInputStream
,
File
,
FileInputStream
,
PrintWriter
}
import
nl.lumc.sasc.biopet.core.BiopetJavaCommandLineFunction
import
scala.io.Source
import
nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
org.broadinstitute.gatk.queue.util.Logging
import
scala.collection.JavaConversions._
import
scala.collection.mutable.Map
class
BiopetFlagstat
(
val
root
:
Configurable
)
extends
BiopetJavaCommandLineFunction
{
class
BiopetFlagstat
(
val
root
:
Configurable
)
extends
BiopetJavaCommandLineFunction
{
javaMainClass
=
getClass
.
getName
@Input
(
doc
=
"Input bam"
,
shortName
=
"input"
,
required
=
true
)
@Input
(
doc
=
"Input bam"
,
shortName
=
"input"
,
required
=
true
)
var
input
:
File
=
_
@Output
(
doc
=
"Output flagstat"
,
shortName
=
"output"
,
required
=
true
)
@Output
(
doc
=
"Output flagstat"
,
shortName
=
"output"
,
required
=
true
)
var
output
:
File
=
_
override
val
defaultVmem
=
"8G"
...
...
@@ -27,13 +27,13 @@ class BiopetFlagstat(val root:Configurable) extends BiopetJavaCommandLineFunctio
}
object
BiopetFlagstat
extends
Logging
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
BiopetFlagstat
=
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
BiopetFlagstat
=
{
val
flagstat
=
new
BiopetFlagstat
(
root
)
flagstat
.
input
=
input
flagstat
.
output
=
output
return
flagstat
}
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
BiopetFlagstat
=
{
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
BiopetFlagstat
=
{
val
flagstat
=
new
BiopetFlagstat
(
root
)
flagstat
.
input
=
input
flagstat
.
output
=
new
File
(
outputDir
,
input
.
getName
.
stripSuffix
(
".bam"
)
+
".biopetflagstat"
)
...
...
@@ -50,14 +50,13 @@ object BiopetFlagstat extends Logging {
val
m
=
10
val
max
=
60
for
(
t
<-
0
to
(
max
/
m
))
flagstatCollector
.
addFunction
(
"MAPQ>"
+
(
t
*
m
),
record
=>
record
.
getMappingQuality
>
(
t
*
m
))
flagstatCollector
.
addFunction
(
"MAPQ>"
+
(
t
*
m
),
record
=>
record
.
getMappingQuality
>
(
t
*
m
))
flagstatCollector
.
addFunction
(
"First normal, second read inverted (paired end orientation)"
,
record
=>
{
if
(
record
.
getReferenceIndex
==
record
.
getMateReferenceIndex
&&
record
.
getReadNegativeStrandFlag
!=
record
.
getMateNegativeStrandFlag
&&
((
record
.
getFirstOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
<
record
.
getMateAlignmentStart
)
||
(
record
.
getFirstOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
)
||
(
record
.
getSecondOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
<
record
.
getMateAlignmentStart
)
||
(
record
.
getSecondOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
))
)
true
(
record
.
getSecondOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
)))
true
else
false
})
flagstatCollector
.
addFunction
(
"First normal, second read normal"
,
record
=>
{
...
...
@@ -65,8 +64,7 @@ object BiopetFlagstat extends Logging {
((
record
.
getFirstOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
<
record
.
getMateAlignmentStart
)
||
(
record
.
getFirstOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
)
||
(
record
.
getSecondOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
<
record
.
getMateAlignmentStart
)
||
(
record
.
getSecondOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
))
)
true
(
record
.
getSecondOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
)))
true
else
false
})
flagstatCollector
.
addFunction
(
"First inverted, second read inverted"
,
record
=>
{
...
...
@@ -74,8 +72,7 @@ object BiopetFlagstat extends Logging {
((
record
.
getFirstOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
<
record
.
getMateAlignmentStart
)
||
(
record
.
getFirstOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
)
||
(
record
.
getSecondOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
<
record
.
getMateAlignmentStart
)
||
(
record
.
getSecondOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
))
)
true
(
record
.
getSecondOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
)))
true
else
false
})
flagstatCollector
.
addFunction
(
"First inverted, second read normal"
,
record
=>
{
...
...
@@ -83,8 +80,7 @@ object BiopetFlagstat extends Logging {
((
record
.
getFirstOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
<
record
.
getMateAlignmentStart
)
||
(
record
.
getFirstOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
)
||
(
record
.
getSecondOfPairFlag
&&
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
<
record
.
getMateAlignmentStart
)
||
(
record
.
getSecondOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
))
)
true
(
record
.
getSecondOfPairFlag
&&
!
record
.
getReadNegativeStrandFlag
&&
record
.
getAlignmentStart
>
record
.
getMateAlignmentStart
)))
true
else
false
})
flagstatCollector
.
addFunction
(
"Mate in same strand"
,
record
=>
record
.
getReadNegativeStrandFlag
&&
record
.
getMateNegativeStrandFlag
&&
...
...
@@ -106,7 +102,7 @@ object BiopetFlagstat extends Logging {
private
val
names
:
Map
[
Int
,
String
]
=
Map
()
private
var
functions
:
Array
[
SAMRecord
=>
Boolean
]
=
Array
()
private
var
totalCounts
:
Array
[
Long
]
=
Array
()
private
var
crossCounts
=
Array
.
ofDim
[
Int
](
1
,
1
)
private
var
crossCounts
=
Array
.
ofDim
[
Int
](
1
,
1
)
def
loadDefaultFunctions
{
addFunction
(
"All"
,
record
=>
true
)
...
...
@@ -130,7 +126,7 @@ object BiopetFlagstat extends Logging {
addFunction
(
"SecondaryOrSupplementary"
,
record
=>
record
.
isSecondaryOrSupplementary
)
}
def
loadRecord
(
record
:
SAMRecord
)
{
def
loadRecord
(
record
:
SAMRecord
)
{
readsCount
+=
1
val
values
:
Array
[
Boolean
]
=
new
Array
(
names
.
size
)
for
(
t
<-
0
until
names
.
size
)
{
...
...
@@ -148,9 +144,9 @@ object BiopetFlagstat extends Logging {
}
}
def
addFunction
(
name
:
String
,
function
:
SAMRecord
=>
Boolean
)
{
def
addFunction
(
name
:
String
,
function
:
SAMRecord
=>
Boolean
)
{
functionCount
+=
1
crossCounts
=
Array
.
ofDim
[
Int
](
functionCount
,
functionCount
)
crossCounts
=
Array
.
ofDim
[
Int
](
functionCount
,
functionCount
)
totalCounts
=
new
Array
[
Long
](
functionCount
)
val
temp
=
new
Array
[
SAMRecord
=>
Boolean
](
functionCount
)
for
(
t
<-
0
until
(
temp
.
size
-
1
))
temp
(
t
)
=
functions
(
t
)
...
...
@@ -167,7 +163,7 @@ object BiopetFlagstat extends Logging {
buffer
.
append
(
"Number\tTotal Flags\tFraction\tName\n"
)
for
(
t
<-
0
until
names
.
size
)
{
val
precentage
=
(
totalCounts
(
t
).
toFloat
/
readsCount
)
*
100
buffer
.
append
(
"#"
+
(
t
+
1
)
+
"\t"
+
totalCounts
(
t
)
+
"\t"
+
f
"$precentage%.4f"
+
"%\t"
+
names
(
t
)
+
"\n"
)
buffer
.
append
(
"#"
+
(
t
+
1
)
+
"\t"
+
totalCounts
(
t
)
+
"\t"
+
f
"$precentage%.4f"
+
"%\t"
+
names
(
t
)
+
"\n"
)
}
buffer
.
append
(
"\n"
)
...
...
@@ -177,22 +173,22 @@ object BiopetFlagstat extends Logging {
return
buffer
.
toString
}
def
crossReport
(
fraction
:
Boolean
=
false
)
:
String
=
{
def
crossReport
(
fraction
:
Boolean
=
false
)
:
String
=
{
val
buffer
=
new
StringBuilder
for
(
t
<-
0
until
names
.
size
)
// Header for table
buffer
.
append
(
"\t#"
+
(
t
+
1
))
buffer
.
append
(
"\t#"
+
(
t
+
1
))