-
Notifications
You must be signed in to change notification settings - Fork 1
/
rrun-j1-chem_dis-sentence-extraction-batch.sh
executable file
·78 lines (68 loc) · 4.37 KB
/
rrun-j1-chem_dis-sentence-extraction-batch.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
#!/bin/sh
source ./rrun.env.sh
SCRIPT=./scripts/pipelines/sentences/run_sentence_extraction.sh
TEXT_PIPELINE_KEY=MEDLINE_XML_TO_TEXT
TEXT_PIPELINE_VERSION="recent"
SECTION_PIPELINE_KEY=MEDLINE_XML_TO_TEXT
SECTION_PIPELINE_VERSION="recent"
MAX_SUBSET_INDEX=38
SUBSET_PREFIX=PUBMED_SUB_
# TEXT_PIPELINE_KEY=FILTER_UNACTIONABLE_TEXT
# TEXT_PIPELINE_VERSION="recent"
# SECTION_PIPELINE_KEY=BIOC_TO_TEXT
# SECTION_PIPELINE_VERSION="recent"
# SUBSET_PREFIX=PMC_SUBSET_
# MAX_SUBSET_INDEX=41
SENTENCE_PIPELINE_KEY=SENTENCE_SEGMENTATION
SENTENCE_PIPELINE_VERSION="recent"
CONCEPT_POST_PROCESS_VERSION="0.3.0"
# For chemical/drug to disease/phenotype sentences
ASSOCIATION="bl_chemical_to_disease_or_phenotypic_feature"
PREFIX_X="CHEBI|DRUGBANK"
PLACEHOLDER_X="@CHEMICAL$"
PREFIX_Y="MONDO|HP"
PLACEHOLDER_Y="@DISEASE$"
OUTPUT_VERSION="0.2.0" # v0.2.0 is a run after large concept recognition error analysis and updates
# # # ---------------------------------------------
# # # process a single collection
# COLLECTION="PUBMED_SUB_0"
# OUTPUT_COLLECTION=$COLLECTION
# $SCRIPT $PROJECT_ID ${COLLECTION} $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SECTION_PIPELINE_KEY $SECTION_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $CONCEPT_POST_PROCESS_VERSION $ASSOCIATION $PREFIX_X $PLACEHOLDER_X $PREFIX_Y $PLACEHOLDER_Y ${STAGE_LOCATION} ${TEMP_LOCATION} ${WORK_BUCKET} $JAR_VERSION ${OUTPUT_VERSION} ${OUTPUT_COLLECTION} &> "./logs/sentence-extraction-${COLLECTION}-${ASSOCIATION}.log" &
# # ---------------------------------------------
# # use the below for bulk processing
# #
for INDEX in $(seq 0 4 $MAX_SUBSET_INDEX)
do
ind=$(($INDEX + 0))
if (( ind <= $MAX_SUBSET_INDEX)); then
echo "Starting sentence extraction pipeline... ${ind} $(date)"
COLLECTION="${SUBSET_PREFIX}${ind}"
OUTPUT_COLLECTION=$COLLECTION
$SCRIPT $PROJECT_ID ${COLLECTION} $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SECTION_PIPELINE_KEY $SECTION_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $CONCEPT_POST_PROCESS_VERSION $ASSOCIATION $PREFIX_X $PLACEHOLDER_X $PREFIX_Y $PLACEHOLDER_Y ${STAGE_LOCATION} ${TEMP_LOCATION} ${WORK_BUCKET} $JAR_VERSION ${OUTPUT_VERSION} ${OUTPUT_COLLECTION} &> "./logs/sentence-extraction-${COLLECTION}-${ASSOCIATION}-${OUTPUT_VERSION}.log" &
sleep 120
fi
ind=$(($INDEX + 1))
if (( ind <= $MAX_SUBSET_INDEX)); then
echo "Starting sentence extraction pipeline... ${ind} $(date)"
COLLECTION="${SUBSET_PREFIX}${ind}"
OUTPUT_COLLECTION=$COLLECTION
$SCRIPT $PROJECT_ID ${COLLECTION} $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SECTION_PIPELINE_KEY $SECTION_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $CONCEPT_POST_PROCESS_VERSION $ASSOCIATION $PREFIX_X $PLACEHOLDER_X $PREFIX_Y $PLACEHOLDER_Y ${STAGE_LOCATION} ${TEMP_LOCATION} ${WORK_BUCKET} $JAR_VERSION ${OUTPUT_VERSION} ${OUTPUT_COLLECTION} &> "./logs/sentence-extraction-${COLLECTION}-${ASSOCIATION}-${OUTPUT_VERSION}.log" &
sleep 120
fi
ind=$(($INDEX + 2))
if (( ind <= $MAX_SUBSET_INDEX)); then
echo "Starting sentence extraction pipeline... ${ind} $(date)"
COLLECTION="${SUBSET_PREFIX}${ind}"
OUTPUT_COLLECTION=$COLLECTION
$SCRIPT $PROJECT_ID ${COLLECTION} $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SECTION_PIPELINE_KEY $SECTION_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $CONCEPT_POST_PROCESS_VERSION $ASSOCIATION $PREFIX_X $PLACEHOLDER_X $PREFIX_Y $PLACEHOLDER_Y ${STAGE_LOCATION} ${TEMP_LOCATION} ${WORK_BUCKET} $JAR_VERSION ${OUTPUT_VERSION} ${OUTPUT_COLLECTION} &> "./logs/sentence-extraction-${COLLECTION}-${ASSOCIATION}-${OUTPUT_VERSION}.log" &
sleep 120
fi
ind=$(($INDEX + 3))
if (( ind <= $MAX_SUBSET_INDEX)); then
echo "Starting sentence extraction pipeline... ${ind} $(date)"
COLLECTION="${SUBSET_PREFIX}${ind}"
OUTPUT_COLLECTION=$COLLECTION
$SCRIPT $PROJECT_ID ${COLLECTION} $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SECTION_PIPELINE_KEY $SECTION_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $CONCEPT_POST_PROCESS_VERSION $ASSOCIATION $PREFIX_X $PLACEHOLDER_X $PREFIX_Y $PLACEHOLDER_Y ${STAGE_LOCATION} ${TEMP_LOCATION} ${WORK_BUCKET} $JAR_VERSION ${OUTPUT_VERSION} ${OUTPUT_COLLECTION} &> "./logs/sentence-extraction-${COLLECTION}-${ASSOCIATION}-${OUTPUT_VERSION}.log" &
fi
wait
done