From 965c52946eef4cd76f0a4119be63d82348cfee23 Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Mon, 26 Aug 2024 16:20:34 +0800 Subject: Use R package jsonlite instead of rjson, to support the 'digits' option, which allows keeping fewer digits after decimal, thus saving disk storage space --- Code/getTF.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Code/getTF.py (limited to 'Code/getTF.py') 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)))) -- cgit v1.2.1