Skip to content

Update example dataset - #74

Merged
lazappi merged 19 commits into
mainfrom
example-dataset
May 15, 2023
Merged

lazappi merged 19 commits into
mainfrom
example-dataset

Conversation

@lazappi

@lazappi lazappi commented May 8, 2023

Copy link
Copy Markdown
Collaborator

The example Krumsiek H5AD files from {zellkonverter} we were using for testing were missing some things we want to check. This dataset should be more complete and easier to add things to as needed.

@lazappi lazappi added the new feature New feature or request label May 8, 2023
@lazappi
lazappi requested a review from rcannood May 8, 2023 13:11
@lazappi

lazappi commented May 8, 2023

Copy link
Copy Markdown
Collaborator Author

Possibly we also want a similar R example (maybe using the in-memory interface)? I wasn't sure how best to do that but if we come up with something it could go here or in a separate PR.

@rcannood rcannood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to remove the krumsiek dataset.

However, the resulting example.h5ad is too big for my liking. Can you create something that's a little smaller, e.g. <100KB?

@lazappi

lazappi commented May 9, 2023

Copy link
Copy Markdown
Collaborator Author

Maybe??? It's only 100 cells x 200 genes so I'm not sure that can be reduced much. Some of the things might be redundant (in that they are the same types) but I'm not sure exactly which parts are taking up space. Any idea if there is an easy way to tell that from a HDF5 file?

I guess the other option would be to put it on Figshare and use {BiocCache} to get it as needed but it would be simpler to have something in the package.

@lazappi

lazappi commented May 9, 2023

Copy link
Copy Markdown
Collaborator Author

Ok, I got it down to ~400kb. Small enough?

@rcannood rcannood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

400KB is already a lot better :)

lazappi and others added 4 commits May 10, 2023 14:09
* origin/main: (74 commits)
  make sure path is printed
  ignore complexity
  fix typo in docs
  update roxygen
  implement get_generator class
  improve test
  redesign HDF5AnnData constructor based on #51
  rename write h5ad encoding function
  move validation functions
  move check
  fix tests
  improve roundtrip test
  wip fix write functions
  fix read functions
  check data frame first
  fix write_encoding_attribute function
  refactor tests using helper functions
  fix abstract method error
  fix issues
  add reticulate-based tests for the hdf5 backend (#69)
  ...
* origin/main:
  Update `skip_if_no_anndata()` test helper function (#77)
  Update HDF5 tests (#78)
@lazappi

lazappi commented May 11, 2023

Copy link
Copy Markdown
Collaborator Author

FYI I want to add some things to this so please don't merge yet

lazappi added 10 commits May 11, 2023 14:59
All arrays were being coerced to vectors
Replace with a single check in HDF5AnnData$new()
Also reduce the size of adata.uns["String2D"]
…xample-dataset

* 'example-dataset' of github.com:scverse/scverseio:
* origin/main:
  Issue-59-suggestions (#80)
  Update `HDF5AnnData` to use common validation function (#79)
  implement from_SingleCellExperiment()
@lazappi
lazappi requested a review from rcannood May 11, 2023 14:31
Comment thread R/HDF5-read.R
#'
#' @return A named list with names type and version
read_h5ad_encoding <- function(file, name) {
requireNamespace("rhdf5")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to keep requireNamespace("rhdf5") in here, if these functions are meant to be transferred to a separate package?

This applies to all of the other read_h5ad_* and write_h5ad_* functions as well.

@lazappi lazappi May 15, 2023 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure what you mean? These functions aren't exported so I was imagining anyone depending on this would use HDF5AnnData which now contains a dependency check when the object is created. Maybe I'm missing something though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weren't you planning on moving all of the read_h5ad_* and so on functions into a separate package which could then be used by anndataR, mudata and spatialdataR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, possibly... I had forgotten about that. Even if that does happen I think this would need to be revisited anyway. That package might just import {rhdf5} so this wouldn't be necessary there either.

Comment thread R/HDF5-read.R Resolved
Co-authored-by: Robrecht Cannoodt <[email protected]>

@rcannood rcannood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (again)

@lazappi
lazappi merged commit 77e7f0c into main May 15, 2023
@lazappi
lazappi deleted the example-dataset branch May 15, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants