def bel_to_spia_matrices(graph: BELGraph) -> Mapping[str, pd.DataFrame]:
index_nodes = get_matrix_index(graph)<EOL>spia_matrices = build_spia_matrices(index_nodes)<EOL>for u, v, edge_data in graph.edges(data=True):<EOL><INDENT>if isinstance(u, CentralDogma) and isinstance(v, CentralDogma):<EOL><INDENT>update_spia_matrices(spia_matrices, u, v, edge_data)<EOL><DEDENT>elif isinstance(u, CentralDogma) and isinstance(v, ListAbundance):<EOL><INDENT>for node in v.members:<EOL><INDENT>if not isinstance(node, CentralDogma):<EOL><INDENT>continue<EOL><DEDENT>update_spia_matrices(spia_matrices, u, node, edge_data)<EOL><DEDENT><DEDENT>elif isinstance(u, ListAbundance) and isinstance(v, CentralDogma):<EOL><INDENT>for node in u.members:<EOL><INDENT>if not isinstance(node, CentralDogma):<EOL><INDENT>continue<EOL><DEDENT>update_spia_matrices(spia_matrices, node, v, edge_data)<EOL><DEDENT><DEDENT>elif isinstance(u, ListAbundance) and isinstance(v, ListAbundance):<EOL><INDENT>for sub_member, obj_member in product(u.members, v.members):<EOL><INDENT>if isinstance(sub_member, CentralDogma) and isinstance(obj_member, CentralDogma):<EOL><INDENT>update_spia_matrices(spia_matrices, sub_member, obj_member, edge_data)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return spia_matrices<EOL>
Create an excel sheet ready to be used in SPIA software.

    :param graph: BELGraph
    :return: dictionary with matrices