Skip to content

Add optional data.frame conversion for Matrix column names (Seurat Conversion) #459

Description

@samuel-marsh

Description

Hi scverse team,

Thanks so much for developing this package, it's really fantastic!

I just wanted to propose potential new feature based on warning messages in conversion from Seurat to h5ad.

When converting/writing using write_h5ad the following warnings occur for the dimensionality reductions:

1: Matrix column names cannot be written to a <HDF5AnnData> object, they will be lost
ℹ To write column names for obsm[['pca']], store it as <data.frame> instead of a double matrix
ℹ NOTE: obs_names and var_names are stored separately

It would be awesome if optional parameter could be added to do this conversion (since Seurat will always store these as double matrix) and note could be incorporated into warning to alert users to optional parameter. I understand this might be low priority given ability to work around it but would be nice especially for those less familiar with AnnData structure and/or R/Seurat in general.

Thanks again!
Sam

Proposed Solution

optional logical parameter (can be set to FALSE by default to maintain equivalence to current functionality).
e.g.:
param:
convert_dimreduc_dataframe = FALSE

added note to warning message:

1: Matrix column names cannot be written to a <HDF5AnnData> object, they will be lost
ℹ To write column names for obsm[['pca']], store it as <data.frame> instead of a double matrix or set `convert_dimreduc_dataframe = TRUE`
ℹ NOTE: obs_names and var_names are stored separately

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNew issues yet to be checked by maintainers

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions