def build_database(manager: pybel.Manager, annotation_url: Optional[str] = None) -> None:
annotation_url = annotation_url or NEUROMMSIG_DEFAULT_URL<EOL>annotation = manager.get_namespace_by_url(annotation_url)<EOL>if annotation is None:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>networks = get_networks_using_annotation(manager, annotation)<EOL>dtis = ...<EOL>for network in networks:<EOL><INDENT>graph = network.as_bel()<EOL>scores = epicom_on_graph(graph, dtis)<EOL>for (drug_name, subgraph_name), score in scores.items():<EOL><INDENT>drug_model = get_drug_model(manager, drug_name)<EOL>subgraph_model = manager.get_annotation_entry(annotation_url, subgraph_name)<EOL>score_model = Score(<EOL>network=network,<EOL>annotation=subgraph_model,<EOL>drug=drug_model,<EOL>score=score<EOL>)<EOL>manager.session.add(score_model)<EOL><DEDENT><DEDENT>t = time.time()<EOL>logger.info('<STR_LIT>')<EOL>manager.session.commit()<EOL>logger.info('<STR_LIT>', time.time() - t)<EOL>
Build a database of scores for NeuroMMSig annotated graphs.

    1. Get all networks that use the Subgraph annotation
    2. run on each