@@ -265,7 +265,7 @@ write.table(data_bulk,
265
265
# Run DrImpute
266
266
# ---------------------------------------------------------------------------------
267
267
268
- dir.create(file.path(" imputation_drimpute_data /" ),
268
+ dir.create(file.path(" imputation_data /" ),
269
269
showWarnings = FALSE )
270
270
271
271
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")
279
279
# ---------------------------------------------------------------------------------
280
280
281
281
# create the folder of the imputation result
282
- dir.create(file.path(" imputation_drimpute_data /" ),
282
+ dir.create(file.path(" imputation_data /" ),
283
283
showWarnings = FALSE )
284
284
285
285
# load the data
@@ -291,7 +291,7 @@ scimpute(
291
291
" /data_all/sc_data_ES_scimpute.csv" ,
292
292
infile = " csv" ,
293
293
outfile = " csv" ,
294
- out_dir = paste0(cwd1 ),
294
+ out_dir = paste0(" imputation_data/ " ),
295
295
drop_thre = 0.5 ,
296
296
Kcluster = 2 ,
297
297
ncores = 2 )
@@ -302,7 +302,7 @@ tmp1$X <- NULL
302
302
tmp1 [is.na(tmp1 )] <- 0
303
303
304
304
# 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" ,
306
306
sep = ' ,' ,row.names = FALSE , col.names = FALSE )
307
307
308
308
@@ -312,8 +312,8 @@ write.table(tmp1, file = "imputation_drimpute_data/data_scimpute_imputation.csv"
312
312
313
313
# cwd = os.getwd()
314
314
#
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 ")
317
317
#
318
318
#
319
319
# 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"
324
324
#
325
325
# out_magic = X_magic.T
326
326
#
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)
328
328
329
329
330
330
# ---------------------------------------------------------------------------------
331
331
# Run SCRABBLE
332
332
# ---------------------------------------------------------------------------------
333
333
334
334
# create the folder
335
- dir.create(file.path(" /imputation_scrabble_data /" ),
335
+ dir.create(file.path(" /imputation_data /" ),
336
336
showWarnings = FALSE )
337
337
338
338
# load the scRNAseq data
@@ -358,7 +358,7 @@ result <- scrabble(data,
358
358
error_inner_threshold = 1e-14 )
359
359
360
360
# save the result
361
- saveRDS(result , file = " /imputation_scrabble_data /data_scrabble_imputation.rds" )
361
+ saveRDS(result , file = " /imputation_data /data_scrabble_imputation.rds" )
362
362
363
363
# ---------------------------------------------------------------------------------
364
364
# 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",
382
382
data_sc_bulk <- log10(as.matrix(data_sc_bulk ) + 1 )
383
383
384
384
# 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" )
386
386
387
387
data_sc_drimpute <- log10(data_sc_drimpute + 1 )
388
388
389
389
# 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" ,
391
391
fill = TRUE , header = FALSE , sep = " ," ,
392
392
stringsAsFactors = FALSE )
393
393
394
394
data_sc_scimpute <- log10(data_sc_scimpute + 1 )
395
395
396
396
# 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" ,
398
398
header = FALSE , sep = " ," ,
399
399
stringsAsFactors = FALSE )
400
400
@@ -403,7 +403,7 @@ data_sc_magic <- data_sc_magic[,-1]
403
403
data_sc_magic <- log10(data_sc_magic + 1 )
404
404
405
405
# 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" )
407
407
408
408
data_sc_scrabble <- log10(data_sc_scrabble + 1 )
409
409
@@ -460,7 +460,7 @@ p <- performance_distribution_comparison(gene_only_SCRB, gene_filter, 22, data_d
460
460
main <- grid.arrange(grobs = p [c(1 : 20 )],ncol = 4 , top = " main" )
461
461
462
462
ggsave(
463
- filename = paste0(" gene_performance_compare_1 .pdf" ),
463
+ filename = paste0(" Figure_gene_performance_compare_1 .pdf" ),
464
464
plot = main ,
465
465
width = 14 ,
466
466
height = 20
@@ -470,7 +470,7 @@ ggsave(
470
470
main <- grid.arrange(grobs = p [c(21 : 40 )],ncol = 4 , top = " main" )
471
471
472
472
ggsave(
473
- filename = paste0(" gene_performance_compare_2 .pdf" ),
473
+ filename = paste0(" Figure_gene_performance_compare_2 .pdf" ),
474
474
plot = main ,
475
475
width = 14 ,
476
476
height = 20
@@ -480,7 +480,7 @@ ggsave(
480
480
main <- grid.arrange(grobs = p [c(41 : 56 )],ncol = 4 , top = " main" )
481
481
482
482
ggsave(
483
- filename = paste0(" gene_performance_compare_3 .pdf" ),
483
+ filename = paste0(" Figure_gene_performance_compare_3 .pdf" ),
484
484
plot = main ,
485
485
width = 14 ,
486
486
height = 20
0 commit comments