Skip to content

Commit

Permalink
#140 made sure its only defined once
Browse files Browse the repository at this point in the history
  • Loading branch information
ecwood committed Jul 17, 2024
1 parent 07c8549 commit 184fa6e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build/Snakefile-post-etl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ rule Simplify:
log:
config['SIMPLIFY_LOG']
shell:
"bash -x {input.code} {input.nodes} {input.edges} {output.nodes} {output.edges} " + config['VERSION_FILE'] + " " + config['TEST_FLAG'] + " > {log} 2>&1"
"bash -x {input.code} {input.nodes} {input.edges} {output.nodes} {output.edges} " + config['TEST_FLAG'] + " > {log} 2>&1"

rule Slim:
input:
Expand Down
10 changes: 4 additions & 6 deletions build/build-kg2-snakemake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ then
run_flag="-F"
fi

kg2_version_file="kg2-version.txt"
local_kg2_version_file="${BUILD_DIR}/${kg2_version_file}"
trigger_file_is_major_release=${BUILD_DIR}/major-release
trigger_file_is_minor_release=${BUILD_DIR}/minor-release

Expand All @@ -89,14 +87,14 @@ if [[ "${ci_flag}" == "ci" ]]
then
sed -i "\@^kg2_version=@ckg2_version=KG2.CI" ${CODE_DIR}/master-config.shinc
else
${s3_cp_cmd} s3://${s3_bucket_public}/${kg2_version_file} ${local_kg2_version_file}
${s3_cp_cmd} s3://${s3_bucket_public}/${kg2_version_file} ${kg2_version_file_local}
if [[ "${increment_flag}" != '' ]]
then
${VENV_DIR}/bin/python3 ${PROCESS_CODE_DIR}/update_version.py ${increment_flag} ${local_kg2_version_file}
${VENV_DIR}/bin/python3 ${PROCESS_CODE_DIR}/update_version.py ${increment_flag} ${kg2_version_file_local}
else
echo "*** TEST MODE -- NO INCREMENT ***"
fi
curr_kg2_version=`cat ${local_kg2_version_file}`
curr_kg2_version=`cat ${kg2_version_file_local}`
sed -i "\@^kg2_version=@ckg2_version=${curr_kg2_version}" ${CODE_DIR}/master-config.shinc
fi

Expand Down Expand Up @@ -156,7 +154,7 @@ cd ~ && ${VENV_DIR}/bin/snakemake --snakefile ${snakefile} ${run_flag} -R Finish

if [[ "${ci_flag}" != "ci" ]]
then
${s3_cp_cmd} ${local_kg2_version_file} s3://${s3_bucket_public}/${kg2_version_file}
${s3_cp_cmd} ${kg2_version_file_local} s3://${s3_bucket_public}/${kg2_version_file}
fi

if [[ -f ${trigger_file_is_major_release} ]]
Expand Down
2 changes: 0 additions & 2 deletions build/snakemake-config-var.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,5 +291,3 @@ kg2_tsv_tarball: ${BUILD_DIR}/kg2-tsv-for-neo4j${version_suffix}${test_suffix}.t
tsv_placeholder: ${BUILD_DIR}/tsv_placeholder.empty

finish_script: ${BUILD_CODE_DIR}/finish-snakemake.sh

version_file: ${BUILD_DIR}/kg2-version.txt
2 changes: 2 additions & 0 deletions master-config.shinc
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ ont_load_inventory_file=${MAPS_CODE_DIR}/ont-load-inventory${test_suffix}.yaml
rtx_config_file=RTXConfiguration-config.json
biolink_model_version=4.2.0
infores_registry_version=0.2.8
kg2_version_file=version.txt
kg2_version_file_local=${BUILD_DIR}/${kg2_version_file}
kg2_version=
5 changes: 2 additions & 3 deletions neo4j/tsv-to-neo4j.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ rm -r -f ${tsv_dir}
mkdir -p ${tsv_dir}

# get the latest KG2 version
kg2_version_file="kg2-version.txt"
${s3_cp_cmd} s3://${s3_bucket}/${kg2_version_file} ${BUILD_DIR}/${kg2_version_file}
kg2_version=`cat ${BUILD_DIR}/${kg2_version_file}`
${s3_cp_cmd} s3://${s3_bucket}/${kg2_version_file} ${kg2_version_file_local}
kg2_version=`cat ${kg2_version_file_local}`

# download the latest TSV files from the S3 Bucket
${s3_cp_cmd} s3://${s3_bucket}/kg2-tsv-for-neo4j-${kg2_version}${test_arg}.tar.gz ${tsv_tarball}
Expand Down
7 changes: 3 additions & 4 deletions process/run-simplify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
exit 2
fi

# Usage: run-simplify.sh <input_nodes_json> <input_edges_json> <output_nodes_json> <output_edges_json> [version_filename] [test]
# Usage: run-simplify.sh <input_nodes_json> <input_edges_json> <output_nodes_json> <output_edges_json> [test]

echo "================= starting run-simplify.sh =================="
date
Expand All @@ -22,15 +22,14 @@ input_nodes_json=${1:-}
input_edges_json=${2:-}
output_nodes_json=${3:-}
output_edges_json=${4:-}
local_version_filename=${5:-"${BUILD_DIR}/kg2-version.txt"}
build_flag=${6:-""}
build_flag=${5:-""}

# TODO: Inhibits and increase are not in biolink model anymore - Find out what that should be now
${VENV_DIR}/bin/python3 -u ${PROCESS_CODE_DIR}/filter_kg_and_remap_predicates.py ${test_flag} --dropNegated \
--dropSelfEdgesExcept interacts_with,regulates,inhibits,increase \
${predicate_mapping_file} ${infores_mapping_file} ${curies_to_urls_file} \
${knowledge_level_agent_type_mapping_file} ${input_nodes_json} ${input_edges_json} \
${output_nodes_json} ${output_edges_json} ${local_version_filename}
${output_nodes_json} ${output_edges_json} ${kg2_version_file_local}

date
echo "================= finishing run-simplify.sh =================="

0 comments on commit 184fa6e

Please sign in to comment.