diff options
author | Hui Lan <lanhui@zjnu.edu.cn> | 2024-08-07 18:40:49 +0800 |
---|---|---|
committer | Hui Lan <lanhui@zjnu.edu.cn> | 2024-08-07 18:40:49 +0800 |
commit | e5593827fbc6c35e1df6b7ab1131b0717130219c (patch) | |
tree | f5050e597dbd8c1b4e550e7575f409ce0563eba1 | |
parent | b442a3ddf7f0452e5dd0d8c042a5e155effea154 (diff) |
Use TPM_FILE instead of TPM_TABLE
-rw-r--r-- | Code/buildRmatrix.py | 5 | ||||
-rw-r--r-- | Code/slice_TPM_to_JSON.R | 19 |
2 files changed, 3 insertions, 21 deletions
diff --git a/Code/buildRmatrix.py b/Code/buildRmatrix.py index 363e0a3..1c90eb0 100644 --- a/Code/buildRmatrix.py +++ b/Code/buildRmatrix.py @@ -10,8 +10,9 @@ # Last modified 10 Oct 2020, hui, zjnu [note that if there are more than 1000 RNA-seq samples, this script requires at least 7GB memory to run.]
import os, sys, glob
+from configure import TPM_FILE
-TPM_TABLE = '../Data/history/expr/TPM.txt'
+TPM_TABLE = TPM_FILE
WARN_NA = False
####################################
@@ -239,4 +240,4 @@ global_param_dict = make_global_param_dict(param_file) data_dict = make_data_dict(param_file)
TPM_TABLE = os.path.abspath(TPM_TABLE)
save_TPM_table(get_gene_list(global_param_dict['GENE_LIST']), get_dict_list(data_dict), TPM_TABLE)
-#print('Done. Check %s.' % (TPM_TABLE))
+
diff --git a/Code/slice_TPM_to_JSON.R b/Code/slice_TPM_to_JSON.R deleted file mode 100644 index fb7a39d..0000000 --- a/Code/slice_TPM_to_JSON.R +++ /dev/null @@ -1,19 +0,0 @@ - -library(rjson) -dir.name <- '../Data/history/expr/json' -tpm.file <- '../Data/history/expr/TPM.txt' -take.log <- 'YES' -X <- read.table(tpm.file, header=T, check.names=FALSE, sep="\t") -gene.id <- as.vector(X[,1]) -X[,1] <- NULL # remove first column -if (take.log == 'YES') { - X <- log(X+1) -} -if (!dir.exists(dir.name)) { - dir.create(dir.name) -} -for (i in 1:dim(X)[1]) { - y <- toJSON(X[i,]) - file.name = paste(dir.name, paste(gene.id[i], 'json', sep='.'), sep='/') - cat(y, file=file.name) -} |