Skip to content
Snippets Groups Projects
Commit 04bbabd5 authored by Gervaise Henry's avatar Gervaise Henry :cowboy:
Browse files

Allow override for input bagit #61

parent 8fae34bd
Branches
Tags
2 merge requests!43Develop,!420.0.3
...@@ -19,6 +19,9 @@ params.refHuVersion = "38.p12.v31" ...@@ -19,6 +19,9 @@ params.refHuVersion = "38.p12.v31"
params.refERCCVersion = "92" params.refERCCVersion = "92"
params.outDir = "${baseDir}/../output" params.outDir = "${baseDir}/../output"
// Define override input variable
params.inputBagForce = ""
// Parse input variables // Parse input variables
deriva = Channel deriva = Channel
.fromPath(params.deriva) .fromPath(params.deriva)
...@@ -32,6 +35,8 @@ refHuVersion = params.refHuVersion ...@@ -32,6 +35,8 @@ refHuVersion = params.refHuVersion
refERCCVersion = params.refERCCVersion refERCCVersion = params.refERCCVersion
outDir = params.outDir outDir = params.outDir
logsDir = "${outDir}/Logs" logsDir = "${outDir}/Logs"
inputBagForce = params.inputBagForce
// Define fixed files // Define fixed files
derivaConfig = Channel.fromPath("${baseDir}/conf/replicate_export_config.json") derivaConfig = Channel.fromPath("${baseDir}/conf/replicate_export_config.json")
...@@ -119,6 +124,9 @@ process getBag { ...@@ -119,6 +124,9 @@ process getBag {
output: output:
path ("Replicate_*.zip") into bagit path ("Replicate_*.zip") into bagit
when:
params.inputBagForce == ""
script: script:
""" """
hostname > ${repRID}.getBag.log hostname > ${repRID}.getBag.log
...@@ -137,6 +145,15 @@ process getBag { ...@@ -137,6 +145,15 @@ process getBag {
""" """
} }
// Set inputBag to downloaded or forced input
if (inputBagForce != "") {
inputBag = Channel
.fromPath(inputBagForce)
.ifEmpty { exit 1, "override inputBagit file not found: ${inputBagForce}" }
} else {
inputBag = bagit
}
/* /*
* getData: fetch study files from consortium with downloaded bdbag.zip * getData: fetch study files from consortium with downloaded bdbag.zip
*/ */
...@@ -146,7 +163,7 @@ process getData { ...@@ -146,7 +163,7 @@ process getData {
input: input:
path script_bdbagFetch path script_bdbagFetch
path cookies, stageAs: "deriva-cookies.txt" from bdbag path cookies, stageAs: "deriva-cookies.txt" from bdbag
path bagit path inputBag
output: output:
path ("*.R{1,2}.fastq.gz") into fastqs path ("*.R{1,2}.fastq.gz") into fastqs
...@@ -158,7 +175,7 @@ process getData { ...@@ -158,7 +175,7 @@ process getData {
""" """
hostname > ${repRID}.getData.log hostname > ${repRID}.getData.log
ulimit -a >> ${repRID}.getData.log ulimit -a >> ${repRID}.getData.log
# link deriva cookie for authentication # link deriva cookie for authentication
echo -e "LOG: linking deriva cookie" >> ${repRID}.getData.log echo -e "LOG: linking deriva cookie" >> ${repRID}.getData.log
mkdir -p ~/.bdbag mkdir -p ~/.bdbag
...@@ -166,12 +183,12 @@ process getData { ...@@ -166,12 +183,12 @@ process getData {
echo -e "LOG: linked" >> ${repRID}.getData.log echo -e "LOG: linked" >> ${repRID}.getData.log
# get bagit basename # get bagit basename
replicate=\$(basename "${bagit}" | cut -d "." -f1) replicate=\$(basename "\${inputBag}" | cut -d "." -f1)
echo -e "LOG: bagit replicate name \${replicate}" >> ${repRID}.getData.log echo -e "LOG: bagit replicate name \${replicate}" >> ${repRID}.getData.log
# unzip bagit # unzip bagit
echo -e "LOG: unzipping replicate bagit" >> ${repRID}.getData.log echo -e "LOG: unzipping replicate bagit" >> ${repRID}.getData.log
unzip ${bagit} unzip ${inputBag}
echo -e "LOG: unzipped" >> ${repRID}.getData.log echo -e "LOG: unzipped" >> ${repRID}.getData.log
# bagit fetch fastq's only and rename by repRID # bagit fetch fastq's only and rename by repRID
......
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