libokj commited on
Commit
35ebed3
·
1 Parent(s): c4bc2b8

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +53 -58
app.py CHANGED
@@ -868,9 +868,9 @@ To predict interactions/binding affinities of a single target against a library
868
  drug_library = gr.Dropdown(label='Step 3. Select or Upload a Compound Library',
869
  choices=list(DRUG_LIBRARY_MAP.keys()))
870
  with gr.Row():
871
- gr.File(label='Example SDF compound library',
872
  value='data/examples/compound_library.sdf', interactive=False)
873
- gr.File(label='Example CSV compound library',
874
  value='data/examples/compound_library.csv', interactive=False)
875
  drug_library_upload_btn = gr.UploadButton(
876
  label='Upload a custom library', variant='primary')
@@ -918,19 +918,6 @@ To predict interactions/binding affinities of a single target against a library
918
  <center>
919
  To predict interactions/binding affinities of a single compound against a library of protein targets.
920
  </center>
921
-
922
- ℹ️ A custom target library can be a FASTA file with a single or multiple amino acid sequences,
923
- or a CSV file has a required FASTA string column and optionally an ID column:
924
-
925
- <b>X2</b>: the FASTA sequence of a target\n
926
- <b>ID2</b> (optional): the ID (PubChem or any arbitrary unique identifier) of a compound\n
927
-
928
- Example CSV target library:
929
-
930
- | X2 | ID2 |
931
- |---------------|--------|
932
- | MVQKSRNGGV... | O88943 |
933
- | MTSPSSSPVF... | Q9Y5S1 |
934
  ''')
935
  with gr.Blocks() as identify_block:
936
  with gr.Column() as identify_page:
@@ -971,9 +958,9 @@ Example CSV target library:
971
  target_library = gr.Dropdown(label='Step 3. Select or Upload a Target Library',
972
  choices=list(TARGET_LIBRARY_MAP.keys()))
973
  with gr.Row():
974
- gr.File(label='Example FASTA target library',
975
  value='data/examples/target_library.fasta', interactive=False)
976
- gr.File(label='Example CSV target library',
977
  value='data/examples/target_library.csv', interactive=False)
978
  target_library_upload_btn = gr.UploadButton(
979
  label='Upload a custom library', variant='primary')
@@ -1016,64 +1003,72 @@ Example CSV target library:
1016
  gr.Markdown('''
1017
  # <center>DeepSEQreen Interaction Pair Inference</center>
1018
  <center>To predict interactions/binding affinities between any compound-protein pairs.</center>
1019
-
1020
- ℹ️ A custom interaction pair dataset can be generated from a FASTA file containing multiple sequences
1021
- and a SDF file containing multiple compounds (for predicting CPI/CPA of all possible combinations of
1022
- compound-protein pairs), or a CSV file with 2 required string columns and optionally 2 ID columns:
1023
-
1024
- <b>X1</b>: the SMILES string of a compound\n
1025
- <b>X2</b>: the FASTA sequence of a target\n
1026
- <b>ID1</b> (optional): the ID (PubChem or any arbitrary unique identifier) of a compound\n
1027
- <b>ID2</b> (optional): the ID (UniProt or any arbitrary unique identifier) of a protein
1028
-
1029
- Example CSV interaction pair dataset:
1030
-
1031
- | X1 | X2 | ID1 | ID2 |
1032
- |---------------------------------------- |---------------|--------------|--------|
1033
- | CCOC(=O)Nc1ccc(NCc2ccc(F)cc2)cc1N | MVQKSRNGGV... | CHEMBL41355 | O88943 |
1034
- | CCCCCc1cc(O)c(C/C=C(\C)CCC=C(C)C)c(O)c1 | MTSPSSSPVF... | CHEMBL497318 | Q9Y5S1 |
1035
  ''')
1036
  with gr.Blocks() as infer_block:
1037
  with gr.Column() as infer_page:
1038
- infer_type = gr.Dropdown(choices=['Upload a compound library and a target library',
1039
- 'Upload a CSV interaction pair dataset'],
1040
- value='Upload a compound library and a target library')
 
1041
  with gr.Column() as pair_upload:
1042
- gr.File(label="Example custom dataset",
1043
- value="data/examples/interaction_pair_inference.csv",
1044
- interactive=False)
1045
- with gr.Column():
 
1046
  infer_data_for_predict = gr.File(
1047
- label='Upload a custom dataset', file_count="single", type='filepath', visible=True)
1048
  with gr.Column() as pair_generate:
1049
  with gr.Row():
1050
- gr.File(label='Example SDF compound library',
1051
  value='data/examples/compound_library.sdf', interactive=False)
1052
- gr.File(label='Example FASTA target library',
1053
  value='data/examples/target_library.fasta', interactive=False)
1054
  with gr.Row():
1055
- gr.File(label='Example CSV compound library',
1056
  value='data/examples/compound_library.csv', interactive=False)
1057
- gr.File(label='Example CSV target library',
1058
  value='data/examples/target_library.csv', interactive=False)
1059
  with gr.Row():
1060
- infer_drug = gr.File(label='SDF/CSV file containing multiple compounds',
1061
  file_count="single", type='filepath')
1062
- infer_target = gr.File(label='FASTA/CSV file containing multiple targets',
1063
  file_count="single", type='filepath')
1064
 
1065
- with gr.Row(visible=True):
1066
- pair_infer_task = gr.Dropdown(list(TASK_MAP.keys()), label='Task')
1067
- pair_infer_preset = gr.Dropdown(list(PRESET_MAP.keys()), label='Preset')
1068
- pair_infer_target_family = gr.Dropdown(choices=['General'],
1069
- label='Target family',
1070
- value='General')
 
 
 
1071
 
1072
- # with gr.Row():
1073
- # pair_infer_email = gr.Textbox(
1074
- # label='Email (optional)',
1075
- # info="Your email will be used to send you notifications when your job finishes."
1076
- # )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1077
 
1078
  with gr.Row(visible=True):
1079
  # pair_infer_clr_btn = gr.ClearButton(size='lg')
 
868
  drug_library = gr.Dropdown(label='Step 3. Select or Upload a Compound Library',
869
  choices=list(DRUG_LIBRARY_MAP.keys()))
870
  with gr.Row():
871
+ gr.File(label='Example SDF Compound Library',
872
  value='data/examples/compound_library.sdf', interactive=False)
873
+ gr.File(label='Example CSV Compound Library',
874
  value='data/examples/compound_library.csv', interactive=False)
875
  drug_library_upload_btn = gr.UploadButton(
876
  label='Upload a custom library', variant='primary')
 
918
  <center>
919
  To predict interactions/binding affinities of a single compound against a library of protein targets.
920
  </center>
 
 
 
 
 
 
 
 
 
 
 
 
 
921
  ''')
