From eb288ea1c5a8116bdad3a6588b83fdb6a55548f0 Mon Sep 17 00:00:00 2001 From: Gavin Ha Date: Tue, 23 Oct 2018 15:18:06 -0400 Subject: [PATCH] fixed issue with copy number correction There was an issue with the use of the cellular prevalence in the copy number correction post-processing step. The issue is now fixed and cellular prevalence is properly used in the computation of the new corrected copy number. --- R/utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/utils.R b/R/utils.R index 310752c..f2d58c5 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1223,8 +1223,8 @@ correctIntegerCN <- function(cn, segs, purity, ploidy, maxCNtoCorrect.autosomes } ## compute copy number using corrected log ratio ## -logRbasedCN <- function(x, purity, ploidyT, cellPrev, cn = 2){ - if (is.null(cellPrev) || is.na(cellPrev)){ +logRbasedCN <- function(x, purity, ploidyT, cellPrev=NA, cn = 2){ + if (length(cellPrev) == 1 && is.na(cellPrev)){ cellPrev <- 1 } ct <- (2^x