-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotfix/fix gs get singlecell expression by gate #391
Merged
mikejiang
merged 4 commits into
devel
from
hotfix/fix-gs_get_singlecell_expression_by_gate
Aug 20, 2023
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: flowWorkspace | ||
Type: Package | ||
Title: Infrastructure for representing and interacting with gated and ungated cytometry data sets. | ||
Version: 4.13.1 | ||
Version: 4.13.2 | ||
Date: 2011-06-10 | ||
Author: Greg Finak, Mike Jiang | ||
Maintainer: Greg Finak <[email protected]>, Mike Jiang <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -467,16 +467,16 @@ test_that("add", { | |
gs_pop_remove("CD8_demo", gs = gs) | ||
}) | ||
|
||
if(!isCpStaticGate) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re-enable test |
||
{ | ||
|
||
|
||
test_that("gs_get_singlecell_expression for COMPASS",{ | ||
nodes <- c('CD8/38- DR+', 'CD8/CCR7- 45RA+') | ||
|
||
thisRes <- gs_get_singlecell_expression(gs, nodes, map = list("CD8/38- DR+" = "CD38 APC", "CD8/CCR7- 45RA+" = "CCR7 PE")) | ||
expectRes <- readRDS(file.path(resultDir, "getData_COMPASS_gs.rds")) | ||
# browser() | ||
|
||
expect_equal(thisRes,rev(expectRes),tol = 1e-07) | ||
|
||
|
||
|
||
|
||
#test other.markers (redundant marker should be merged automatically) | ||
thisRes <- gs_get_singlecell_expression(gs, nodes | ||
|
@@ -503,32 +503,33 @@ if(!isCpStaticGate) | |
), "number of markers") | ||
#marginal = FALSE | ||
thisRes <- gs_get_singlecell_expression(gs, nodes, marginal = FALSE) | ||
expect_equal(thisRes[[1]][,c("CD38 APC", "CCR7 PE")],expectRes[[1]],tol = 1e-07) | ||
expect_equal(thisRes[[1]][,1] == 0, thisRes[[1]][,2] == 0) | ||
|
||
|
||
|
||
#gates share the same marker | ||
nodes <- c('CD8/38- DR+', "CD8/38+ DR-", 'CD8/CCR7- 45RA+') | ||
thisRes <- gs_get_singlecell_expression(gs, nodes, marginal = FALSE) | ||
#TODO: gh_pop_get_indices_mat api is somehow broken, since rarely used, not going to fix until asked for | ||
#verify the results by calling R routines | ||
nodes.expr <- quote(`CD8/38- DR+|CD8/38+ DR-|CD8/CCR7- 45RA+`) | ||
ind.total <- getIndices(gs[1], nodes.expr)[[1]] | ||
ind.mat <- gh_pop_get_indices_mat(gs[[1]], nodes.expr) | ||
#Or the ind for the same marker from nodes | ||
ind.DR <- ind.38 <- ind.mat[,1] | ind.mat[,2] | ||
ind.CCR <- ind.45 <- ind.mat[,3] | ||
#masking | ||
mat <- exprs(gh_pop_get_data(gs[[1]]))[,c(6, 9, 10, 11)] | ||
mat <- mat * c(ind.38, ind.DR, ind.CCR, ind.45) | ||
mat <- mat[ind.total, ] | ||
expect_equal(thisRes[[1]], mat, check.attributes = FALSE) | ||
# nodes.expr <- quote(`CD8/38- DR+|CD8/38+ DR-|CD8/CCR7- 45RA+`) | ||
# ind.total <- ncdfFlow::getIndices(gs[1], nodes.expr)[[1]] | ||
# ind.mat <- gh_pop_get_indices_mat(gs[[1]], nodes.expr) | ||
# #Or the ind for the same marker from nodes | ||
# ind.DR <- ind.38 <- ind.mat[,1] | ind.mat[,2] | ||
# ind.CCR <- ind.45 <- ind.mat[,3] | ||
# #masking | ||
# mat <- exprs(gh_pop_get_data(gs[[1]]))[,c(6, 9, 10, 11)] | ||
# mat <- mat * c(ind.38, ind.DR, ind.CCR, ind.45) | ||
# mat <- mat[ind.total, ] | ||
# expect_equal(thisRes[[1]], mat, check.attributes = FALSE) | ||
|
||
#gs_get_singlecell_expression_by_gate associated with channel that does not have markers | ||
mat <- gs_get_singlecell_expression_by_gate(gs, "CD3+") | ||
expect_equal(colnames(mat[[1]]), c("CD3 V450", "SSC-A")) | ||
expect_equal(nrow(mat[[1]]), gh_pop_get_count(gs[[1]], "CD3+")) | ||
}) | ||
|
||
} | ||
|
||
|
||
|
||
test_that("markernames", { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is offending line, where pops[j] doesn't appear to be cpp11:string anymore when pops is length of 1.
The fix is easy, remove explicit coercion, let cpp11 own magic auto coercion takes its place