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

Hdf5r rownames rework #166

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a77035b
Update write_h5ad_categorical
lazappi Dec 4, 2023
f739fe2
fix styling
rcannood Dec 4, 2023
4b24b2b
Merge remote-tracking branch 'origin/main' into write-h5ad-categoricals
rcannood Dec 5, 2023
a05d60c
Merge remote-tracking branch 'origin/main' into write-h5ad-categoricals
rcannood Dec 5, 2023
a042777
Update write_h5ad_categorical
lazappi Dec 4, 2023
d273343
Adjust H5AD categorical write test
lazappi Dec 6, 2023
bb2b2cf
Merge branch 'write-h5ad-categoricals' of github.com:scverse/scversei…
lazappi Dec 6, 2023
d4dc429
Add write_h5ad_attributes function
lazappi Dec 6, 2023
dbc1dc5
ignore cyclomatic complexity warning for `write_h5ad_element` warning
rcannood Dec 7, 2023
a46a234
formatting changes
rcannood Dec 7, 2023
fd735e4
in write_h5ad_attributes, allow file to be an open hdf5 file
rcannood Dec 7, 2023
9720706
wip
rcannood Dec 7, 2023
d3f1d5c
wip
rcannood Dec 13, 2023
731df9a
substitute mentions of rhdf5 with hdf5r
rcannood Dec 13, 2023
d0ad1ec
strip obs_names and var_names from framework
rcannood Dec 13, 2023
16441ff
update
rcannood Dec 13, 2023
f01ea73
fix tests and finalize
rcannood Dec 13, 2023
8b58bc8
remove mentions of obs_names and var_names in the constructor
rcannood Dec 14, 2023
7d4a182
make sure filenames are always unique
rcannood Dec 14, 2023
c3586e8
add mode to various functions
rcannood Dec 14, 2023
c7b30ca
manually close anndatas in tests (where needed)
rcannood Dec 14, 2023
e9d16fc
only close when pointer is valid
rcannood Dec 14, 2023
c1dd3c4
move match
rcannood Dec 14, 2023
8d73f13
use $close() instead of $close_all()
rcannood Dec 14, 2023
e3180db
switch to different branch
rcannood Dec 17, 2023
9504e0b
simplify test
rcannood Dec 17, 2023
0b1850a
gc afterclosing the adata in write_h5ad
rcannood Dec 20, 2023
29628a8
guess the dtype and the space
rcannood Dec 20, 2023
5fd53ad
update docs
rcannood Dec 20, 2023
4278c02
use hhoeflin's remote
rcannood Jan 9, 2024
bebb3bd
bugfix in hdf5r has been released
rcannood Jan 16, 2024
d0371aa
update: nevermind, the fix wasn't included in the release yet
rcannood Jan 30, 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
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Suggests:
BiocStyle,
knitr,
reticulate,
rhdf5,
hdf5r,
rmarkdown,
S4Vectors,
SeuratObject,
Expand All @@ -85,3 +85,4 @@ Encoding: UTF-8
Roxygen: list(markdown = TRUE, r6 = TRUE)
RoxygenNote: 7.2.3
biocViews: SingleCell, DataImport, DataRepresentation
Remotes: github::hhoeflin/hdf5r@bug/fix_empty_attrs_again
7 changes: 0 additions & 7 deletions R/AbstractAnnData.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,6 @@ AbstractAnnData <- R6::R6Class("AbstractAnnData", # nolint
))
}

if (has_row_names(df)) {
warning(wrap_message(
"'", label, "' should not have any rownames, removing them from the data frame."
))
rownames(df) <- NULL
}

df
},

Expand Down
17 changes: 3 additions & 14 deletions R/AnnData.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@
#'
#' To read an AnnData file from disk, use [read_h5ad()] instead.
#'
#' @param obs_names A vector of unique identifiers
#' used to identify each row of `obs` and to act as an index into the
#' observation dimension of the AnnData object. The length of `obs_names`
#' defines the observation dimension of the AnnData object.
#' @param var_names A vector of unique identifiers used to identify each row
#' of `var` and to act as an index into the variable dimension of the
#' AnnData object. The length of `var_names` defines the variable
#' dimension of the AnnData object.
#' @param AnnData object.
#' @param X Either `NULL` or a observation × variable matrix with
#' dimensions consistent with `obs` and `var`.
#' @param layers Either `NULL` or a named list, where each element is an
Expand Down Expand Up @@ -46,22 +39,20 @@
#'
#' @examples
#' adata <- AnnData(
#' obs_names = paste0("obs", 1:3),
#' var_names = paste0("var", 1:4),
#' X = matrix(1:12, nrow = 3, ncol = 4),
#' obs = data.frame(
#' row.names = paste0("obs", 1:3),
#' n_counts = c(1, 2, 3),
#' n_cells = c(1, 2, 3)
#' ),
#' var = data.frame(
#' row.names = paste0("var", 1:4),
#' n_cells = c(1, 2, 3, 4)
#' )
#' )
#'
#' adata
AnnData <- function(
obs_names = NULL,
var_names = NULL,
X = NULL,
obs = NULL,
var = NULL,
Expand All @@ -72,8 +63,6 @@ AnnData <- function(
varp = NULL,
uns = NULL) {
InMemoryAnnData$new(
obs_names = obs_names,
var_names = var_names,
X = X,
obs = obs,
var = var,
Expand Down
Loading
Loading