# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import pandas as pd
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))

gsea_file = pd.read_csv('GSEA_/1/gseapy.gsea.gene_set.report.csv').iloc[:,:-3]
fullname_list = []
ID_list = []
for i in gsea_file['Term'].iteritems():
    i = i[1].split(" ")
    full_name = i[:-3]
    ID = i[-1:]
    full_name = " ".join(full_name)
    fullname_list.append(full_name)
    ID_list.append(ID[0])
full_name_series = pd.Series(fullname_list, name="name")
ID_series = pd.Series(ID_list, name="ID")
complete_reactome = pd.concat([ID_series, full_name_series], axis=1)
complete_reactome = complete_reactome.set_index('ID')

complete_reactome

complete_reactome.to_csv("../data/GSEA_reactome.csv")

StarcoderdataJupyterScriptsDedupFiltered