scverse / genomic-features

Genomic Features in Python from BioConductor's AnnotationHub
https://genomic-features.readthedocs.io
BSD 3-Clause "New" or "Revised" License
18 stars 5 forks source link

`return_type` #63

Open ivirshup opened 3 months ago

ivirshup commented 3 months ago

Description of feature

It would be nice to have a return_type argument that allowed results other than a pandas dataframe. Currently, I think that pyarrow.Table, ibis.Table, and pd.DataFrame (defaulting to pd.DataFrame would be a good set of options.

This would look like:

ensdb.genes(return_type=ibis.expr.types.Table)

(I generally like the idea of passing a type instead of a string literal here, but I see how the ibis case is unwieldy)

Advantages

Allows us to work with a few use cases:

Disadvantages

Mainly complexity. Also keeping data types consistent.

It would probably be pretty easy to start with only supporting pandas and ibis, where the ibis case is just not running .execute()