Skip to content

Commit d9ee2f7

Browse files
authored
Add files via upload
1 parent 6cbef02 commit d9ee2f7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

R/BenchMark/ES_SCRB/analysis_main.R

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ write.table(data_bulk,
265265
# Run DrImpute
266266
# ---------------------------------------------------------------------------------
267267

268-
dir.create(file.path("imputation_drimpute_data/"),
268+
dir.create(file.path("imputation_data/"),
269269
showWarnings = FALSE)
270270

271271
data_sc <- as.matrix(fread("/data_all/sc_data_ES.csv"))
@@ -279,7 +279,7 @@ saveRDS(extdata, file = "imputation_drimpute_data/data_drimpute_imputation.rds")
279279
# ---------------------------------------------------------------------------------
280280

281281
# create the folder of the imputation result
282-
dir.create(file.path("imputation_drimpute_data/"),
282+
dir.create(file.path("imputation_data/"),
283283
showWarnings = FALSE)
284284

285285
# load the data
@@ -291,7 +291,7 @@ scimpute(
291291
"/data_all/sc_data_ES_scimpute.csv",
292292
infile = "csv",
293293
outfile = "csv",
294-
out_dir = paste0(cwd1),
294+
out_dir = paste0("imputation_data/"),
295295
drop_thre = 0.5,
296296
Kcluster = 2,
297297
ncores = 2)
@@ -302,7 +302,7 @@ tmp1$X <- NULL
302302
tmp1[is.na(tmp1)] <- 0
303303

304304
# save the data
305-
write.table(tmp1, file = "imputation_drimpute_data/data_scimpute_imputation.csv",
305+
write.table(tmp1, file = "imputation_data/data_scimpute_imputation.csv",
306306
sep=',',row.names = FALSE, col.names = FALSE)
307307

308308

@@ -312,8 +312,8 @@ write.table(tmp1, file = "imputation_drimpute_data/data_scimpute_imputation.csv"
312312

313313
# cwd = os.getwd()
314314
#
315-
# if not os.path.exists(cwd+"/imputation_magic_data"):
316-
# os.makedirs(cwd+"/imputation_magic_data")
315+
# if not os.path.exists(cwd+"/imputation_data"):
316+
# os.makedirs(cwd+"/imputation_data")
317317
#
318318
#
319319
# X = pd.read_csv(cwd + "/data_all/sc_data_ES.csv",sep = ',',header=None)
@@ -324,15 +324,15 @@ write.table(tmp1, file = "imputation_drimpute_data/data_scimpute_imputation.csv"
324324
#
325325
# out_magic = X_magic.T
326326
#
327-
# out_magic.to_csv(cwd+"/magic_data/data_magic_imputation.csv", sep = ',', header= None)
327+
# out_magic.to_csv(cwd+"/magic_data/data_imputation.csv", sep = ',', header= None)
328328

329329

330330
# ---------------------------------------------------------------------------------
331331
# Run SCRABBLE
332332
# ---------------------------------------------------------------------------------
333333

334334
# create the folder
335-
dir.create(file.path("/imputation_scrabble_data/"),
335+
dir.create(file.path("/imputation_data/"),
336336
showWarnings = FALSE)
337337

338338
# load the scRNAseq data
@@ -358,7 +358,7 @@ result <- scrabble(data,
358358
error_inner_threshold = 1e-14)
359359

360360
# save the result
361-
saveRDS(result, file = "/imputation_scrabble_data/data_scrabble_imputation.rds")
361+
saveRDS(result, file = "/imputation_data/data_scrabble_imputation.rds")
362362

363363
# ---------------------------------------------------------------------------------
364364
# Assemble all data: raw data, gold standard data, imputed data
@@ -382,19 +382,19 @@ data_sc_bulk <- read.table(file = "data_all/bulk_data_ES.csv",
382382
data_sc_bulk <- log10(as.matrix(data_sc_bulk) + 1)
383383

384384
# load the imputed data of DrImpute
385-
data_sc_drimpute <- readRDS(file = "imputation_drimpute_data/data_drimpute_imputation.rds")
385+
data_sc_drimpute <- readRDS(file = "imputation_data/data_drimpute_imputation.rds")
386386

387387
data_sc_drimpute <- log10(data_sc_drimpute + 1)
388388

389389
# load the imputed data of scImpute
390-
data_sc_scimpute <- read.table(file = "imputation_scimpute_data/data_scimpute_imputation.csv",
390+
data_sc_scimpute <- read.table(file = "imputation_data/data_scimpute_imputation.csv",
391391
fill = TRUE, header = FALSE, sep = ",",
392392
stringsAsFactors = FALSE)
393393

394394
data_sc_scimpute <- log10(data_sc_scimpute + 1)
395395

396396
# load the imputed data of MAGIC
397-
data_sc_magic <- read.table(file = "imputation_magic_data/data_magic_imputation.csv",
397+
data_sc_magic <- read.table(file = "imputation_data/data_magic_imputation.csv",
398398
header = FALSE, sep = ",",
399399
stringsAsFactors = FALSE)
400400

@@ -403,7 +403,7 @@ data_sc_magic <- data_sc_magic[,-1]
403403
data_sc_magic <- log10(data_sc_magic + 1)
404404

405405
# load the imputed data of SCRABBLE
406-
data_sc_scrabble <- readRDS(file = "imputation_scrabble_data/data_scrabble_imputation.rds")
406+
data_sc_scrabble <- readRDS(file = "imputation_data/data_scrabble_imputation.rds")
407407

408408
data_sc_scrabble <- log10(data_sc_scrabble + 1)
409409

@@ -460,7 +460,7 @@ p <- performance_distribution_comparison(gene_only_SCRB, gene_filter, 22, data_d
460460
main <- grid.arrange(grobs = p[c(1:20)],ncol = 4, top = "main")
461461

462462
ggsave(
463-
filename = paste0("gene_performance_compare_1.pdf"),
463+
filename = paste0("Figure_gene_performance_compare_1.pdf"),
464464
plot = main,
465465
width = 14,
466466
height = 20
@@ -470,7 +470,7 @@ ggsave(
470470
main <- grid.arrange(grobs = p[c(21:40)],ncol = 4, top = "main")
471471

472472
ggsave(
473-
filename = paste0("gene_performance_compare_2.pdf"),
473+
filename = paste0("Figure_gene_performance_compare_2.pdf"),
474474
plot = main,
475475
width = 14,
476476
height = 20
@@ -480,7 +480,7 @@ ggsave(
480480
main <- grid.arrange(grobs = p[c(41:56)],ncol = 4, top = "main")
481481

482482
ggsave(
483-
filename = paste0("gene_performance_compare_3.pdf"),
483+
filename = paste0("Figure_gene_performance_compare_3.pdf"),
484484
plot = main,
485485
width = 14,
486486
height = 20

0 commit comments

Comments
 (0)