Пример #1
0
 def load_data(self):
     edgelist = pd.read_csv(self.benchmark, header=None, sep="\t").values.tolist()
     self.nx_graph = nx.OrderedGraph(edgelist)
     # Map nodes from ncbi to hugo names
     self.nx_graph = nx.relabel.relabel_nodes(self.nx_graph, ncbi_to_hugo_map(self.nx_graph.nodes, datastore=self.datastore))
     # Remove nodes which are not covered by the map
     for node in list(self.nx_graph.nodes):
         if isinstance(node, int):
             self.nx_graph.remove_node(node)
Пример #2
0
 def load_data(self):
     self.benchmark = self.datastore + "/graphs/HumanNet-XN.tsv"
     edgelist = pd.read_csv(self.benchmark, header=None, sep="\t", skiprows=1).values[:, :2].tolist()
     self.nx_graph = nx.OrderedGraph(edgelist)
     # Map nodes from ncbi to hugo names
     self.nx_graph = nx.relabel.relabel_nodes(self.nx_graph, ncbi_to_hugo_map(self.nx_graph.nodes, datastore=self.datastore))
     # Remove nodes which are not covered by the map
     for node in list(self.nx_graph.nodes):
         if isinstance(node, float):
             self.nx_graph.remove_node(node)