Skip to content

Commit

Permalink
Merge branch 'master' into ct-add-bwa-depletion
Browse files Browse the repository at this point in the history
  • Loading branch information
dpark01 committed Jan 26, 2018
2 parents 3a4dab9 + 1ff0d37 commit 72eddc4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions pipes/WDL/workflows/tasks/metagenomics.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ task krona {
docker: "quay.io/broadinstitute/viral-ngs"
memory: "2 GB"
cpu: 1
dx_instance_type: "mem1_ssd1_x4"
}
}

Expand Down
2 changes: 2 additions & 0 deletions pipes/WDL/workflows/tasks/reports.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ task fastqc {
memory: "2 GB"
cpu: 1
docker: "quay.io/broadinstitute/viral-ngs"
dx_instance_type: "mem1_ssd1_x4"
}
}

Expand Down Expand Up @@ -142,5 +143,6 @@ task spikein_report {
memory: "3 GB"
cpu: 2
docker: "quay.io/broadinstitute/viral-ngs"
dx_instance_type: "mem1_ssd1_x4"
}
}
1 change: 1 addition & 0 deletions pipes/WDL/workflows/tasks/taxon_filter.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,6 @@ task merge_one_per_sample {
memory: "7 GB"
cpu: 4
docker: "quay.io/broadinstitute/viral-ngs"
dx_instance_type: "mem2_hdd2_x4"
}
}
9 changes: 8 additions & 1 deletion util/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ def extract_tarball(tarfile, out_dir=None, threads=None, compression='auto', pip
elif compression == 'none':
decompressor = ['cat']
untar_cmd = ['tar', '-C', out_dir, '-x']
if os.getuid() == 0:
# GNU tar behaves differently when run as root vs normal user
# we want normal user behavior always
if 'GNU' in subprocess.check_output(['tar', '--version']).decode('UTF-8'):
untar_cmd.append('--no-same-owner')
log.debug("cat {} | {} | {}".format(tarfile, ' '.join(decompressor), ' '.join(untar_cmd)))
with open(os.devnull, 'w') as fnull:
if tarfile == '-':
Expand All @@ -250,9 +255,11 @@ def extract_tarball(tarfile, out_dir=None, threads=None, compression='auto', pip
decompress_proc = subprocess.Popen(decompressor,
stdin=inf, stdout=subprocess.PIPE)
untar_proc = subprocess.Popen(untar_cmd,
stdin=decompress_proc.stdout, stderr=fnull)
stdin=decompress_proc.stdout) #, stderr=fnull)
if untar_proc.wait():
raise subprocess.CalledProcessError(untar_proc.returncode, untar_cmd)
if decompress_proc.wait():
raise subprocess.CalledProcessError(decompress_proc.returncode, decompressor)
if inf is not None:
inf.close()
log.debug("completed unpacking of {} into {}".format(tarfile, out_dir))
Expand Down

0 comments on commit 72eddc4

Please sign in to comment.