networkcommons.data.omics.convert_ensembl_to_gene_symbol

networkcommons.data.omics.convert_ensembl_to_gene_symbol(dataframe, equivalence_df, column_name='idx', summarisation=<built-in function max>)

Converts Ensembl IDs to gene symbols using an equivalence dataframe, handles partial matches, and summarizes duplicated entries by taking the maximum value.

Parameters:
  • dataframe (pd.DataFrame) – The input dataframe with Ensembl IDs.

  • equivalence_df (pd.DataFrame) – The equivalence dataframe with Ensembl IDs as index and gene symbols.

  • get_ensembl_mappings(). (You can either use a custom one or use the one retrieved by)

  • column_name (str) – The name of the column containing Ensembl IDs in the input dataframe.

  • summarisation (function) – The method to summarize duplicated entries.

Returns:

The dataframe with gene symbols and summarized duplicated entries.

Return type:

pd.DataFrame