Skip to content

Master Issue: Function Compatibility with the Different Array Types of AnnData Fields #829

Description

@eroell

Description of feature

Right now AnnData fields such as .X can have different datatypes, being e.g. numpy dense arrays, sparse arrays, or dask arrays.

Some ehrapy functions are compatible with multiple of these types, while some are not.

We can roll this out in a 2 step process:

  1. Introduce a consistent response for functions that fail for a given datatype.
    One way to implement this could be via consistent use of single-dispatch. Should also include dedicated tests.
  2. Address functions or batches of functions step by step, and extend the datatypes they support
    The order could be determined with volume of estimated usage, required effort, and typical data load (e.g. operations happening on full feature set vs lower-dimensional space)

List of affected functions

Module Function Status?
.\anndata\anndata_ext.py anndata_to_df
.\anndata\anndata_ext.py _assert_encoded
.\anndata\anndata_ext.py set_numeric_vars
.\anndata\anndata_ext.py _to_dense_matrix
.\io\_read.py _write_cache
.\io\_read.py _decode_cached_adata
.\io\_write.py write
.\preprocessing\_balanced_sampling.py balanced_sample
.\preprocessing\_encoding.py encode
.\preprocessing\_encoding.py _one_hot_encoding
.\preprocessing\_encoding.py _label_encoding
.\preprocessing\_encoding.py _delete_all_encodings
.\preprocessing\_encoding.py _update_obs
.\preprocessing\_imputation.py explicit_impute Numpy Array, Dask Array
.\preprocessing\_imputation.py _simple_impute
.\preprocessing\_imputation.py knn_impute
.\preprocessing\_imputation.py _knn_impute
.\preprocessing\_imputation.py miss_forest_impute
.\preprocessing\_imputation.py mice_forest_impute
.\preprocessing\_normalization.py _scale_func_group
.\preprocessing\_normalization.py scale_norm Numpy Array, Dask Array
.\preprocessing\_normalization.py minmax_norm Numpy Array, Dask Array
.\preprocessing\_normalization.py maxabs_norm Numpy Array, Dask Array
.\preprocessing\_normalization.py robust_scale_norm Numpy Array, Dask Array
.\preprocessing\_normalization.py quantile_norm Numpy Array, Dask Array
.\preprocessing\_normalization.py power_norm Numpy Array, Dask Array
.\preprocessing\_normalization.py log_norm Numpy Array, Dask Array
.\preprocessing\_normalization.py _prep_adata_norm
.\preprocessing\_normalization.py offset_negative_values
.\preprocessing\_quality_control.py _obs_qc_metrics Numpy Array, Dask Array
.\preprocessing\_quality_control.py _var_qc_metrics Numpy Array, Dask Array
.\tools\_sa.py ols
.\tools\_sa.py glm
.\tools\feature_ranking\_rank_features_groups.py rank_features_groups

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions