-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move parameter validation to nextflow schema
- Loading branch information
Showing
5 changed files
with
130 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import groovy.json.JsonSlurper | ||
|
||
|
||
class WorkflowScrnaseq { | ||
// Retrieve the aligner-specific protocol based on the specified protocol. | ||
// Returns a map ["protocol": protocol, "extra_args": <extra args>, "whitelist": <path to whitelist>] | ||
// extra_args and whitelist are optional. | ||
public static Map getProtocol(workflow, log, aligner, protocol) { | ||
def jsonSlurper = new JsonSlurper() | ||
def json = new File("${workflow.projectDir}/assets/protocols.json").text | ||
def protocols = jsonSlurper.parseText(json) | ||
def aligner_map = protocols[aligner] | ||
if(aligner_map.containsKey(protocol)) { | ||
return aligner_map[protocol] | ||
} else { | ||
log.warn("Protocol '${protocol}' not recognized by the pipeline. Passing on the protocol to the aligner unmodified.") | ||
return ["protocol": protocol] | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.