scverse/anndataR

Read/write H5AD obs/var names directly

Closed this issue · 1 comments

Currently reading works by reading obs/var and getting the row names (and caching them). Writing tries to set the rownames and then write obs/var but that doesn't work because the validation function strips the rownames.

What we need to do instead is:

  1. Check the name of the index column
  2. Read names directly from [obs/var]/[_index]
  3. Maybe writing should always write to _index and not overwrite any other column that might be an index?

Needs to be fixed for #85. Maybe should also properly consider how this works for data frames more generally.

Also need to make sure that writing obs/var doesn't overwrite obs_names/var_names. This is trickier and probably requires modifying write_h5ad_data_frame to give some way of not writing the index.