summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHui Lan <lanhui@zjnu.edu.cn>2024-08-10 14:41:25 +0800
committerHui Lan <lanhui@zjnu.edu.cn>2024-08-10 14:41:25 +0800
commit88263d51a3f8c5b9257f0a5521769f14570c2fc6 (patch)
tree9cae71d730e6a9ea696745c1fe72d0297d7b7569
parenteb18d1994377c574bc191e9fee6c4921e3165883 (diff)
[update_network.py] Do not generation json files for gene expression if not do webapp
-rwxr-xr-xCode/update_network.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Code/update_network.py b/Code/update_network.py
index f4ceda1..0d944fa 100755
--- a/Code/update_network.py
+++ b/Code/update_network.py
@@ -529,9 +529,12 @@ def check_rnaseq_info():
# main
+
FILE_LIST_TO_CHECK = [PARAMETER_FOR_BUILDCMATRIX, PARAMETER_FOR_BUILDRMATRIX, PARAMETER_FOR_NET, \
MERGED_EDGE_FILE, BINDING_FILE, TPM_FILE] # a list of important files
+PREPARE_JSON_FOR_WEBAPP = False
+
make_important_dirs() # make important directories (if non-existent) for holding various kinds of files, must be put after os.chdir(CODE_DIR)
#validate_webapp_dir(PARAMETER_FOR_NET) # make sure the directory Webapp contains necessary files, e.g., genes.json.
@@ -684,13 +687,13 @@ if 'TPM.txt' in updated_file_list: # we could _touch_ TPM.txt to make it recent.
cmd = 'python3 make_target_tf.py %s > %s' % (PARAMETER_FOR_NET, TARGET_TF_FILE)
os.system(cmd)
- if os.path.exists(TPM_FILE):
+ if PREPARE_JSON_FOR_WEBAPP and os.path.exists(TPM_FILE):
write_log_file('[update_network.py] Update ../Data/history/expr/json using the new TPM.txt. Don\'t forget to update the static/edges/json folder in the web application.', UPDATE_NETWORK_LOG_FILE)
## json -- make/renew json directory for displaying scatterplots
cmd = 'python3 slice_TPM_to_JSON.py %s' % (PARAMETER_FOR_NET)
os.system(cmd) # turn this on if we are going to use this TPM.txt for displaying scatterplots
- if os.path.exists(BINDING_FILE):
+ if PREPARE_JSON_FOR_WEBAPP and os.path.exists(BINDING_FILE):
write_log_file('[update_network.py] Update directory ../Data/history/bind/json2. Don\'t forget to copy json2 to static/edges in the web application.', UPDATE_NETWORK_LOG_FILE)
cmd = 'python3 slice_binding_to_JSON.py %s' % (PARAMETER_FOR_NET)
os.system(cmd) # turn this on if we are going to use this binding.txt for displaying bar charts of binding strengths