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
0f4f1881
Commit
0f4f1881
authored
Oct 22, 2015
by
Wai Yi Leung
Browse files
Bugfix in KrakenReportToJson, include Root and Unclassified in any case.
parent
3ded0090
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/KrakenReportToJson.scala
View file @
0f4f1881
...
...
@@ -19,13 +19,13 @@ package nl.lumc.sasc.biopet.tools
* Created by wyleung on 25-9-15.
*/
import
java.io.
{
PrintWriter
,
File
}
import
java.io.
{
File
,
PrintWriter
}
import
nl.lumc.sasc.biopet.utils.ConfigUtils._
import
nl.lumc.sasc.biopet.utils.ToolCommand
import
scala.collection.mutable.ListBuffer
import
scala.collection.mutable
import
scala.collection.mutable
import
scala.collection.mutable.ListBuffer
import
scala.io.Source
case
class
KrakenHit
(
taxonomyID
:
Long
,
...
...
@@ -120,7 +120,6 @@ object KrakenReportToJson extends ToolCommand {
def
reportToJson
(
reportRaw
:
File
,
skipNames
:
Boolean
)
:
String
=
{
val
reader
=
Source
.
fromFile
(
reportRaw
)
// val lines = reader.getLines().toList.filter(!_.isEmpty)
/*
* http://ccb.jhu.edu/software/kraken/MANUAL.html
...
...
@@ -135,7 +134,7 @@ object KrakenReportToJson extends ToolCommand {
lines
=
reader
.
getLines
()
.
map
(
line
=>
parseLine
(
line
,
skipNames
))
.
filter
(
p
=>
p
.
head
.
_2
.
cladeSize
>
0
)
.
filter
(
p
=>
(
p
.
head
.
_2
.
cladeSize
>
0
)
||
List
(
0L
,
1L
).
contains
(
p
.
head
.
_2
.
taxonomyID
))
.
foldLeft
(
Map
.
empty
[
Long
,
KrakenHit
])((
a
,
b
)
=>
{
a
+
b
.
head
})
...
...
public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
View file @
0f4f1881
...
...
@@ -17,10 +17,10 @@ package nl.lumc.sasc.biopet.pipelines.gears
import
nl.lumc.sasc.biopet.core.PipelineCommand
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.extensions.kraken.
{
Kraken
,
KrakenReport
}
import
nl.lumc.sasc.biopet.extensions.kraken.
{
Kraken
,
KrakenReport
}
import
nl.lumc.sasc.biopet.extensions.picard.SamToFastq
import
nl.lumc.sasc.biopet.extensions.sambamba.SambambaView
import
nl.lumc.sasc.biopet.extensions.tools.
{
FastqSync
,
KrakenReportToJson
}
import
nl.lumc.sasc.biopet.extensions.tools.
{
FastqSync
,
KrakenReportToJson
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.queue.QScript
...
...
@@ -44,8 +44,8 @@ class Gears(val root: Configurable) extends QScript with SummaryQScript {
/** Executed before running the script */
def
init
()
:
Unit
=
{
require
(
fastqR1
.
isDefined
||
bamFile
.
isDefined
,
"
Must define
fastq
file(s) or
a
bam file"
)
require
(
fastqR1
.
isDefined
!=
bamFile
.
isDefined
,
"
Can't define
a bam file
and
a R1 file"
)
require
(
fastqR1
.
isDefined
||
bamFile
.
isDefined
,
"
Please specify
fastq
-
file(s) or bam file"
)
require
(
fastqR1
.
isDefined
!=
bamFile
.
isDefined
,
"
Provide either
a bam file
or l
a R1 file"
)
if
(
outputName
==
null
)
{
if
(
fastqR1
.
isDefined
)
outputName
=
fastqR1
.
map
(
_
.
getName
...
...
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