code: def bioSnapFFToNx(nodef, naIdx, edgef, eaIdx):
      dicty = {
          "cellular_component": 0,
          "biological_process": 1.0,
          "molecular_function": 2.0,
      }
      f = open(nodef, "r")
      nodetups = []
      nodes = f.readlines()
      lbls = nodes[0].split("\t")
      nodes = nodes[1:]
      nodeAttr = lbls[naIdx]
      for node in nodes:
          node = node.split("\t")
          if node[naIdx] in dicty.keys():
              nodetups.append(
                  (node[0], {nodeAttr: dicty[node[naIdx]], "sample": 1})
              )
      f.close()
      G = nx.DiGraph()
      G.add_nodes_from(nodetups)
      f = open(edgef, "r")
      edgetups = []
      edges = f.readlines()
      lbls = edges[0].replace("\n", "").split("\t")
      edges = edges[1:]
      dictt = {
          "is_a": 0,
          "alt_id": 1,
          "disjoint_from": 2,
          "consider": 3,
          "intersection_of": 4,
          "relationship": 5,
      }
      edgeAttr = lbls[eaIdx]
      for edge in edges:
          edge = edge.replace("\n", "").split("\t")
          if (
              G.has_node(edge[0])
              and G.has_node(edge[1])
              and edge[eaIdx] in dictt.keys()
          ):
              edgetups.append(
                  (edge[0], edge[1], {edgeAttr: dictt[edge[eaIdx]]})
              )
      G.add_edges_from(edgetups)
      return G
  
file_path: deepsnap/examples/bio_application/converter.py
imports: import pandas
  import networkx
  import torch
  import torch_geometric.data
  import torch_geometric.utils
label_desc: Use image node_id 2 for calling a global function with example usage: bioSnapFFToNx(nodef, naIdx, edgef, eaIdx) and returns: G