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
deced04c
Commit
deced04c
authored
Sep 19, 2016
by
Peter van 't Hof
Browse files
Added centrifuge to Gears
parent
901b11d9
Changes
5
Hide whitespace changes
Inline
Side-by-side
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/centrifuge/Centrifuge.scala
View file @
deced04c
...
...
@@ -4,7 +4,7 @@ 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
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
scala.util.matching.Regex
...
...
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/centrifuge/CentrifugeKreport.scala
View file @
deced04c
...
...
@@ -4,7 +4,7 @@ import java.io.File
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
/**
* Created by pjvanthof on 19/09/16.
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsCentrifuge.scala
0 → 100644
View file @
deced04c
package
nl.lumc.sasc.biopet.pipelines.gears
import
nl.lumc.sasc.biopet.core.SampleLibraryTag
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.extensions.centrifuge.
{
Centrifuge
,
CentrifugeKreport
}
import
nl.lumc.sasc.biopet.extensions.tools.KrakenReportToJson
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.queue.QScript
/**
* Created by pjvanthof on 19/09/16.
*/
class
GearsCentrifuge
(
val
root
:
Configurable
)
extends
QScript
with
SummaryQScript
with
SampleLibraryTag
{
var
fastqR1
:
File
=
_
var
fastqR2
:
Option
[
File
]
=
None
var
outputName
:
String
=
_
def
init
()
:
Unit
=
{
require
(
fastqR1
!=
null
)
if
(
outputName
==
null
)
outputName
=
fastqR1
.
getName
.
stripSuffix
(
".gz"
)
.
stripSuffix
(
".fq"
)
.
stripSuffix
(
".fastq"
)
}
def
biopetScript
()
:
Unit
=
{
val
centrifuge
=
new
Centrifuge
(
this
)
centrifuge
.
inputR1
=
fastqR1
centrifuge
.
inputR2
=
fastqR2
centrifuge
.
output
=
new
File
(
outputDir
,
s
"$outputName.centrifuge"
)
centrifuge
.
report
=
Some
(
new
File
(
outputDir
,
s
"$outputName.centrifuge.report"
))
add
(
centrifuge
)
val
centrifugeKreport
=
new
CentrifugeKreport
(
this
)
centrifugeKreport
.
centrifugeOutputFiles
+=
centrifuge
.
output
centrifugeKreport
.
output
=
new
File
(
outputDir
,
s
"$outputName.centrifuge.kreport"
)
add
(
centrifugeKreport
)
val
krakenReportJSON
=
new
KrakenReportToJson
(
this
)
krakenReportJSON
.
inputReport
=
centrifugeKreport
.
output
krakenReportJSON
.
output
=
new
File
(
outputDir
,
s
"$outputName.krkn.json"
)
krakenReportJSON
.
skipNames
=
config
(
"skipNames"
,
default
=
false
)
add
(
krakenReportJSON
)
addSummarizable
(
krakenReportJSON
,
"centrifugereport"
)
}
/** Location of summary file */
def
summaryFile
=
new
File
(
outputDir
,
sampleId
.
getOrElse
(
"sampleName_unknown"
)
+
".kraken.summary.json"
)
/** Pipeline settings shown in the summary file */
def
summarySettings
:
Map
[
String
,
Any
]
=
Map
()
/** Statistics shown in the summary file */
def
summaryFiles
:
Map
[
String
,
File
]
=
outputFiles
+
(
"input_R1"
->
fastqR1
)
++
(
fastqR2
match
{
case
Some
(
file
)
=>
Map
(
"input_R2"
->
file
)
case
_
=>
Map
()
})
}
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsKraken.scala
View file @
deced04c
...
...
@@ -107,7 +107,7 @@ class GearsKraken(val root: Configurable) extends QScript with SummaryQScript wi
def
summaryFile
=
new
File
(
outputDir
,
sampleId
.
getOrElse
(
"sampleName_unknown"
)
+
".kraken.summary.json"
)
/** Pipeline settings shown in the summary file */
def
summarySettings
:
Map
[
String
,
Any
]
=
Map
.
empty
def
summarySettings
:
Map
[
String
,
Any
]
=
Map
()
/** Statistics shown in the summary file */
def
summaryFiles
:
Map
[
String
,
File
]
=
outputFiles
+
(
"input_R1"
->
fastqR1
)
++
(
fastqR2
match
{
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingle.scala
View file @
deced04c
...
...
@@ -41,6 +41,7 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
var
outputName
:
String
=
_
lazy
val
krakenScript
=
if
(
config
(
"gears_use_kraken"
,
default
=
true
))
Some
(
new
GearsKraken
(
this
))
else
None
lazy
val
centrifugeScript
=
if
(
config
(
"gears_use_centrifuge"
,
default
=
false
))
Some
(
new
GearsCentrifuge
(
this
))
else
None
lazy
val
qiimeRatx
=
if
(
config
(
"gears_use_qiime_rtax"
,
default
=
false
))
Some
(
new
GearsQiimeRtax
(
this
))
else
None
lazy
val
qiimeClosed
=
if
(
config
(
"gears_use_qiime_closed"
,
default
=
false
))
Some
(
new
GearsQiimeClosed
(
this
))
else
None
lazy
val
qiimeOpen
=
if
(
config
(
"gears_use_qiime_open"
,
default
=
false
))
Some
(
new
GearsQiimeOpen
(
this
))
else
None
...
...
@@ -126,6 +127,14 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
add
(
kraken
)
}
centrifugeScript
foreach
{
centrifuge
=>
centrifuge
.
outputDir
=
new
File
(
outputDir
,
"centrifuge"
)
centrifuge
.
fastqR1
=
r1
centrifuge
.
fastqR2
=
r2
centrifuge
.
outputName
=
outputName
add
(
centrifuge
)
}
qiimeRatx
foreach
{
qiimeRatx
=>
qiimeRatx
.
outputDir
=
new
File
(
outputDir
,
"qiime_rtax"
)
qiimeRatx
.
fastqR1
=
r1
...
...
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