xsmiles
Visualize atom and non-atom attributions and SMILES strings
Science Score: 57.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.3%) to scientific vocabulary
Repository
Visualize atom and non-atom attributions and SMILES strings
Basic Info
Statistics
- Stars: 46
- Watchers: 4
- Forks: 4
- Open Issues: 6
- Releases: 1
Metadata Files
README.md
Molecular structures and SMILES visualization
XSMILES is a JavaScript tool to visualize atom and non-atom attributions and SMILES strings through interactive coordinated visualizations.
It is also distributed as a plugin to be used within Jupyter Lab notebooks, as a website where users can input molecules using a JSON format, and as a KNIME plugin.
XSMILES uses the RDKit MinimalLib to draw the molecule structures.
To create the JSON file that can be used with the demonstration website, please check the "Jupyter Lab" and "Use Cases" related notebooks cited in section Availability and examples of this repository.
XSMILES was tested with RDKit Canonical SMILES.
Please Cite
If you use XSMILES, the use cases, its code, or the generated explanations, please cite our article:
https://jcheminf.biomedcentral.com/articles/10.1186/s13321-022-00673-w
Heberle, H., Zhao, L., Schmidt, S. et al. XSMILES: interactive visualization for molecules, SMILES and XAI attribution scores. J Cheminform 15, 2 (2023). https://doi.org/10.1186/s13321-022-00673-w
```BibTeX @article{Heberle2023XSMILES, author={Heberle, Henry and Zhao, Linlin and Schmidt, Sebastian and Wolf, Thomas and Heinrich, Julian}, title={XSMILES: interactive visualization for molecules, SMILES and XAI attribution scores}, journal={Journal of Cheminformatics}, year={2023}, month={Jan}, day={06}, volume={15}, number={1}, pages={2}, abstract={Explainable artificial intelligence (XAI) methods have shown increasing applicability in chemistry. In this context, visualization techniques can highlight regions of a molecule to reveal their influence over a predicted property. For this purpose, some XAI techniques calculate attribution scores associated with tokens of SMILES strings or with atoms of a molecule. While an association of a score with an atom can be directly visually represented on a molecule diagram, scores computed for SMILES non-atom tokens cannot. For instance, a substring [N+] contains 3 non-atom tokens, i.e., [, {\$}{\$}+{\$}{\$}, and ], and their attributions, depending on the model, are not necessarily revealing an influence of the nitrogen atom over the predicted property; for that reason, it is not possible to represent the scores on a molecule diagram. Moreover, SMILES's notation is complex, foregrounding the need for techniques to facilitate the analysis of explanations associated with their tokens.}, issn={1758-2946}, doi={10.1186/s13321-022-00673-w}, url={https://doi.org/10.1186/s13321-022-00673-w} }
```
Availability and examples
<!--
-->
Distributions formats
XSMILES (Javascript) is distributed in 3 main formats and they are available in the dist folder.
Please go to the Readme from that folder for Details.
Simplest usage of XSMILES
If you just want to use XSMILES, for example, as a Machine Learning expert, you may be interested in the JupyterLab plugin or Demo website.
Using XSMILES as npm package
If you are a web-developer, the npm package may be your option.
Requirement: RDKit MinimalLib needs to be loaded as in window.RDKit = RDKit; before any XSMILES functionality is used.
For the Demo Website of this project, you can see how we loaded it on files src/index.tsx and public/index.html.
Depending on the project, you may need to load it in different ways.
Another example is shown in dist/knime/GenericJavascriptView.js, where we load RDKit directly from an URL.
Please refer to https://github.com/rdkit/rdkit-js to learn how to load RDKit.
In future versions we want to include the dependency in the npm package, so you won't need to worry about it.
Run npm install xsmiles (unofficial) to install the module package and use XSMILES in another web-based system.
If xsmiles is not in the npm repository, please download the one of the released versions from this repository and run the code below, changing the version accordingly:
npm install xsmiles-0.5.7.tgz
Using XSMILES as Plain javascript
Required: RDKit MinimalLib, as explained in the section above.
You can use XSMILES from our index.js available at dist/plain.
Once your webpage loads it, it will be available through the window global variable:
javascript
window.xsmiles.appendSingleView(div, setup);
Please check dist/knime for an example of how it can be used within a Javascript code.
In that example, we have XSMILES working in a KNIME's Javascript View.
The xsmiles.js is injected in the View through a "table" that is converted to a "variable".
For more details, please refer to the KNIME example referred at the top of this page.
Running the Demonstration website locally
bash
npm install
npm start
Development
It builds a module that export functions (defined in src/modules) and a web-system (defined in src/webpage) that provides a GUI to input a .json file and display smiles strings - their XAI scores in the form of coordinated bar charts and molecular structure.
The module functions are exported into dist/modules and the website to be served is exported into dist/web.
Components were created to be exported and used in the xsmiles-jupyterlab project, so that it can be used in Jupyter Lab notebooks.
Run npm install to install all dependencies.
Starting the website in development mode
npm start
Building modules (npm, plain javascript) and website
npm run build
Packing the XSMILES to use with npm install
npm run build
npm pack
Owner
- Name: Bayer Open Source
- Login: Bayer-Group
- Kind: organization
- Website: https://bayer.com/
- Repositories: 98
- Profile: https://github.com/Bayer-Group
Science for a better life
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Heberle"
given-names: "Henry"
orcid: "https://orcid.org/0000-0003-1964-268X"
title: "XSMILES: interactive visualization for molecules, SMILES and XAI attribution scores"
version: 0.5.7
doi: 10.1186/s13321-022-00673-w
date-released: 2022-08-25
url: "https://doi.org/10.1186/s13321-022-00673-w"
preferred-citation:
type: article
authors:
- family-names: "Heberle"
given-names: "Henry"
orcid: "https://orcid.org/0000-0003-1964-268X"
- family-names: "Zhao"
given-names: "Linlin"
orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Schmidt"
given-names: "Sebastian"
orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Wolf"
given-names: "Thomas"
orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Heinrich"
given-names: "Julian"
orcid: "https://orcid.org/0000-0000-0000-0000"
doi: "10.1186/s13321-022-00673-w"
journal: "Journal of Cheminformatics"
month: "Jan"
day: 06
start: # First page number
end: # Last page number
title: "XSMILES: interactive visualization for molecules, SMILES and XAI attribution scores"
issue:
volume: 15
year: 2023
GitHub Events
Total
- Issues event: 2
- Watch event: 5
- Pull request event: 2
- Fork event: 2
Last Year
- Issues event: 2
- Watch event: 5
- Pull request event: 2
- Fork event: 2
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Henry Heberle | h****c@g****m | 15 |
| Linlin Zhao | l****o@o****m | 1 |
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 1
- Total pull requests: 6
- Average time to close issues: N/A
- Average time to close pull requests: 40 minutes
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 1.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 5
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- GannaMohit (2)
- waqarahmadm019 (1)
Pull Request Authors
- dependabot[bot] (5)
- GannaMohit (2)
- linlinzhao (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- 667 dependencies
- @testing-library/jest-dom ^5.11.9 development
- @types/chroma-js ^2.1.4 development
- @types/d3 ^7.4.0 development
- @types/kdbush ^3.0.0 development
- @types/react ^18.0.6 development
- @types/react-dom ^18.0.6 development
- copy-webpack-plugin ^11.0.0 development
- css-loader ^6.1.0 development
- html-webpack-plugin ^5.5.0 development
- jsdoc ^3.6.7 development
- sass ^1.35.2 development
- sass-loader ^13.0.2 development
- style-loader ^3.1.0 development
- ts-loader ^9.3.1 development
- webpack ^5.45.1 development
- webpack-cli ^4.10.0 development
- webpack-dev-server ^4.10.0 development
- @emotion/react ^11.7.0
- @emotion/styled ^11.6.0
- @fontsource/roboto ^4.5.1
- @mui/material ^5.2.2
- @types/heatmap.js ^2.0.37
- chroma-js ^2.4.2
- d3 ^7.6.1
- heatmap.js ^2.0.5
- kdbush ^3.0.0
- node ^16.17.0
- react-dropzone ^14.2.2
- react-loading-overlay-ts ^2.0.0
- serve ^14.0.1
- simple-statistics ^7.7.0
- svg-path-bounds ^1.0.2
- typescript ^4.1.3
- web-vitals ^2.1.4