{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "khIVUKYz-zU6" }, "source": [ "# Labeling factor analysis outputs" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "id": "Fuf_PDQt-toU" }, "outputs": [], "source": [ "import cytopus as cp\n", "import pandas as pd\n", "import scanpy as sc" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "YZwUDe1R-71b", "outputId": "28aa9399-2f23-497d-f21c-2762de667309" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "KnowledgeBase object containing 92 cell types and 201 cellular processes\n", "\n" ] } ], "source": [ "G = cp.KnowledgeBase()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## write files required to re-build cytopus KnowledgeBase to .csv" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "#write cell type hierarchy\n", "cp.tl.hierarchy_to_csv(G.get_celltype_hierarchy(),filename='hierarchy.csv',header_name=['Parent','Child'])" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "#write cellular processes\n", "cp.tl.geneset_to_csv(G.processes, filename='processes.csv', header_name=['gene_set_name','gene_name'])" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "#write cellular processes\n", "cp.tl.geneset_to_csv(G.identities, filename='identities.csv', header_name=['gene_set_name','gene_name'])" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "#write metadata to csv \n", "#current cellular processes have no 'class' attribute, this will be fixed in future versions\n", "cp.tl.metadata_to_csv(G.graph, 'metadata.csv', specific_class = False, class_value=None)" ] }, { "cell_type": "markdown", "metadata": { "id": "HIRXO2xb-4Ys" }, "source": [ "## Export gene sets from KnowledgeBase as .gmt files" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "id": "LPqmhww5-11Z" }, "outputs": [], "source": [ "#get cellular processes\n", "gp_dict = G.processes" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "id": "XcpNLfAp_MjG" }, "outputs": [], "source": [ "#get cellular identities\n", "cell_dict = G.identities" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "-w2NOUcD_WjD", "outputId": "b9fda006-78f1-4cba-eea2-d6e456c8f6ce" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "print saving to: cell_identities.gmt\n", "print saving to: cellular_processes.gmt\n" ] } ], "source": [ "#save to gmt files\n", "cp.label.get_gmt(cell_dict,save=True,path='cell_identities.gmt')\n", "cp.label.get_gmt(gp_dict,save=True,path='cellular_processes.gmt')" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "LA9r0ZVh_Z-_", "outputId": "5cb013fd-5947-4ed9-abdc-fe5bf3754eb2" }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
12345678910...24252627282930313233
0
TCMS1PR4CD27CXCR3CD58CD44S1PR1IL7RCCR7ITGALCD28...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
TregENTPD1IL2RATGFB1NT5ETNFRSF9TNFRSF18FOXP3CTLA4NaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
T-naiveS1PR4CD28S1PR1IL7RCD27CCR7SELLNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-pb-t2IGHMCR2JCHAINFCER2PRSS3MMECD38CD24IL10IGHD...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
endo-lymphaticPKHD1L1MMRN1FLT4TFF3SEMA3DTBX1PROX1RELNLINC02147TM4SF18...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
TSCMCD28ATXN1SELLCD27FASIL2RBCCR7IL7RNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
cDC1DPP4CLEC9ATHBDCD8ABTLAIRF8XCR1ID2CADM1CD226...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
ILC1KLRB1IL1R1IL1R2IL12RB1NCR3TNFRSF10ACXCR3NaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
NK-adaptiveFCGR3ANCAM1KLRC2CD2LILRB1IFNGB3GAT1NaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
TEMCD28B3GAT1IL7RCD27FASCD58ITGALIL2RBCD44NaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
FDCMFGE8FDCSPCR2CR1NaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
endo-systemic-venousIGFBP7BMPR2ESAMVWFAQP1EBF1ZNF385DPCDH17LIMS2IFI27...PDE7BCLEC14ASLCO2A1TSHZ2MCTP1COL15A1NaNNaNNaNNaN
endo-aerocyteIFI27CA4EXPH5FLT1B3GALNT1ITM2APCDH17HPGDAFF3ESAM...ADGRL2CYP3A5ADGRF5RCSD1KIAA1217PRKG1ENGSOSTDC1SHROOM4RGCC
CD56bright-NKNCR1ITGA5KLRF1IL7RCCR7NCR3KLRG1KLRC1IFNGKLRK1...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
plasma-blastXBP1IL6RAZBTB20TNFRSF17IL6STCXCR4IRF4HLA-DPB1HLA-DQB1HLA-DQA1...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
CD8-T_KLRG1pos-effectorITGALIFNGGZMBFASCD58IL2RBB3GAT1KLRG1CD44NaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
p-DCFCER1GCLEC4CIRF4NRP1ZEB2IRF7IL3RATCF4IRF8LILRB4...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
mastKITTPSB2ENPP3MS4A2TPSD1PTGDRGATA2HDCIL1RL1TPSAB1...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-memory-DNJCHAINIGHA1IGHMIGHA2IGHG1IGHG3IGHG2IGHG4FCRL5ITGAX...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-naiveCCR7CD40SELLIGHDNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
CD4-TIL17ARORCIL6CD4BCL6IL21IL17BCD40LGICOSGATA3...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-pb-t3PRSS3IGHDCD24CD38IL10NaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
BCD79ACD79BCD19MS4A1NaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-pb-matureIGHDCD38CD80CD69FCER2CD24CD86NaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
MacMARCOCD36MSR1CD68APOEMRC1CD163NaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
granCXCR2CSF3RACOD1CEACAM8FFAR4MPOCD24CTSGFUT4LTF...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
cDC2CD33ID2CD2LILRA2IL23ACLEC10AIRF4FCER1GCD1CFCER1A...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
CD56dim-NKCXCR1CXCR2KLRK1GZMBKLRG1EOMESITGA5GZMAKLRF1NCR1...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
TRMCD69ITGAEITGALCD44NaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
LtiRORCIL7RIL1R2TNFSF11KITCCR6IL23RIL1R1AHRNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
ILC3-NCRposKLRB1IL23RAHRKITIL1R2RORCICOSIL7RTNFSF11NCR2...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
abTCD3ECD3DCD3GNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
TFHIL6CD84S1PR1IL21RCXCR5BCL6IL21STAT3NaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
monoFCGR1BFCGR2AFCGR2BFCGR1ATLR2CR1ITGAMSPI1RXRACD14...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
CD8-T_KLRG1neg-effectorIL2RBITGALB3GAT1CD44IL7RCD58IFNGFASGZMBNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-memory-IgM-MZDTX1CD1DNOTCH2JCHAINCD1CCD24IGHMNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
cDC3TNFSF18CD14FSCN1IL15CCR7CD86LAMP3CD1CCCL22CD163...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-memory-switchedIGHMIGHG3IGHA2IGHG2JCHAINIGHA1IGHG1IGHG4CD24CD38...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
ILC3-NCRnegKLRB1IL7RIL1R2IL23RKITTNFSF11RORCAHRNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
LangerhansCDH1EPCAMTGFBR3CD1ARUNX3TACSTD2ID2LILRA4CD207TGFBR1...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
mo-DCCD1CMAFBITGAXFCGR1ACD209CD1AS100A8SIRPAS100A9KLF4...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
endo-arterialCLEC14ACLDN10ITM2AEPAS1LTBP4CXCL12DKK2HEY1IGFBP3SHROOM4...LIMS2ENGADGRL4NaNNaNNaNNaNNaNNaNNaN
ILC2PTGDR2KLRB1AHRIL7RIL17RBCCR4GATA3ICOSIL2RAKLRG1...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
plasmaIL6STIL6RAZBTB20TNFRSF17IRF4PRDM1XBP1ENPP1IL6RHLA-DMA...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-pb-t1IGHMJCHAINIL10CD38PRSS3CD24MMENaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
lung-endo-venousBMPR2MMRN1EFEMP1MCTP1CDH11PTGS1PLATCLUACKR1DKK3...ITM2APDZRN4ADGRL4IGFBP7SHROOM4IFI27VWFNaNNaNNaN
gdTTRGC2IL17FTRDCIL17BTRGC1IL17ANaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
NKKLRK1NCR3IL12RB1KLRF1NCAM1EOMESNCR1KLRG1TBX21NaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
capillaryADGRF5IL18R1CD36SLCO2A1NRXN3RGCCESAMFLT1BTNL9CLEC14A...IFI27AFF3ENGFCN3NaNNaNNaNNaNNaNNaN
CD8-TTRBC1TRACTRBC2GZMBPRF1GZMAEOMESCD8ACD8BNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-memoryCXCR3CD24CD27NaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
B-memory-non-switchedIGHMJCHAINCD1CCD38CD24IGHDCD27NaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
GC-BLTACXCL13BCL6TCF3CD38TLR4MKI67AICDANaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", "

53 rows × 33 columns

