Mercurial > repos > iuc > ebi_metagenomics_run_downloader
view download_ebi_metagenomics_run_data @ 2:6155fa39a899 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 19ea4feff5ccf3744c549b9a67259947a1cb90ba
author | iuc |
---|---|
date | Sat, 21 Jan 2017 14:40:54 -0500 |
parents | e2e9fae080ad |
children |
line wrap: on
line source
#!/usr/bin/env bash set -e python_script=$1 run_id=$2 information_type=$3 information_to_download=$4 chunk_type=$5 output_file=$6 touch $output_file run_link=$(python $python_script getRunLink $run_id) run_link="$run_link/$information_type/$information_to_download" if [[ $chunk_type == 'multiple_chunks' ]]; then chunk_nb=$(curl "$run_link/chunks") if [[ "$chunk_nb" < 1 ]]; then >&2 echo "-----" >&2 echo "ERROR" >&2 echo "-----" >&2 echo "No data are found for this link:" >&2 echo "$run_link/chunks" >&2 echo "-----" exit 6 fi for i in $(seq "$chunk_nb"); do curl "$run_link/chunks/$i" | gunzip >> $output_file done else curl "$run_link" >> $output_file fi if [ ! -s $output_file ]; then >&2 echo "-----" >&2 echo "ERROR" >&2 echo "-----" >&2 echo "The output file is empty probably because the following link is not working:" >&2 echo "$run_link" >&2 echo "-----" exit 6 fi