From 92cb2a655b6eeb2ac57f4f05715d8824bcc6d047 Mon Sep 17 00:00:00 2001 From: Marijn Date: Thu, 26 Mar 2020 15:10:24 +0100 Subject: [PATCH] Fixed a bug where base rowSums were used instead of Matrix rowSums --- R/FastCAR_Base.R | 4 ++-- README.md | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/R/FastCAR_Base.R b/R/FastCAR_Base.R index 968bd9b..272b8e7 100644 --- a/R/FastCAR_Base.R +++ b/R/FastCAR_Base.R @@ -47,7 +47,7 @@ determine.background.to.remove = function(fullCellMatrix, cellMatrix, emptyDropl # droplets that are empty but not unused barcodes, unused barcodes have zero reads assigned to them. nEmpty = table((Matrix::colSums(fullCellMatrix) < emptyDropletCutoff) &(Matrix::colSums(fullCellMatrix) > 0))[2] # rowSum on a logical statement returns the number of TRUE occurences - occurences = rowSums(fullCellMatrix[,Matrix::colSums(fullCellMatrix) < emptyDropletCutoff] !=0) + occurences = Matrix::rowSums(fullCellMatrix[,Matrix::colSums(fullCellMatrix) < emptyDropletCutoff] !=0) #probability of a background read of a gene ending up in a cell probabiltyCellContaminationPerGene = occurences / nEmpty @@ -100,7 +100,7 @@ describe.ambient.RNA.sequence = function(fullCellMatrix, start, stop, by, contam for(emptyCutoff in seq(start, stop, by)){ nEmpty = table((Matrix::colSums(fullCellMatrix) < emptyCutoff) &(Matrix::colSums(fullCellMatrix) > 0))[2] - occurences = rowSums(fullCellMatrix[,Matrix::colSums(fullCellMatrix) < emptyCutoff] !=0) + occurences = Matrix::rowSums(fullCellMatrix[,Matrix::colSums(fullCellMatrix) < emptyCutoff] !=0) #probability of a background read of a gene ending up in a cell probabiltyCellContaminationPerGene = occurences / nEmpty diff --git a/README.md b/README.md index fb7d5ff..7927417 100644 --- a/README.md +++ b/README.md @@ -84,8 +84,6 @@ write.corrected.matrix(cellMatrix, correctedMatrixFolder, ambientProfile) ``` - - ## Authors * **Marijn Berg** - m.berg@umcg.nl