Skip to content

Commit

Permalink
pass BiocCheck again
Browse files Browse the repository at this point in the history
  • Loading branch information
kollo97 committed Jan 8, 2025
1 parent 2ad190c commit 63bfda1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
^doc$
^Meta$
^codecov\.yml$
^.vscode
^.vscode
25 changes: 13 additions & 12 deletions R/example.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@
#' @importFrom SingleCellExperiment SingleCellExperiment
#' @importFrom stats rpois
#' @importFrom S4Vectors DataFrame
#' @importFrom withr with_seed
#' @return A SingleCellExperiment object
#' @examples
#' sce <- sce_example()
#' sce
#' @export
sce_example <- function(){
# Set seed for reproducibility (optional)
set.seed(42)
sce_example <- function(seed = 42){
# generate example data with two "batches"
counts_mat <- cbind(
matrix(rpois(300 * 300, lambda = 5),
nrow = 300,
dimnames = list(paste0("gene", 1:300), paste0("cell", 1:300))
),
matrix(rpois(300 * 300, lambda = 3),
nrow = 300,
dimnames = list(paste0("gene", 1:300), paste0("cell", 301:600))
withr::with_seed(seed, {
counts_mat <- cbind(
matrix(rpois(300 * 300, lambda = 5),
nrow = 300,
dimnames = list(paste0("gene", 1:300), paste0("cell", 1:300))
),
matrix(rpois(300 * 300, lambda = 3),
nrow = 300,
dimnames = list(paste0("gene", 1:300), paste0("cell", 301:600))
)
)
)
})
# add metadata
batch <- rep(c("batch1", "batch2"), each = 300)
dataset <- rep(c("dataset1", "dataset2", "dataset1", "dataset2"), each = 150)
Expand Down
1 change: 1 addition & 0 deletions R/objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ setGeneric(
#' @import checkmate
#' @importFrom SingleCellExperiment colData
#' @keywords internal
#' @noRd
.get_meta_data <- function(object) {
if (checkmate::test_class(object, "Seurat")) {
return(object[[]])
Expand Down
12 changes: 0 additions & 12 deletions man/dot-get_meta_data.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion man/sce_example.Rd

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

0 comments on commit 63bfda1

Please sign in to comment.