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
2af46d82
Commit
2af46d82
authored
Apr 05, 2016
by
Peter van 't Hof
Browse files
Refactor Reference so dict and fai file becomes accessable as a method
parent
b8b1779f
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
View file @
2af46d82
...
...
@@ -73,6 +73,15 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
def
beforeGraph
()
{}
override
def
freezeFieldValues
()
{
this
match
{
case
r
:
Reference
=>
if
(
r
.
dictRequired
)
deps
:+=
r
.
referenceDict
if
(
r
.
faiRequired
)
deps
:+=
r
.
referenceFai
deps
=
deps
.
distinct
case
_
=>
}
preProcessExecutable
()
beforeGraph
()
internalBeforeGraph
()
...
...
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/Reference.scala
View file @
2af46d82
...
...
@@ -61,25 +61,25 @@ trait Reference extends Configurable {
}
/** When set override this on true the pipeline with raise an exception when fai index is not found */
protected
def
faiRequired
=
false
def
faiRequired
=
false
/** When set override this on true the pipeline with raise an exception when dict index is not found */
protected
def
dictRequired
=
this
.
isInstanceOf
[
Summarizable
]
||
this
.
isInstanceOf
[
SummaryQScript
]
def
dictRequired
=
this
.
isInstanceOf
[
Summarizable
]
||
this
.
isInstanceOf
[
SummaryQScript
]
/** Returns the dict file belonging to the fasta file */
def
referenceDict
=
new
File
(
referenceFasta
().
getAbsolutePath
.
stripSuffix
(
".fa"
)
.
stripSuffix
(
".fasta"
)
.
stripSuffix
(
".fna"
)
+
".dict"
)
/** Returns the fai file belonging to the fasta file */
def
referenceFai
=
new
File
(
referenceFasta
().
getAbsolutePath
+
".fai"
)
/** Returns the fasta file */
def
referenceFasta
()
:
File
=
{
val
file
:
File
=
config
(
"reference_fasta"
)
if
(
config
.
contains
(
"reference_fasta"
))
{
checkFasta
(
file
)
val
dict
=
new
File
(
file
.
getAbsolutePath
.
stripSuffix
(
".fa"
).
stripSuffix
(
".fasta"
).
stripSuffix
(
".fna"
)
+
".dict"
)
val
fai
=
new
File
(
file
.
getAbsolutePath
+
".fai"
)
this
match
{
case
c
:
BiopetCommandLineFunction
=>
c
.
deps
:::=
dict
::
fai
::
Nil
case
_
=>
}
}
else
{
if
(
config
.
contains
(
"reference_fasta"
))
checkFasta
(
file
)
else
{
val
defaults
=
ConfigUtils
.
mergeMaps
(
this
.
defaults
,
this
.
internalDefaults
)
def
getReferences
(
map
:
Map
[
String
,
Any
])
:
Set
[(
String
,
String
)]
=
(
for
(
...
...
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