Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
biopet.biopet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Mirrors
biopet.biopet
Commits
4f2a0f07
Commit
4f2a0f07
authored
Jun 20, 2016
by
Peter van 't Hof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a skip option in merge otu maps tool
parent
bace55eb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
10 deletions
+22
-10
biopet-tools-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/MergeOtuMaps.scala
...a/nl/lumc/sasc/biopet/extensions/tools/MergeOtuMaps.scala
+6
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/MergeOtuMaps.scala
...c/main/scala/nl/lumc/sasc/biopet/tools/MergeOtuMaps.scala
+14
-8
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
...ain/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
+2
-0
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsReport.scala
...ala/nl/lumc/sasc/biopet/pipelines/gears/GearsReport.scala
+0
-1
No files found.
biopet-tools-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/MergeOtuMaps.scala
View file @
4f2a0f07
...
...
@@ -31,9 +31,14 @@ class MergeOtuMaps(val root: Configurable) extends ToolCommandFunction {
@Output
(
doc
=
"Output"
,
shortName
=
"output"
,
required
=
true
)
var
output
:
File
=
_
var
skipPrefix
:
List
[
String
]
=
config
(
"skip_prefix"
,
default
=
Nil
)
override
def
defaultCoreMemory
=
6.0
override
def
cmdLine
=
super
.
cmdLine
+
repeat
(
"-I"
,
input
)
+
required
(
"-o"
,
output
)
override
def
cmdLine
=
super
.
cmdLine
+
repeat
(
"-I"
,
input
)
+
required
(
"-o"
,
output
)
+
repeat
(
"-p"
,
skipPrefix
)
}
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/MergeOtuMaps.scala
View file @
4f2a0f07
...
...
@@ -24,7 +24,9 @@ import scala.io.Source
* Created by pjvan_thof on 12/18/15.
*/
object
MergeOtuMaps
extends
ToolCommand
{
case
class
Args
(
inputFiles
:
List
[
File
]
=
Nil
,
outputFile
:
File
=
null
)
extends
AbstractArgs
case
class
Args
(
inputFiles
:
List
[
File
]
=
Nil
,
outputFile
:
File
=
null
,
skipPrefix
:
List
[
String
]
=
Nil
)
extends
AbstractArgs
class
OptParser
extends
AbstractOptParser
{
opt
[
File
](
'I'
,
"input"
)
minOccurs
2
required
()
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
...
...
@@ -33,6 +35,9 @@ object MergeOtuMaps extends ToolCommand {
opt
[
File
](
'o'
,
"output"
)
required
()
unbounded
()
maxOccurs
1
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
outputFile
=
x
)
}
opt
[
String
](
'p'
,
"skipPrefix"
)
unbounded
()
valueName
"<text>"
action
{
(
x
,
c
)
=>
c
.
copy
(
skipPrefix
=
x
::
c
.
skipPrefix
)
}
}
/**
...
...
@@ -40,23 +45,24 @@ object MergeOtuMaps extends ToolCommand {
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
c
omman
dArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
c
m
dArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
var
map
:
Map
[
Lo
ng
,
String
]
=
Map
()
var
map
:
Map
[
Stri
ng
,
String
]
=
Map
()
for
(
inputFile
<-
c
omman
dArgs
.
inputFiles
)
{
for
(
inputFile
<-
c
m
dArgs
.
inputFiles
)
{
logger
.
info
(
s
"Start reading $inputFile"
)
val
reader
=
Source
.
fromFile
(
inputFile
)
reader
.
getLines
().
foreach
{
line
=>
val
values
=
line
.
split
(
"\t"
,
2
)
val
key
=
values
.
head
.
toLong
map
+=
key
->
(
line
.
stripPrefix
(
s
"$key"
)
+
map
.
getOrElse
(
key
,
""
))
val
key
=
values
.
head
if
(!
cmdArgs
.
skipPrefix
.
exists
(
key
.
startsWith
))
map
+=
key
->
(
line
.
stripPrefix
(
s
"$key"
)
+
map
.
getOrElse
(
key
,
""
))
}
reader
.
close
()
}
logger
.
info
(
s
"Start writing to ${c
omman
dArgs.outputFile}"
)
val
writer
=
new
PrintWriter
(
c
omman
dArgs
.
outputFile
)
logger
.
info
(
s
"Start writing to ${c
m
dArgs.outputFile}"
)
val
writer
=
new
PrintWriter
(
c
m
dArgs
.
outputFile
)
map
.
foreach
{
case
(
key
,
list
)
=>
writer
.
println
(
key
+
list
)
}
writer
.
close
()
}
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
View file @
4f2a0f07
...
...
@@ -37,6 +37,8 @@ class Gears(val root: Configurable) extends QScript with MultiSampleQScript { qs
Some
(
gearsReport
)
}
override
def
defaults
=
Map
(
"mergeotumaps"
->
Map
(
"skip_prefix"
->
"New."
))
override
def
fixedValues
=
Map
(
"gearssingle"
->
Map
(
"skip_flexiprep"
->
true
))
/** Init for pipeline */
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsReport.scala
View file @
4f2a0f07
...
...
@@ -43,7 +43,6 @@ object GearsReport extends MultisampleReportBuilder {
val
qiimeOpenOtuTable
=
summary
.
getValue
(
"gears"
,
"files"
,
"pipeline"
,
"qiime_open_otu_table"
,
"path"
)
.
map
(
x
=>
new
File
(
x
.
toString
))
ReportPage
(
(
if
(
krakenExecuted
)
List
(
"Kraken analysis"
->
ReportPage
(
List
(),
List
(
"Krona plot"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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