"chemical webapp" Code Answer's

You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "chemical webapp" answered properly. Developers are finding an appropriate answer about chemical webapp related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like chemical webapp. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on chemical webapp. 

chemical webapp

By Cloudy CaimanCloudy Caiman on May 05, 2021
"""
Docker Container: https://hub.docker.com/r/continuumio/anaconda3
RDKit Installation: https://www.rdkit.org/docs/Install.html
"""
import mols2grid
import pandas as pd
import streamlit as st
import streamlit.components.v1 as components
from rdkit import Chem
from rdkit.Chem.Descriptors import ExactMolWt

st.title("Filter FDA Approved Drugs by Molecular Weight with Streamlit")


@st.cache(allow_output_mutation=True)
def download_dataset():
    """Loads once then cached for subsequent runs"""
    df = pd.read_csv(
        "https://www.cureffi.org/wp-content/uploads/2013/10/drugs.txt", sep="\t"
    ).dropna()
    return df


def calc_mw(smiles_string):
    """Given a smiles string (ex. C1CCCCC1), calculate and return the molecular weight"""
    mol = Chem.MolFromSmiles(smiles_string)
    return ExactMolWt(mol)


# Copy the dataset so any changes are not applied to the original cached version
df = download_dataset().copy()
df["mol_weight"] = df.apply(lambda x: calc_mw(x["smiles"]), axis=1)

weight_cutoff = st.slider(
    label="Show compounds that weigh below:",
    min_value=0,
    max_value=500,
    value=150,
    step=10,
)


df_result = df[df["mol_weight"] < weight_cutoff]
st.write(df_result)


raw_html = mols2grid.display(df_result, mapping={"smiles": "SMILES"})._repr_html_()
components.html(raw_html, width=900, height=900, scrolling=True)

Source: gist.githubusercontent.com

Add Comment

0

All those coders who are working on the Whatever based application and are stuck on chemical webapp can get a collection of related answers to their query. Programmers need to enter their query on chemical webapp related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about chemical webapp for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of chemical webapp while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "chemical webapp". Visit this developer's friendly online web community, CodeProZone, and get your queries like chemical webapp resolved professionally and stay updated to the latest Whatever updates. 

Whatever answers related to "chemical webapp"

View All Whatever queries

Whatever queries related to "chemical webapp"

Browse Other Code Languages

CodeProZone