\n", "
" ], "text/plain": [ " 1 2 3 4 5 \\\n", "0 \n", "TCM S1PR4 CD27 CXCR3 CD58 CD44 \n", "Treg ENTPD1 IL2RA TGFB1 NT5E TNFRSF9 \n", "T-naive S1PR4 CD28 S1PR1 IL7R CD27 \n", "B-pb-t2 IGHM CR2 JCHAIN FCER2 PRSS3 \n", "endo-lymphatic PKHD1L1 MMRN1 FLT4 TFF3 SEMA3D \n", "TSCM CD28 ATXN1 SELL CD27 FAS \n", "cDC1 DPP4 CLEC9A THBD CD8A BTLA \n", "ILC1 KLRB1 IL1R1 IL1R2 IL12RB1 NCR3 \n", "NK-adaptive FCGR3A NCAM1 KLRC2 CD2 LILRB1 \n", "TEM CD28 B3GAT1 IL7R CD27 FAS \n", "FDC MFGE8 FDCSP CR2 CR1 NaN \n", "endo-systemic-venous IGFBP7 BMPR2 ESAM VWF AQP1 \n", "endo-aerocyte IFI27 CA4 EXPH5 FLT1 B3GALNT1 \n", "CD56bright-NK NCR1 ITGA5 KLRF1 IL7R CCR7 \n", "plasma-blast XBP1 IL6RA ZBTB20 TNFRSF17 IL6ST \n", "CD8-T_KLRG1pos-effector ITGAL IFNG GZMB FAS CD58 \n", "p-DC FCER1G CLEC4C IRF4 NRP1 ZEB2 \n", "mast KIT TPSB2 ENPP3 MS4A2 TPSD1 \n", "B-memory-DN JCHAIN IGHA1 IGHM IGHA2 IGHG1 \n", "B-naive CCR7 CD40 SELL IGHD NaN \n", "CD4-T IL17A RORC IL6 CD4 BCL6 \n", "B-pb-t3 PRSS3 IGHD CD24 CD38 IL10 \n", "B CD79A CD79B CD19 MS4A1 NaN \n", "B-pb-mature IGHD CD38 CD80 CD69 FCER2 \n", "Mac MARCO CD36 MSR1 CD68 APOE \n", "gran CXCR2 CSF3R ACOD1 CEACAM8 FFAR4 \n", "cDC2 CD33 ID2 CD2 LILRA2 IL23A \n", "CD56dim-NK CXCR1 CXCR2 KLRK1 GZMB KLRG1 \n", "TRM CD69 ITGAE ITGAL CD44 NaN \n", "Lti RORC IL7R IL1R2 TNFSF11 KIT \n", "ILC3-NCRpos KLRB1 IL23R AHR KIT IL1R2 \n", "abT CD3E CD3D CD3G NaN NaN \n", "TFH IL6 CD84 S1PR1 IL21R CXCR5 \n", "mono FCGR1B FCGR2A FCGR2B FCGR1A TLR2 \n", "CD8-T_KLRG1neg-effector IL2RB ITGAL B3GAT1 CD44 IL7R \n", "B-memory-IgM-MZ DTX1 CD1D NOTCH2 JCHAIN CD1C \n", "cDC3 TNFSF18 CD14 FSCN1 IL15 CCR7 \n", "B-memory-switched IGHM IGHG3 IGHA2 IGHG2 JCHAIN \n", "ILC3-NCRneg KLRB1 IL7R IL1R2 IL23R KIT \n", "Langerhans CDH1 EPCAM TGFBR3 CD1A RUNX3 \n", "mo-DC CD1C MAFB ITGAX FCGR1A CD209 \n", "endo-arterial CLEC14A CLDN10 ITM2A EPAS1 LTBP4 \n", "ILC2 PTGDR2 KLRB1 AHR IL7R IL17RB \n", "plasma IL6ST IL6RA ZBTB20 TNFRSF17 IRF4 \n", "B-pb-t1 IGHM JCHAIN IL10 CD38 PRSS3 \n", "lung-endo-venous BMPR2 MMRN1 EFEMP1 MCTP1 CDH11 \n", "gdT TRGC2 IL17F TRDC IL17B TRGC1 \n", "NK KLRK1 NCR3 IL12RB1 KLRF1 NCAM1 \n", "capillary ADGRF5 IL18R1 CD36 SLCO2A1 NRXN3 \n", "CD8-T TRBC1 TRAC TRBC2 GZMB PRF1 \n", "B-memory CXCR3 CD24 CD27 NaN NaN \n", "B-memory-non-switched IGHM JCHAIN CD1C CD38 CD24 \n", "GC-B LTA CXCL13 BCL6 TCF3 CD38 \n", "\n", " 6 7 8 9 10 \\\n", "0 \n", "TCM S1PR1 IL7R CCR7 ITGAL CD28 \n", "Treg TNFRSF18 FOXP3 CTLA4 NaN NaN \n", "T-naive CCR7 SELL NaN NaN NaN \n", "B-pb-t2 MME CD38 CD24 IL10 IGHD \n", "endo-lymphatic TBX1 PROX1 RELN LINC02147 TM4SF18 \n", "TSCM IL2RB CCR7 IL7R NaN NaN \n", "cDC1 IRF8 XCR1 ID2 CADM1 CD226 \n", "ILC1 TNFRSF10A CXCR3 NaN NaN NaN \n", "NK-adaptive IFNG B3GAT1 NaN NaN NaN \n", "TEM CD58 ITGAL IL2RB CD44 NaN \n", "FDC NaN NaN NaN NaN NaN \n", "endo-systemic-venous EBF1 ZNF385D PCDH17 LIMS2 IFI27 \n", "endo-aerocyte ITM2A PCDH17 HPGD AFF3 ESAM \n", "CD56bright-NK NCR3 KLRG1 KLRC1 IFNG KLRK1 \n", "plasma-blast CXCR4 IRF4 HLA-DPB1 HLA-DQB1 HLA-DQA1 \n", "CD8-T_KLRG1pos-effector IL2RB B3GAT1 KLRG1 CD44 NaN \n", "p-DC IRF7 IL3RA TCF4 IRF8 LILRB4 \n", "mast PTGDR GATA2 HDC IL1RL1 TPSAB1 \n", "B-memory-DN IGHG3 IGHG2 IGHG4 FCRL5 ITGAX \n", "B-naive NaN NaN NaN NaN NaN \n", "CD4-T IL21 IL17B CD40LG ICOS GATA3 \n", "B-pb-t3 NaN NaN NaN NaN NaN \n", "B NaN NaN NaN NaN NaN \n", "B-pb-mature CD24 CD86 NaN NaN NaN \n", "Mac MRC1 CD163 NaN NaN NaN \n", "gran MPO CD24 CTSG FUT4 LTF \n", "cDC2 CLEC10A IRF4 FCER1G CD1C FCER1A \n", "CD56dim-NK EOMES ITGA5 GZMA KLRF1 NCR1 \n", "TRM NaN NaN NaN NaN NaN \n", "Lti CCR6 IL23R IL1R1 AHR NaN \n", "ILC3-NCRpos RORC ICOS IL7R TNFSF11 NCR2 \n", "abT NaN NaN NaN NaN NaN \n", "TFH BCL6 IL21 STAT3 NaN NaN \n", "mono CR1 ITGAM SPI1 RXRA CD14 \n", "CD8-T_KLRG1neg-effector CD58 IFNG FAS GZMB NaN \n", "B-memory-IgM-MZ CD24 IGHM NaN NaN NaN \n", "cDC3 CD86 LAMP3 CD1C CCL22 CD163 \n", "B-memory-switched IGHA1 IGHG1 IGHG4 CD24 CD38 \n", "ILC3-NCRneg TNFSF11 RORC AHR NaN NaN \n", "Langerhans TACSTD2 ID2 LILRA4 CD207 TGFBR1 \n", "mo-DC CD1A S100A8 SIRPA S100A9 KLF4 \n", "endo-arterial CXCL12 DKK2 HEY1 IGFBP3 SHROOM4 \n", "ILC2 CCR4 GATA3 ICOS IL2RA KLRG1 \n", "plasma PRDM1 XBP1 ENPP1 IL6R HLA-DMA \n", "B-pb-t1 CD24 MME NaN NaN NaN \n", "lung-endo-venous PTGS1 PLAT CLU ACKR1 DKK3 \n", "gdT IL17A NaN NaN NaN NaN \n", "NK EOMES NCR1 KLRG1 TBX21 NaN \n", "capillary RGCC ESAM FLT1 BTNL9 CLEC14A \n", "CD8-T GZMA EOMES CD8A CD8B NaN \n", "B-memory NaN NaN NaN NaN NaN \n", "B-memory-non-switched IGHD CD27 NaN NaN NaN \n", "GC-B TLR4 MKI67 AICDA NaN NaN \n", "\n", " ... 24 25 26 27 28 \\\n", "0 ... \n", "TCM ... NaN NaN NaN NaN NaN \n", "Treg ... NaN NaN NaN NaN NaN \n", "T-naive ... NaN NaN NaN NaN NaN \n", "B-pb-t2 ... NaN NaN NaN NaN NaN \n", "endo-lymphatic ... NaN NaN NaN NaN NaN \n", "TSCM ... NaN NaN NaN NaN NaN \n", "cDC1 ... NaN NaN NaN NaN NaN \n", "ILC1 ... NaN NaN NaN NaN NaN \n", "NK-adaptive ... NaN NaN NaN NaN NaN \n", "TEM ... NaN NaN NaN NaN NaN \n", "FDC ... NaN NaN NaN NaN NaN \n", "endo-systemic-venous ... PDE7B CLEC14A SLCO2A1 TSHZ2 MCTP1 \n", "endo-aerocyte ... ADGRL2 CYP3A5 ADGRF5 RCSD1 KIAA1217 \n", "CD56bright-NK ... NaN NaN NaN NaN NaN \n", "plasma-blast ... NaN NaN NaN NaN NaN \n", "CD8-T_KLRG1pos-effector ... NaN NaN NaN NaN NaN \n", "p-DC ... NaN NaN NaN NaN NaN \n", "mast ... NaN NaN NaN NaN NaN \n", "B-memory-DN ... NaN NaN NaN NaN NaN \n", "B-naive ... NaN NaN NaN NaN NaN \n", "CD4-T ... NaN NaN NaN NaN NaN \n", "B-pb-t3 ... NaN NaN NaN NaN NaN \n", "B ... NaN NaN NaN NaN NaN \n", "B-pb-mature ... NaN NaN NaN NaN NaN \n", "Mac ... NaN NaN NaN NaN NaN \n", "gran ... NaN NaN NaN NaN NaN \n", "cDC2 ... NaN NaN NaN NaN NaN \n", "CD56dim-NK ... NaN NaN NaN NaN NaN \n", "TRM ... NaN NaN NaN NaN NaN \n", "Lti ... NaN NaN NaN NaN NaN \n", "ILC3-NCRpos ... NaN NaN NaN NaN NaN \n", "abT ... NaN NaN NaN NaN NaN \n", "TFH ... NaN NaN NaN NaN NaN \n", "mono ... NaN NaN NaN NaN NaN \n", "CD8-T_KLRG1neg-effector ... NaN NaN NaN NaN NaN \n", "B-memory-IgM-MZ ... NaN NaN NaN NaN NaN \n", "cDC3 ... NaN NaN NaN NaN NaN \n", "B-memory-switched ... NaN NaN NaN NaN NaN \n", "ILC3-NCRneg ... NaN NaN NaN NaN NaN \n", "Langerhans ... NaN NaN NaN NaN NaN \n", "mo-DC ... NaN NaN NaN NaN NaN \n", "endo-arterial ... LIMS2 ENG ADGRL4 NaN NaN \n", "ILC2 ... NaN NaN NaN NaN NaN \n", "plasma ... NaN NaN NaN NaN NaN \n", "B-pb-t1 ... NaN NaN NaN NaN NaN \n", "lung-endo-venous ... ITM2A PDZRN4 ADGRL4 IGFBP7 SHROOM4 \n", "gdT ... NaN NaN NaN NaN NaN \n", "NK ... NaN NaN NaN NaN NaN \n", "capillary ... IFI27 AFF3 ENG FCN3 NaN \n", "CD8-T ... NaN NaN NaN NaN NaN \n", "B-memory ... NaN NaN NaN NaN NaN \n", "B-memory-non-switched ... NaN NaN NaN NaN NaN \n", "GC-B ... NaN NaN NaN NaN NaN \n", "\n", " 29 30 31 32 33 \n", "0 \n", "TCM NaN NaN NaN NaN NaN \n", "Treg NaN NaN NaN NaN NaN \n", "T-naive NaN NaN NaN NaN NaN \n", "B-pb-t2 NaN NaN NaN NaN NaN \n", "endo-lymphatic NaN NaN NaN NaN NaN \n", "TSCM NaN NaN NaN NaN NaN \n", "cDC1 NaN NaN NaN NaN NaN \n", "ILC1 NaN NaN NaN NaN NaN \n", "NK-adaptive NaN NaN NaN NaN NaN \n", "TEM NaN NaN NaN NaN NaN \n", "FDC NaN NaN NaN NaN NaN \n", "endo-systemic-venous COL15A1 NaN NaN NaN NaN \n", "endo-aerocyte PRKG1 ENG SOSTDC1 SHROOM4 RGCC \n", "CD56bright-NK NaN NaN NaN NaN NaN \n", "plasma-blast NaN NaN NaN NaN NaN \n", "CD8-T_KLRG1pos-effector NaN NaN NaN NaN NaN \n", "p-DC NaN NaN NaN NaN NaN \n", "mast NaN NaN NaN NaN NaN \n", "B-memory-DN NaN NaN NaN NaN NaN \n", "B-naive NaN NaN NaN NaN NaN \n", "CD4-T NaN NaN NaN NaN NaN \n", "B-pb-t3 NaN NaN NaN NaN NaN \n", "B NaN NaN NaN NaN NaN \n", "B-pb-mature NaN NaN NaN NaN NaN \n", "Mac NaN NaN NaN NaN NaN \n", "gran NaN NaN NaN NaN NaN \n", "cDC2 NaN NaN NaN NaN NaN \n", "CD56dim-NK NaN NaN NaN NaN NaN \n", "TRM NaN NaN NaN NaN NaN \n", "Lti NaN NaN NaN NaN NaN \n", "ILC3-NCRpos NaN NaN NaN NaN NaN \n", "abT NaN NaN NaN NaN NaN \n", "TFH NaN NaN NaN NaN NaN \n", "mono NaN NaN NaN NaN NaN \n", "CD8-T_KLRG1neg-effector NaN NaN NaN NaN NaN \n", "B-memory-IgM-MZ NaN NaN NaN NaN NaN \n", "cDC3 NaN NaN NaN NaN NaN \n", "B-memory-switched NaN NaN NaN NaN NaN \n", "ILC3-NCRneg NaN NaN NaN NaN NaN \n", "Langerhans NaN NaN NaN NaN NaN \n", "mo-DC NaN NaN NaN NaN NaN \n", "endo-arterial NaN NaN NaN NaN NaN \n", "ILC2 NaN NaN NaN NaN NaN \n", "plasma NaN NaN NaN NaN NaN \n", "B-pb-t1 NaN NaN NaN NaN NaN \n", "lung-endo-venous IFI27 VWF NaN NaN NaN \n", "gdT NaN NaN NaN NaN NaN \n", "NK NaN NaN NaN NaN NaN \n", "capillary NaN NaN NaN NaN NaN \n", "CD8-T NaN NaN NaN NaN NaN \n", "B-memory NaN NaN NaN NaN NaN \n", "B-memory-non-switched NaN NaN NaN NaN NaN \n", "GC-B NaN NaN NaN NaN NaN \n", "\n", "[53 rows x 33 columns]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#load cellular identities gmt files\n", "cell_gmt = pd.read_csv('cell_identities.gmt',sep='\\t',header=None,index_col=0)\n", "cell_gmt" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 455 }, "id": "QD6yFuaU_i89", "outputId": "50a17581-4b72-4957-9da7-198500afc8d4" }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
12345678910...410411412413414415416417418419
0
all_chondroitine-and-heparan-sulfate_synthesisHS3ST1USTCHST11HS3ST4XYLT1CHPF2NDST3B3GAT3EXTL1HS3ST5...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
all_retinol_metabolismZADH2ADH1AUGT1A8ADH7SDR16C5RDH12ALDH1A2ALDH1A3AOX1RDH16...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
all_RIG-I-like-receptor_signalingIKBKGIL12AIFIH1IFNA14MAPK14ATG12MAPK8STING1TNFMAPK9...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
leuko_transendothelial-migrationESAMMYLPFCTNNA2MYL12ATXKCLDN8PTK2BMMP9PTPN11CLDN9...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
all_propanoate_metabolismSLC16A3SLC5A12SLC16A8HIBCHSLC16A1SLC16A7SLC5A8NaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
..................................................................
all_eicosanoid_metabolismCYP4F12MGST3SLCO4A1TBXAS1CYP4F8CBR1PTGDSSLCO2A1PTGS2SLC22A2...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
CD4-T_IL12_responseACVR1BRHOGUPF3ALCP1PLXNB2SLC6A12ZNF516STK40PDE6DSLC38A2...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
all_fatty-acid-beta-oxidation-mitochondrialACAD10ACOT2ETFDHETFBECHS1HADHAADH5ADH6ECI1ADH1A...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
all_posttranslation-modificationP4HA2P4HBPLOD2HMGCRSLC25A1SLC33A1MTMR3P4HA1PLOD1GGPS1...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
all_transmembrane-transport-cellmembraneATP2B4ATP1A3SLC34A2SLC20A1SLC17A4SLC26A9SLC26A4SLC8A1SLC26A2SLC17A2...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", "

