diff options
author | Lan Hui <lanhui@zjnu.edu.cn> | 2024-08-26 16:20:34 +0800 |
---|---|---|
committer | Lan Hui <lanhui@zjnu.edu.cn> | 2024-08-26 16:20:34 +0800 |
commit | 965c52946eef4cd76f0a4119be63d82348cfee23 (patch) | |
tree | 7aba7ea456daa9abdedae049b3ea98c3c7fee177 /Code/getTF.py | |
parent | f312d8bbef849370aacefba1f6e8b1b420047cbb (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.py | 19 |
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)))) |