BioinfoMachineLearning / DeepInteract

A geometric deep learning pipeline for predicting protein interface contacts. (ICLR 2022)
https://zenodo.org/record/6671582
GNU General Public License v3.0
62 stars 11 forks source link

[Doc] Documentation Confusion #6

Closed XuBlack closed 3 years ago

XuBlack commented 3 years ago

In project/utils/deepinteract_utils.py line 378, the function description about convert_df_to_dgl_graph says that it will return edata['w'] and edata['a'] and in line 860 edata['w'] and edata['a'] are used, but the function convert_df_to_dgl_graph doesn't generate the two parameters.

amorehead commented 3 years ago

@XuBlack,

Thank you for pointing this out! You are correct that there is a discrepancy between what line 378 describes for the edge features and what line 860 references. Line 860 refers to a deprecated way of storing DGLGraphs for each protein complex (for which the argument use_dgl would be set to False). Your issue here on GitHub has reminded me to remove this portion of logic from the repository as it was not ultimately used (see our latest release).

In addition, I have updated the documentation for the function convert_df_to_dgl_graph to read as follows. My hope is that its behavior is much clearer (and more up-to-date) now.

r""" Transform a given DataFrame of residues into a corresponding DGL graph.

    Parameters
    ----------
    df : pandas.DataFrame
    input_file : str
    knn : int
    geo_nbrhd_size : int
    self_loops : bool

    Returns
    -------
    :class:`dgl.DGLGraph`

        Graph structure, feature tensors for each node and edge.

...     node_feats = graph.ndata['f']
...     node_coords = graph.ndata['x']
...     edge_feats = graph.edata['f']

        - ``ndata['f']``: feature tensors of the nodes
                            Indices:
                            'node_pos_enc': 0,
                            'node_geo_feats_start': 1,
                            'node_geo_feats_end': 7,
                            'node_dips_plus_feats_start': 7,
                            'node_dips_plus_feats_end': 113,
        - ``ndata['x']:`` Cartesian coordinate tensors of the nodes
        - ``edata['f']``: feature tensors of the edges
                            Indices:
                            'edge_pos_enc': 0,
                            'edge_weights': 1,
                            'edge_dist_feats_start': 2,
                            'edge_dist_feats_end': 20,
                            'edge_dir_feats_start': 20,
                            'edge_dir_feats_end': 23,
                            'edge_orient_feats_start': 23,
                            'edge_orient_feats_end': 27,
                            'edge_amide_angles': 27
        - ``edata['src_nbr_e_ids']``: For edge e, integer IDs of incident edges connected to e's source node
        - ``edata['dst_nbr_e_ids']``: For edge e, integer IDs of incident edges connected to e's destination node
    """
amorehead commented 3 years ago

@XuBlack, If you have any more questions, please feel free to reopen this issue. Thanks.