Interactive scatter plots for analyzing candidate cis-regulatory elements (cCREs) with JScatter, featuring dynamic class filtering, and category- or density-based coloring.
- Interactive Scatter Plots: Built on JScatter for high-performance visualization
- Dynamic Class Filtering: Switch between user-defined categories
- Flexible Coloring: Categorical coloring with interpolated palettes or density-based coloring
- Selection Support: Interactive point selection with callback functions
- Polars Integration: Efficient data processing with Polars DataFrames
# Clone the repo
git clone https://github.com/conradbzura/ccre-scatter.git
cd ccre-scatter
# Create a virtual environment and install dependencies
uv sync# Clone the repo
git clone https://github.com/conradbzura/ccre-scatter.git
cd ccre-scatter
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install .scatterplot(x, y, metadata, join_column, category_column="class", ...)Creates an interactive scatter plot with categorical coloring and filtering.
Parameters:
x(pl.DataFrame): Dataset for X-axis valuesy(pl.DataFrame): Dataset for Y-axis valuesmetadata(pl.DataFrame): Metadata with categorical informationjoin_column(str): Column name to join datasets oncategory_column(str, default="class"): Column for categorical coloring/filteringx_label(str, optional): Custom X-axis labely_label(str, optional): Custom Y-axis labeltitle(str, optional): Custom plot titlecolormap(Callable, optional): Function for data-driven coloringdefault_category(str, default="All"): Initial category filter
Returns:
ScatterplotResult named tuple with:
scatter: JScatter plot objectmerged_data: Combined dataset (Polars DataFrame)container: Plot container widgetselection: Function returning selected pointsclass_dropdown: Class filter dropdown widget
See example_usage.ipynb for detailed examples including:
- Basic categorical scatter plots
- Density-based coloring
- Custom category columns
- Programmatic interaction with plots
- Data selection and filtering
