Hukuna commited on
Commit
bb146b1
·
verified ·
1 Parent(s): f8303cf

Update demo.py

Browse files
Files changed (1) hide show
  1. demo.py +11 -5
demo.py CHANGED
@@ -332,8 +332,12 @@ def cSSStructureSampleDemo(style,resn):
332
  st.caption("This approach involves adding a secondary structure classifier to conditionally sample an Asymmetric unit (AU) that is beta-rich, followed by symmetrization.")
333
  output='./output/symm_beta.pdb'
334
  CATH=st.sidebar.text_input('CATH:protein domain annotations from <https://www.cathdb.info/>. Annotation examples include 2, 2.40, 2.40.155.','2',key='CATH_beta')
335
- beta = conditioners.ProClassConditioner('cath', CATH, weight=5, max_norm=20)
336
- c_symmetry = conditioners.SymmetryConditioner(G="C_3", num_chain_neighbors=2)
 
 
 
 
337
  composed_cond = conditioners.ComposedConditioner([beta, c_symmetry])
338
  if st.sidebar.button("Run Code with Button",key="substructure"):
339
  cSSStructureSample(composed_cond,output)
@@ -341,7 +345,7 @@ def cSSStructureSampleDemo(style,resn):
341
  display(output,style,resn)
342
 
343
  # Merging Symmetry and Substructure
344
- def mSSubstructureSample(protein,composedCondtioner,output):
345
  protein, trajectories = chroma.sample(
346
  protein_init=protein,
347
  conditioner=composedCondtioner,
@@ -367,12 +371,14 @@ def mSSubstructureSampleDemo(style,resn):
367
  protein, backbone_model=chroma.backbone_network, selection="x < 25 and y < 25")
368
 
369
  # C_3 symmetry
370
- c_symmetry = conditioners.SymmetryConditioner(G="C_3", num_chain_neighbors=3)
 
 
371
 
372
  # Composing
373
  composed_cond = conditioners.ComposedConditioner([substruct_conditioner, c_symmetry])
374
 
375
  if st.sidebar.button("Run Code with Button",key="substructure"):
376
- mSSubstructureSample(protein,composed_cond,output)
377
 
378
  display(output,style,resn)
 
332
  st.caption("This approach involves adding a secondary structure classifier to conditionally sample an Asymmetric unit (AU) that is beta-rich, followed by symmetrization.")
333
  output='./output/symm_beta.pdb'
334
  CATH=st.sidebar.text_input('CATH:protein domain annotations from <https://www.cathdb.info/>. Annotation examples include 2, 2.40, 2.40.155.','2',key='CATH_beta')
335
+ weight=st.sidebar.number_input('weight : The weighting of the conditioner relative to the backbone model. Defaults is 5,step=1.',value=5,max_value=10,min_value=1,step=1,key='weight')
336
+ max_norm=st.sidebar.number_input(" max_norm: The maximum magnitude of the gradient, above which the magnitude is clipped. Defaults is 20,step=2.",max_value=30,min_value=10,value=20,step=2,key='max_norm')
337
+ beta = conditioners.ProClassConditioner('cath', CATH, weight=weight, max_norm=max_norm)
338
+ symmetry_group=st.sidebar.text_input('symmetry_group:@param ["C_2", "C_3", "C_4", "C_5", "C_6", "C_7", "C_8", "D_2", "D_3", "D_4", "D_5", "D_6", "D_7", "D_8", "T", "O", "I"]',value="C_3",key='symmetry_group_css')
339
+ knbr=st.sidebar.number_input("knbr:The number of neighbors to consider for each chain in the complex.Default is 2,step=1",min_value=1,max_value=10,step=1,value=2,key='knbr_css')
340
+ c_symmetry = conditioners.SymmetryConditioner(G=symmetry_group, num_chain_neighbors=knbr)
341
  composed_cond = conditioners.ComposedConditioner([beta, c_symmetry])
342
  if st.sidebar.button("Run Code with Button",key="substructure"):
343
  cSSStructureSample(composed_cond,output)
 
345
  display(output,style,resn)
346
 
347
  # Merging Symmetry and Substructure
348
+ def mSSubstructureSample(composedCondtioner,output):
349
  protein, trajectories = chroma.sample(
350
  protein_init=protein,
351
  conditioner=composedCondtioner,
 
371
  protein, backbone_model=chroma.backbone_network, selection="x < 25 and y < 25")
372
 
373
  # C_3 symmetry
374
+ symmetry_group=st.sidebar.text_input('symmetry_group:@param ["C_2", "C_3", "C_4", "C_5", "C_6", "C_7", "C_8", "D_2", "D_3", "D_4", "D_5", "D_6", "D_7", "D_8", "T", "O", "I"]',value="C_3",key='symmetry_group_mss')
375
+ knbr=st.sidebar.number_input("knbr:The number of neighbors to consider for each chain in the complex.Default is 3,step=1",min_value=1,max_value=10,step=1,value=3,key='knbr_mss')
376
+ c_symmetry = conditioners.SymmetryConditioner(G=symmetry_group, num_chain_neighbors=knbr)
377
 
378
  # Composing
379
  composed_cond = conditioners.ComposedConditioner([substruct_conditioner, c_symmetry])
380
 
381
  if st.sidebar.button("Run Code with Button",key="substructure"):
382
+ mSSubstructureSample(composed_cond,output)
383
 
384
  display(output,style,resn)