Skip to content

Commit cfc24e2

Browse files
committed
Updating GUI and readme
1 parent 710d468 commit cfc24e2

File tree

7 files changed

+22
-11
lines changed

7 files changed

+22
-11
lines changed

LICENSES_THIRD_PARTY

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ click-log 0.4.0 MIT License
1212
colorama 0.4.6 BSD License
1313
contourpy 1.2.0 BSD License
1414
cycler 0.11.0 BSD License
15+
dash 2.18.2 MIT License
1516
et-xmlfile 1.1.0 MIT License
1617
fonttools 4.25.0 MIT License
1718
future 1.0.0 MIT License
@@ -33,6 +34,7 @@ openpyxl 3.0.10 MIT License
3334
packaging 23.2 Apache Software License; BSD License
3435
pandas 2.1.4 BSD License
3536
pillow 10.2.0 Historical Permission Notice and Disclaimer (HPND)
37+
plotly 5.24.1. MIT License
3638
ply 3.11 BSD
3739
point-cloud-utils 0.30.4 MIT License
3840
pynndescent 0.5.10 BSD

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,17 @@ python -m dedenser dedense -dw -200 --SHOW -o data/ZINC_sc_d30w-200 -t 0.3 data/
197197
![clust](data/sc_clust_down_w-200.svg)
198198

199199
The weighting may require some manual tuning depending on what is desired by the user.
200+
201+
## Dash-app
202+
203+
A dash-app can be locally hosted and used to test and visualize various downsampling parameters.
204+
205+
The command for intializing the dash-app is:
206+
207+
```
208+
python -m dedenser Dash-app c data/doyle_cloud.npy data/doyle_cloud.csv
209+
Dash is running on http://127.0.0.1:8050/
210+
```
211+
212+
The app is then ready to be used in a web browser of choosing:
213+
![dash](data/dash-app.png)

data/dash-app.png

266 KB
Loading

dedenser/__main__.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ def display_click_data(clickData):
235235
if clickData is None:
236236
return ''
237237

238-
# Extracting the relevant data from clickData
239-
point_info = clickData['points'][0] # Get the first point data
238+
point_info = clickData['points'][0]
240239

241240
# Extract UMAP coordinates
242241
umap_1 = point_info['x']
@@ -282,21 +281,19 @@ def create_mol_plot(smiles):
282281
Output('basic-interactions', 'figure'),
283282
Output('update-button', 'n_clicks'),
284283
Input('update-button', 'n_clicks'),
285-
Input('d-input', 'value'), # Get the input value for Target
286-
Input('m-input', 'value'), # Get the input value for Min. Size
284+
Input('d-input', 'value'),
285+
Input('m-input', 'value'),
287286
Input('e-input', 'value'),
288287
Input('strict-options', 'value'),
289288
Input('w-options', 'value'),
290289
Input('weight', 'value'),
291290
Input('basic-interactions', 'figure'),
292-
prevent_initial_call=True, # Get the input value for Epsilon
291+
prevent_initial_call=True,
293292
)
294293
def update_plot(n_clicks, t_value, m_value, e_value, s_value, w_bool, w_val, figure):
295294
# Validate that all input values are provided
296-
print(t_value,m_value,e_value)
297295
if not n_clicks is None:
298296
if n_clicks > 0 and None not in (t_value, m_value, e_value):
299-
print('hello')
300297
d_weight,v_weight = None, None
301298
if s_value == 'STRICT2':
302299
strict = True
@@ -335,9 +332,7 @@ def update_plot(n_clicks, t_value, m_value, e_value, s_value, w_bool, w_val, fig
335332
return fig, None
336333
return figure, None
337334
else:
338-
print(figure)
339335
return figure, None
340-
print('did not return right')
341336

342337
@app.callback(
343338
Output('rdkit-display', 'src'),

dedenser/dedenser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ class Dedenser( ):
101101
def __init__(self,data=None, target=.5, random_seed=1, alpha=False,
102102
min_size = 5, d_weight = None, v_weight = None, epsilon=0.0,
103103
strict=False, show=False, GUI=False):
104-
print(len(data[0]))
105104
if target in (0, 1):
106105
raise ValueError(f'Target can not be {target}.')
107106
if target > 1 or target < 0:

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ click==8.1.7
33
click-log==0.4.0
44
contourpy==1.1.1
55
cycler==0.12.1
6+
dash==2.18.2
67
et-xmlfile==1.1.0
78
fonttools==4.47.2
89
importlib-metadata==7.0.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def find_package_data(packages):
8080

8181

8282
install_requires=['numpy>=1.24.4','pandas','openpyxl', 'mordred>=1.2.0', 'rdkit', 'scikit-learn>=1.3.0', 'alphashape>=1.3.1', 'scipy>=1.10.1',
83-
'point-cloud-utils==0.30.4', 'umap-learn>=0.5.5', 'matplotlib', 'future', 'plotly']
83+
'point-cloud-utils==0.30.4', 'umap-learn>=0.5.5', 'matplotlib', 'future', 'plotly', 'dash']
8484

8585
setup(
8686
name = 'dedenser',

0 commit comments

Comments
 (0)