Skip to content

Instantly share code, notes, and snippets.

@sbamin
Created February 7, 2018 20:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbamin/7f33b26198a00ad6846d124b8ba8d2b4 to your computer and use it in GitHub Desktop.
Save sbamin/7f33b26198a00ad6846d124b8ba8d2b4 to your computer and use it in GitHub Desktop.
Install NCI gdc-client on RHEL 6 to download GDC data

gdc-client on RHEL/CentOS 6

Linux 2.6.32-431.23.3.el6.x86_64

## Using conda 4.3.33

## remove unstable conda env
conda env remove --name rvlabpy2

## create gdc_client conda env with required dependencies
conda create --name gdc_client python=2.7 pip parcel pyopenssl cryptography libxml2 yaml

## activate gdc_client env
source activate gdc_client

## make accessible for all users
umask 0022

## clone GDC repository
cd /fastscratch/dump/gdc
git clone git@github.com:NCI-GDC/gdc-client.git
cd gdc-client

which python

/projects/verhaak-lab/verhaak_env/anaconda/v4.2.0/envs/gdc_client/bin/python

pwd
# fastscratch/dump/gdc/gdc-client

python setup.py install 2>&1 | tee -a install.log
  • This will install gdc-client in your PATH
which gdc-client

gdc-client --help

'DownloadStream' object has no attribute 'url'

        # gdc-client calls parcel's parallel_download,
        # which is where most of the downloading takes place
        file_id = stream.uri.split('/')[-1]
        super(GDCDownloadMixin, self).parallel_download(stream)
  • Run setup again
cd fastscratch/dump/gdc/gdc-client
python setup.py install 2>&1 | tee -a install_patch1.log

## remove source
rm -rf fastscratch/dump/gdc/gdc-client

Test gdc-client download

OUTDIR=/fastscratch/dump/gdc/lgg
MANIFEST=/fastscratch/dump/gdc/lgg/controlled_manifest.tsv
TOKEN="${HOME}"/.myconfs/gdc_token.key
CMD=gdc-client

## single sample
# ${CMD} download --log-file="${OUTDIR}"/download.log -n 2 --token-file ${TOKEN} --dir ${OUTDIR} 6c849069-054f-42d6-94ef-194d8a4eb58a 

## batch download
${CMD} download --log-file="${OUTDIR}"/download.log -n 2 -t ${TOKEN} -d ${OUTDIR} -m ${MANIFEST}

Known issues

  • There is an open issue of output directory containing full URL instead of UUID/out.bam.

END

@hannah413
Copy link

thank you! used this today. the url line that needs changing was on line 303.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment