summaryrefslogtreecommitdiff
path: root/Code/slice_TPM_to_JSON.py
diff options
context:
space:
mode:
authorHui Lan <lanhui@zjnu.edu.cn>2025-03-09 16:27:16 +0800
committerHui Lan <lanhui@zjnu.edu.cn>2025-03-09 16:27:16 +0800
commit92ef45014d95e029f227e9332ac0e2bb80541c83 (patch)
treee5fb2cc889c4e12164b67a33ab00cb1d49f2d748 /Code/slice_TPM_to_JSON.py
parentd6b28e7a6e11de2622988488badc7a07c662e2c4 (diff)
parent837a291e6a1816920c7116410dd1e0df9fd3eaf7 (diff)
Sync changes made on my Ubuntu desktop machine i7-13700H
Diffstat (limited to 'Code/slice_TPM_to_JSON.py')
-rw-r--r--Code/slice_TPM_to_JSON.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Code/slice_TPM_to_JSON.py b/Code/slice_TPM_to_JSON.py
index e597b78..7509f00 100644
--- a/Code/slice_TPM_to_JSON.py
+++ b/Code/slice_TPM_to_JSON.py
@@ -127,7 +127,7 @@ def make_json_file(expr_dict, dir_name, glb_param_dict):
def make_json_file_using_r(dir_name, glb_param_dict): # use r script to make it faster
r_code = '''
- library(rjson)
+ library(jsonlite)
dir.name <- '%s'
tpm.file <- '%s'
take.log <- '%s'
@@ -141,7 +141,7 @@ def make_json_file_using_r(dir_name, glb_param_dict): # use r script to make it
dir.create(dir.name)
}
for (i in 1:dim(X)[1]) {
- y <- toJSON(X[i,])
+ y <- toJSON(unbox(X[i,]), digits=I(3), pretty=TRUE)
file.name = paste(dir.name, paste(gene.id[i], 'json', sep='.'), sep='/')
cat(y, file=file.name)
}