diff --git a/bin/1.2_filter_motifs/compareBed_runinfo.R b/bin/1.2_filter_motifs/compareBed_runinfo.R index ea6b1a6..2723fb5 100644 --- a/bin/1.2_filter_motifs/compareBed_runinfo.R +++ b/bin/1.2_filter_motifs/compareBed_runinfo.R @@ -8,7 +8,7 @@ # adds a column with a flag "contains_maxpos" # and creates a file with information of the bedtool comparison -# parameters: Parameters are not named. Respect the parameter order. +# parameters: Parameters are not named, respect the parameter order. # min: minimum footprint size threshold # max: maximum footprint size threshold # input_raw: unfiltered BED-file @@ -52,10 +52,10 @@ data_filtered[[7]] <- data_filtered[[3]] - data_filtered[[2]] # adding column "contains_maxpos", containing flag (0 or 1) # max_pos is the position of maximum score of a footprint -data_filtered[[8]] <- data_filtered[[8]] - data_filtered[[2]] +data_filtered[[8]] <- data_filtered[[8]] + data_filtered[[2]] data_filtered <- cbind(data_filtered, contains_maxpos = 0) data_filtered$contains_maxpos[intersect(which(data_filtered[[2]] <= data_filtered[[8]]), which(data_filtered[[3]] > data_filtered[[8]]))] = 1 -data_filtered[[8]] <- data_filtered[[8]] + data_filtered[[2]] +data_filtered[[8]] <- data_filtered[[8]] - data_filtered[[2]] fwrite(data_filtered, output, col.names=FALSE, quote = FALSE, sep = '\t')