tumourkit.utils.preprocessing.read_graph

tumourkit.utils.preprocessing.read_graph(name: str, graph_dir: str) DataFrame

Reads a graph in CSV format from the specified directory and returns it as a Pandas DataFrame.

Parameters:
  • name (str) – The base name of the graph file (without extension).

  • graph_dir (str) – The directory containing the graph file.

Returns:

The graph nodes as a Pandas DataFrame.

Return type:

pd.DataFrame or None

This function reads a graph in CSV format from the specified directory and returns it as a Pandas DataFrame. The function expects the graph file to have a specific filename format: ‘<name>.nodes.csv’. If the function is unable to read the file or encounters an error, it returns None.