Skip to content

Update HDF5 writing functions and implement data frame writing - #85

Merged
rcannood merged 26 commits into
mainfrom
hdf5-write-dataframe
Jun 7, 2023
Merged

rcannood merged 26 commits into
mainfrom
hdf5-write-dataframe

Conversation

@lazappi

@lazappi lazappi commented May 15, 2023

Copy link
Copy Markdown
Collaborator

This implements writing of data frames to HDF5 files and generally updates the HDF5 writing functions

  • Update write_h5ad_encoding() to work more reliably
  • Rename path_exists() to hdf5_path_exists()
  • write_h5ad_element() now deletes any existing elements before writing the new one. This should always be used instead of the specific writing functions.
  • write_h5ad_element() now also passes arguments to writing functions using ..., needed for data frames and has other potential uses.
  • Implement write_h5ad_data_frame()
  • Add tests for low level HDF5 writing functions
  • General tidying

Still to do:

  • Add HDF5AnnData setter tests (needs Update example dataset #74 to be merged)
  • Turn on the reticulate round trip test. This needs the constructor to be rewritten to use obs_names/var_names instead of obs/var which felt like a big enough change for a separate PR.

@rcannood

Copy link
Copy Markdown
Member

Thanks for your hard work! Would you like us to review the pr?

lazappi added 3 commits May 22, 2023 14:00
* origin/main: (23 commits)
  initial implementation of from_Seurat (#64)
  only check size when the names are already defined
  todo: add back obs_names and var_names length check
  update roxygen
  move required args to the front
  Update R/HDF5-read.R
  fix lint issues
  update tests
  refactor code to assume obs_names and var_names are defined
  Style and lint
  Add rhdf5 package skipe to HDF5 tests
  Add 1D sparse array to example.h5ad
  Remove requireNamespace("rhdf5")
  Fix bug in read_h5ad_string_array()
  Add support for reading H5AD rec arrays
  Covert 1D string arrays to vectors in read_h5ad_string_array()
  Update tests to use example.h5ad
  wip changes for #76
  Remove Krumsiek augemented dataset
  Reduce example H5AD to 50 cells x 100 genes
  ...
Need to write attributes as scalars for Python to read them
@lazappi
lazappi marked this pull request as ready for review June 7, 2023 11:49
@lazappi
lazappi requested a review from rcannood June 7, 2023 11:49

@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, though the proof of the pudding will be in the eating :)

@rcannood
rcannood merged commit f15e269 into main Jun 7, 2023
@rcannood
rcannood deleted the hdf5-write-dataframe branch July 5, 2023 10:37
lazappi added a commit that referenced this pull request Jul 5, 2023
* main: (26 commits)
  add gthb pat
  Update HDF5 writing functions and implement data frame writing (#85)
  remove shape trackstatus for now
  initial implementation of from_Seurat (#64)
  only check size when the names are already defined
  todo: add back obs_names and var_names length check
  update roxygen
  move required args to the front
  Update R/HDF5-read.R
  fix lint issues
  update tests
  refactor code to assume obs_names and var_names are defined
  Style and lint
  Add rhdf5 package skipe to HDF5 tests
  Add 1D sparse array to example.h5ad
  Remove requireNamespace("rhdf5")
  Fix bug in read_h5ad_string_array()
  Add support for reading H5AD rec arrays
  Covert 1D string arrays to vectors in read_h5ad_string_array()
  Update tests to use example.h5ad
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants