Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -74,6 +74,7 @@ def smi2viewer(smi='CC=O'):
|
|
74 |
except:
|
75 |
return None
|
76 |
|
|
|
77 |
smi = 'COc3nc(OCc2ccc(C#N)c(c1ccc(C(=O)O)cc1)c2P(=O)(O)O)ccc3C[NH2+]CC(I)NC(=O)C(F)(Cl)Br'
|
78 |
conf = smi2conf(smi)
|
79 |
viewer = MolTo3DView(conf, size=(600, 300), style='sphere')
|
@@ -135,68 +136,4 @@ with c1:
|
|
135 |
with c2:
|
136 |
components.html(source_code, height = 400,width=400)
|
137 |
|
138 |
-
################ Sidebar ####################
|
139 |
-
with st.sidebar.expander('Rule One (Atoms and Bonds)'):
|
140 |
-
st.markdown('''
|
141 |
-
## Atoms
|
142 |
-
|If |then |
|
143 |
-
|----|----|
|
144 |
-
| Non-aromatic atoms |Uper case letters |
|
145 |
-
| Aromatic atoms |lower case letters |
|
146 |
-
|Atomic symbols has more than one letter | The second is lower case |
|
147 |
-
## Bonds
|
148 |
-
| Bond type| Bond symbol |
|
149 |
-
|---|---|
|
150 |
-
|Simple | - |
|
151 |
-
|Double|=|
|
152 |
-
|Triple|#|
|
153 |
-
|Aromatic|*|
|
154 |
-
| Disconnected structures|. |
|
155 |
-
### Example:
|
156 |
-
CC 👉 There is a non-aromatic carbon attached to another non-aromatic carbon by a single bond.
|
157 |
-
🛑 A bond between two lower case atom symbols is *aromatic*.
|
158 |
-
''')
|
159 |
-
|
160 |
-
with st.sidebar.expander('Rule Two (Simple Chains)'):
|
161 |
-
st.markdown('''
|
162 |
-
## Simple chains
|
163 |
-
* Structures are hydrogen suppresed (Molecules represented without hydrogens)
|
164 |
-
* If enough bonds are not identified by the user, the system will assume that connections
|
165 |
-
are satisfied by hidrogens.
|
166 |
-
* The user can explicitly identify hydrogen bonds, but if so the interpreter will assume that all of them are fully identified.
|
167 |
-
Note:
|
168 |
-
|
169 |
-
*Because SMILES allows entry of all elements in the periodic table,
|
170 |
-
and also utilizes hydrogen suppression, the user should be aware of chemicals with two letters
|
171 |
-
that could be misinterpreted by the computer. For example, 'Sc' could be interpreted as a **sulfur**
|
172 |
-
atom connected to an aromatic **carbon** by a single bond, or it could be the symbol for **scandium**.
|
173 |
-
The SMILES interpreter gives priority to the interpretation of a single bond connecting a sulfur atom and an aromatic carbon.
|
174 |
-
To identify scandium the user should enter [Sc]*.
|
175 |
-
''')
|
176 |
-
|
177 |
-
with st.sidebar.expander('Rule Three (Branches)'):
|
178 |
-
st.markdown('''
|
179 |
-
## Branches
|
180 |
-
* A branch from a chain is specified by placing the SMILES symbol(s) for the branch between parenthesis.
|
181 |
-
* The string in parentheses is placed directly after the symbol for the atom to which it is connected.
|
182 |
-
* If it is connected by a double or triple bond, the bond symbol immediately follows the left parenthesis.
|
183 |
-
''')
|
184 |
-
|
185 |
-
with st.sidebar.expander('Rule Four (Rings)'):
|
186 |
-
st.markdown('''
|
187 |
-
## Rings
|
188 |
-
* SMILES allows a user to identify ring structures by using numbers to identify the opening and closing ring atom.
|
189 |
-
For example, in C1CCCCC1, the first carbon has a number '1' which connects by a single bond with the last carbon which also has a number '1'.
|
190 |
-
The resulting structure is cyclohexane. Chemicals that have multiple rings may be identified by using different numbers for each ring.
|
191 |
-
* If a double, single, or aromatic bond is used for the ring closure, the bond symbol is placed before the ring closure number.
|
192 |
-
''')
|
193 |
-
|
194 |
-
with st.sidebar.expander('Rule Five (Charged atoms)'):
|
195 |
-
st.markdown('''
|
196 |
-
## Charged atoms
|
197 |
-
Charges on an atom can be used to override the knowledge regarding valence that is built into SMILES software.
|
198 |
-
The format for identifying a charged atom consists of the atom followed by brackets which enclose the charge on the atom.
|
199 |
-
The number of charges may be explicitly stated ({-1}) or not ({-}).
|
200 |
-
''')
|
201 |
-
st.sidebar.markdown('Original Author: José Manuel Nápoles ([@napoles3d](https://twitter.com/napoles3D)). Find original app in https://share.streamlit.io/napoles-uach/st_smiles/main/smiles.py')
|
202 |
st.sidebar.write('Info about SMILES: https://archive.epa.gov/med/med_archive_03/web/html/smiles.html')
|
|
|
74 |
except:
|
75 |
return None
|
76 |
|
77 |
+
|
78 |
smi = 'COc3nc(OCc2ccc(C#N)c(c1ccc(C(=O)O)cc1)c2P(=O)(O)O)ccc3C[NH2+]CC(I)NC(=O)C(F)(Cl)Br'
|
79 |
conf = smi2conf(smi)
|
80 |
viewer = MolTo3DView(conf, size=(600, 300), style='sphere')
|
|
|
136 |
with c2:
|
137 |
components.html(source_code, height = 400,width=400)
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
st.sidebar.write('Info about SMILES: https://archive.epa.gov/med/med_archive_03/web/html/smiles.html')
|