922
  with gr.Blocks() as identify_block:
923
  with gr.Column() as identify_page:
 
958
  target_library = gr.Dropdown(label='Step 3. Select or Upload a Target Library',
959
  choices=list(TARGET_LIBRARY_MAP.keys()))
960
  with gr.Row():
961
+ gr.File(label='Example FASTA Target Library',
962
  value='data/examples/target_library.fasta', interactive=False)
963
+ gr.File(label='Example CSV Target Library',
964
  value='data/examples/target_library.csv', interactive=False)
965
  target_library_upload_btn = gr.UploadButton(
966
  label='Upload a custom library', variant='primary')
 
1003
  gr.Markdown('''
1004
  # <center>DeepSEQreen Interaction Pair Inference</center>
1005
  <center>To predict interactions/binding affinities between any compound-protein pairs.</center>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1006
  ''')
1007
  with gr.Blocks() as infer_block:
1008
  with gr.Column() as infer_page:
1009
+ infer_type = gr.Dropdown(choices=['Upload a CSV interaction pair dataset',
1010
+ 'Upload a compound library and a target library'],
1011
+ label='Step 1. Select Pair Input Type and Input',
1012
+ value='Upload a CSV interaction pair dataset')
1013
  with gr.Column() as pair_upload:
1014
+ with gr.Row():
1015
+ gr.File(label="Example custom dataset",
1016
+ value="data/examples/interaction_pair_inference.csv",
1017
+ interactive=False)
1018
+ with gr.Row():
1019
  infer_data_for_predict = gr.File(
1020
+ label='Upload a Custom Dataset', file_count="single", type='filepath', visible=True)
1021
  with gr.Column() as pair_generate:
1022
  with gr.Row():
1023
+ gr.File(label='Example SDF Compound Library',
1024
  value='data/examples/compound_library.sdf', interactive=False)
1025
+ gr.File(label='Example FASTA Target Library',
1026
  value='data/examples/target_library.fasta', interactive=False)
1027
  with gr.Row():
1028
+ gr.File(label='Example CSV Compound Library',
1029
  value='data/examples/compound_library.csv', interactive=False)
1030
+ gr.File(label='Example CSV Target Library',
1031
  value='data/examples/target_library.csv', interactive=False)
1032
  with gr.Row():
1033
+ infer_drug = gr.File(label='SDF/CSV File Containing Multiple Compounds',
1034
  file_count="single", type='filepath')
1035
+ infer_target = gr.File(label='FASTA/CSV File Containing Multiple Targets',
1036
  file_count="single", type='filepath')
1037
 
1038
+ with gr.Row():
1039
+ with gr.Column():
1040
+ HelpTip(
1041
+ "By default, models trained on all protein families (general) will be applied."
1042
+ "If the proteins in the target library of interest all belong to the same protein family, manually selecting the family is supported."
1043
+ )
1044
+ pair_infer_target_family = gr.Dropdown(choices=list(TARGET_FAMILY_MAP.keys()),
1045
+ value='General',
1046
+ label='Step 2. Select Target Protein Family (Optional)')
1047
 
1048
+ with gr.Row():
1049
+ with gr.Column():
1050
+ HelpTip(
1051
+ "Interaction prediction provides you binding probability score between the target of interest and each compound in the library,"
1052
+ "while affinity prediction directly estimates their binding strength measured using IC50."
1053
+ )
1054
+ pair_infer_task = gr.Dropdown(list(TASK_MAP.keys()),
1055
+ label='Step 3. Select a Prediction Task',
1056
+ value='Compound-protein interaction')
1057
+
1058
+ with gr.Row():
1059
+ with gr.Column():
1060
+ HelpTip("Select your preferred model, or click Recommend for the best-performing model based on the selected task, family, and random splitting validation."
1061
+ "Please refer to documentation for detailed benchamrk results."
1062
+ )
1063
+ pair_infer_preset = gr.Dropdown(list(PRESET_MAP.keys()), label='Step 4. Select a Preset Model')
1064
+ infer_preset_recommend_btn = gr.Button(value='Recommend a model', variant='primary')
1065
+
1066
+
1067
+ with gr.Row():
1068
+ pair_infer_email = gr.Textbox(
1069
+ label='Step 5. Email (Optional)',
1070
+ info="If an email is provided, a notification email will be sent to you when your job is completed."
1071
+ )
1072
 
1073
  with gr.Row(visible=True):
1074
  # pair_infer_clr_btn = gr.ClearButton(size='lg')