Skip to content

Repository files navigation

StreamJSME

This package is intended to be used as a Molecule Draw component on Streamlit applications. It uses jsme-react.

Buildpypi-version
Source CodeGitHub-Repo
Python Versionspyversions
DependenciesStreamlitJSME
Licenselicense
Downloadsdownload

Installation

pip install StreamJSME

Use

fromStreamJSMEimportStreamJSMEfromrdkitimportChemfromrdkit.ChemimportDescriptorsfromrdkit.ChemimportDrawfromioimportBytesIOimportstreamlitasstst.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)

If trying to run the Streamlit application you get OSError: [Errno 28] inotify watch limit reached, just use the flag --server.fileWatcherType none:

streamlit run app.py --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.

Acknowledgment

See the full list of contributors in the CONTRIBUTORS.md file.

About

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

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages