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
92b003d5
Commit
92b003d5
authored
Jun 25, 2015
by
bow
Browse files
Wrap Picard dependency list fetch in Option
parent
c6e433e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/Picard.scala
View file @
92b003d5
...
...
@@ -82,25 +82,29 @@ abstract class Picard extends BiopetJavaCommandLineFunction {
object
Picard
extends
Logging
{
lazy
val
getBiopetPicardVersion
:
Option
[
String
]
=
{
val
reader
=
Source
.
fromInputStream
(
getClass
.
getResourceAsStream
(
"/dependency_list.txt"
))
val
dependencies
=
reader
.
getLines
().
map
(
_
.
trim
.
split
(
":"
)).
filter
(
_
.
size
==
5
).
map
(
line
=>
Map
(
"groupId"
->
line
(
0
),
"artifactId"
->
line
(
1
),
"type"
->
line
(
2
),
"version"
->
line
(
3
),
"scope"
->
line
(
4
)
)).
toList
logger
.
debug
(
"dependencies: "
+
dependencies
)
val
htsjdk
=
dependencies
.
find
(
dep
=>
dep
(
"groupId"
)
==
"samtools"
&&
dep
(
"artifactId"
)
==
"htsjdk"
).
collect
{
case
dep
=>
"samtools htsjdk "
+
dep
(
"version"
)
}
Option
(
getClass
.
getResourceAsStream
(
"/dependency_list.txt"
))
match
{
case
Some
(
src
)
=>
val
dependencies
=
Source
.
fromInputStream
(
src
)
.
getLines
().
map
(
_
.
trim
.
split
(
":"
)).
filter
(
_
.
size
==
5
).
map
(
line
=>
Map
(
"groupId"
->
line
(
0
),
"artifactId"
->
line
(
1
),
"type"
->
line
(
2
),
"version"
->
line
(
3
),
"scope"
->
line
(
4
)
)).
toList
logger
.
debug
(
"dependencies: "
+
dependencies
)
val
htsjdk
=
dependencies
.
find
(
dep
=>
dep
(
"groupId"
)
==
"samtools"
&&
dep
(
"artifactId"
)
==
"htsjdk"
).
collect
{
case
dep
=>
"samtools htsjdk "
+
dep
(
"version"
)
}
dependencies
.
find
(
dep
=>
dep
(
"groupId"
)
==
"picard"
&&
dep
(
"artifactId"
)
==
"picard"
).
collect
{
case
dep
=>
"Picard "
+
dep
(
"version"
)
+
" using "
+
htsjdk
.
getOrElse
(
"unknown htsjdk"
)
dependencies
.
find
(
dep
=>
dep
(
"groupId"
)
==
"picard"
&&
dep
(
"artifactId"
)
==
"picard"
).
collect
{
case
dep
=>
"Picard "
+
dep
(
"version"
)
+
" using "
+
htsjdk
.
getOrElse
(
"unknown htsjdk"
)
}
case
otherwise
=>
None
}
}
...
...
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