summaryrefslogtreecommitdiff
path: root/Code/getTF.py
diff options
context:
space:
mode:
authorLan Hui <lanhui@zjnu.edu.cn>2024-08-26 16:20:34 +0800
committerLan Hui <lanhui@zjnu.edu.cn>2024-08-26 16:20:34 +0800
commit965c52946eef4cd76f0a4119be63d82348cfee23 (patch)
tree7aba7ea456daa9abdedae049b3ea98c3c7fee177 /Code/getTF.py
parentf312d8bbef849370aacefba1f6e8b1b420047cbb (diff)
Use R package jsonlite instead of rjson, to support the 'digits' option, which allows keeping fewer digits after decimal, thus saving disk storage space
Diffstat (limited to 'Code/getTF.py')
-rw-r--r--Code/getTF.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Code/getTF.py b/Code/getTF.py
new file mode 100644
index 0000000..1090bd2
--- /dev/null
+++ b/Code/getTF.py
@@ -0,0 +1,19 @@
+import json
+
+tfs = set()
+
+with open('../Data/information/target_tf.txt') as f:
+ for line in f:
+ line = line.strip()
+ lst = line.split('\t')
+ tf = lst[1]
+ tfs.add(tf)
+
+with open('../Data/information/target_tf_agris.txt') as f:
+ for line in f:
+ line = line.strip()
+ lst = line.split('\t')
+ tf = lst[1]
+ tfs.add(tf)
+
+print(json.dumps(sorted(list(tfs))))