Skip to content

Commit

Permalink
- expression matrices as input for EMD calculation (done)
Browse files Browse the repository at this point in the history
- bumped version to 1.1.2
  • Loading branch information
phauchamps committed Sep 18, 2024
1 parent b8dc303 commit 8212342
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: CytoMDS
Title: Low Dimensions projection of cytometry samples
Version: 1.1.0
Version: 1.1.2
Authors@R:
c(person(given = "Philippe",
family = "Hauchamps",
Expand Down
7 changes: 6 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## CytoMDS 1.1.0
## CytoMDS 1.1

### CytoMDS 1.1.1
- added citation to _bioRxiv_ pre-print

### CytoMDS 1.1.2
- expression matrices as input to EMD calculation

## CytoMDS 1.0.0
(release Bioconductor)

Expand Down
20 changes: 12 additions & 8 deletions R/stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ pairwiseEMDDist <- function(
nSamples <- NULL

if(inherits(x, "flowSet")) {
getExpr <- function(exprMatrixIndex, fs, channels) {
getExprFlowSet <- function(exprMatrixIndex, fs, channels) {
exprMat <- flowCore::exprs(fs[[exprMatrixIndex]])
channelIds <- .toChannelNames(channels, x)
exprMat <- exprMat[, channelIds, drop = FALSE]
Expand All @@ -999,7 +999,7 @@ pairwiseEMDDist <- function(
nSamples = nSamples,
rowRange = rowRange,
colRange = colRange,
loadExprMatrixFUN = getExpr,
loadExprMatrixFUN = getExprFlowSet,
loadExprMatrixFUNArgs = list(fs = x, channels = channels),
channels = NULL, #already taken into account in loadExprMatrixFUN
verbose = verbose,
Expand All @@ -1020,7 +1020,7 @@ pairwiseEMDDist <- function(
}
return(TRUE)
})
getExpr <- function(exprMatrixIndex, expMatrixList, channels) {
getExprMatList <- function(exprMatrixIndex, expMatrixList, channels) {
exprMat <- expMatrixList[[exprMatrixIndex]]
channelIds <- .toChannelNames(channels, exprMat)
exprMat <- exprMat[, channelIds, drop=FALSE]
Expand All @@ -1031,7 +1031,7 @@ pairwiseEMDDist <- function(
nSamples = nSamples,
rowRange = rowRange,
colRange = colRange,
loadExprMatrixFUN = getExpr,
loadExprMatrixFUN = getExprMatList,
loadExprMatrixFUNArgs = list(
expMatrixList = x, channels = channels),
channels = NULL, #already taken into account in loadExprMatrixFUN
Expand Down Expand Up @@ -1278,6 +1278,10 @@ pairwiseEMDDist <- function(
#' - if it is a numeric vector,
#' it refers to the indices of channels in `fs`
#' - if NULL, all scatter and fluorescent channels of `fs` #' will be selected.
#' @param statFUNs a list (possibly of length one) of functions to call
#' to calculate the statistics, or a simple function.
#' This list can be named, in that case, these names will be transfered to the
#' returned list.
#' @param verbose if `TRUE`, output a message
#' after each single statistics calculation
#' @param BPPARAM sets the `BPPARAM` back-end to
Expand Down Expand Up @@ -1348,7 +1352,7 @@ channelSummaryStats <- function(
nSamples <- NULL

if(inherits(x, "flowSet")) {
getExpr <- function(exprMatrixIndex, fs, channels) {
getExprFlowSet <- function(exprMatrixIndex, fs, channels) {
exprMat <- flowCore::exprs(fs[[exprMatrixIndex]])
channelIds <- .toChannelNames(channels, x)
exprMat <- exprMat[, channelIds, drop = FALSE]
Expand All @@ -1368,7 +1372,7 @@ channelSummaryStats <- function(

chStats <- .channelSummaryStats(
nSamples = nSamples,
loadExprMatrixFUN = getExpr,
loadExprMatrixFUN = getExprFlowSet,
loadExprMatrixFUNArgs = list(fs = x, channels = channels),
channels = NULL, # already taken into account in loadExprMatrixFUN
statFUNs = statFUNs,
Expand Down Expand Up @@ -1396,7 +1400,7 @@ channelSummaryStats <- function(
}
return(TRUE)
})
getExpr <- function(exprMatrixIndex, expMatrixList, channels) {
getExprMatList <- function(exprMatrixIndex, expMatrixList, channels) {
exprMat <- expMatrixList[[exprMatrixIndex]]
channelIds <- .toChannelNames(channels, exprMat)
exprMat <- exprMat[, channelIds, drop=FALSE]
Expand All @@ -1408,7 +1412,7 @@ channelSummaryStats <- function(
}
chStats <- .channelSummaryStats(
nSamples = nSamples,
loadExprMatrixFUN = getExpr,
loadExprMatrixFUN = getExprMatList,
loadExprMatrixFUNArgs = list(
expMatrixList = x, channels = channels),
channels = NULL, # already taken into account in loadExprMatrixFUN
Expand Down
5 changes: 5 additions & 0 deletions man/channelSummaryStats.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8212342

Please sign in to comment.