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
5903aff3
Commit
5903aff3
authored
Mar 07, 2015
by
Peter van 't Hof
Browse files
Adding scala docs
parent
24749608
Changes
11
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/Picard.scala
View file @
5903aff3
...
...
@@ -25,7 +25,7 @@ import scala.io.Source
/**
* General picard extension
*
* This is based on using class files directly from the jar
* This is based on using class files directly from the jar
, if needed other picard jar can be used
*/
abstract
class
Picard
extends
BiopetJavaCommandLineFunction
{
override
def
subPath
=
"picard"
::
super
.
subPath
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/sambamba/Sambamba.scala
View file @
5903aff3
...
...
@@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.extensions.sambamba
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
/** General Sambamba extension */
abstract
class
Sambamba
extends
BiopetCommandLineFunction
{
override
val
defaultVmem
=
"4G"
override
val
defaultThreads
=
2
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/sambamba/SambambaFlagstat.scala
View file @
5903aff3
...
...
@@ -19,6 +19,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
/** Extension for sambemba flagstat */
class
SambambaFlagstat
(
val
root
:
Configurable
)
extends
Sambamba
{
override
val
defaultThreads
=
2
...
...
@@ -28,6 +29,7 @@ class SambambaFlagstat(val root: Configurable) extends Sambamba {
@Output
(
doc
=
"output File"
)
var
output
:
File
=
_
/** Returns command to execute */
def
cmdLine
=
required
(
executable
)
+
required
(
"flagstat"
)
+
optional
(
"-t"
,
nCoresRequest
)
+
...
...
@@ -35,24 +37,3 @@ class SambambaFlagstat(val root: Configurable) extends Sambamba {
" > "
+
required
(
output
)
}
object
SambambaFlagstat
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
SambambaFlagstat
=
{
val
flagstat
=
new
SambambaFlagstat
(
root
)
flagstat
.
input
=
input
flagstat
.
output
=
output
return
flagstat
}
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
SambambaFlagstat
=
{
val
dir
=
if
(
outputDir
.
endsWith
(
"/"
))
outputDir
else
outputDir
+
"/"
val
outputFile
=
new
File
(
dir
+
swapExtension
(
input
.
getName
))
return
apply
(
root
,
input
,
outputFile
)
}
def
apply
(
root
:
Configurable
,
input
:
File
)
:
SambambaFlagstat
=
{
return
apply
(
root
,
input
,
new
File
(
swapExtension
(
input
.
getAbsolutePath
)))
}
private
def
swapExtension
(
inputFile
:
String
)
=
inputFile
.
stripSuffix
(
".bam"
)
+
".flagstat"
}
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/sambamba/SambambaIndex.scala
View file @
5903aff3
...
...
@@ -19,6 +19,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
/** Extension for sambemba index */
class
SambambaIndex
(
val
root
:
Configurable
)
extends
Sambamba
{
override
val
defaultThreads
=
2
...
...
@@ -28,30 +29,10 @@ class SambambaIndex(val root: Configurable) extends Sambamba {
@Output
(
doc
=
"Output .bai file to"
)
var
output
:
File
=
_
/** Returns command to execute */
def
cmdLine
=
required
(
executable
)
+
required
(
"index"
)
+
optional
(
"-t"
,
nCoresRequest
)
+
required
(
input
)
+
required
(
output
)
}
object
SambambaIndex
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
SambambaIndex
=
{
val
flagstat
=
new
SambambaIndex
(
root
)
flagstat
.
input
=
input
flagstat
.
output
=
output
return
flagstat
}
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
SambambaIndex
=
{
val
dir
=
if
(
outputDir
.
endsWith
(
"/"
))
outputDir
else
outputDir
+
"/"
val
outputFile
=
new
File
(
dir
+
swapExtension
(
input
.
getName
))
return
apply
(
root
,
input
,
outputFile
)
}
def
apply
(
root
:
Configurable
,
input
:
File
)
:
SambambaIndex
=
{
return
apply
(
root
,
input
,
new
File
(
swapExtension
(
input
.
getAbsolutePath
)))
}
private
def
swapExtension
(
inputFile
:
String
)
=
inputFile
.
stripSuffix
(
".bam"
)
+
".bam.bai"
}
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/sambamba/SambambaMarkdup.scala
View file @
5903aff3
...
...
@@ -19,6 +19,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
/** Extension for sambemba markdup */
class
SambambaMarkdup
(
val
root
:
Configurable
)
extends
Sambamba
{
override
val
defaultThreads
=
4
...
...
@@ -36,6 +37,7 @@ class SambambaMarkdup(val root: Configurable) extends Sambamba {
val
overflow_list_size
:
Option
[
Int
]
=
config
(
"overflow-list-size"
,
default
=
200000
)
val
io_buffer_size
:
Option
[
Int
]
=
config
(
"io-buffer-size"
,
default
=
128
)
/** Returns command to execute */
def
cmdLine
=
required
(
executable
)
+
required
(
"markdup"
)
+
conditional
(
remove_duplicates
,
"--remove-duplicates"
)
+
...
...
@@ -47,24 +49,3 @@ class SambambaMarkdup(val root: Configurable) extends Sambamba {
required
(
input
)
+
required
(
output
)
}
object
SambambaMarkdup
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
SambambaMarkdup
=
{
val
flagstat
=
new
SambambaMarkdup
(
root
)
flagstat
.
input
=
input
flagstat
.
output
=
output
return
flagstat
}
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
SambambaMarkdup
=
{
val
dir
=
if
(
outputDir
.
endsWith
(
"/"
))
outputDir
else
outputDir
+
"/"
val
outputFile
=
new
File
(
dir
+
swapExtension
(
input
.
getName
))
return
apply
(
root
,
input
,
outputFile
)
}
def
apply
(
root
:
Configurable
,
input
:
File
)
:
SambambaMarkdup
=
{
return
apply
(
root
,
input
,
new
File
(
swapExtension
(
input
.
getAbsolutePath
)))
}
private
def
swapExtension
(
inputFile
:
String
)
=
inputFile
.
stripSuffix
(
".bam"
)
+
".bam.bai"
}
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/sambamba/SambambaMerge.scala
View file @
5903aff3
...
...
@@ -19,6 +19,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
/** Extension for sambemba merge */
class
SambambaMerge
(
val
root
:
Configurable
)
extends
Sambamba
{
override
val
defaultThreads
=
4
...
...
@@ -31,6 +32,7 @@ class SambambaMerge(val root: Configurable) extends Sambamba {
// @doc: compression_level 6 is average, 0 = no compression, 9 = best
val
compression_level
:
Option
[
Int
]
=
config
(
"compression_level"
,
default
=
6
)
/** Returns command to execute */
def
cmdLine
=
required
(
executable
)
+
required
(
"merge"
)
+
optional
(
"-t"
,
nCoresRequest
)
+
...
...
@@ -38,36 +40,3 @@ class SambambaMerge(val root: Configurable) extends Sambamba {
required
(
output
)
+
repeat
(
""
,
input
)
}
object
SambambaMerge
{
def
apply
(
root
:
Configurable
,
input
:
List
[
File
],
output
:
File
)
:
SambambaMerge
=
{
val
flagstat
=
new
SambambaMerge
(
root
)
flagstat
.
input
=
input
flagstat
.
output
=
output
return
flagstat
}
def
apply
(
root
:
Configurable
,
input
:
List
[
File
],
outputDir
:
String
)
:
SambambaMerge
=
{
val
dir
=
if
(
outputDir
.
endsWith
(
"/"
))
outputDir
else
outputDir
+
"/"
val
outputFile
=
new
File
(
dir
+
swapExtension
(
input
.
head
.
getName
))
return
apply
(
root
,
input
,
outputFile
)
}
def
apply
(
root
:
Configurable
,
input
:
List
[
File
])
:
SambambaMerge
=
{
return
apply
(
root
,
input
,
new
File
(
swapExtension
(
input
.
head
.
getAbsolutePath
)))
}
private
def
swapExtension
(
inputFile
:
String
)
=
inputFile
.
stripSuffix
(
".bam"
)
+
".merge.bam"
}
//
//object MergeSamFiles {
// def apply(root: Configurable, input: List[File], outputDir: String, sortOrder: String = null): MergeSamFiles = {
// val mergeSamFiles = new MergeSamFiles(root)
// mergeSamFiles.input = input
// mergeSamFiles.output = new File(outputDir, input.head.getName.stripSuffix(".bam").stripSuffix(".sam") + ".merge.bam")
// if (sortOrder == null) mergeSamFiles.sortOrder = "coordinate"
// else mergeSamFiles.sortOrder = sortOrder
// return mergeSamFiles
// }
//}
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/samtools/Samtools.scala
View file @
5903aff3
...
...
@@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.extensions.samtools
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
/** General class for samtools extensions */
abstract
class
Samtools
extends
BiopetCommandLineFunction
{
override
def
subPath
=
"samtools"
::
super
.
subPath
executable
=
config
(
"exe"
,
default
=
"samtools"
)
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/samtools/SamtoolsFlagstat.scala
View file @
5903aff3
...
...
@@ -19,6 +19,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
/** Extension for samtools flagstat */
class
SamtoolsFlagstat
(
val
root
:
Configurable
)
extends
Samtools
{
@Input
(
doc
=
"Bam File"
)
var
input
:
File
=
_
...
...
@@ -26,6 +27,7 @@ class SamtoolsFlagstat(val root: Configurable) extends Samtools {
@Output
(
doc
=
"output File"
)
var
output
:
File
=
_
/** Returns command to execute */
def
cmdLine
=
required
(
executable
)
+
required
(
"flagstat"
)
+
required
(
input
)
+
" > "
+
required
(
output
)
}
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/samtools/SamtoolsMpileup.scala
View file @
5903aff3
...
...
@@ -19,6 +19,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
/** Extension for samtools mpileup */
class
SamtoolsMpileup
(
val
root
:
Configurable
)
extends
Samtools
{
@Input
(
doc
=
"Bam File"
)
var
input
:
File
=
_
...
...
@@ -45,6 +46,8 @@ class SamtoolsMpileup(val root: Configurable) extends Samtools {
conditional
(
disableBaq
,
"-B"
)
def
cmdPipeInput
=
cmdBase
+
"-"
def
cmdPipe
=
cmdBase
+
required
(
input
)
/** Returns command to execute */
def
cmdLine
=
cmdPipe
+
" > "
+
required
(
output
)
}
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/samtools/SamtoolsView.scala
View file @
5903aff3
...
...
@@ -19,6 +19,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
/** Extension for samtools view */
class
SamtoolsView
(
val
root
:
Configurable
)
extends
Samtools
{
@Input
(
doc
=
"Bam File"
)
var
input
:
File
=
_
...
...
@@ -37,6 +38,8 @@ class SamtoolsView(val root: Configurable) extends Samtools {
conditional
(
h
,
"-h"
)
def
cmdPipeInput
=
cmdBase
+
"-"
def
cmdPipe
=
cmdBase
+
required
(
input
)
/** Returns command to execute */
def
cmdLine
=
cmdPipe
+
" > "
+
required
(
output
)
}
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/seqtk/Seqtk.scala
View file @
5903aff3
...
...
@@ -17,9 +17,7 @@ package nl.lumc.sasc.biopet.extensions.seqtk
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
/**
* Abstract class for all seqtk wrappers.
*/
/** Abstract class for all seqtk wrappers. */
abstract
class
Seqtk
extends
BiopetCommandLineFunction
{
override
def
subPath
=
"seqtk"
::
super
.
subPath
executable
=
config
(
"exe"
,
default
=
"seqtk"
,
freeVar
=
true
)
...
...
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