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
b5461f9d
Commit
b5461f9d
authored
Sep 09, 2014
by
Peter van 't Hof
Browse files
Added samtools modules
parent
5af4086c
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/samtools/SamtoolsMpileup.scala
0 → 100644
View file @
b5461f9d
package
nl.lumc.sasc.biopet.extensions.samtools
import
nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
class
SamtoolsMpileup
(
val
root
:
Configurable
)
extends
Samtools
{
@Input
(
doc
=
"Bam File"
)
var
input
:
File
=
_
@Output
(
doc
=
"output File"
)
var
output
:
File
=
_
@Input
(
doc
=
"Reference fasta"
)
var
reference
:
File
=
config
(
"reference"
)
@Input
(
doc
=
"Interval bed"
)
var
intervalBed
:
File
=
config
(
"interval_bed"
)
def
cmdBase
=
required
(
executable
)
+
required
(
"mpileup"
)
+
optional
(
"-f"
,
reference
)
+
optional
(
"-l"
,
intervalBed
)
def
cmdPipeInput
=
cmdBase
+
"-"
def
cmdPipe
=
cmdBase
+
required
(
input
)
def
cmdLine
=
cmdPipe
+
" > "
+
required
(
output
)
}
object
SamtoolsMpileup
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
SamtoolsMpileup
=
{
val
mpileup
=
new
SamtoolsMpileup
(
root
)
mpileup
.
input
=
input
mpileup
.
output
=
output
return
mpileup
}
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
SamtoolsMpileup
=
{
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
)
:
SamtoolsMpileup
=
{
return
apply
(
root
,
input
,
new
File
(
swapExtension
(
input
.
getAbsolutePath
)))
}
private
def
swapExtension
(
inputFile
:
String
)
=
inputFile
.
stripSuffix
(
".bam"
)
+
".mpileup"
}
\ No newline at end of file
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/samtools/SamtoolsView.scala
0 → 100644
View file @
b5461f9d
package
nl.lumc.sasc.biopet.extensions.samtools
import
nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
java.io.File
class
SamtoolsView
(
val
root
:
Configurable
)
extends
Samtools
{
@Input
(
doc
=
"Bam File"
)
var
input
:
File
=
_
@Output
(
doc
=
"output File"
)
var
output
:
File
=
_
var
quality
:
Option
[
Int
]
=
config
(
"quality"
)
var
b
:
Boolean
=
config
(
"b"
)
var
h
:
Boolean
=
config
(
"h"
)
def
cmdBase
=
required
(
executable
)
+
required
(
"view"
)
+
optional
(
"-q"
,
quality
)
+
conditional
(
b
,
"-b"
)
+
conditional
(
h
,
"-h"
)
def
cmdPipeInput
=
cmdBase
+
"-"
def
cmdPipe
=
cmdBase
+
required
(
input
)
def
cmdLine
=
cmdPipe
+
" > "
+
required
(
output
)
}
object
SamtoolsView
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
SamtoolsView
=
{
val
view
=
new
SamtoolsView
(
root
)
view
.
input
=
input
view
.
output
=
output
return
view
}
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
SamtoolsView
=
{
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
)
:
SamtoolsView
=
{
return
apply
(
root
,
input
,
new
File
(
swapExtension
(
input
.
getAbsolutePath
)))
}
private
def
swapExtension
(
inputFile
:
String
)
=
inputFile
.
stripSuffix
(
".bam"
)
+
".mpileup"
}
\ No newline at end of file
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