|
5 | 5 | # load libraries
|
6 | 6 | library(data.table)
|
7 | 7 | library(plyr)
|
| 8 | +library(tidyverse) |
8 | 9 |
|
9 | 10 | debug = F
|
10 | 11 |
|
11 |
| -system.time({ |
12 |
| -if (debug){ |
13 |
| - tag = paste("_", "default", sep="") |
14 |
| -} else { |
15 |
| - # get options tag |
16 |
| - args = commandArgs(trailingOnly = TRUE) |
17 |
| - tag = args[1] |
18 |
| - input_file = args[2] |
19 |
| - if ( substr(tag, 2, 3) == "--"){ |
20 |
| - stop("Please specify an option tag (e.g. \"default\", \"i20e5\")") |
21 |
| - } |
22 |
| -} |
23 |
| - |
24 |
| -# tag = 'I' |
25 |
| -# 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' |
26 | 27 |
|
27 | 28 | # All splicing relevant variants (union of rows from variants.bed files; add column with comma-separated list of sample names)
|
28 |
| -input_file = args[2] |
29 | 29 | all_splicing_variants = unique(data.table::fread(input_file), sep = '\t', header = T, stringsAsFactors = FALSE)
|
30 | 30 | colnames(all_splicing_variants) <- c("chrom", "start", "end", "samples")
|
31 | 31 |
|
@@ -214,6 +214,6 @@ all_splicing_variants <- as.data.table(all_splicing_variants)
|
214 | 214 | regtools_data = regtools_data %>% distinct()
|
215 | 215 |
|
216 | 216 |
|
217 |
| -write.table(regtools_data, file=paste(input_file, "_out.tsv", sep=""), quote=FALSE, sep='\t', row.names = F) |
| 217 | +write.table(regtools_data, file=paste(input_file, "_out_test.tsv", sep=""), quote=FALSE, sep='\t', row.names = F) |
218 | 218 |
|
219 |
| -}) |
| 219 | +# }) |
0 commit comments