Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tasks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
biowdl
tasks
Commits
c9c2fc44
Commit
c9c2fc44
authored
6 years ago
by
Ruben Vorderman
Browse files
Options
Downloads
Patches
Plain Diff
common to 1.0
parent
37f0afb7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!34
Move all files to version 1.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common.wdl
+43
-47
43 additions, 47 deletions
common.wdl
with
43 additions
and
47 deletions
common.wdl
+
43
−
47
View file @
c9c2fc44
task AppendToStringArray {
Array[String] array
String string
version 1.0
task AppendToStringArray {
input {
Array[String] array
String string
}
command {
echo "
$
{sep='\n' array}
$
{string}"
echo "
~
{sep='\n' array}
~
{string}"
}
output {
...
...
@@ -18,27 +21,29 @@ task AppendToStringArray {
# This task will fail if the MD5sum doesn't match the file.
task CheckFileMD5 {
File file
String MD5sum
input {
File file
String MD5sum
}
command {
set -e -o pipefail
MD5SUM=$(md5sum
$
{file} | cut -d ' ' -f 1)
[ $MD5SUM =
$
{MD5sum} ]
MD5SUM=$(md5sum
~
{file} | cut -d ' ' -f 1)
[ $MD5SUM =
~
{MD5sum} ]
}
}
task ConcatenateTextFiles {
Array[File] fileList
String combinedFilePath
Boolean? unzip = false
Boolean? zip = false
input {
Array[File] fileList
String combinedFilePath
Boolean? unzip = false
Boolean? zip = false
}
command {
set -e -o pipefail
$
{"mkdir -p $(dirname " + combinedFilePath + ")"}
$
{true='zcat' false= 'cat' unzip}
$
{sep=' ' fileList} \
$
{true="| gzip -c" false="" zip} >
$
{combinedFilePath}
~
{"mkdir -p $(dirname " + combinedFilePath + ")"}
~
{true='zcat' false= 'cat' unzip}
~
{sep=' ' fileList} \
~
{true="| gzip -c" false="" zip} >
~
{combinedFilePath}
}
output {
...
...
@@ -53,11 +58,12 @@ task ConcatenateTextFiles {
task CreateLink {
# Making this of type File will create a link to the copy of the file in the execution
# folder, instead of the actual file.
String inputFile
String outputPath
input {
String inputFile
String outputPath
}
command {
ln -sf
$
{inputFile}
$
{outputPath}
ln -sf
~
{inputFile}
~
{outputPath}
}
output {
...
...
@@ -65,29 +71,17 @@ task CreateLink {
}
}
# inspired by https://gatkforums.broadinstitute.org/wdl/discussion/9616/is-there-a-way-to-flatten-arrays
task FlattenStringArray {
Array[Array[String]] arrayList
command {
for line in $(echo ${sep=', ' arrayList}) ; \
do echo $line | tr -d '"[],' ; done
}
output {
Array[String] flattenedArray = read_lines(stdout())
}
runtime {
memory: 1
}
}
# DEPRECATED. USE BUILT-IN FLATTEN FUNCTION
# task FlattenStringArray {}
# Commented out to let pipelines that depend on this fail.
task MapMd5 {
Map[String,String] map
input {
Map[String,String] map
}
command {
cat
$
{write_map(map)} | md5sum - | sed -e 's/ -//'
cat
~
{write_map(map)} | md5sum - | sed -e 's/ -//'
}
output {
...
...
@@ -101,10 +95,11 @@ task MapMd5 {
task ObjectMd5 {
Object the_object
input {
Object the_object
}
command {
cat
$
{write_object(the_object)} | md5sum - | sed -e 's/ -//'
cat
~
{write_object(the_object)} | md5sum - | sed -e 's/ -//'
}
output {
...
...
@@ -117,11 +112,12 @@ task ObjectMd5 {
}
task StringArrayMd5 {
Array[String] stringArray
input {
Array[String] stringArray
}
command {
set -eu -o pipefail
echo
$
{sep=',' stringArray} | md5sum - | sed -e 's/ -//'
echo
~
{sep=',' stringArray} | md5sum - | sed -e 's/ -//'
}
output {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment