From eeebe2c9fe579597c8f7ce108f3a6c7429d64ee8 Mon Sep 17 00:00:00 2001 From: Armen Abnousi Date: Thu, 21 Nov 2019 13:06:01 -0500 Subject: [PATCH] adding chip label column to awk output --- Imp_Scripts/DiffAnalysisHiChIP.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Imp_Scripts/DiffAnalysisHiChIP.r b/Imp_Scripts/DiffAnalysisHiChIP.r index 5c1cc56..b0716b0 100644 --- a/Imp_Scripts/DiffAnalysisHiChIP.r +++ b/Imp_Scripts/DiffAnalysisHiChIP.r @@ -491,7 +491,7 @@ FillFeatureValues <- function(UnionLoopFile, AllLoopList, BinSize, ChIPCovFileLi # check the first field of chromosome name # and second and third fields as integers # extract the bin number and the coverage information (assume 4th field) - system(paste0("awk -v b=", BinSize, " \'{if (($1==\"", chrName, "\") && ($2 ~ /^[0-9]+$/) && ($3 ~ /^[0-9]+$/)) {print ($2/b)\"\t\"$4}}\' ", currcovfile, " > ", InpTempChIPCoverageFile)) + system(paste0("awk -v b=", BinSize, " \'{if (($1==\"", chrName, "\") && ($2 ~ /^[0-9]+$/) && ($3 ~ /^[0-9]+$/)) {print ($2/b)\"\t\"$4\"\t\"$5}}\' ", currcovfile, " > ", InpTempChIPCoverageFile)) # read the ChIP coverage for the current sample and for the current chromosome # ChIPCoverageData <- read.table(InpTempChIPCoverageFile, header=F, sep="\t", stringsAsFactors=F)