Skip to main content

StreamJSME is a Streamlit component that use JSME to draw 2D molecules and use them on your Streamlit app

Project description

This package is intend to be used as Molecule Draw component on Streamlit applications. It use jsme-react. It was inspired on chemstreamlit_js; so, the credits all to them.

Build

pypi-version

Source Code

GitHub-Repo

Python Versions

pyversions

Dependencies

Streamlit JSME

License

license

Downloads

download

Installation

pip install StreamJSME

Use

from StreamJSME import StreamJSME
from rdkit import Chem
from rdkit.Chem import Descriptors
from rdkit.Chem import Draw
from io import BytesIO
import streamlit as st
st.title('✍️ molecules with JSME in Streamlit 🤩')
# Create a first plot with an input SMILES, by default smiles = 'C'
update_smiles = StreamJSME(smiles='CCC')

st.subheader('Using the draw molecule inside RDKit')
st.write(f"New SMILES = {update_smiles}")
mol = Chem.MolFromSmiles(update_smiles)
st.write(f"MolLogP = {Descriptors.MolLogP(mol)}\n\nTPSA = {Descriptors.TPSA(mol)}")

st.subheader('Getting the RDKit image')
img = Draw.MolToImage(mol)
bio = BytesIO()
img.save(bio, format='png')
st.image(img)

To run the application

streamlit run --server.fileWatcherType none

Issues

If you have found a bug, please open an issue on the GitHub Issues.

Discussion

If you have questions on how to use StreamJSME, or if you want to give feedback or share ideas and new features, please head to the GitHub Discussions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

StreamJSME-0.0.3.tar.gz (506.2 kB view hashes)

Uploaded Source

Built Distribution

StreamJSME-0.0.3-py3-none-any.whl (510.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page