comparison make_window_bed.R @ 4:72571a30f17b draft

Add test for unique peak names.
author kyost
date Wed, 02 May 2018 13:20:21 -0400
parents fd3ea97a96bc
children
comparison
equal deleted inserted replaced
3:fbfe7b785ea7 4:72571a30f17b
12 qPCR_bed <- args[1] 12 qPCR_bed <- args[1]
13 window_size <- strtoi(args[2]) 13 window_size <- strtoi(args[2])
14 output_file <- args[3] 14 output_file <- args[3]
15 15
16 qPCR_table <- read.delim(qPCR_bed, header=FALSE, stringsAsFactors=FALSE) 16 qPCR_table <- read.delim(qPCR_bed, header=FALSE, stringsAsFactors=FALSE)
17
18 qPCR_table[,4] <- make.unique(qPCR_table[,4], sep = "_")
17 19
18 make_windows_bed <- function(a, size) { #a is a bed file containing peaks of interest and coordinates 20 make_windows_bed <- function(a, size) { #a is a bed file containing peaks of interest and coordinates
19 #generates bed file with overlapping windows spanning each peak of specified size 21 #generates bed file with overlapping windows spanning each peak of specified size
20 return_bed <- data.frame() 22 return_bed <- data.frame()
21 for (i in 1:nrow(a)) { 23 for (i in 1:nrow(a)) {