Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set -e
PYTHON_VERSION='3.6.0'
PYTHON_INTERPRETER='python3.6'
ROOT=$(readlink -f $(dirname ${BASH_SOURCE}))
mkdir -p ${ROOT}/tmpdata
export TMPDIR=${ROOT}/tmpdata # Write temporary files to tmpdata
export CPIPE_ROOT=$ROOT
TEMP_SUBDIR=`mktemp -d`
Expand Down
7 changes: 5 additions & 2 deletions tasks/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def unzip_todir(input, directory, type):
tar = tarfile.open(fileobj=input, mode='r:bz2')
tar.extractall(tempdir)
else:
raise ValueError('Can only download .tar.gz, .tar.bz2, or .zip file')
raise ValueError('Type: {0} given. Can only download .tar.gz, .tar.bz2, or .zip file'.format(type))

# If there is only one subdirectory, take the files inside that
files = [os.path.join(tempdir, f) for f in os.listdir(tempdir)]
Expand Down Expand Up @@ -207,7 +207,7 @@ def download_zip(url_str, directory, type=None):
input = BytesIO(url.read())

# Try to deduce the type from the URL
if not type:
if type is None:
[name, ext2] = os.path.splitext(url_str)
[name, ext1] = os.path.splitext(name)

Expand All @@ -217,6 +217,9 @@ def download_zip(url_str, directory, type=None):
type = 'tgz'
elif (ext1 == '.tar' and ext2 == '.bz2') or ext2 == '.tbz2':
type = 'tbz2'
else:
raise ValueError ("Unknow filetype: ext1: {}, ext2: {}\nurl_str: {}".format(ext1, ext2,
url_str))

unzip_todir(input, directory, type)

Expand Down
12 changes: 10 additions & 2 deletions tasks/download/download_reference_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,15 @@ def task_download_ucsc():
["ucsc.hg19.dict.gz", "ucsc.hg19.fasta.gz", "ucsc.hg19.fasta.fai.gz"],
UCSC_ROOT,
'bundle/hg19/'
)
),
cmd('''
mkdir -p ucsc\
&& pushd {data_dir}/ucsc\
&& gunzip -c ucsc.hg19.dict.gz >ucsc.hg19.dict\
&& gunzip -c ucsc.hg19.fasta.fai.gz >ucsc.hg19.fasta.fai\
&& gunzip -c ucsc.hg19.fasta.gz >ucsc.hg19.fasta
'''.format(data_dir=DATA_ROOT), cwd=DATA_ROOT, executable='bash')

],
'uptodate': [run_once],
}
Expand Down Expand Up @@ -311,7 +319,7 @@ def task_bwa_index_ucsc_reference():
return {
'targets': [UCSC_BWA_INDEX],
'actions': [
'{tools}/bwa/bwa index -a bwtsw {data}/ucsc/ucsc.hg19.fasta'.format(tools=TOOLS_ROOT, data=DATA_ROOT)
'{tools}/bin/bwa index -a bwtsw {data}/ucsc/ucsc.hg19.fasta'.format(tools=TOOLS_ROOT, data=DATA_ROOT)
],
'task_dep': [
'install_bwa',
Expand Down
9 changes: 6 additions & 3 deletions tasks/download/download_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def action():
curl -L https://cpanmin.us/ -o cpanm
chmod +x cpanm
''', cwd=temp_dir)
return {
'dir': temp_dir
}

return {
'actions': [action],
Expand Down Expand Up @@ -99,7 +102,7 @@ def task_download_bwa():
if swift_install():
return nectar_download('bwa')
else:
return download_task("https://codeload.github.com/lh3/bwa/tar.gz/v{0}".format(BWA_VERSION))
return download_task("https://codeload.github.com/lh3/bwa/tar.gz/v{0}".format(BWA_VERSION), type='tgz')


def task_download_htslib():
Expand Down Expand Up @@ -130,7 +133,7 @@ def task_download_bedtools():
if swift_install():
return nectar_download('bedtools')
else:
return download_task("https://codeload.github.com/arq5x/bedtools2/tar.gz/v{0}".format(BEDTOOLS_VERSION))
return download_task("https://codeload.github.com/arq5x/bedtools2/tar.gz/v{0}".format(BEDTOOLS_VERSION), type='tgz')

def task_download_vep():
if swift_install():
Expand Down Expand Up @@ -331,7 +334,7 @@ def task_download_zlib():
return nectar_download('zlib')
else:
return download_task(
'https://codeload.github.com/madler/zlib/tar.gz/v{}'.format(ZLIB_VERSION))
'https://codeload.github.com/madler/zlib/tar.gz/v{}'.format(ZLIB_VERSION), type='tgz')

def task_download_vcfanno():
if has_swift_auth():
Expand Down