Skip to content

Commit 7a6a014

Browse files
committed
add arg parse back in
1 parent dbd0f20 commit 7a6a014

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

scripts/compare_junctions_hist_v2.R

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ library(tidyverse)
99

1010
debug = F
1111

12-
# system.time({
13-
# if (debug){
14-
# tag = paste("_", "default", sep="")
15-
# } else {
16-
# # get options tag
17-
# args = commandArgs(trailingOnly = TRUE)
18-
# tag = args[1]
19-
# input_file = args[2]
20-
# if ( substr(tag, 2, 3) == "--"){
21-
# stop("Please specify an option tag (e.g. \"default\", \"i20e5\")")
22-
# }
23-
# }
24-
25-
tag = 'I'
26-
input_file = '~/Desktop/CHOL/all_splicing_variants_I.bed'
12+
system.time({
13+
if (debug){
14+
tag = paste("_", "default", sep="")
15+
} else {
16+
# get options tag
17+
args = commandArgs(trailingOnly = TRUE)
18+
tag = args[1]
19+
input_file = args[2]
20+
if ( substr(tag, 2, 3) == "--"){
21+
stop("Please specify an option tag (e.g. \"default\", \"i20e5\")")
22+
}
23+
}
24+
25+
# tag = 'I'
26+
# input_file = '~/Desktop/CHOL/all_splicing_variants_I.bed'
2727

2828
# All splicing relevant variants (union of rows from variants.bed files; add column with comma-separated list of sample names)
2929
all_splicing_variants = unique(data.table::fread(input_file), sep = '\t', header = T, stringsAsFactors = FALSE)
@@ -158,7 +158,6 @@ a <- function(x, y, z){
158158
return(x)
159159
}
160160
x <- mapply(a, regtools_data$norm_scores_non, length(all_samples), regtools_data$samples)
161-
# x = split(x, rep(1:ncol(x), each = nrow(x)))
162161
regtools_data$norm_scores_non = x
163162
print("test7")
164163

@@ -216,4 +215,4 @@ regtools_data = regtools_data %>% distinct()
216215

217216
write.table(regtools_data, file=paste(input_file, "_out_test.tsv", sep=""), quote=FALSE, sep='\t', row.names = F)
218217

219-
# })
218+
})

0 commit comments

Comments
 (0)