Commit 110a3ebf authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added check also to libs

parent 62c1705d
...@@ -47,6 +47,8 @@ trait MultiSampleQScript extends SummaryQScript { ...@@ -47,6 +47,8 @@ trait MultiSampleQScript extends SummaryQScript {
/** Adds the library jobs */ /** Adds the library jobs */
final def addAndTrackJobs(): Unit = { final def addAndTrackJobs(): Unit = {
if (nameRegex.findFirstIn(libId) == None)
Logging.addError(s"Library '$libId' contains illegal chars, may only exist alphanumeric, '-' or '_' chars")
currentSample = Some(sampleId) currentSample = Some(sampleId)
currentLib = Some(libId) currentLib = Some(libId)
addJobs() addJobs()
...@@ -90,8 +92,8 @@ trait MultiSampleQScript extends SummaryQScript { ...@@ -90,8 +92,8 @@ trait MultiSampleQScript extends SummaryQScript {
/** Adds sample jobs */ /** Adds sample jobs */
final def addAndTrackJobs(): Unit = { final def addAndTrackJobs(): Unit = {
if (sampleRegex.findFirstIn(sampleId) == None) if (nameRegex.findFirstIn(sampleId) == None)
Logging.addError(s"Sample '$sampleId' contains illegal chars") Logging.addError(s"Sample '$sampleId' contains illegal chars, may only exist alphanumeric, '-' or '_' chars")
currentSample = Some(sampleId) currentSample = Some(sampleId)
addJobs() addJobs()
qscript.addSummarizable(this, "pipeline", Some(sampleId)) qscript.addSummarizable(this, "pipeline", Some(sampleId))
...@@ -131,7 +133,7 @@ trait MultiSampleQScript extends SummaryQScript { ...@@ -131,7 +133,7 @@ trait MultiSampleQScript extends SummaryQScript {
/** Returns a list of all sampleIDs */ /** Returns a list of all sampleIDs */
protected def sampleIds: Set[String] = ConfigUtils.any2map(globalConfig.map("samples")).keySet protected def sampleIds: Set[String] = ConfigUtils.any2map(globalConfig.map("samples")).keySet
protected lazy val sampleRegex = """^[a-zA-Z0-9-_]+$""".r protected lazy val nameRegex = """^[a-zA-Z0-9-_]+$""".r
/** Runs addAndTrackJobs method for each sample */ /** Runs addAndTrackJobs method for each sample */
final def addSamplesJobs() { final def addSamplesJobs() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment