forked from stuppie/semmed-biolink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_environment.sh
executable file
·109 lines (93 loc) · 4.53 KB
/
setup_environment.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env bash
if [[ -f ".env" ]]
then
export $(cat .env | sed 's/#.*//g' | sed '/^[[:space:]]*$/d' | sed 's/^/export /' | sed 's/ = /=/' | xargs )
else
echo "Please copy the template.env file into .env; customize as required, before running this script"
read
exit -1
fi
#
# SemMedDb 2020 data release values taken as defaults in June 2020 script
# These variables which can be overridden from the command line or by the .env file
#
: ${SEMEDDB_DOWNLOAD_PATH:=https://ii.nlm.nih.gov/SemRep_SemMedDB_SKR/SemMedDB/download/}
: ${SEMEDDB_VERSION:=42}
: ${SEMEDDB_PUBMED_RELEASE:=2020}
echo
echo "SemMedDb Data Parameters (variables that might be overridden from the command line):"
echo
echo "SEMEDDB_DOWNLOAD_PATH: ${SEMEDDB_DOWNLOAD_PATH}"
echo "SEMEDDB_VERSION: ${SEMEDDB_VERSION}"
echo "SEMEDDB_PUBMED_RELEASE: ${SEMEDDB_PUBMED_RELEASE}"
# Data file targets:
SEMMEDB_FILE_PREFIX=semmedVER${SEMEDDB_VERSION}
echo "SEMMEDB_FILE_PREFIX: ${SEMMEDB_FILE_PREFIX}"
# SemMedDb 2019 data release file name in original Greg Stupp script
# SEMMEDDB_PREDICATION_FILE=${SEMMEDB_FILE_PREFIX}_R_PREDICATION_${SEMEDDB_PUBMED_RELEASE}
# Slightly revised file name format in SemMedDb 2020 data release
# Predication Table Data Targets:
: ${SEMMEDDB_PREDICATION_FILE:=${SEMMEDB_FILE_PREFIX}_${SEMEDDB_PUBMED_RELEASE}_R_PREDICATION}
export SEMMEDDB_PREDICATION_ARCHIVE=${SEMMEDDB_PREDICATION_FILE}.sql.gz
export SEMMEDDB_PREDICATION_DOWNLOAD=${SEMEDDB_DOWNLOAD_PATH}${SEMMEDDB_PREDICATION_ARCHIVE}
export SEMMEDDB_PREDICATION_CSV=${SEMMEDDB_PREDICATION_FILE}.csv
echo
echo "SemMedDb Predication File Variables (normally not overridden but generated from above SemMedDb parameters):"
echo
echo "SEMMEDDB_PREDICATION_ARCHIVE: ${SEMMEDDB_PREDICATION_ARCHIVE}"
echo "SEMMEDDB_PREDICATION_DOWNLOAD: ${SEMMEDDB_PREDICATION_DOWNLOAD}"
echo "SEMMEDDB_PREDICATION_CSV: ${SEMMEDDB_PREDICATION_CSV}"
# Citation Table Data Targets:
SEMMEDDB_CITATIONS_FILE=${SEMMEDB_FILE_PREFIX}_${SEMEDDB_PUBMED_RELEASE}_R_CITATIONS
export SEMMEDDB_CITATIONS_ARCHIVE=${SEMMEDDB_CITATIONS_FILE}.sql.gz
export SEMMEDDB_CITATIONS_DOWNLOAD=${SEMEDDB_DOWNLOAD_PATH}${SEMMEDDB_CITATIONS_ARCHIVE}
export SEMMEDDB_CITATIONS_CSV=${SEMMEDDB_CITATIONS_FILE}.csv
echo
echo "SemMedDb Citation File Variables (normally not overridden but generated from above SemMedDb parameters):"
echo
echo "SEMMEDDB_CITATIONS_ARCHIVE: ${SEMMEDDB_CITATIONS_ARCHIVE}"
echo "SEMMEDDB_CITATIONS_DOWNLOAD: ${SEMMEDDB_CITATIONS_DOWNLOAD}"
echo "SEMMEDDB_CITATIONS_CSV: ${SEMMEDDB_CITATIONS_CSV}"
# Predication Aux Table Data Targets:
SEMMEDDB_PREDICATION_AUX_FILE=${SEMMEDB_FILE_PREFIX}_${SEMEDDB_PUBMED_RELEASE}_R_PREDICATION_AUX
export SEMMEDDB_PREDICATION_AUX_ARCHIVE=${SEMMEDDB_PREDICATION_AUX_FILE}.sql.gz
export SEMMEDDB_PREDICATION_AUX_DOWNLOAD=${SEMEDDB_DOWNLOAD_PATH}${SEMMEDDB_PREDICATION_AUX_ARCHIVE}
export SEMMEDDB_PREDICATION_AUX_CSV=${SEMMEDDB_PREDICATION_AUX_FILE}.csv
echo
echo "SemMedDb Predication File Variables (normally not overridden but generated from above SemMedDb parameters):"
echo
echo "SEMMEDDB_PREDICATION_AUX_ARCHIVE: ${SEMMEDDB_PREDICATION_AUX_ARCHIVE}"
echo "SEMMEDDB_PREDICATION_AUX_DOWNLOAD: ${SEMMEDDB_PREDICATION_AUX_DOWNLOAD}"
echo "SEMMEDDB_PREDICATION_AUX_CSV: ${SEMMEDDB_PREDICATION_AUX_CSV}"
# Sentence Table Data Targets:
SEMMEDDB_SENTENCE_FILE=${SEMMEDB_FILE_PREFIX}_${SEMEDDB_PUBMED_RELEASE}_R_SENTENCE
export SEMMEDDB_SENTENCE_ARCHIVE=${SEMMEDDB_SENTENCE_FILE}.sql.gz
export SEMMEDDB_SENTENCE_DOWNLOAD=${SEMEDDB_DOWNLOAD_PATH}${SEMMEDDB_SENTENCE_ARCHIVE}
export SEMMEDDB_SENTENCE_CSV=${SEMMEDDB_SENTENCE_FILE}.csv
echo
echo "SemMedDb Predication File Variables (normally not overridden but generated from above SemMedDb parameters):"
echo
echo "SEMMEDDB_SENTENCE_ARCHIVE: ${SEMMEDDB_SENTENCE_ARCHIVE}"
echo "SEMMEDDB_SENTENCE_DOWNLOAD: ${SEMMEDDB_SENTENCE_DOWNLOAD}"
echo "SEMMEDDB_SENTENCE_CSV: ${SEMMEDDB_SENTENCE_CSV}"
#
# Original "classic" release used https://download.nlm.nih.gov/umls/kss/2018AA/umls-2018AA-full.zip
#
# But we update to the latest UMLS release
#
: ${UMLS_VERSION:="2020AA"}
export UMLS_ARCHIVE="umls-${UMLS_VERSION}-full.zip"
export UMLS_DOWNLOAD="https://download.nlm.nih.gov/umls/kss/${UMLS_VERSION}/${UMLS_ARCHIVE}"
echo
echo "UMLS Metadata version (update to set to latest version, as necessary):"
echo
echo "UMLS_VERSION: ${UMLS_VERSION}"
echo
echo "UMLS Metadata file variables (normally not overridden but generated for above UMLS_VERSION):"
echo
echo "UMLS_ARCHIVE: ${UMLS_ARCHIVE}"
echo "UMLS_DOWNLOAD: ${UMLS_DOWNLOAD}"
echo
echo "METAMAP_VERSION: ${METAMAP_VERSION}"
echo "UNII_VERSION: ${UNII_VERSION}"
echo