comparison xcorr.r @ 1:243f75d0ed6e draft default tip

Uploaded. Includes new release 1.0.7 with fixed optional controls.
author messersc
date Thu, 19 Feb 2015 05:39:45 -0500
parents d42f4d78c85e
children
comparison
equal deleted inserted replaced
0:d42f4d78c85e 1:243f75d0ed6e
1 ############################### 1 ########################################################################
2 #### Fragment Length Calculator 2 # JAMMv1.0.7rev1 is a peak finder for joint analysis of NGS replicates.
3 #### R script 3 # Copyright (C) 2014-2015 Mahmoud Ibrahim
4 ############################### 4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #
18 # Contact: mahmoud.ibrahim@mdc-berlin.de
19 ########################################################################
5 20
6 21
7 # ========================= 22 # =========================
8 # Required Libraries check 23 # Required Libraries check
9 # ========================= 24 # =========================
29 44
30 #Parsing arguments and storing values 45 #Parsing arguments and storing values
31 for (each.arg in args) { 46 for (each.arg in args) {
32 #input bed file 47 #input bed file
33 if (grepl('^-ibed=',each.arg)) { 48 if (grepl('^-ibed=',each.arg)) {
34 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]] # split on = 49 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]]
35 if (! is.na(arg.split[2]) ) { 50 if (! is.na(arg.split[2]) ) {
36 ibed <- arg.split[2] 51 ibed <- arg.split[2]
37 } else { 52 } else {
38 stop('No input bed file') 53 stop('No input bed file')
39 } 54 }
40 } 55 }
41 if (grepl('^-s=',each.arg)) { 56 if (grepl('^-s=',each.arg)) {
42 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]] # split on = 57 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]]
43 if (! is.na(arg.split[2]) ) { 58 if (! is.na(arg.split[2]) ) {
44 sFile <- arg.split[2] 59 sFile <- arg.split[2]
45 } else { 60 } else {
46 stop('No chromosome size file') 61 stop('No chromosome size file')
47 } 62 }
48 } 63 }
49 if (grepl('^-rl=',each.arg)) { 64 if (grepl('^-rl=',each.arg)) {
50 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]] # split on = 65 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]]
51 if (! is.na(arg.split[2]) ) { 66 if (! is.na(arg.split[2]) ) {
52 rl <- arg.split[2] 67 rl <- arg.split[2]
53 } else { 68 } else {
54 stop('Read length missing') 69 stop('Read length missing')
55 } 70 }
56 } 71 }
57 if (grepl('^-d=',each.arg)) { 72 if (grepl('^-d=',each.arg)) {
58 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]] # split on = 73 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]]
59 if (! is.na(arg.split[2]) ) { 74 if (! is.na(arg.split[2]) ) {
60 storeFile <- arg.split[2] 75 storeFile <- arg.split[2]
61 } else { 76 } else {
62 stop('No file to store result') 77 stop('No file to store result')
63 } 78 }
64 } 79 }
65 if (grepl('^-p=',each.arg)) { 80 if (grepl('^-p=',each.arg)) {
66 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]] # split on = 81 arg.split <- strsplit(each.arg,'=',fixed=TRUE)[[1]]
67 if (! is.na(arg.split[2]) ) { 82 if (! is.na(arg.split[2]) ) {
68 cornum <- as.numeric(arg.split[2]) 83 cornum <- as.numeric(arg.split[2])
69 } else { 84 } else {
70 stop('No number of cores given') 85 stop('No number of cores given')
71 } 86 }