-
Notifications
You must be signed in to change notification settings - Fork 16
feat: Support count_mat as BPCells matrix
#91
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
Changes from all commits
6f82d4f
fc3b081
caa7a68
b7417ef
5429f8d
57731b7
5e4d09a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,8 @@ RoxygenNote: 7.3.2 | |
| Suggests: | ||
| testthat (>= 3.0.0), | ||
| Matrix, | ||
| SeuratObject (>= 5.0.0) | ||
| SeuratObject (>= 5.0.0), | ||
|
Collaborator
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. You might also need to add a REMOTES section so that the CI knows where/how to download bpcells. |
||
| BPCells | ||
| Config/testthat/edition: 3 | ||
| Imports: | ||
| methods, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,8 +15,8 @@ | |
| #' | ||
| #' @export | ||
| validate_count_mat <- function(count_mat, feature_ids = NULL) { # nolint: cyclocomp_linter. | ||
| if (!is(count_mat, "dgCMatrix")) { | ||
| return(err("count_mat must be a dgCMatrix")) | ||
| if (!is(count_mat, "dgCMatrix") && !inherits(count_mat, "IterableMatrix")) { | ||
| return(err("count_mat must be a dgCMatrix or IterableMatrix")) | ||
| } | ||
|
|
||
| features <- rownames(count_mat) | ||
|
|
@@ -34,11 +34,13 @@ validate_count_mat <- function(count_mat, feature_ids = NULL) { # nolint: cycloc | |
| if (length(barcodes) == 0) { | ||
| return(err("count_mat must have at least one barcode")) | ||
| } | ||
| if (any(is.nan(count_mat@x))) { | ||
| return(err("matrix values must not be NaN")) | ||
| } | ||
| if (any(is.infinite(count_mat@x))) { | ||
| return(err("matrix values must not be infinite")) | ||
| if (inherits(count_mat, "dgCMatrix")) { | ||
|
Collaborator
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. Are we avoiding this check because the matrix will be large? Or is this unsupported.
Contributor
Author
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. Yes, only |
||
| if (any(is.nan(count_mat@x))) { | ||
| return(err("matrix values must not be NaN")) | ||
| } | ||
| if (any(is.infinite(count_mat@x))) { | ||
| return(err("matrix values must not be infinite")) | ||
| } | ||
| } | ||
| if (!all(sapply(barcodes, nzchar))) { | ||
| return(err("barcodes cannot be the empty string")) | ||
|
|
||
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.
I copied what Seurat-Object is doing to unbreak the CI builds