201 rows × 419 columns

\n", "
" ], "text/plain": [ " 1 2 3 \\\n", "0 \n", "all_chondroitine-and-heparan-sulfate_synthesis HS3ST1 UST CHST11 \n", "all_retinol_metabolism ZADH2 ADH1A UGT1A8 \n", "all_RIG-I-like-receptor_signaling IKBKG IL12A IFIH1 \n", "leuko_transendothelial-migration ESAM MYLPF CTNNA2 \n", "all_propanoate_metabolism SLC16A3 SLC5A12 SLC16A8 \n", "... ... ... ... \n", "all_eicosanoid_metabolism CYP4F12 MGST3 SLCO4A1 \n", "CD4-T_IL12_response ACVR1B RHOG UPF3A \n", "all_fatty-acid-beta-oxidation-mitochondrial ACAD10 ACOT2 ETFDH \n", "all_posttranslation-modification P4HA2 P4HB PLOD2 \n", "all_transmembrane-transport-cellmembrane ATP2B4 ATP1A3 SLC34A2 \n", "\n", " 4 5 6 \\\n", "0 \n", "all_chondroitine-and-heparan-sulfate_synthesis HS3ST4 XYLT1 CHPF2 \n", "all_retinol_metabolism ADH7 SDR16C5 RDH12 \n", "all_RIG-I-like-receptor_signaling IFNA14 MAPK14 ATG12 \n", "leuko_transendothelial-migration MYL12A TXK CLDN8 \n", "all_propanoate_metabolism HIBCH SLC16A1 SLC16A7 \n", "... ... ... ... \n", "all_eicosanoid_metabolism TBXAS1 CYP4F8 CBR1 \n", "CD4-T_IL12_response LCP1 PLXNB2 SLC6A12 \n", "all_fatty-acid-beta-oxidation-mitochondrial ETFB ECHS1 HADHA \n", "all_posttranslation-modification HMGCR SLC25A1 SLC33A1 \n", "all_transmembrane-transport-cellmembrane SLC20A1 SLC17A4 SLC26A9 \n", "\n", " 7 8 9 \\\n", "0 \n", "all_chondroitine-and-heparan-sulfate_synthesis NDST3 B3GAT3 EXTL1 \n", "all_retinol_metabolism ALDH1A2 ALDH1A3 AOX1 \n", "all_RIG-I-like-receptor_signaling MAPK8 STING1 TNF \n", "leuko_transendothelial-migration PTK2B MMP9 PTPN11 \n", "all_propanoate_metabolism SLC5A8 NaN NaN \n", "... ... ... ... \n", "all_eicosanoid_metabolism PTGDS SLCO2A1 PTGS2 \n", "CD4-T_IL12_response ZNF516 STK40 PDE6D \n", "all_fatty-acid-beta-oxidation-mitochondrial ADH5 ADH6 ECI1 \n", "all_posttranslation-modification MTMR3 P4HA1 PLOD1 \n", "all_transmembrane-transport-cellmembrane SLC26A4 SLC8A1 SLC26A2 \n", "\n", " 10 ... 410 411 412 \\\n", "0 ... \n", "all_chondroitine-and-heparan-sulfate_synthesis HS3ST5 ... NaN NaN NaN \n", "all_retinol_metabolism RDH16 ... NaN NaN NaN \n", "all_RIG-I-like-receptor_signaling MAPK9 ... NaN NaN NaN \n", "leuko_transendothelial-migration CLDN9 ... NaN NaN NaN \n", "all_propanoate_metabolism NaN ... NaN NaN NaN \n", "... ... ... ... ... ... \n", "all_eicosanoid_metabolism SLC22A2 ... NaN NaN NaN \n", "CD4-T_IL12_response SLC38A2 ... NaN NaN NaN \n", "all_fatty-acid-beta-oxidation-mitochondrial ADH1A ... NaN NaN NaN \n", "all_posttranslation-modification GGPS1 ... NaN NaN NaN \n", "all_transmembrane-transport-cellmembrane SLC17A2 ... NaN NaN NaN \n", "\n", " 413 414 415 416 417 418 \\\n", "0 \n", "all_chondroitine-and-heparan-sulfate_synthesis NaN NaN NaN NaN NaN NaN \n", "all_retinol_metabolism NaN NaN NaN NaN NaN NaN \n", "all_RIG-I-like-receptor_signaling NaN NaN NaN NaN NaN NaN \n", "leuko_transendothelial-migration NaN NaN NaN NaN NaN NaN \n", "all_propanoate_metabolism NaN NaN NaN NaN NaN NaN \n", "... ... ... ... ... ... ... \n", "all_eicosanoid_metabolism NaN NaN NaN NaN NaN NaN \n", "CD4-T_IL12_response NaN NaN NaN NaN NaN NaN \n", "all_fatty-acid-beta-oxidation-mitochondrial NaN NaN NaN NaN NaN NaN \n", "all_posttranslation-modification NaN NaN NaN NaN NaN NaN \n", "all_transmembrane-transport-cellmembrane NaN NaN NaN NaN NaN NaN \n", "\n", " 419 \n", "0 \n", "all_chondroitine-and-heparan-sulfate_synthesis NaN \n", "all_retinol_metabolism NaN \n", "all_RIG-I-like-receptor_signaling NaN \n", "leuko_transendothelial-migration NaN \n", "all_propanoate_metabolism NaN \n", "... ... \n", "all_eicosanoid_metabolism NaN \n", "CD4-T_IL12_response NaN \n", "all_fatty-acid-beta-oxidation-mitochondrial NaN \n", "all_posttranslation-modification NaN \n", "all_transmembrane-transport-cellmembrane NaN \n", "\n", "[201 rows x 419 columns]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#load cellular identities gmt files\n", "cell_gmt = pd.read_csv('cellular_processes.gmt',sep='\\t',header=None,index_col=0)\n", "cell_gmt" ] }, { "cell_type": "markdown", "metadata": { "id": "HA6E8SdYAb6U" }, "source": [ "## Label output from Spectra or other factor analysis method" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "_IprctpCAFs-", "outputId": "c5036d28-93ec-40b0-c16e-90753eca8e37" }, "outputs": [ { "data": { "text/plain": [ "AnnData object with n_obs × n_vars = 10000 × 6397\n", " obs: 'cell_type_annotations'\n", " var: 'n_cells_by_counts', 'highly_variable', 'spectra_vocab'\n", " uns: 'SPECTRA_L', 'SPECTRA_factors', 'SPECTRA_markers', 'annotation_SPADE_1_colors', 'cell_type_annotations_colors', 'diffmap_evals', 'draw_graph', 'hvg', 'neighbors', 'pca'\n", " obsm: 'SPECTRA_cell_scores', 'X_diffmap', 'X_draw_graph_fa', 'X_pca', 'X_tsne', 'X_umap'\n", " varm: 'PCs'\n", " obsp: 'connectivities', 'distances'" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#load example data\n", "#this data contains a standard Spectra output in adata.obsm and adata.uns\n", "adata = sc.read('data/adata_spectra.h5ad')\n", "adata" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "fkHyYSv4GnBM", "outputId": "c07cd159-1ae9-4f77-c886-2f0133846966" }, "outputs": [ { "data": { "text/plain": [ "array([['SLC5A6', 'BTD', 'SLC16A1', ..., 'NOD2', 'MTDH', 'IL22RA1'],\n", " ['SLC2A9', 'NT5E', 'XDH', ..., 'ITPA', 'FDX1', 'NDUFB3'],\n", " ['ALDH3B1', 'ALDH1B1', 'ALDH3A1', ..., 'S100A11', 'SV2A',\n", " 'POLR2G'],\n", " ...,\n", " ['ZAP70', 'SGK1', 'TCF7', ..., 'CDC42EP2', 'CYB561D2', 'PODN'],\n", " ['TCF4', 'LILRA4', 'PLPP3', ..., 'CYP19A1', 'ASPM', 'CUL2'],\n", " ['FKBP11', 'IGLL5', 'CRELD2', ..., 'PELI1', 'FN3KRP', 'TCEAL7']],\n", " dtype=object)" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#the marker genes are stored here (but you can use any other numpy array or a list of lists)\n", "adata.uns['SPECTRA_markers']" ] }, { "cell_type": "markdown", "metadata": { "id": "FJ8T9n0IHmOA" }, "source": [ "**load the cytopus KnoweldgeBase or a dictionary of format:**\n", "\n", "{'gene_set_name_a':['gene_a','gene_b','gene_c',...],'gene_set_name_b':['gene_a','gene_d',...]}" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "2Vc_iYfIHTBh", "outputId": "c0667add-818c-4e29-8904-e6dc9696884e" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "KnowledgeBase object containing 92 cell types and 201 cellular processes\n", "\n" ] }, { "data": { "text/plain": [ "" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "G = cp.KnowledgeBase()\n", "G" ] }, { "cell_type": "markdown", "metadata": { "id": "__UnKGNgJoc3" }, "source": [ "**Get the factor cell type**\n", "\n", "In Spectra the cell scores for cell type specific factors will be != 0 only for the cell type they are specific too. All other \"global\" actors will be express across cell types. Currently we are not aware of another method which allows for incorporating both global and cell type specific factors. This might be extended in the future to give the degree of cell type specificity for methods which do not explicitly incorporate the cell type.\n", "\n", "Use the get_celltype function to infer cell type specificity.\n", "\n", "Description:\n", "\n", "For a list of factors check in which cell types they are expressed\n", "\n", "adata: anndata.AnnData, containing cell type labels in adata.obs[celltype_key]\n", "\n", "celltype_key: str, key for adata.obs containing the cell type labels\n", "\n", "factor_list: list, list of keys for factor loadings in .obs, if none use factor loadings in adata.obsm['SPECTRA_factors']\n", "\n", "return: dictionary mapping factor names and celltypes\n", "\n", "Spectra_cell_scores: str, key for Spectra cell scores in adata.obsm" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "id": "7mODF5W0JRkF" }, "outputs": [], "source": [ "#use function to infer cell type specificity\n", "cell_type_specificity = cp.label.get_celltype(adata, celltype_key='cell_type_annotations',\n", " factor_list=None, Spectra_cell_scores= 'SPECTRA_cell_scores')" ] }, { "cell_type": "markdown", "metadata": { "id": "_mxMU6AKIBeW" }, "source": [ "**Use the label_marker_genes function to label marker genes based on their Szymkiewicz–Simpson overlap coefficient with the input gene sets**\n", "\n", "Description:\n", "\n", "label an array of marker genes using a KnowledgeBase or a dictionary derived from the KnowledgeBase\n", "\n", "returns a dataframe of overlap coefficients for each gene set annotation and marker gene\n", " \n", "marker_genes: numpy.array or list of lists, factors x marker genes\n", "\n", "gs_label_dict: cytopus.KnowledgeBase or dict, with gene set names (str) as keys and gene sets (list) as values\n", "\n", "threshold: float, if overlap coefficient > than threshold the factor will be labeled with the gene set name with \n", "\n", "maximum overlap coefficient\n", " \n", "returns: pandas.DataFrame, with overlap coefficients of factors (rows) and gene sets (columns), indices are relabeled to the gene set with the maximum overlap coefficient" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 609 }, "id": "PoTHPJ-hHKDF", "outputId": "5025b165-ee97-410b-8b32-c26c3a9e33de" }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
all_chondroitine-and-heparan-sulfate_synthesisall_retinol_metabolismall_RIG-I-like-receptor_signalingleuko_transendothelial-migrationall_propanoate_metabolismNSCLC-carcinoma-cell_TGFB1_responseall_p53-signalingall_autophagy-selectiveall_circadian-rhythmall_VAL-LEU-ILE_metabolism...all_folate_metabolismall_CYP_metabolismT_IL21_responsep-DC_CpG-TLR9_responseall_NOD-like-receptor_signalingall_eicosanoid_metabolismCD4-T_IL12_responseall_fatty-acid-beta-oxidation-mitochondrialall_posttranslation-modificationall_transmembrane-transport-cellmembrane
all_biotin_metabolism0.000.0000000.000.00.1428570.000.000.00.00.04...0.0588240.00.00.00.040.000.00.0000000.0000000.04
all_purine_metabolism0.000.0000000.000.00.0000000.000.080.00.00.00...0.0000000.00.00.00.000.000.00.0000000.0000000.00
all_ethanol_metabolism0.000.1818180.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.000.00.0869570.0000000.00
all_amino-sugar-nucleotide-sugar_metabolism0.000.0000000.000.00.0000000.040.040.00.00.00...0.0000000.00.00.00.000.000.00.0000000.0000000.00
all_steroid_metabolism0.000.0000000.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.080.00.0000000.0909090.00
..................................................................
mast_granule-exocytosis0.040.0000000.000.00.0000000.000.040.00.00.00...0.0000000.00.00.00.000.040.00.0000000.0000000.00
1920.000.0000000.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.080.00.0000000.0000000.00
p-DC_CpG-TLR9_response0.000.0000000.040.00.0000000.000.040.00.00.00...0.0000000.00.01.00.040.000.00.0000000.0000000.00
1940.000.0000000.000.00.0000000.040.000.00.00.00...0.0000000.00.00.00.000.040.00.0000000.0000000.00
1950.000.0000000.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.000.00.0000000.0000000.00
\n", "

