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
6bd92c80
Commit
6bd92c80
authored
Sep 19, 2016
by
Peter van 't Hof
Browse files
Added base version of centrifuge extension
parent
ca6efa52
Changes
1
Hide whitespace changes
Inline
Side-by-side
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/centrifuge/Centrifuge.scala
0 → 100644
View file @
6bd92c80
package
nl.lumc.sasc.biopet.extensions.centrifuge
import
java.io.File
import
nl.lumc.sasc.biopet.core.
{
BiopetCommandLineFunction
,
Version
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
scala.util.matching.Regex
/**
* Created by pjvanthof on 19/09/16.
*/
class
Centrifuge
(
val
root
:
Configurable
)
extends
BiopetCommandLineFunction
with
Version
{
@Input
(
doc
=
"Input: FastQ or FastA"
,
required
=
true
)
var
inputR1
:
File
=
_
@Input
(
doc
=
"Input: FastQ or FastA"
,
required
=
false
)
var
inputR2
:
Option
[
File
]
=
None
@Input
(
doc
=
"Centrifuge index prefix"
,
required
=
true
)
var
index
:
File
=
_
@Output
(
doc
=
"Output with hits per sequence"
)
var
output
:
File
=
_
@Output
(
doc
=
"Output with hits per sequence"
)
var
report
:
Option
[
File
]
=
None
override
def
defaultThreads
=
8
executable
=
config
(
"exe"
,
default
=
"centrifuge"
,
freeVar
=
false
)
/** Command to get version of executable */
def
versionCommand
:
String
=
s
"$executable --version"
/** Regex to get version from version command output */
def
versionRegex
:
Regex
=
".* version (.*)"
.
r
/**
* This function needs to be implemented to define the command that is executed
*
* @return Command to run
*/
protected
[
core
]
def
cmdLine
:
String
=
executable
+
//TODO: Options
optional
(
"--threads"
,
threads
)
required
(
"-x"
,
index
)
+
(
inputR2
match
{
case
Some
(
r2
)
=>
required
(
"-1"
,
inputR1
)
+
required
(
"-2"
,
r2
)
case
_
=>
required
(
"-U"
,
inputR1
)
})
+
(
if
(
outputAsStsout
)
""
else
required
(
"-S"
,
output
))
+
optional
(
"--report-file"
,
report
)
}
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