From 6582bb51da6d50c0516da766439c2d716fbea6c7 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Mon, 3 Mar 2014 17:43:03 -0800 Subject: [PATCH] switch back to runavg --- R/bayesian_analysis.R | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/R/bayesian_analysis.R b/R/bayesian_analysis.R index 24b99ce..438ee59 100644 --- a/R/bayesian_analysis.R +++ b/R/bayesian_analysis.R @@ -64,7 +64,7 @@ pierre.pair <- function (h, cs, ce, end, totalexpresscol, # running average standard deviation xxx <- S.sd[!is.na(S.sd)][order(index.col[!is.na(S.sd)])] - xxx <- _runavg(xxx, winsize) + xxx <- runavg(xxx, winsize) xxx <- xxx[rank(index.col[!is.na(S.sd)])] S.rasd <- rep(NA, nrow(h)) S.rasd[!is.na(S.sd)] <- xxx @@ -197,28 +197,28 @@ microarray.bayesian <- ## average expression level and the running average calculated on ## the estimated st. dev. for each locus. All the wierd code is a ## work around of missing values - cont.sd.runavg <- _runavg(cont.sd[order(cont.mean)])[order(order(cont.mean))] - exp.sd.runavg <- _runavg( exp.sd[order( exp.mean)])[order(order( exp.mean))] + cont.sd.runavg <- runavg(cont.sd[order(cont.mean)])[order(order(cont.mean))] + exp.sd.runavg <- runavg( exp.sd[order( exp.mean)])[order(order( exp.mean))] ## xxx <- temp5[!is.na(temp5)][order(temp3[!is.na(temp5)])] - ## xxx <- _runavg(xxx, winsize) + ## xxx <- runavg(xxx, winsize) ## xxx <- xxx[rank(temp3[!is.na(temp5)])] ## temp11 <- rep(NA, nrow(h)) ## temp11[!is.na(temp5)] <- xxx ## xxx <- temp6[!is.na(temp6)][order(temp4[!is.na(temp6)])] - ## xxx <- _runavg(xxx, winsize) + ## xxx <- runavg(xxx, winsize) ## xxx <- xxx[rank(temp4[!is.na(temp6)])] ## temp12 <- rep(NA, nrow(h)) ## temp12[!is.na(temp6)] <- xxx - cont.sd.log.runavg <- _runavg(cont.sd.log[order(cont.mean.log)])[order(order(cont.mean.log))] - exp.sd.log.runavg <- _runavg( exp.sd.log[order( exp.mean.log)])[order(order( exp.mean.log))] + cont.sd.log.runavg <- runavg(cont.sd.log[order(cont.mean.log)])[order(order(cont.mean.log))] + exp.sd.log.runavg <- runavg( exp.sd.log[order( exp.mean.log)])[order(order( exp.mean.log))] ## xxx <- temp9[!is.na(temp9)][order(temp7[!is.na(temp9)])] - ## xxx <- _runavg(xxx, winsize) + ## xxx <- runavg(xxx, winsize) ## xxx <- xxx[rank(temp7[!is.na(temp9)])] ## ## like 11 and 12 but for the log transofrmed data ## temp13 <- rep(NA, nrow(h)) ## temp13[!is.na(temp9)] <- xxx ## xxx <- temp10[!is.na(temp10)][order(temp8[!is.na(temp10)])] - ## xxx <- _runavg(xxx, winsize) + ## xxx <- runavg(xxx, winsize) ## xxx <- xxx[rank(temp8[!is.na(temp10)])] ## temp14 <- rep(NA, nrow(h)) ## temp14[!is.na(temp10)] <- xxx @@ -428,7 +428,7 @@ microarray.bayesian <- } -_runavg <- function(x,k=1){ +runavg <- function(x,k=1){ if (k < 0) stop("k must be greater than or equal to 0"); if (k==0) -- 2.39.2