forked from RTXteam/RTX-KG2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathextract-smpdb.sh
executable file
·44 lines (32 loc) · 1.32 KB
/
extract-smpdb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
# extract-smpdb.sh: Download the Small Molecule Pathway Database
# Copyright 2019 Stephen A. Ramsey
# Author Erica Wood
set -o nounset -o pipefail -o errexit
if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
echo Usage: "$0 <output-dir>"
exit 2
fi
# Usage: extract-smpdb.sh <output-dir>
echo "================= starting extract-smpdb.sh =================="
date
config_dir=`dirname "$0"`
source ${config_dir}/master-config.shinc
output_dir=${1:-"${BUILD_DIR}/smpdb"}
smpdb_output_file="pathbank_pathways.csv"
pw_output_file="pathbank_all_pwml.zip"
mkdir -p ${output_dir}
smpdb_link="https://pathbank.org/downloads/pathbank_all_pathways.csv.zip"
pwml_link="https://pathbank.org/downloads/pathbank_all_pwml.zip"
smpdb_pmids_file="SMPDB_pubmed_IDs.csv"
${curl_get} ${output_dir}/ ${smpdb_link} > ${output_dir}/${smpdb_output_file}.zip
${curl_get} ${output_dir}/ ${pwml_link} > ${output_dir}/${pw_output_file}
unzip -o ${output_dir}/${smpdb_output_file}.zip -d ${output_dir}/
unzip -o -q ${output_dir}/${pw_output_file} -d ${output_dir}/
for individ_file in $(ls ${output_dir}/pathbank_all_pwml)
do
mv ${output_dir}/pathbank_all_pwml/${individ_file} ${output_dir}
done
${s3_cp_cmd} s3://${s3_bucket}/${smpdb_pmids_file} ${output_dir}
date
echo "================= finishing extract-smpdb.sh =================="