comparison bincalculator.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 #### Bin Size Calculator after Shimazaki and Shinomoto 2007 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 # User-defined variables 23 # User-defined variables
9 # ======================= 24 # =======================
169 frags = as.numeric(strsplit(frags, ",", fixed = TRUE)[[1]]) 184 frags = as.numeric(strsplit(frags, ",", fixed = TRUE)[[1]])
170 #=======================> DONE! 185 #=======================> DONE!
171 186
172 187
173 188
174 # ===================== 189 # ===================================================
175 # Shimazaki Procedure 190 # Shimazaki Procedure (Shimazaki and Shinomoto 2007)
176 # ===================== 191 # ===================================================
177 for (i in 1:length(ibed)) { 192 for (i in 1:length(ibed)) {
178 if (frags[i] > rl[i]) { 193 if (frags[i] > rl[i]) {
179 minbin = floor(frags[i] / 2) 194 minbin = floor(frags[i] / 2)
180 bins = c(bins, seq(minbin, minbin*15, by = minbin)) 195 bins = c(bins, seq(minbin, minbin*15, by = minbin))
181 } else { 196 } else {