Mercurial > repos > iuc > ebi_search_rest_results
view download_ebi_metagenomics_run_data @ 1:a2c83f79f253 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ebi_tools commit 6847e1202f570ae466cf98affe54a7016fa98cd8
author | iuc |
---|---|
date | Mon, 12 Dec 2016 10:04:11 -0500 |
parents | bb7989bd88ba |
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