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

Jsme integration #587

Merged
merged 25 commits into from
Nov 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1af9c4c
Integrate jsme component in dash_bio library
nickmelnikov82 Sep 27, 2021
e2ecaf9
Start working on tests
nickmelnikov82 Oct 18, 2021
7077499
Fixed dash python imports.
nickmelnikov82 Oct 21, 2021
2d029ce
Added tests for default component buttons
nickmelnikov82 Oct 21, 2021
56a7126
Added tests for depict, export, button options
nickmelnikov82 Oct 21, 2021
4f9fd4e
Added tests for style, width, height and other options
nickmelnikov82 Oct 25, 2021
de08315
Fixed popup window move bug
nickmelnikov82 Oct 28, 2021
cd094e9
Improving the jsme scrolling function
nickmelnikov82 Oct 28, 2021
007b394
Merging data from master
nickmelnikov82 Oct 29, 2021
13bc538
Changes to match the style guide
nickmelnikov82 Nov 1, 2021
a2accb3
Merge branch 'master' into jsme-integration
nickmelnikov82 Nov 1, 2021
547a981
Update jsme dependencie
nickmelnikov82 Nov 1, 2021
63d27ea
Fixed test wait component
nickmelnikov82 Nov 1, 2021
85769ac
Rollback lint:test script
nickmelnikov82 Nov 1, 2021
50113db
Minor changes to defaults and demo app
HammadTheOne Nov 12, 2021
b93cdf9
Merge branch 'master' into jsme-integration
HammadTheOne Nov 12, 2021
9b87a29
Linting fix
HammadTheOne Nov 12, 2021
b2e6dc0
Updating dev requirements
HammadTheOne Nov 12, 2021
76697c5
updating config
HammadTheOne Nov 12, 2021
55e8374
Updating tests
HammadTheOne Nov 12, 2021
008940a
Reverting dash bio utils update
HammadTheOne Nov 13, 2021
6b5c2c6
Re-running tests
HammadTheOne Nov 13, 2021
4dd04de
Re-running tests
HammadTheOne Nov 13, 2021
7870ec4
Re-running tests
HammadTheOne Nov 13, 2021
1725dac
Changing flaky test
HammadTheOne Nov 13, 2021
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
command: |
sudo pip install virtualenv --upgrade
python -m venv venv || virtualenv venv && . venv/bin/activate
python -m pip install --upgrade pip
pip install --progress-bar off --no-cache-dir -r dev-requirements.txt
- save_cache:
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

## Unreleased - ???

### Added
* [#587](https://github.com/plotly/dash-bio/pull/587) Added JSME component.

### Changed
* [#589](https://github.com/plotly/dash-bio/pull/589) Removed hardcoded clustergram linkage method, added parameter `link_method` instead.
* [#589](https://github.com/plotly/dash-bio/pull/589) Removed hardcoded clustergram linkage method, added parameter `link_method` instead.

## [0.8.0] - 2021-09-27

Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export(dashbioCircos)
export(dashbioFornaContainer)
export(dashbioIdeogram)
export(dashbioIgv)
export(dashbioJsme)
export(dashbioMolecule2dViewer)
export(dashbioMolecule3dViewer)
export(dashbioNeedlePlot)
Expand Down
18 changes: 18 additions & 0 deletions R/dashbioJsme.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# AUTO GENERATED FILE - DO NOT EDIT

dashbioJsme <- function(id=NULL, eventSmiles=NULL, height=NULL, options=NULL, smiles=NULL, style=NULL, width=NULL) {

props <- list(id=id, eventSmiles=eventSmiles, height=height, options=options, smiles=smiles, style=style, width=width)
if (length(props) > 0) {
props <- props[!vapply(props, is.null, logical(1))]
}
component <- list(
props = props,
type = 'Jsme',
namespace = 'dash_bio',
propNames = c('id', 'eventSmiles', 'height', 'options', 'smiles', 'style', 'width'),
package = 'dashBio'
)

structure(component, class = c('dash_component', 'list'))
}
12 changes: 12 additions & 0 deletions R/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ all_files = FALSE, async = TRUE), class = "html_dependency"),
`dash_bio` = structure(list(name = "dash_bio",
version = "0.8.0", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async-jsme.js',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashBio",
all_files = FALSE, async = TRUE), class = "html_dependency"),
`dash_bio` = structure(list(name = "dash_bio",
version = "0.8.0", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async-alignment.js.map',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashBio",
all_files = FALSE, dynamic = TRUE), class = "html_dependency"),
Expand Down Expand Up @@ -146,6 +152,12 @@ all_files = FALSE, dynamic = TRUE), class = "html_dependency"),
`dash_bio` = structure(list(name = "dash_bio",
version = "0.8.0", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async-jsme.js.map',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashBio",
all_files = FALSE, dynamic = TRUE), class = "html_dependency"),
`dash_bio` = structure(list(name = "dash_bio",
version = "0.8.0", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'bundle.js',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashBio",
all_files = FALSE), class = "html_dependency"),
Expand Down
63 changes: 63 additions & 0 deletions dash_bio/Jsme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# AUTO GENERATED FILE - DO NOT EDIT

