From f4b6748210633e9c693fe38cc609d2e615286e87 Mon Sep 17 00:00:00 2001 From: Marijn Date: Mon, 8 Jun 2020 10:15:27 +0200 Subject: [PATCH] Fixed variable name issue in remove.background function --- R/FastCAR_Base.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/FastCAR_Base.R b/R/FastCAR_Base.R index cc50f34..636ff96 100644 --- a/R/FastCAR_Base.R +++ b/R/FastCAR_Base.R @@ -31,13 +31,13 @@ remove.background = function(geneCellMatrix, ambientRNAprofile){ # Here is the actual functionality - for(gene in names(ambientProfile[ambientProfile > 0])){ + for(gene in names(ambientRNAprofile[ambientRNAprofile > 0])){ # Determine the locations where the gene is not zero, therefore referenced in i iLocs = which(geneCellMatrix@Dimnames[[1]] == gene) # Determine the location of the actual values, xLocs = which(geneCellMatrix@i == iLocs-1) # -1 because of 0 and 1 based counting systems # Remove the contaminating RNA - geneCellMatrix@x[xLocs] = geneCellMatrix@x[xLocs] - ambientProfile[gene] + geneCellMatrix@x[xLocs] = geneCellMatrix@x[xLocs] - ambientRNAprofile[gene] } # correct for instances where the expression was corrected to below zero geneCellMatrix@x[geneCellMatrix@x < 0] = 0