Skip to content

Commit

Permalink
allow sequencing_center to be passed as an optional input to demux_la…
Browse files Browse the repository at this point in the history
…uncher (#844)

* allow sequencing_center to be passed as an optional input to demux_launcher

allow sequencing_center to be passed as an optional input to demux_launcher; this allows each job spawning a demux (uploader laptops, etc.) to set the sequencing center at upload time

* extend travis cache timeout

* make safe sequencing_center value passed to illumina.py, mention to avoid spaces in the DNAnexus applet demux_launcher

spaces may cause issues for the bash-like demux_launcher applet script
  • Loading branch information
tomkinsc committed Jul 10, 2018
1 parent a30825c commit e5ae663
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cache:
directories:
- $HOME/misc_cache
- $HOME/miniconda
timeout: 480
timeout: 1000

#stages:
# - build
Expand Down
5 changes: 4 additions & 1 deletion illumina.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ def main_illumina_demux(args):
if not picardOpts.get('sequencing_center') and runinfo:
picardOpts['sequencing_center'] = runinfo.get_machine()

if picardOpts.get('sequencing_center'):
picardOpts["sequencing_center"] = util.file.string_to_file_name(picardOpts["sequencing_center"])

# manually garbage collect to make sure we have as much RAM free as possible
gc.collect()
if multiplexed_samples:
Expand Down Expand Up @@ -875,7 +878,7 @@ def miseq_fastq_to_bam(outBam, sampleSheet, inFastq1, inFastq2=None, runInfo=Non
if sequencing_center is None and runInfo:
sequencing_center = runInfo.get_machine()
if sequencing_center:
picardOpts['SEQUENCING_CENTER'] = sequencing_center
picardOpts['SEQUENCING_CENTER'] = util.file.string_to_file_name(sequencing_center)
picardOpts['PLATFORM_UNIT'] = '.'.join((flowcell, '1', barcode))
if len(flowcell) > 5:
flowcell = flowcell[:5]
Expand Down
11 changes: 10 additions & 1 deletion pipes/WDL/dx-launcher/demux_launcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputSpec:
class: string
default: /
help: Output folder in the root project. For this applet, the --destination should be set to / and this input should be used to control the output folder.
- name: sequencing_center
class: string
optional: true
help: Optional- the name of the sequencing center to be included in the demultiplexed output (bam files). Please avoid spaces and special characters.
- name: api_token
class: file
optional: true
Expand Down Expand Up @@ -140,9 +144,14 @@ runSpec:
# launch the demux workflow on each lane
analyses=()
output_project=$DX_WORKSPACE_ID
if [ -n "$sequencing_center" ]; then
sequencing_center_input="-i illumina_demux.sequencingCenter=$sequencing_center"
else
sequencing_center_input=""
fi
for i in $(seq "$lane_count"); do
folder2=$(printf "%s/%s/reads/L%d" "$folder" "$run_id" $i)
runcmd="dx run $demux_workflow_id -i stage-0.flowcell_tgz=$run_tarball -i illumina_demux.lane=$i -i illumina_demux.minimumBaseQuality=$min_base_quality -i illumina_demux.threads=$demux_threads --folder $folder2 --instance-type illumina_demux=$demux_instance_type --name demux:$run_id:L$i -y --brief"
runcmd="dx run $demux_workflow_id -i stage-0.flowcell_tgz=$run_tarball -i illumina_demux.lane=$i -i illumina_demux.minimumBaseQuality=$min_base_quality -i illumina_demux.threads=$demux_threads $sequencing_center_input --folder $folder2 --instance-type illumina_demux=$demux_instance_type --name demux:$run_id:L$i -y --brief"
echo "$runcmd"
set +x
if [ -n "$api_token" ]; then
Expand Down

0 comments on commit e5ae663

Please sign in to comment.