from dash.development.base_component import Component, _explicitize_args


class Jsme(Component):
"""A Jsme component.
JSME is a molecule editor that supports drawing and
editing of molecules and reactions on in a web app,
supporting both desktop and mobile devices. A built-in
substituent menu and several keyboard shortcuts
provide speedy access to the most common editing features and allow easy
and fast creation of even large and complex molecules. The editor
is able to export molecules as SMILES, MDL/Symyx/Accelrys Molfile or
in its own compact format (one line textual representation of a molecule or
reaction including also atomic 2D coordinates). The SMILES code generated by the JSME
is canonical, i.e. independent on the way how the molecule was drawn.

See more detailed documentation here: https://jsme-editor.github.io/help.html

Keyword arguments:

- id (string; default 'jsme'):
The ID of this component, used to identify dash components in
callbacks. The ID needs to be unique across all of the components
in an app.

- eventSmiles (string; optional):
A Dash prop that returns data when SMILE will be changed.

- height (string; default '600px'):
The height of the JSME container. Can be set in px, % etc.

- options (string; default 'newLook'):
String that is a comma separated string of JSME options. The
available options are described on the
https://wiki.jmol.org/index.php/Jmol_JavaScript_Object/JME/Options.

- smiles (string; optional):
The molecule SMILE to display.

- style (dict; optional):
Generic style overrides on the plot div.

- width (string; default '600px'):
The width of the JSME container. Can be set in px, % etc."""
@_explicitize_args
def __init__(self, id=Component.UNDEFINED, style=Component.UNDEFINED, options=Component.UNDEFINED, height=Component.UNDEFINED, width=Component.UNDEFINED, eventSmiles=Component.UNDEFINED, smiles=Component.UNDEFINED, **kwargs):
self._prop_names = ['id', 'eventSmiles', 'height', 'options', 'smiles', 'style', 'width']
self._type = 'Jsme'
self._namespace = 'dash_bio'
self._valid_wildcard_attributes = []
self.available_properties = ['id', 'eventSmiles', 'height', 'options', 'smiles', 'style', 'width']
self.available_wildcard_properties = []
_explicit_args = kwargs.pop('_explicit_args')
_locals = locals()
_locals.update(kwargs) # For wildcard attrs
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
for k in []:
if k not in args:
raise TypeError(
'Required argument `' + k + '` was not specified.')
super(Jsme, self).__init__(**args)
3 changes: 2 additions & 1 deletion dash_bio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
'nglmoleculeviewer',
'onco',
'sequence',
'speck'
'speck',
'jsme'
]

_js_dist = []
Expand Down
2 changes: 2 additions & 0 deletions dash_bio/_imports_.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .FornaContainer import FornaContainer
from .Ideogram import Ideogram
from .Igv import Igv
from .Jsme import Jsme
from .Molecule2dViewer import Molecule2dViewer
from .Molecule3dViewer import Molecule3dViewer
from .NeedlePlot import NeedlePlot
Expand All @@ -18,6 +19,7 @@
"FornaContainer",
"Ideogram",
"Igv",
"Jsme",
"Molecule2dViewer",
"Molecule3dViewer",
"NeedlePlot",
Expand Down
6 changes: 3 additions & 3 deletions dash_bio/async-alignment.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-circos.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-ideogram.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-igv.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dash_bio/async-jsme.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dash_bio/async-jsme.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-moleculeviewer2.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-moleculeviewer2.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-moleculeviewer3.js

Large diffs are not rendered by default.

Loading