196 rows × 201 columns

\n", "
" ], "text/plain": [ " all_chondroitine-and-heparan-sulfate_synthesis \\\n", "all_biotin_metabolism 0.00 \n", "all_purine_metabolism 0.00 \n", "all_ethanol_metabolism 0.00 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.00 \n", "all_steroid_metabolism 0.00 \n", "... ... \n", "mast_granule-exocytosis 0.04 \n", "192 0.00 \n", "p-DC_CpG-TLR9_response 0.00 \n", "194 0.00 \n", "195 0.00 \n", "\n", " all_retinol_metabolism \\\n", "all_biotin_metabolism 0.000000 \n", "all_purine_metabolism 0.000000 \n", "all_ethanol_metabolism 0.181818 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.000000 \n", "all_steroid_metabolism 0.000000 \n", "... ... \n", "mast_granule-exocytosis 0.000000 \n", "192 0.000000 \n", "p-DC_CpG-TLR9_response 0.000000 \n", "194 0.000000 \n", "195 0.000000 \n", "\n", " all_RIG-I-like-receptor_signaling \\\n", "all_biotin_metabolism 0.00 \n", "all_purine_metabolism 0.00 \n", "all_ethanol_metabolism 0.00 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.00 \n", "all_steroid_metabolism 0.00 \n", "... ... \n", "mast_granule-exocytosis 0.00 \n", "192 0.00 \n", "p-DC_CpG-TLR9_response 0.04 \n", "194 0.00 \n", "195 0.00 \n", "\n", " leuko_transendothelial-migration \\\n", "all_biotin_metabolism 0.0 \n", "all_purine_metabolism 0.0 \n", "all_ethanol_metabolism 0.0 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.0 \n", "all_steroid_metabolism 0.0 \n", "... ... \n", "mast_granule-exocytosis 0.0 \n", "192 0.0 \n", "p-DC_CpG-TLR9_response 0.0 \n", "194 0.0 \n", "195 0.0 \n", "\n", " all_propanoate_metabolism \\\n", "all_biotin_metabolism 0.142857 \n", "all_purine_metabolism 0.000000 \n", "all_ethanol_metabolism 0.000000 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.000000 \n", "all_steroid_metabolism 0.000000 \n", "... ... \n", "mast_granule-exocytosis 0.000000 \n", "192 0.000000 \n", "p-DC_CpG-TLR9_response 0.000000 \n", "194 0.000000 \n", "195 0.000000 \n", "\n", " NSCLC-carcinoma-cell_TGFB1_response \\\n", "all_biotin_metabolism 0.00 \n", "all_purine_metabolism 0.00 \n", "all_ethanol_metabolism 0.00 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.04 \n", "all_steroid_metabolism 0.00 \n", "... ... \n", "mast_granule-exocytosis 0.00 \n", "192 0.00 \n", "p-DC_CpG-TLR9_response 0.00 \n", "194 0.04 \n", "195 0.00 \n", "\n", " all_p53-signaling \\\n", "all_biotin_metabolism 0.00 \n", "all_purine_metabolism 0.08 \n", "all_ethanol_metabolism 0.00 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.04 \n", "all_steroid_metabolism 0.00 \n", "... ... \n", "mast_granule-exocytosis 0.04 \n", "192 0.00 \n", "p-DC_CpG-TLR9_response 0.04 \n", "194 0.00 \n", "195 0.00 \n", "\n", " all_autophagy-selective \\\n", "all_biotin_metabolism 0.0 \n", "all_purine_metabolism 0.0 \n", "all_ethanol_metabolism 0.0 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.0 \n", "all_steroid_metabolism 0.0 \n", "... ... \n", "mast_granule-exocytosis 0.0 \n", "192 0.0 \n", "p-DC_CpG-TLR9_response 0.0 \n", "194 0.0 \n", "195 0.0 \n", "\n", " all_circadian-rhythm \\\n", "all_biotin_metabolism 0.0 \n", "all_purine_metabolism 0.0 \n", "all_ethanol_metabolism 0.0 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.0 \n", "all_steroid_metabolism 0.0 \n", "... ... \n", "mast_granule-exocytosis 0.0 \n", "192 0.0 \n", "p-DC_CpG-TLR9_response 0.0 \n", "194 0.0 \n", "195 0.0 \n", "\n", " all_VAL-LEU-ILE_metabolism ... \\\n", "all_biotin_metabolism 0.04 ... \n", "all_purine_metabolism 0.00 ... \n", "all_ethanol_metabolism 0.00 ... \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.00 ... \n", "all_steroid_metabolism 0.00 ... \n", "... ... ... \n", "mast_granule-exocytosis 0.00 ... \n", "192 0.00 ... \n", "p-DC_CpG-TLR9_response 0.00 ... \n", "194 0.00 ... \n", "195 0.00 ... \n", "\n", " all_folate_metabolism \\\n", "all_biotin_metabolism 0.058824 \n", "all_purine_metabolism 0.000000 \n", "all_ethanol_metabolism 0.000000 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.000000 \n", "all_steroid_metabolism 0.000000 \n", "... ... \n", "mast_granule-exocytosis 0.000000 \n", "192 0.000000 \n", "p-DC_CpG-TLR9_response 0.000000 \n", "194 0.000000 \n", "195 0.000000 \n", "\n", " all_CYP_metabolism \\\n", "all_biotin_metabolism 0.0 \n", "all_purine_metabolism 0.0 \n", "all_ethanol_metabolism 0.0 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.0 \n", "all_steroid_metabolism 0.0 \n", "... ... \n", "mast_granule-exocytosis 0.0 \n", "192 0.0 \n", "p-DC_CpG-TLR9_response 0.0 \n", "194 0.0 \n", "195 0.0 \n", "\n", " T_IL21_response \\\n", "all_biotin_metabolism 0.0 \n", "all_purine_metabolism 0.0 \n", "all_ethanol_metabolism 0.0 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.0 \n", "all_steroid_metabolism 0.0 \n", "... ... \n", "mast_granule-exocytosis 0.0 \n", "192 0.0 \n", "p-DC_CpG-TLR9_response 0.0 \n", "194 0.0 \n", "195 0.0 \n", "\n", " p-DC_CpG-TLR9_response \\\n", "all_biotin_metabolism 0.0 \n", "all_purine_metabolism 0.0 \n", "all_ethanol_metabolism 0.0 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.0 \n", "all_steroid_metabolism 0.0 \n", "... ... \n", "mast_granule-exocytosis 0.0 \n", "192 0.0 \n", "p-DC_CpG-TLR9_response 1.0 \n", "194 0.0 \n", "195 0.0 \n", "\n", " all_NOD-like-receptor_signaling \\\n", "all_biotin_metabolism 0.04 \n", "all_purine_metabolism 0.00 \n", "all_ethanol_metabolism 0.00 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.00 \n", "all_steroid_metabolism 0.00 \n", "... ... \n", "mast_granule-exocytosis 0.00 \n", "192 0.00 \n", "p-DC_CpG-TLR9_response 0.04 \n", "194 0.00 \n", "195 0.00 \n", "\n", " all_eicosanoid_metabolism \\\n", "all_biotin_metabolism 0.00 \n", "all_purine_metabolism 0.00 \n", "all_ethanol_metabolism 0.00 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.00 \n", "all_steroid_metabolism 0.08 \n", "... ... \n", "mast_granule-exocytosis 0.04 \n", "192 0.08 \n", "p-DC_CpG-TLR9_response 0.00 \n", "194 0.04 \n", "195 0.00 \n", "\n", " CD4-T_IL12_response \\\n", "all_biotin_metabolism 0.0 \n", "all_purine_metabolism 0.0 \n", "all_ethanol_metabolism 0.0 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.0 \n", "all_steroid_metabolism 0.0 \n", "... ... \n", "mast_granule-exocytosis 0.0 \n", "192 0.0 \n", "p-DC_CpG-TLR9_response 0.0 \n", "194 0.0 \n", "195 0.0 \n", "\n", " all_fatty-acid-beta-oxidation-mitochondrial \\\n", "all_biotin_metabolism 0.000000 \n", "all_purine_metabolism 0.000000 \n", "all_ethanol_metabolism 0.086957 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.000000 \n", "all_steroid_metabolism 0.000000 \n", "... ... \n", "mast_granule-exocytosis 0.000000 \n", "192 0.000000 \n", "p-DC_CpG-TLR9_response 0.000000 \n", "194 0.000000 \n", "195 0.000000 \n", "\n", " all_posttranslation-modification \\\n", "all_biotin_metabolism 0.000000 \n", "all_purine_metabolism 0.000000 \n", "all_ethanol_metabolism 0.000000 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.000000 \n", "all_steroid_metabolism 0.090909 \n", "... ... \n", "mast_granule-exocytosis 0.000000 \n", "192 0.000000 \n", "p-DC_CpG-TLR9_response 0.000000 \n", "194 0.000000 \n", "195 0.000000 \n", "\n", " all_transmembrane-transport-cellmembrane \n", "all_biotin_metabolism 0.04 \n", "all_purine_metabolism 0.00 \n", "all_ethanol_metabolism 0.00 \n", "all_amino-sugar-nucleotide-sugar_metabolism 0.00 \n", "all_steroid_metabolism 0.00 \n", "... ... \n", "mast_granule-exocytosis 0.00 \n", "192 0.00 \n", "p-DC_CpG-TLR9_response 0.00 \n", "194 0.00 \n", "195 0.00 \n", "\n", "[196 rows x 201 columns]" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#label marker genes\n", "overlap_df = cp.label.label_marker_genes(adata.uns['SPECTRA_markers'], G.processes, threshold = 0.2)\n", "overlap_df" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 679 }, "id": "VIIDb6CUMLJ0", "outputId": "b61779e0-cbb4-45d3-889d-4180f38052e2" }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
all_chondroitine-and-heparan-sulfate_synthesisall_retinol_metabolismall_RIG-I-like-receptor_signalingleuko_transendothelial-migrationall_propanoate_metabolismNSCLC-carcinoma-cell_TGFB1_responseall_p53-signalingall_autophagy-selectiveall_circadian-rhythmall_VAL-LEU-ILE_metabolism...all_folate_metabolismall_CYP_metabolismT_IL21_responsep-DC_CpG-TLR9_responseall_NOD-like-receptor_signalingall_eicosanoid_metabolismCD4-T_IL12_responseall_fatty-acid-beta-oxidation-mitochondrialall_posttranslation-modificationall_transmembrane-transport-cellmembrane
global-X-all_biotin_metabolism0.000.0000000.000.00.1428570.000.000.00.00.04...0.0588240.00.00.00.040.000.00.0000000.0000000.04
global-X-all_purine_metabolism0.000.0000000.000.00.0000000.000.080.00.00.00...0.0000000.00.00.00.000.000.00.0000000.0000000.00
global-X-all_ethanol_metabolism0.000.1818180.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.000.00.0869570.0000000.00
global-X-all_amino-sugar-nucleotide-sugar_metabolism0.000.0000000.000.00.0000000.040.040.00.00.00...0.0000000.00.00.00.000.000.00.0000000.0000000.00
global-X-all_steroid_metabolism0.000.0000000.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.080.00.0000000.0909090.00
..................................................................
mast-X-mast_granule-exocytosis0.040.0000000.000.00.0000000.000.040.00.00.00...0.0000000.00.00.00.000.040.00.0000000.0000000.00
mast-X-1920.000.0000000.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.080.00.0000000.0000000.00
pDC-X-p-DC_CpG-TLR9_response0.000.0000000.040.00.0000000.000.040.00.00.00...0.0000000.00.01.00.040.000.00.0000000.0000000.00
pDC-X-1940.000.0000000.000.00.0000000.040.000.00.00.00...0.0000000.00.00.00.000.040.00.0000000.0000000.00
plasma-X-1950.000.0000000.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.000.00.0000000.0000000.00
\n", "

