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
9b9fd26a
Commit
9b9fd26a
authored
6 years ago
by
Cats
Browse files
Options
Downloads
Patches
Plain Diff
style
parent
26e020d6
No related branches found
No related tags found
1 merge request
!32
style changes and adds task to check file md5
This commit is part of merge request
!32
. Comments created here will be created in the context of that merge request.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common.wdl
+48
-47
48 additions, 47 deletions
common.wdl
with
48 additions
and
47 deletions
common.wdl
+
48
−
47
Edit
View file @
9b9fd26a
task objectMd5 {
task AppendToStringArray {
Object the_object
Array[String] array
String string
command {
command {
cat ${write_object(the_object)} | md5sum - | sed -e 's/ -//'
echo "${sep='\n' array}
${string}"
}
}
output {
output {
String md5sum
= read_
string
(stdout())
Array[String] out_array
= read_
lines
(stdout())
}
}
runtime {
runtime {
...
@@ -14,15 +16,21 @@ task objectMd5 {
...
@@ -14,15 +16,21 @@ task objectMd5 {
}
}
}
}
task mapMd5 {
task ConcatenateTextFiles {
Map[String,String] map
Array[File] fileList
String combinedFilePath
Boolean? unzip=false
Boolean? zip=false
command {
command {
cat ${write_map(map)} | md5sum - | sed -e 's/ -//'
set -e -o pipefail
${"mkdir -p $(dirname " + combinedFilePath + ")"}
${true='zcat' false= 'cat' unzip} ${sep=' ' fileList} \
${true="| gzip -c" false="" zip} > ${combinedFilePath}
}
}
output {
output {
String md5sum = read_string(stdout())
File combinedFile = combinedFilePath
}
}
runtime {
runtime {
...
@@ -30,38 +38,32 @@ task mapMd5 {
...
@@ -30,38 +38,32 @@ task mapMd5 {
}
}
}
}
task stringArrayMd5 {
task CreateLink {
Array[String] stringArray
# 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
command {
command {
set -eu -o pipefail
ln -sf ${inputFile} ${outputPath}
echo ${sep=',' stringArray} | md5sum - | sed -e 's/ -//'
}
}
output {
output {
String md5sum = read_string(stdout())
File link = outputPath
}
runtime {
memory: 1
}
}
}
}
task concatenateTextFiles {
# inspired by https://gatkforums.broadinstitute.org/wdl/discussion/9616/is-there-a-way-to-flatten-arrays
Array[File] fileList
task FlattenStringArray {
String combinedFilePath
Array[Array[String]] arrayList
Boolean? unzip=false
Boolean? zip=false
command {
command {
set -e -o pipefail
for line in $(echo ${sep=', ' arrayList}) ; \
${"mkdir -p $(dirname " + combinedFilePath + ")"}
do echo $line | tr -d '"[],' ; done
${true='zcat' false= 'cat' unzip} ${sep=' ' fileList} \
${true="| gzip -c" false="" zip} > ${combinedFilePath}
}
}
output {
output {
File combinedFile = combinedFilePath
Array[String] flattenedArray = read_lines(stdout())
}
}
runtime {
runtime {
...
@@ -69,17 +71,15 @@ task concatenateTextFiles {
...
@@ -69,17 +71,15 @@ task concatenateTextFiles {
}
}
}
}
# inspired by https://gatkforums.broadinstitute.org/wdl/discussion/9616/is-there-a-way-to-flatten-arrays
task MapMd5 {
task flattenStringArray {
Map[String,String] map
Array[Array[String]] arrayList
command {
command {
for line in $(echo ${sep=', ' arrayList}) ; \
cat ${write_map(map)} | md5sum - | sed -e 's/ -//'
do echo $line | tr -d '"[],' ; done
}
}
output {
output {
Array[String] flattenedArray
= read_
lines
(stdout())
String md5sum
= read_
string
(stdout())
}
}
runtime {
runtime {
...
@@ -87,17 +87,16 @@ task flattenStringArray {
...
@@ -87,17 +87,16 @@ task flattenStringArray {
}
}
}
}
task appendToStringArray {
Array[String] array
task ObjectMd5 {
String string
Object the_object
command {
command {
echo "${sep='\n' array}
cat ${write_object(the_object)} | md5sum - | sed -e 's/ -//'
${string}"
}
}
output {
output {
Array[String] out_array
= read_
lines
(stdout())
String md5sum
= read_
string
(stdout())
}
}
runtime {
runtime {
...
@@ -105,17 +104,19 @@ task appendToStringArray {
...
@@ -105,17 +104,19 @@ task appendToStringArray {
}
}
}
}
task createLink {
task StringArrayMd5 {
# Making this of type File will create a link to the copy of the file in the execution
Array[String] stringArray
# folder, instead of the actual file.
String inputFile
String outputPath
command {
command {
ln -sf ${inputFile} ${outputPath}
set -eu -o pipefail
echo ${sep=',' stringArray} | md5sum - | sed -e 's/ -//'
}
}
output {
output {
File link = outputPath
String md5sum = read_string(stdout())
}
}
}
\ No newline at end of file
runtime {
memory: 1
}
}
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