emmas96 commited on
Commit
daeb1af
·
1 Parent(s): 2f247b2

revert esm structure prediction

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -242,21 +242,22 @@ def display_protein():
242
  sequence = st.text_input('Enter the amino-acid sequence of the query protein target', value='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA', placeholder='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA')
243
 
244
  if sequence:
245
- #model = esm.pretrained.esmfold_v1()
246
- #model = model.eval().cuda()
247
-
248
- #with torch.no_grad():
249
- # output = model.infer_pdb(sequence)
250
-
251
- #with open("result.pdb", "w") as f:
252
- # f.write(output)
253
 
 
 
 
254
 
255
- #struct = bsio.load_structure("result.pdb", extra_fields=["b_factor"])
256
- #print(struct.b_factor.mean())
257
 
258
- #st.write(output)
259
 
 
 
 
 
 
260
  model, alphabet = esm.pretrained.esm2_t33_650M_UR50D()
261
  batch_converter = alphabet.get_batch_converter()
262
  batch_labels, batch_strs, batch_tokens = batch_converter([("protein1", sequence),])
@@ -311,6 +312,7 @@ def display_protein():
311
  st.session_state['xq'] = st.session_state.model
312
 
313
  # example proteins ["HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA"], ["AHKLFIGGLPNYLNDDQVKELLTSFGPLKAFNLVKDSATGLSKGYAFCEYVDINVTDQAIAGLNGMQLGDKKLLVQRASVGAKNA"]
 
314
 
315
  def display_context():
316
  st.markdown('## Display context')
 
242
  sequence = st.text_input('Enter the amino-acid sequence of the query protein target', value='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA', placeholder='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA')
243
 
244
  if sequence:
245
+ model = esm.pretrained.esmfold_v1()
246
+ model = model.eval().cuda()
 
 
 
 
 
 
247
 
248
+ with torch.no_grad():
249
+ output = model.infer_pdb(sequence)
250
+ st.write(output)
251
 
252
+ with open("result.pdb", "w") as f:
253
+ f.write(output)
254
 
 
255
 
256
+ struct = bsio.load_structure("result.pdb", extra_fields=["b_factor"])
257
+ print(struct.b_factor.mean())
258
+
259
+
260
+ """
261
  model, alphabet = esm.pretrained.esm2_t33_650M_UR50D()
262
  batch_converter = alphabet.get_batch_converter()
263
  batch_labels, batch_strs, batch_tokens = batch_converter([("protein1", sequence),])
 
312
  st.session_state['xq'] = st.session_state.model
313
 
314
  # example proteins ["HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA"], ["AHKLFIGGLPNYLNDDQVKELLTSFGPLKAFNLVKDSATGLSKGYAFCEYVDINVTDQAIAGLNGMQLGDKKLLVQRASVGAKNA"]
315
+ """
316
 
317
  def display_context():
318
  st.markdown('## Display context')