196 rows × 201 columns

\n", "
" ], "text/plain": [ " all_chondroitine-and-heparan-sulfate_synthesis \\\n", "global-X-all_biotin_metabolism 0.00 \n", "global-X-all_purine_metabolism 0.00 \n", "global-X-all_ethanol_metabolism 0.00 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.00 \n", "global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.04 \n", "mast-X-192 0.00 \n", "pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "pDC-X-194 0.00 \n", "plasma-X-195 0.00 \n", "\n", " all_retinol_metabolism \\\n", "global-X-all_biotin_metabolism 0.000000 \n", "global-X-all_purine_metabolism 0.000000 \n", "global-X-all_ethanol_metabolism 0.181818 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.000000 \n", "global-X-all_steroid_metabolism 0.000000 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.000000 \n", "mast-X-192 0.000000 \n", "pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "pDC-X-194 0.000000 \n", "plasma-X-195 0.000000 \n", "\n", " all_RIG-I-like-receptor_signaling \\\n", "global-X-all_biotin_metabolism 0.00 \n", "global-X-all_purine_metabolism 0.00 \n", "global-X-all_ethanol_metabolism 0.00 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.00 \n", "global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.00 \n", "mast-X-192 0.00 \n", "pDC-X-p-DC_CpG-TLR9_response 0.04 \n", "pDC-X-194 0.00 \n", "plasma-X-195 0.00 \n", "\n", " leuko_transendothelial-migration \\\n", "global-X-all_biotin_metabolism 0.0 \n", "global-X-all_purine_metabolism 0.0 \n", "global-X-all_ethanol_metabolism 0.0 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.0 \n", "global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.0 \n", "mast-X-192 0.0 \n", "pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "pDC-X-194 0.0 \n", "plasma-X-195 0.0 \n", "\n", " all_propanoate_metabolism \\\n", "global-X-all_biotin_metabolism 0.142857 \n", "global-X-all_purine_metabolism 0.000000 \n", "global-X-all_ethanol_metabolism 0.000000 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.000000 \n", "global-X-all_steroid_metabolism 0.000000 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.000000 \n", "mast-X-192 0.000000 \n", "pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "pDC-X-194 0.000000 \n", "plasma-X-195 0.000000 \n", "\n", " NSCLC-carcinoma-cell_TGFB1_response \\\n", "global-X-all_biotin_metabolism 0.00 \n", "global-X-all_purine_metabolism 0.00 \n", "global-X-all_ethanol_metabolism 0.00 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.04 \n", "global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.00 \n", "mast-X-192 0.00 \n", "pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "pDC-X-194 0.04 \n", "plasma-X-195 0.00 \n", "\n", " all_p53-signaling \\\n", "global-X-all_biotin_metabolism 0.00 \n", "global-X-all_purine_metabolism 0.08 \n", "global-X-all_ethanol_metabolism 0.00 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.04 \n", "global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.04 \n", "mast-X-192 0.00 \n", "pDC-X-p-DC_CpG-TLR9_response 0.04 \n", "pDC-X-194 0.00 \n", "plasma-X-195 0.00 \n", "\n", " all_autophagy-selective \\\n", "global-X-all_biotin_metabolism 0.0 \n", "global-X-all_purine_metabolism 0.0 \n", "global-X-all_ethanol_metabolism 0.0 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.0 \n", "global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.0 \n", "mast-X-192 0.0 \n", "pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "pDC-X-194 0.0 \n", "plasma-X-195 0.0 \n", "\n", " all_circadian-rhythm \\\n", "global-X-all_biotin_metabolism 0.0 \n", "global-X-all_purine_metabolism 0.0 \n", "global-X-all_ethanol_metabolism 0.0 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.0 \n", "global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.0 \n", "mast-X-192 0.0 \n", "pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "pDC-X-194 0.0 \n", "plasma-X-195 0.0 \n", "\n", " all_VAL-LEU-ILE_metabolism \\\n", "global-X-all_biotin_metabolism 0.04 \n", "global-X-all_purine_metabolism 0.00 \n", "global-X-all_ethanol_metabolism 0.00 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.00 \n", "global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.00 \n", "mast-X-192 0.00 \n", "pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "pDC-X-194 0.00 \n", "plasma-X-195 0.00 \n", "\n", " ... \\\n", "global-X-all_biotin_metabolism ... \n", "global-X-all_purine_metabolism ... \n", "global-X-all_ethanol_metabolism ... \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... ... \n", "global-X-all_steroid_metabolism ... \n", "... ... \n", "mast-X-mast_granule-exocytosis ... \n", "mast-X-192 ... \n", "pDC-X-p-DC_CpG-TLR9_response ... \n", "pDC-X-194 ... \n", "plasma-X-195 ... \n", "\n", " all_folate_metabolism \\\n", "global-X-all_biotin_metabolism 0.058824 \n", "global-X-all_purine_metabolism 0.000000 \n", "global-X-all_ethanol_metabolism 0.000000 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.000000 \n", "global-X-all_steroid_metabolism 0.000000 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.000000 \n", "mast-X-192 0.000000 \n", "pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "pDC-X-194 0.000000 \n", "plasma-X-195 0.000000 \n", "\n", " all_CYP_metabolism \\\n", "global-X-all_biotin_metabolism 0.0 \n", "global-X-all_purine_metabolism 0.0 \n", "global-X-all_ethanol_metabolism 0.0 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.0 \n", "global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.0 \n", "mast-X-192 0.0 \n", "pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "pDC-X-194 0.0 \n", "plasma-X-195 0.0 \n", "\n", " T_IL21_response \\\n", "global-X-all_biotin_metabolism 0.0 \n", "global-X-all_purine_metabolism 0.0 \n", "global-X-all_ethanol_metabolism 0.0 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.0 \n", "global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.0 \n", "mast-X-192 0.0 \n", "pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "pDC-X-194 0.0 \n", "plasma-X-195 0.0 \n", "\n", " p-DC_CpG-TLR9_response \\\n", "global-X-all_biotin_metabolism 0.0 \n", "global-X-all_purine_metabolism 0.0 \n", "global-X-all_ethanol_metabolism 0.0 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.0 \n", "global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.0 \n", "mast-X-192 0.0 \n", "pDC-X-p-DC_CpG-TLR9_response 1.0 \n", "pDC-X-194 0.0 \n", "plasma-X-195 0.0 \n", "\n", " all_NOD-like-receptor_signaling \\\n", "global-X-all_biotin_metabolism 0.04 \n", "global-X-all_purine_metabolism 0.00 \n", "global-X-all_ethanol_metabolism 0.00 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.00 \n", "global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.00 \n", "mast-X-192 0.00 \n", "pDC-X-p-DC_CpG-TLR9_response 0.04 \n", "pDC-X-194 0.00 \n", "plasma-X-195 0.00 \n", "\n", " all_eicosanoid_metabolism \\\n", "global-X-all_biotin_metabolism 0.00 \n", "global-X-all_purine_metabolism 0.00 \n", "global-X-all_ethanol_metabolism 0.00 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.00 \n", "global-X-all_steroid_metabolism 0.08 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.04 \n", "mast-X-192 0.08 \n", "pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "pDC-X-194 0.04 \n", "plasma-X-195 0.00 \n", "\n", " CD4-T_IL12_response \\\n", "global-X-all_biotin_metabolism 0.0 \n", "global-X-all_purine_metabolism 0.0 \n", "global-X-all_ethanol_metabolism 0.0 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.0 \n", "global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.0 \n", "mast-X-192 0.0 \n", "pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "pDC-X-194 0.0 \n", "plasma-X-195 0.0 \n", "\n", " all_fatty-acid-beta-oxidation-mitochondrial \\\n", "global-X-all_biotin_metabolism 0.000000 \n", "global-X-all_purine_metabolism 0.000000 \n", "global-X-all_ethanol_metabolism 0.086957 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.000000 \n", "global-X-all_steroid_metabolism 0.000000 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.000000 \n", "mast-X-192 0.000000 \n", "pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "pDC-X-194 0.000000 \n", "plasma-X-195 0.000000 \n", "\n", " all_posttranslation-modification \\\n", "global-X-all_biotin_metabolism 0.000000 \n", "global-X-all_purine_metabolism 0.000000 \n", "global-X-all_ethanol_metabolism 0.000000 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.000000 \n", "global-X-all_steroid_metabolism 0.090909 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.000000 \n", "mast-X-192 0.000000 \n", "pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "pDC-X-194 0.000000 \n", "plasma-X-195 0.000000 \n", "\n", " all_transmembrane-transport-cellmembrane \n", "global-X-all_biotin_metabolism 0.04 \n", "global-X-all_purine_metabolism 0.00 \n", "global-X-all_ethanol_metabolism 0.00 \n", "global-X-all_amino-sugar-nucleotide-sugar_metab... 0.00 \n", "global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "mast-X-mast_granule-exocytosis 0.00 \n", "mast-X-192 0.00 \n", "pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "pDC-X-194 0.00 \n", "plasma-X-195 0.00 \n", "\n", "[196 rows x 201 columns]" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#add cell type to relabeled factor marker genes dataframe\n", "\n", "#get celltypes\n", "new_index = []\n", "for i,v in enumerate(overlap_df.index):\n", " new_index.append(cell_type_specificity[i]+'-X-'+str(v))\n", "\n", "#change index\n", "overlap_df.index = new_index\n", "overlap_df" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 713 }, "id": "gMM9cxDjJDkf", "outputId": "9c4d7222-3f3e-42fa-a457-9921ba866153" }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
all_chondroitine-and-heparan-sulfate_synthesisall_retinol_metabolismall_RIG-I-like-receptor_signalingleuko_transendothelial-migrationall_propanoate_metabolismNSCLC-carcinoma-cell_TGFB1_responseall_p53-signalingall_autophagy-selectiveall_circadian-rhythmall_VAL-LEU-ILE_metabolism...all_folate_metabolismall_CYP_metabolismT_IL21_responsep-DC_CpG-TLR9_responseall_NOD-like-receptor_signalingall_eicosanoid_metabolismCD4-T_IL12_responseall_fatty-acid-beta-oxidation-mitochondrialall_posttranslation-modificationall_transmembrane-transport-cellmembrane
0-X-global-X-all_biotin_metabolism0.000.0000000.000.00.1428570.000.000.00.00.04...0.0588240.00.00.00.040.000.00.0000000.0000000.04
1-X-global-X-all_purine_metabolism0.000.0000000.000.00.0000000.000.080.00.00.00...0.0000000.00.00.00.000.000.00.0000000.0000000.00
2-X-global-X-all_ethanol_metabolism0.000.1818180.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.000.00.0869570.0000000.00
3-X-global-X-all_amino-sugar-nucleotide-sugar_metabolism0.000.0000000.000.00.0000000.040.040.00.00.00...0.0000000.00.00.00.000.000.00.0000000.0000000.00
4-X-global-X-all_steroid_metabolism0.000.0000000.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.080.00.0000000.0909090.00
..................................................................
191-X-mast-X-mast_granule-exocytosis0.040.0000000.000.00.0000000.000.040.00.00.00...0.0000000.00.00.00.000.040.00.0000000.0000000.00
192-X-mast-X-1920.000.0000000.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.080.00.0000000.0000000.00
193-X-pDC-X-p-DC_CpG-TLR9_response0.000.0000000.040.00.0000000.000.040.00.00.00...0.0000000.00.01.00.040.000.00.0000000.0000000.00
194-X-pDC-X-1940.000.0000000.000.00.0000000.040.000.00.00.00...0.0000000.00.00.00.000.040.00.0000000.0000000.00
195-X-plasma-X-1950.000.0000000.000.00.0000000.000.000.00.00.00...0.0000000.00.00.00.000.000.00.0000000.0000000.00
\n", "

