Spaces:
Sleeping
Sleeping
File size: 3,288 Bytes
fbc2291 41a03fb fbc2291 b64cfbe fbc2291 b64cfbe fbc2291 b64cfbe fbc2291 b64cfbe fbc2291 b64cfbe fbc2291 b64cfbe fbc2291 41a03fb b64cfbe fbc2291 41a03fb b64cfbe fbc2291 41a03fb b64cfbe fbc2291 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
from mammal_demo.demo_framework import (
ModelRegistry,
TaskRegistry,
)
from mammal_demo.dti_task import DtiTask
from mammal_demo.ppi_task import PpiTask
from mammal_demo.ps_task import PsTask
from mammal_demo.tcr_task import TcrTask
from mammal_demo.molnet_task import MolnetTask
def tasks_and_models():
all_tasks = TaskRegistry()
all_models = ModelRegistry()
# first create the required tasks
# Note that the tasks need access to the models, as the model to use depends on the state of the widget
# we pass the all_models dict and update it when we actualy have the models.
ppi_task_name = all_tasks.register_task(PpiTask(model_dict=all_models))
tdi_task_name = all_tasks.register_task(DtiTask(model_dict=all_models))
ps_task_name = all_tasks.register_task(PsTask(model_dict=all_models))
tcr_task_name = all_tasks.register_task(TcrTask(model_dict=all_models))
bbbp_task = MolnetTask(model_dict=all_models,task_name="BBBP", name= "Blood-Brain Barrier Penetration")
bbbp_task.markup_text = """
# Mammal based small molecule blood-brain barrier penetration demonstration
Given a drug (in SMILES), estimate the likelihood that it will penetrate the Blood-Brain Barrier.
"""
bbbp_task_name = all_tasks.register_task(bbbp_task)
toxicity_task = MolnetTask(model_dict=all_models,task_name="TOXICITY", name= "Drug Toxicity Trials Failer")
toxicity_task.markup_text = """
# Mammal based small molecule toxicity trials failer estimation demonstration
Given a drug (in SMILES), estimate the likelihood that it will fail in clinical toxicity trials.
"""
toxicity_task_name = all_tasks.register_task(toxicity_task)
fda_appr_task=MolnetTask(model_dict=all_models,task_name="FDA_APPR", name="drug FDA approval demonstration")
fda_appr_task.markup_text = """
# Mammal based small molecule drug FDA approval demonstration
Given a drug (in SMILES), estimate the likelihood that it will be approved by the FDA.
"""
fda_appr_task_name = all_tasks.register_task(fda_appr_task)
# create the model holders. hold the model and the tokenizer, lazy download
# note that the list of relevent tasks needs to be stated.
all_models.register_model(
model_path="ibm/biomed.omics.bl.sm.ma-ted-458m.dti_bindingdb_pkd",
task_list=[tdi_task_name],
)
all_models.register_model(
model_path="ibm/biomed.omics.bl.sm.ma-ted-458m.dti_bindingdb_pkd_peer",
task_list=[tdi_task_name],
)
all_models.register_model(
model_path="ibm/biomed.omics.bl.sm.ma-ted-458m.tcr_epitope_bind",
task_list=[tcr_task_name],
)
all_models.register_model(
model_path="ibm/biomed.omics.bl.sm.ma-ted-458m.protein_solubility",
task_list=[ps_task_name],
)
all_models.register_model(
model_path="ibm/biomed.omics.bl.sm.ma-ted-458m",
task_list=[ppi_task_name],
)
all_models.register_model(
"ibm/biomed.omics.bl.sm.ma-ted-458m.moleculenet_clintox_tox",
task_list=[toxicity_task_name]
)
all_models.register_model(
"ibm/biomed.omics.bl.sm.ma-ted-458m.moleculenet_clintox_fda",
task_list=[fda_appr_task_name]
)
all_models.register_model(
"ibm/biomed.omics.bl.sm.ma-ted-458m.moleculenet_bbbp",
task_list=[bbbp_task_name],
)
return all_tasks,all_models
|