Skip to content
GitLab
Menu
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
9f90d2be
Commit
9f90d2be
authored
Oct 09, 2015
by
Peter van 't Hof
Browse files
Make name more strict
parent
110a3ebf
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/MultiSampleQScript.scala
View file @
9f90d2be
...
...
@@ -48,7 +48,7 @@ trait MultiSampleQScript extends SummaryQScript {
/** Adds the library jobs */
final
def
addAndTrackJobs
()
:
Unit
=
{
if
(
nameRegex
.
findFirstIn
(
libId
)
==
None
)
Logging
.
addError
(
s
"Library '$libId'
contains illegal chars, may only exist alphanumeric, '-' or '_' chars
"
)
Logging
.
addError
(
s
"Library '$libId'
does not conform to '$nameRegex'
"
)
currentSample
=
Some
(
sampleId
)
currentLib
=
Some
(
libId
)
addJobs
()
...
...
@@ -93,7 +93,7 @@ trait MultiSampleQScript extends SummaryQScript {
/** Adds sample jobs */
final
def
addAndTrackJobs
()
:
Unit
=
{
if
(
nameRegex
.
findFirstIn
(
sampleId
)
==
None
)
Logging
.
addError
(
s
"Sample '$sampleId'
contains illegal chars, may only exist alphanumeric, '-' or '_' chars
"
)
Logging
.
addError
(
s
"Sample '$sampleId'
does not conform to '$nameRegex'
"
)
currentSample
=
Some
(
sampleId
)
addJobs
()
qscript
.
addSummarizable
(
this
,
"pipeline"
,
Some
(
sampleId
))
...
...
@@ -133,7 +133,7 @@ trait MultiSampleQScript extends SummaryQScript {
/** Returns a list of all sampleIDs */
protected
def
sampleIds
:
Set
[
String
]
=
ConfigUtils
.
any2map
(
globalConfig
.
map
(
"samples"
)).
keySet
protected
lazy
val
nameRegex
=
"""^[a-zA-Z
0-9-_]+
$"""
.
r
protected
lazy
val
nameRegex
=
"""^[a-zA-Z
][a-zA-Z0-9-_]+[a-zA-Z0-9]
$"""
.
r
/** Runs addAndTrackJobs method for each sample */
final
def
addSamplesJobs
()
{
...
...
Write
Preview
Supports
Markdown
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