-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathPHIAL_wrapper.R
60 lines (47 loc) · 2.32 KB
/
PHIAL_wrapper.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
## Wrapper script to run somatic PHIAL
## Eliezer Van Allen
## 4/2013
## The Broad Institute of MIT and Harvard / Cancer program.
## This program is free software: you can redistribute it and/or modify it
## under the terms of the GNU Lesser General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU Lesser General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
###############################################################################
suppressPackageStartupMessages(require(optparse))
option_list <- list(
make_option(c("-i", "--individual_input_data"), action="store", type="character", help= "Individual patient to be analyzed"),
make_option(c("-d", "--databases_paths"), action="store", type="character", help="Databases to be used")
)
# Load files
opt <- parse_args(OptionParser(option_list=option_list, usage = "Rscript %prog [options]"), print_help_and_exit=FALSE)
print ("Loading relevant files...")
patient_data <- read.delim(opt$individual_input_data, header=T, as.is=T, comment.char="#")
databases <- read.delim(opt$databases_paths, header=T, as.is=T, comment.char="#")
#Somatic PHIAL
for(i in 1:nrow(patient_data)) {
bsub.command <- paste("Rscript PHIAL_v1.0.R",
" -i ", patient_data$individual[i],
" -t ", patient_data$tumor_type[i],
" -o ", patient_data$output_dir[i],
" --mut.path ", patient_data$mutation_data[i],
" --indel.path ", patient_data$indel_data[i],
" --dranger.path ", patient_data$rearrangement_data[i],
" --segfile.path ", patient_data$copynumber_data[i],
" --actdb.mini ", databases$actdb.mini,
" --actdb.large ", databases$actdb.large,
" --current_panel ", databases$current_panel,
" --cosmic ", databases$cosmic,
" --gsea.pathways ", databases$gsea.pathways,
" --gsea.overlap ", databases$gsea.overlap,
" --gsea.modules ", databases$gsea.modules,
" --refseq ", databases$refseq,
sep="")
system(bsub.command, ignore.stdout=FALSE)
}