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
83b6e834
Commit
83b6e834
authored
Jul 03, 2014
by
Peter van 't Hof
Browse files
Added samtools flagstat
parent
fcaea52d
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/samtools/Samtools.scala
0 → 100644
View file @
83b6e834
package
nl.lumc.sasc.biopet.function.samtools
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
abstract
class
Samtools
extends
BiopetCommandLineFunction
{
executeble
=
config
(
"exe"
,
"samtools"
,
"samtools"
)
override
def
versionCommand
=
executeble
override
val
versionRegex
=
"""Version: (.*)"""
.
r
override
val
versionExitcode
=
List
(
0
,
1
)
}
\ No newline at end of file
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/function/samtools/SamtoolsFlagstat.scala
0 → 100644
View file @
83b6e834
package
nl.lumc.sasc.biopet.function.samtools
import
nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.sting.commandline.
{
Input
,
Output
}
import
java.io.File
class
SamtoolsFlagstat
(
val
root
:
Configurable
)
extends
Samtools
{
@Input
(
doc
=
"Bam File"
)
var
input
:
File
=
_
@Output
(
doc
=
"output File"
)
var
output
:
File
=
_
def
cmdLine
=
required
(
executeble
)
+
required
(
"flagstat"
)
+
required
(
input
)
+
" > "
+
required
(
output
)
}
object
SamtoolsFlagstat
{
def
apply
(
root
:
Configurable
,
input
:
File
,
output
:
File
)
:
SamtoolsFlagstat
=
{
val
flagstat
=
new
SamtoolsFlagstat
(
root
)
flagstat
.
input
=
input
flagstat
.
output
=
output
return
flagstat
}
def
apply
(
root
:
Configurable
,
input
:
File
,
outputDir
:
String
)
:
SamtoolsFlagstat
=
{
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
)
:
SamtoolsFlagstat
=
{
return
apply
(
root
,
input
,
new
File
(
swapExtension
(
input
.
getAbsolutePath
)))
}
private
def
swapExtension
(
inputFile
:
String
)
=
inputFile
.
substring
(
0
,
inputFile
.
lastIndexOf
(
".bam"
))
+
".flagstat"
}
\ 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