196 rows × 201 columns

\n", "
" ], "text/plain": [ " all_chondroitine-and-heparan-sulfate_synthesis \\\n", "0-X-global-X-all_biotin_metabolism 0.00 \n", "1-X-global-X-all_purine_metabolism 0.00 \n", "2-X-global-X-all_ethanol_metabolism 0.00 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.00 \n", "4-X-global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.04 \n", "192-X-mast-X-192 0.00 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "194-X-pDC-X-194 0.00 \n", "195-X-plasma-X-195 0.00 \n", "\n", " all_retinol_metabolism \\\n", "0-X-global-X-all_biotin_metabolism 0.000000 \n", "1-X-global-X-all_purine_metabolism 0.000000 \n", "2-X-global-X-all_ethanol_metabolism 0.181818 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.000000 \n", "4-X-global-X-all_steroid_metabolism 0.000000 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.000000 \n", "192-X-mast-X-192 0.000000 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "194-X-pDC-X-194 0.000000 \n", "195-X-plasma-X-195 0.000000 \n", "\n", " all_RIG-I-like-receptor_signaling \\\n", "0-X-global-X-all_biotin_metabolism 0.00 \n", "1-X-global-X-all_purine_metabolism 0.00 \n", "2-X-global-X-all_ethanol_metabolism 0.00 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.00 \n", "4-X-global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.00 \n", "192-X-mast-X-192 0.00 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.04 \n", "194-X-pDC-X-194 0.00 \n", "195-X-plasma-X-195 0.00 \n", "\n", " leuko_transendothelial-migration \\\n", "0-X-global-X-all_biotin_metabolism 0.0 \n", "1-X-global-X-all_purine_metabolism 0.0 \n", "2-X-global-X-all_ethanol_metabolism 0.0 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.0 \n", "4-X-global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.0 \n", "192-X-mast-X-192 0.0 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "194-X-pDC-X-194 0.0 \n", "195-X-plasma-X-195 0.0 \n", "\n", " all_propanoate_metabolism \\\n", "0-X-global-X-all_biotin_metabolism 0.142857 \n", "1-X-global-X-all_purine_metabolism 0.000000 \n", "2-X-global-X-all_ethanol_metabolism 0.000000 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.000000 \n", "4-X-global-X-all_steroid_metabolism 0.000000 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.000000 \n", "192-X-mast-X-192 0.000000 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "194-X-pDC-X-194 0.000000 \n", "195-X-plasma-X-195 0.000000 \n", "\n", " NSCLC-carcinoma-cell_TGFB1_response \\\n", "0-X-global-X-all_biotin_metabolism 0.00 \n", "1-X-global-X-all_purine_metabolism 0.00 \n", "2-X-global-X-all_ethanol_metabolism 0.00 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.04 \n", "4-X-global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.00 \n", "192-X-mast-X-192 0.00 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "194-X-pDC-X-194 0.04 \n", "195-X-plasma-X-195 0.00 \n", "\n", " all_p53-signaling \\\n", "0-X-global-X-all_biotin_metabolism 0.00 \n", "1-X-global-X-all_purine_metabolism 0.08 \n", "2-X-global-X-all_ethanol_metabolism 0.00 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.04 \n", "4-X-global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.04 \n", "192-X-mast-X-192 0.00 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.04 \n", "194-X-pDC-X-194 0.00 \n", "195-X-plasma-X-195 0.00 \n", "\n", " all_autophagy-selective \\\n", "0-X-global-X-all_biotin_metabolism 0.0 \n", "1-X-global-X-all_purine_metabolism 0.0 \n", "2-X-global-X-all_ethanol_metabolism 0.0 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.0 \n", "4-X-global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.0 \n", "192-X-mast-X-192 0.0 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "194-X-pDC-X-194 0.0 \n", "195-X-plasma-X-195 0.0 \n", "\n", " all_circadian-rhythm \\\n", "0-X-global-X-all_biotin_metabolism 0.0 \n", "1-X-global-X-all_purine_metabolism 0.0 \n", "2-X-global-X-all_ethanol_metabolism 0.0 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.0 \n", "4-X-global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.0 \n", "192-X-mast-X-192 0.0 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "194-X-pDC-X-194 0.0 \n", "195-X-plasma-X-195 0.0 \n", "\n", " all_VAL-LEU-ILE_metabolism \\\n", "0-X-global-X-all_biotin_metabolism 0.04 \n", "1-X-global-X-all_purine_metabolism 0.00 \n", "2-X-global-X-all_ethanol_metabolism 0.00 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.00 \n", "4-X-global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.00 \n", "192-X-mast-X-192 0.00 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "194-X-pDC-X-194 0.00 \n", "195-X-plasma-X-195 0.00 \n", "\n", " ... \\\n", "0-X-global-X-all_biotin_metabolism ... \n", "1-X-global-X-all_purine_metabolism ... \n", "2-X-global-X-all_ethanol_metabolism ... \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... ... \n", "4-X-global-X-all_steroid_metabolism ... \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis ... \n", "192-X-mast-X-192 ... \n", "193-X-pDC-X-p-DC_CpG-TLR9_response ... \n", "194-X-pDC-X-194 ... \n", "195-X-plasma-X-195 ... \n", "\n", " all_folate_metabolism \\\n", "0-X-global-X-all_biotin_metabolism 0.058824 \n", "1-X-global-X-all_purine_metabolism 0.000000 \n", "2-X-global-X-all_ethanol_metabolism 0.000000 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.000000 \n", "4-X-global-X-all_steroid_metabolism 0.000000 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.000000 \n", "192-X-mast-X-192 0.000000 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "194-X-pDC-X-194 0.000000 \n", "195-X-plasma-X-195 0.000000 \n", "\n", " all_CYP_metabolism \\\n", "0-X-global-X-all_biotin_metabolism 0.0 \n", "1-X-global-X-all_purine_metabolism 0.0 \n", "2-X-global-X-all_ethanol_metabolism 0.0 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.0 \n", "4-X-global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.0 \n", "192-X-mast-X-192 0.0 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "194-X-pDC-X-194 0.0 \n", "195-X-plasma-X-195 0.0 \n", "\n", " T_IL21_response \\\n", "0-X-global-X-all_biotin_metabolism 0.0 \n", "1-X-global-X-all_purine_metabolism 0.0 \n", "2-X-global-X-all_ethanol_metabolism 0.0 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.0 \n", "4-X-global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.0 \n", "192-X-mast-X-192 0.0 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "194-X-pDC-X-194 0.0 \n", "195-X-plasma-X-195 0.0 \n", "\n", " p-DC_CpG-TLR9_response \\\n", "0-X-global-X-all_biotin_metabolism 0.0 \n", "1-X-global-X-all_purine_metabolism 0.0 \n", "2-X-global-X-all_ethanol_metabolism 0.0 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.0 \n", "4-X-global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.0 \n", "192-X-mast-X-192 0.0 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 1.0 \n", "194-X-pDC-X-194 0.0 \n", "195-X-plasma-X-195 0.0 \n", "\n", " all_NOD-like-receptor_signaling \\\n", "0-X-global-X-all_biotin_metabolism 0.04 \n", "1-X-global-X-all_purine_metabolism 0.00 \n", "2-X-global-X-all_ethanol_metabolism 0.00 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.00 \n", "4-X-global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.00 \n", "192-X-mast-X-192 0.00 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.04 \n", "194-X-pDC-X-194 0.00 \n", "195-X-plasma-X-195 0.00 \n", "\n", " all_eicosanoid_metabolism \\\n", "0-X-global-X-all_biotin_metabolism 0.00 \n", "1-X-global-X-all_purine_metabolism 0.00 \n", "2-X-global-X-all_ethanol_metabolism 0.00 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.00 \n", "4-X-global-X-all_steroid_metabolism 0.08 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.04 \n", "192-X-mast-X-192 0.08 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "194-X-pDC-X-194 0.04 \n", "195-X-plasma-X-195 0.00 \n", "\n", " CD4-T_IL12_response \\\n", "0-X-global-X-all_biotin_metabolism 0.0 \n", "1-X-global-X-all_purine_metabolism 0.0 \n", "2-X-global-X-all_ethanol_metabolism 0.0 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.0 \n", "4-X-global-X-all_steroid_metabolism 0.0 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.0 \n", "192-X-mast-X-192 0.0 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.0 \n", "194-X-pDC-X-194 0.0 \n", "195-X-plasma-X-195 0.0 \n", "\n", " all_fatty-acid-beta-oxidation-mitochondrial \\\n", "0-X-global-X-all_biotin_metabolism 0.000000 \n", "1-X-global-X-all_purine_metabolism 0.000000 \n", "2-X-global-X-all_ethanol_metabolism 0.086957 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.000000 \n", "4-X-global-X-all_steroid_metabolism 0.000000 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.000000 \n", "192-X-mast-X-192 0.000000 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "194-X-pDC-X-194 0.000000 \n", "195-X-plasma-X-195 0.000000 \n", "\n", " all_posttranslation-modification \\\n", "0-X-global-X-all_biotin_metabolism 0.000000 \n", "1-X-global-X-all_purine_metabolism 0.000000 \n", "2-X-global-X-all_ethanol_metabolism 0.000000 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.000000 \n", "4-X-global-X-all_steroid_metabolism 0.090909 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.000000 \n", "192-X-mast-X-192 0.000000 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.000000 \n", "194-X-pDC-X-194 0.000000 \n", "195-X-plasma-X-195 0.000000 \n", "\n", " all_transmembrane-transport-cellmembrane \n", "0-X-global-X-all_biotin_metabolism 0.04 \n", "1-X-global-X-all_purine_metabolism 0.00 \n", "2-X-global-X-all_ethanol_metabolism 0.00 \n", "3-X-global-X-all_amino-sugar-nucleotide-sugar_m... 0.00 \n", "4-X-global-X-all_steroid_metabolism 0.00 \n", "... ... \n", "191-X-mast-X-mast_granule-exocytosis 0.00 \n", "192-X-mast-X-192 0.00 \n", "193-X-pDC-X-p-DC_CpG-TLR9_response 0.00 \n", "194-X-pDC-X-194 0.00 \n", "195-X-plasma-X-195 0.00 \n", "\n", "[196 rows x 201 columns]" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#add index to make labels unique\n", "new_index =[]\n", "for h,i in enumerate(overlap_df.index):\n", " new_index.append(str(h)+'-X-'+str(i))\n", " \n", "overlap_df.index = new_index\n", "overlap_df" ] } ], "metadata": { "colab": { "authorship_tag": "ABX9TyPXZ9+aYYvqPmG/YgUJMYmF", "include_colab_link": true, "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.9" } }, "nbformat": 4, "nbformat_minor": 0 }