Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting up viz Enrich widget #60

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion js/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,31 @@ export const render_matrix_new = async ({ model, el }) => {

}

export const render_enrich = async ({model, el}) => {
const gene_list = model.get('gene_list')

console.log('gene_list', gene_list)
}

export const render = async ({ model, el }) => {

const componentType = model.get("component");

console.log('componentType', componentType)

switch (componentType) {
case "Landscape":
render_landscape({ model, el });
break;
case "Matrix":
render_matrix_new({ model, el });
break;
case "Enrich":
render_enrich({ model, el});
break;
default:
throw new Error(`Unknown component type: ${componentType}`);
}
};


export default { render, landscape_ist, landscape_sst, matrix_viz };
4 changes: 4 additions & 0 deletions src/celldega/clust/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
import ipywidgets as widgets
import statsmodels.stats.multitest as smm


def enrich(gene_list):
print('gene_list', gene_list)

def hc(df, filter_N_top=None, norm_col='total', norm_row='zscore'):

"""
Expand Down
4 changes: 2 additions & 2 deletions src/celldega/viz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Module for visualization
"""

from .widget import Landscape, Matrix
from .widget import Landscape, Matrix, Enrich
from ipywidgets import jslink, HBox, Layout

def landscape_matrix(landscape, mat, width='600px', height='700px'):
Expand Down Expand Up @@ -34,4 +34,4 @@ def landscape_matrix(landscape, mat, width='600px', height='700px'):

display(widgets_side_by_side)

__all__ = ["Landscape", "Matrix", 'landscape_matrix']
__all__ = ['Landscape', 'Matrix', 'landscape_matrix', 'Enrich']
15 changes: 15 additions & 0 deletions src/celldega/viz/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ class Matrix(anywidget.AnyWidget):
height = traitlets.Int(600).tag(sync=True)
click_info = traitlets.Dict({}).tag(sync=True)

class Enrich(anywidget.AnyWidget):
"""

"""

_esm = pathlib.Path(__file__).parent / "../static" / "widget.js"
_css = pathlib.Path(__file__).parent / "../static" / "widget.css"

value = traitlets.Int(0).tag(sync=True)

component = traitlets.Unicode("Enrich").tag(sync=True)

# gene list
gene_list = traitlets.List([]).tag(sync=True)


class MatrixNew(anywidget.AnyWidget):
_esm = pathlib.Path(__file__).parent / "../static" / "widget.js"
Expand Down
Loading