Skip to content

Commit

Permalink
Update extract-dgidb.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
acevedol authored Apr 1, 2024
1 parent b527618 commit e4cf2a0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions extract-dgidb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ source ${config_dir}/master-config.shinc

dgidb_dir=${1:-"${BUILD_DIR}/dgidb/"}
dgidb_file=interactions.tsv
dgidb_base_url="https://www.dgidb.org/"
mkdir -p ${dgidb_dir}
dgidb_latest_download_url="https://www.dgidb.org/data/2022-Feb/interactions.tsv"

# not the most future proof, but finds the first table entry of interactions.tsv and grabs url from href
dgidb_path=`${curl_get} http://www.dgidb.org/downloads | grep -m 1 'interactions.tsv' | sed 's:<td><a href="\(.*\)">.*</a></td>:\1:'`
update_date=`echo ${dgidb_path} | grep -i -o -E '[0-9]{4}-[a-z]{3}'`
dgidb_url="${dgidb_base_url}${dgidb_path}"
mkdir -p ${dgidb_dir}

${curl_get} ${dgidb_url} > /tmp/${dgidb_file}
${curl_get} ${dgidb_latest_download_url} > /tmp/${dgidb_file}

echo ${update_date}
echo "#${update_date}" > ${dgidb_dir}/${dgidb_file}
Expand Down

0 comments on commit e4cf2a0

Please sign in to comment.