Improve DeSide package accessibility with NumPy/Pandas-style imports#4
Draft
Improve DeSide package accessibility with NumPy/Pandas-style imports#4
Conversation
Co-authored-by: OnlyBelter <16537617+OnlyBelter@users.noreply.github.com>
Co-authored-by: OnlyBelter <16537617+OnlyBelter@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Please review this package and help me improve the accessibility. For example, users can use it by one line code, just like using other wide-spread python packages like NumPy or Pandas.
Improve DeSide package accessibility with NumPy/Pandas-style imports
Aug 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR transforms the DeSide package to be as accessible as popular scientific Python packages like NumPy and Pandas, addressing user requests for simplified one-line usage patterns.
Problem
Previously, users had to remember complex nested import paths to use DeSide functionality:
Solution
Now users can import DeSide like NumPy/Pandas with simple one-line patterns:
Key Improvements
📦 Package-Level Access
__init__.pyexposing core functionality across all modules__all__list for clean namespace management🚀 Ultra-Simple Convenience Functions
Added 4 wrapper functions for common workflows:
✅ Backward Compatibility
All existing import patterns continue to work unchanged:
🛡️ Robust Error Handling
Missing dependencies show helpful error messages instead of cryptic import failures:
What's Included
Core Classes Exposed
ds.DeSide- Main deconvolution modelds.ReadH5AD/ds.ReadExp- Data reading classesds.BulkGEPGenerator/ds.SingleCellTypeGEPGenerator- Simulation classesUtility Functions Exposed
ds.filter_gene_by_expression_log_mean(),ds.log2_transform()ds.log_exp2cpm(),ds.non_log2log_cpm()ds.calculate_rmse(),ds.calculate_r2(),ds.calculate_mae()ds.check_dir(),ds.read_df()Visualization Functions
ds.plot_gene_exp(),ds.compare_y_y_pred_plot(),ds.plot_pca()Enhanced Documentation
Testing
ds.function_nameThis change dramatically improves the user experience, making DeSide as approachable as NumPy (
import numpy as np) or Pandas (import pandas as pd), while maintaining full backward compatibility.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.