Skip to content
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

Refactor from/to Seurat conversion #183

Merged
merged 54 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
25f479d
wip new seurat conversion
rcannood Sep 19, 2024
35575ea
fix var
rcannood Sep 19, 2024
3cc6d88
fix test
rcannood Sep 19, 2024
8e029a4
style pkg
rcannood Sep 19, 2024
a5024eb
refactor seurat approach
rcannood Sep 26, 2024
ed4e84f
add graph mappings
rcannood Sep 26, 2024
c594734
update to_Seurat function
rcannood Oct 17, 2024
4a36109
update from_Seurat
rcannood Oct 17, 2024
82d6d0c
add assay name to helper functions
rcannood Oct 24, 2024
87c8e62
improve to_seurat docs
rcannood Oct 24, 2024
0013a95
improvements to seurat docs
rcannood Oct 24, 2024
a7da64b
update documentation
rcannood Oct 24, 2024
e7f2be2
run styler
rcannood Oct 24, 2024
46d8672
make sure that assay meta.data ends up in the output
rcannood Oct 24, 2024
64f7023
fix unit test
rcannood Oct 24, 2024
75f5206
fix to_seurat
rcannood Oct 24, 2024
bb0951a
add to_seurat test
rcannood Oct 24, 2024
b770be9
update docs and styler
rcannood Oct 24, 2024
6b6b696
add seurat to suggests
rcannood Oct 24, 2024
21d1284
remove biocstyle from vignette
rcannood Oct 24, 2024
74b4b2d
fix variable
rcannood Oct 24, 2024
653d6b8
fix guess_varms
rcannood Oct 24, 2024
ec0e6a0
do not export to/from_Seurat helper functions
rcannood Nov 5, 2024
89d7821
roxygen
rcannood Nov 5, 2024
1046628
remove accidental comment
rcannood Nov 5, 2024
c48f1fa
fix links
rcannood Nov 5, 2024
539e1db
undo changes not related to seurat
rcannood Nov 6, 2024
d9b2888
add more info to layer mapping
rcannood Nov 6, 2024
e79f103
Update R/Seurat.R
rcannood Nov 6, 2024
aad931f
Apply suggestions from code review
rcannood Nov 6, 2024
2d2e1cb
update descriptions
rcannood Nov 6, 2024
139535b
map all uns to misc my default
rcannood Nov 6, 2024
cd4358a
use `check_requires` to check required packages
rcannood Nov 6, 2024
f190373
roxygenise
rcannood Nov 6, 2024
f6a3fed
Merge branch 'new_seurat' of github.com:scverse/anndataR into new_seurat
rcannood Nov 6, 2024
7bd35ca
simplify flow
rcannood Nov 6, 2024
4713aea
improve readability
rcannood Nov 6, 2024
a8c04c7
change warning into stop
rcannood Nov 6, 2024
1f1da31
remove do.call
rcannood Nov 6, 2024
034f3cc
clarify
rcannood Nov 6, 2024
3e7ee60
address comments
rcannood Nov 6, 2024
bf4a171
fix imports
rcannood Nov 6, 2024
9bf5d28
styler
rcannood Nov 6, 2024
a530de4
fix check_requires if packages are on bioconductor
rcannood Nov 9, 2024
bfa5d90
uniformise notation
rcannood Nov 9, 2024
1324c33
apply suggestions from review
rcannood Nov 9, 2024
061e9d8
apply suggestions
rcannood Nov 9, 2024
27852cb
Apply suggestions from code review
rcannood Nov 9, 2024
7568b79
Merge remote-tracking branch 'origin/main' into new_seurat
rcannood Nov 9, 2024
114fba2
apply suggestions from review
rcannood Nov 9, 2024
6493d2c
trycatch generator
rcannood Nov 9, 2024
3e9d477
restyle
rcannood Nov 9, 2024
7b3b64f
fix guess function
rcannood Nov 9, 2024
9faaa7f
Update R/Seurat.R
rcannood Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ BugReports: https://github.com/scverse/anndataR/issues
Depends:
R (>= 4.0.0)
Imports:
cli,
Matrix,
methods,
R6
purrr,
R6,
rlang
Suggests:
anndata,
BiocStyle,
rcannood marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -73,6 +76,7 @@ Suggests:
hdf5r (>= 1.3.11),
rmarkdown,
S4Vectors,
Seurat,
SeuratObject,
SingleCellExperiment,
SummarizedExperiment,
Expand Down
7 changes: 7 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ export(from_Seurat)
export(from_SingleCellExperiment)
export(generate_dataset)
export(read_h5ad)
export(to_Seurat)
export(write_h5ad)
importFrom(Matrix,as.matrix)
importFrom(Matrix,sparseMatrix)
importFrom(Matrix,t)
importFrom(R6,R6Class)
importFrom(cli,cli_abort)
importFrom(cli,cli_inform)
importFrom(cli,cli_warn)
importFrom(methods,as)
importFrom(methods,new)
importFrom(purrr,map_lgl)
importFrom(rlang,caller_env)
13 changes: 10 additions & 3 deletions R/HDF5AnnData.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@ HDF5AnnData <- R6::R6Class("HDF5AnnData", # nolint
shape = NULL,
mode = c("r", "r+", "a", "w", "w-", "x"),
compression = c("none", "gzip", "lzf")) {
if (!requireNamespace("hdf5r", quietly = TRUE)) {
stop("The HDF5 interface requires the 'hdf5r' package to be installed")
}
check_requires("HDF5AnnData", "hdf5r")

# check arguments
compression <- match.arg(compression)
Expand Down Expand Up @@ -446,3 +444,12 @@ to_HDF5AnnData <- function(
mode = mode
)
}

cleanup_HDF5AnnData <- function(...) { # nolint object_name_linter
args <- list(...)

if (!is.null(args$file) && is.character(args$file) && file.exists(args$file)) {
cli::cli_alert("Removing file: ", args$file)
unlink(args$file)
}
}
Loading