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
cf4d0b82
Commit
cf4d0b82
authored
Oct 29, 2015
by
Peter van 't Hof
Browse files
Changed error handeling
parent
ef5ea6ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/Reference.scala
View file @
cf4d0b82
...
...
@@ -118,22 +118,22 @@ object Reference {
/**
* Raise an exception when given fasta file has no fai file
* @param fastaFile Fasta file
* @throws IllegalArgumentException
*/
def
requireFai
(
fastaFile
:
File
)
:
Unit
=
{
val
fai
=
new
File
(
fastaFile
.
getAbsolutePath
+
".fai"
)
require
(
fai
.
exists
(),
"Reference is missing a fai file"
)
require
(
IndexedFastaSequenceFile
.
canCreateIndexedFastaReader
(
fastaFile
),
"Index of reference cannot be loaded, reference: "
+
fastaFile
)
if
(
fai
.
exists
())
{
if
(!
IndexedFastaSequenceFile
.
canCreateIndexedFastaReader
(
fastaFile
))
Logging
.
addError
(
s
"Index of reference cannot be loaded, reference: $fastaFile"
)
}
else
Logging
.
addError
(
"Reference is missing a fai file"
)
}
/**
* Raise an exception when given fasta file has no dict file
* @param fastaFile Fasta file
* @throws IllegalArgumentException
*/
def
requireDict
(
fastaFile
:
File
)
:
Unit
=
{
val
dict
=
new
File
(
fastaFile
.
getAbsolutePath
.
stripSuffix
(
".fa"
).
stripSuffix
(
".fasta"
)
+
".dict"
)
require
(
dict
.
exists
()
,
"Reference is missing a dict file"
)
if
(!
dict
.
exists
()
)
Logging
.
addError
(
"Reference is missing a dict file"
)
}
}
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