| 45 | |
| 46 | |
| 47 | def graph_concat(graphs): |
| 48 | if len(graphs) == 1: |
| 49 | return graphs[0] |
| 50 | graph = graphs[0].pack(graphs) |
| 51 | if isinstance(graph, data.Protein): |
| 52 | # residue graph |
| 53 | _graph = data.Protein(edge_list=graph.edge_list, atom_type=graph.atom_type, bond_type=graph.bond_type, |
| 54 | residue_type=graph.residue_type, atom_name=graph.atom_name, atom2residue=graph.atom2residue, |
| 55 | residue_feature=graph.residue_feature, b_factor=graph.b_factor, bond_feature=None, |
| 56 | node_position=graph.node_position, num_node=graph.num_atom, num_residue=graph.num_residue, |
| 57 | ) |
| 58 | else: |
| 59 | # surface graph |
| 60 | _graph = data.Graph(edge_list=graph.edge_list, num_node=graph.num_node, num_relation=1) |
| 61 | with _graph.node(): |
| 62 | _graph.node_position = graph.node_position |
| 63 | _graph.node_feature = graph.node_feature |
| 64 | _graph.normals = graph.normals |
| 65 | return _graph |
| 66 | |
| 67 | |
| 68 | def get_optimal_window(mutation_position_relative, seq_len_wo_special, model_window): |