-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:stemangiola/tidyseurat Conflicts: tests/testthat/test-dplyr.R
- Loading branch information
Showing
26 changed files
with
241 additions
and
240 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: rworkflows | ||
'on': | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- devel | ||
- RELEASE_** | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
- devel | ||
- RELEASE_** | ||
jobs: | ||
rworkflows: | ||
permissions: write-all | ||
runs-on: ${{ matrix.config.os }} | ||
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
container: ${{ matrix.config.cont }} | ||
strategy: | ||
fail-fast: ${{ false }} | ||
matrix: | ||
config: | ||
- os: ubuntu-latest | ||
bioc: devel | ||
r: auto | ||
cont: ghcr.io/bioconductor/bioconductor_docker:devel | ||
rspm: ~ | ||
- os: macOS-latest | ||
bioc: release | ||
r: auto | ||
cont: ~ | ||
rspm: ~ | ||
- os: windows-latest | ||
bioc: release | ||
r: auto | ||
cont: ~ | ||
rspm: ~ | ||
steps: | ||
- uses: neurogenomics/rworkflows@master | ||
with: | ||
run_bioccheck: ${{ false }} | ||
run_rcmdcheck: ${{ true }} | ||
as_cran: ${{ true }} | ||
run_vignettes: ${{ true }} | ||
has_testthat: ${{ true }} | ||
run_covr: ${{ true }} | ||
run_pkgdown: ${{ true }} | ||
has_runit: ${{ false }} | ||
has_latex: ${{ false }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run_docker: ${{ false }} | ||
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} | ||
runner_os: ${{ runner.os }} | ||
cache_version: cache-v1 | ||
docker_registry: ghcr.io |
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 @@ | ||
Type: Package | ||
Package: tidyseurat | ||
Title: Brings Seurat to the Tidyverse | ||
Version: 0.7.2 | ||
Version: 0.7.8 | ||
Authors@R: c(person("Stefano", "Mangiola", email = "[email protected]", | ||
role = c("aut", "cre")), | ||
person("Maria", "Doyle", email = "[email protected]", | ||
|
@@ -15,7 +15,7 @@ Depends: | |
ttservice (>= 0.3.8), | ||
SeuratObject | ||
Imports: | ||
Seurat, | ||
Seurat (>= 4.3.0), | ||
tibble, | ||
dplyr, | ||
magrittr, | ||
|
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 |
---|---|---|
|
@@ -12,13 +12,23 @@ | |
#' @importFrom dplyr arrange | ||
#' @export | ||
arrange.Seurat <- function(.data, ..., .by_group=FALSE) { | ||
.data@meta.data <- | ||
.data %>% | ||
as_tibble() %>% | ||
dplyr::arrange( ..., .by_group=.by_group ) %>% | ||
as_meta_data(.data) | ||
|
||
.data | ||
|
||
# DEPRECATE | ||
deprecate_warn( | ||
when="0.7.5", | ||
what="arrange()", | ||
details="tidyseurat says: arrange() is temporarly deprected as it is not clear that Seurat allows reordering of cells." | ||
) | ||
|
||
# .cell_ordered <- | ||
# .data %>% | ||
# as_tibble() %>% | ||
# dplyr::arrange( ..., .by_group=.by_group ) %>% | ||
# pull(!!c_(.data)$symbol) | ||
# | ||
# .data[,.cell_ordered] | ||
|
||
.data | ||
} | ||
|
||
#' @name bind_rows | ||
|
@@ -48,7 +58,7 @@ bind_rows.Seurat <- function(..., .id=NULL, add.cell.ids=NULL) | |
# slot(object=object[[assay]], name="SCTModel.list") | ||
# So I have to delete any sample of size 1 if I have calculated SCT | ||
# if() | ||
# GetAssayData(object, slot='SCTModel.list', assay="SCT") %>% | ||
# GetAssayData(object, layer='SCTModel.list', assay="SCT") %>% | ||
# map(~ [email protected] %>% nrow) | ||
|
||
# Check if cell with same name | ||
|
@@ -269,6 +279,7 @@ mutate.Seurat <- function(.data, ...) { | |
#' data(pbmc_small) | ||
#' pbmc_small |> rename(s_score=nFeature_RNA) | ||
#' | ||
#' @importFrom Seurat DietSeurat | ||
#' @importFrom tidyselect eval_select | ||
#' @importFrom dplyr rename | ||
#' @export | ||
|
@@ -281,7 +292,10 @@ rename.Seurat <- function(.data, ...) | |
get_special_columns(.data)) | ||
|
||
# Small df to be more efficient | ||
df <- .data[1, 1] |> as_tibble() | ||
df <- | ||
DietSeurat(.data, features = rownames(.data)[1])[,1] |> | ||
suppressWarnings() |> | ||
as_tibble() | ||
|
||
# What columns we are going to create | ||
cols_from <- tidyselect::eval_select(expr(c(...)), df) |> names() | ||
|
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
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
Oops, something went wrong.