In [1]:
import numpy as np
import pandas as pd
import scanpy as sc
import leidenalg as leiden
import matplotlib.pyplot as plt

import seaborn as sns
import sceleto2 as scl
import scrublet as scr
import gseapy as gp
import glob
import os
import sys
import pickle

import decoupler

import scipy
from statannot import add_stat_annotation
import celltypist
import random
import symphonypy as sp
/home/kytak/.conda/envs/jp24/lib/python3.8/site-packages/pandas/core/computation/expressions.py:20: UserWarning: Pandas requires version '2.7.3' or newer of 'numexpr' (version '2.7.1' currently installed).
  from pandas.core.computation.check import NUMEXPR_INSTALLED
In [2]:
from pydeseq2.dds import DeseqDataSet
from pydeseq2.ds import DeseqStats
In [3]:
%matplotlib inline
In [4]:
sc.settings.verbosity = 3 
sc.logging.print_version_and_date()
sc.settings.set_figure_params(dpi=250)
Running Scanpy 1.9.8, on 2024-06-05 10:05.
In [5]:
gene_sets = 'GO_Molecular_Function_2021,GO_Biological_Process_2021,KEGG_2019_Mouse,KEGG_2021_Human,Reactome_2022,WikiPathway_2021_Human,WikiPathways_2019_Mouse,MSigDB_Hallmark_2020,GTEx_Aging_Signatures_2021' 
In [6]:
from gseapy.plot import barplot, dotplot, gseaplot
In [7]:
def run_enrichr(gene_list,gene_sets):
    enr = gp.enrichr(gene_list=gene_list,
                     gene_sets=gene_sets,
                     organism='mouse', # don't forget to set organism to the one you desired! e.g. Yeast
                     background = 5000,
                     outdir=None,
                     no_plot=True,
                     cutoff=0.1 # test dataset, use lower value from range(0,1)
                    )
    results = enr.results.sort_values(by = ['Adjusted P-value'])[:50]
    return results
In [8]:
class sample_volcano():
  
    def __init__(self,adata,patient_id,anno_key,comp1,comp2,P=0.01,quick=True,
                 fc_cut_pval=0.5,n_pos_cell=10,n_patient_cell=10):
        '''
        param P :pseudocount for fc calculation
        '''
        from scipy.stats import ttest_ind, mannwhitneyu
        self.genelist = adata.raw.var_names
        from collections import Counter
        
        # Removing Patients with cells less than n_patient_cell(10 by default)
        rmlist = []
        for f in Counter(adata.obs[patient_id]).items():
            if f[1]<n_patient_cell:
                rmlist.append(f[0])
            else:
                continue
        adata = adata[~adata.obs[patient_id].isin(rmlist)]
        
        adraw = adata.raw.to_adata()
        cond1 = adraw[adraw.obs[anno_key]==comp1]
        cond2 = adraw[adraw.obs[anno_key]==comp2]
        
        cond1 = pd.DataFrame(data=cond1.X.toarray(),index=cond1.obs[patient_id],columns=cond1.var_names)
        cond2 = pd.DataFrame(data=cond2.X.toarray(),index=cond2.obs[patient_id],columns=cond2.var_names)
        
        exp1 = cond1.groupby(cond1.index).mean()
        exp2 = cond2.groupby(cond2.index).mean()
        
        self.pval = []
        self.fc = []
        
        for i in adraw.var_names:
            # Calculating number of cell count with positive gene exp
            n_pos1 = np.sum(cond1[i]>0)
            n_pos2 = np.sum(cond2[i]>0)
            n_max = np.sum([n_pos1,n_pos2])
            
            # Calculating mean exp of each patient
            norm_count1 = np.mean(exp1[i])+P
            norm_count2 = np.mean(exp2[i])+P

            self.fc.append(np.log2(norm_count1/norm_count2))
            
            if quick:
                if np.abs(self.fc[-1])< fc_cut_pval:
                    self.pval.append(1)
                elif n_max < n_pos_cell:
                    self.pval.append(1)
                else:
                    self.pval.append(ttest_ind(exp1[i],exp2[i])[1])
            else:
                self.pval.append(ttest_ind(exp1[i],exp2[i])[1])

        self.pval = np.array(self.pval)
        self.fc = np.array(self.fc)
            
    def draw(self, title=None, pvalue_cut=100, to_show = 0.2, adjust_lim = 5, show=True, sig_mode = 'auto',adjust = True):
        '''
        draw volcano plot
        param pvalue_cut :-log10Pvalue for cutoff
        sig_mode: ['auto','complex','pval']
        '''
        from adjustText import adjust_text
        plt.figure(figsize=(6,6))

        xpos = np.array(self.fc)
        ypos = -np.log10(np.array(self.pval))
        ypos[ypos==np.inf] = np.max(ypos[ypos!=np.inf])

        if sig_mode == 'complex':
            index = (np.abs(xpos))*ypos
            index_cut = np.percentile(index,100-to_show)
            sig = (np.abs(xpos) > 1) & (ypos > 2) & ((np.abs(xpos))*ypos > index_cut)
        elif sig_mode =='pval':
            sig = (np.abs(xpos) > 1) & (ypos > pvalue_cut)
        elif sig_mode =='auto':
            index_cut = np.percentile(ypos,100-to_show)
            sig = (np.abs(xpos) > 1) & (ypos > index_cut)
        else:
            print('error, check sig_mode')
            raise SystemError

        if title:
            plt.title(title)
        plt.xlabel('log2FoldChange',fontsize=12)
        plt.ylabel('-log10Pval',fontsize=12)
        plt.xticks(fontsize=10)
        plt.yticks(fontsize=10)
        plt.scatter(xpos,ypos,s=1, color='k', alpha =0.5, rasterized=True)
        plt.scatter(xpos[sig],ypos[sig],s=3,color='red', rasterized=True)

        texts = []
        for i, gene in enumerate(self.genelist[sig]):
            texts.append(plt.text(xpos[sig][i],ypos[sig][i],gene,fontsize=5))
        
        if adjust:
            adjust_text(texts,only_move={'texts':'xy'},lim=adjust_lim)
        else:
            pass
        if show:
            plt.show()
In [42]:
final
Out[42]:
AnnData object with n_obs × n_vars = 93201 × 29814
    obs: 'pct_counts_mt', 'n_genes', 'n_counts', 'age', 'status', 'sample', 'age_status', 'annolv1', 'n_genes_by_counts', 'log1p_n_genes_by_counts', 'total_counts', 'log1p_total_counts', 'pct_counts_in_top_50_genes', 'pct_counts_in_top_100_genes', 'pct_counts_in_top_200_genes', 'pct_counts_in_top_500_genes', 'total_counts_mt', 'log1p_total_counts_mt'
    var: 'highly_variable', 'means', 'dispersions', 'dispersions_norm', 'mean', 'std'
    uns: 'age_colors', 'age_status_colors', 'annotation_publish_1_colors', 'annotation_publish_colors', 'condition_colors', 'hvg', 'neighbors', 'pca', 'predicted_labels_colors', 'sample_colors', 'sample_refined_colors', 'status_colors', 'subannotation_publish_1_colors', 'subannotation_publish_colors', 'umap'
    obsm: 'X_pca', 'X_pca_harmony', 'X_umap'
    varm: 'PCs'
    obsp: 'connectivities', 'distances'

Fig1.

proportion

In [102]:
df = pd.crosstab(final.obs['annotation_publish_1'], final.obs['age_status'], normalize=1)
In [121]:
l = []
for index in df.index:
    l.append(dict(zip(final.obs['annotation_publish_1'].cat.categories, final.uns['annotation_publish_1_colors']))[index])
In [122]:
df['color'] = l
In [104]:
df['log2fc(FiNi)'] = np.log2(df['Old_FiNi-seq']/df['Young_FiNi-seq'])
df['log2fc(Ctrl)'] = np.log2(df['Old_Control']/df['Young_Control'])
In [125]:
plt.scatter(x=df['log2fc(Ctrl)'], y=df['log2fc(FiNi)'], c=df['color'])

for index in df.index:
    plt.text(x=df['log2fc(Ctrl)'][index], y=df['log2fc(FiNi)'][index], s=index)
    

    
    
plt.xlabel('log2fc(Ctrl)')
plt.ylabel('log2fc(FiNi)')

y1, y2 = plt.gca().get_ylim()
x1, x2 = plt.gca().get_xlim()
lim = max(abs(x1), abs(x2), abs(y1), abs(y2))


plt.ylim(-lim, lim)
plt.xlim(-lim, lim)

plt.axhline(0, color='black', linewidth=0.7)
plt.axvline(0, color='black', linewidth=0.7)

plt.axhline(0.5, linestyle='--', color='lightskyblue', alpha=0.7, linewidth=0.7)
plt.axhline(-0.5, linestyle='--', color='peachpuff', alpha=0.7, linewidth=0.7)
plt.axvline(0.5, linestyle='--', color='navy', alpha=0.7, linewidth=0.7)
plt.axvline(-0.5, linestyle='--', color='orangered', alpha=0.7, linewidth=0.7)

savefig('scatter_agingproportion_bycondition')

vs tabula muris

In [127]:
tm
Out[127]:
AnnData object with n_obs × n_vars = 6480 × 19860
    obs: 'age', 'batch', 'cell', 'cell_ontology_class', 'cell_ontology_id', 'free_annotation', 'method', 'mouse.id', 'n_genes', 'sex', 'subtissue', 'tissue', 'tissue_free_annotation', 'n_counts', 'louvain', 'cluster_names', 'annotation'
    var: 'n_cells', 'means', 'dispersions', 'dispersions_norm', 'highly_variable'
    uns: 'cluster_names_colors', 'louvain', 'neighbors', 'pca', 'rank_genes_groups'
    obsm: 'X_pca', 'X_tsne', 'X_umap'
    varm: 'PCs'
    obsp: 'connectivities', 'distances'
In [249]:
scl.us(tm, 'annotation,age')
In [356]:
degtotal = {}
degtotal['Old_Ctrl'] = volcano_analysis(integrated, 'group', 'Old_Control','TM_Old')
degtotal['Old_FiNi'] = volcano_analysis(integrated, 'group', 'Old_FiNi-seq','TM_Old')
In [357]:
degtotal['Young_Ctrl'] = volcano_analysis(integrated, 'group', 'Young_Control','TM_Young')
degtotal['Young_FiNi'] = volcano_analysis(integrated, 'group', 'Young_FiNi-seq','TM_Young')
In [358]:
for key in degtotal:
    degtotal[key].columns = [key+'_'+x for x in degtotal[key].columns]
In [359]:
old_df = pd.concat([degtotal['Old_Ctrl'], degtotal['Old_FiNi']], axis=1)
young_df = pd.concat([degtotal['Young_Ctrl'], degtotal['Young_FiNi']], axis=1)
In [132]:
degdict = {}
for ct in ['Endothelial', 'Macrophage','Mesenchyme']:
    temp = {}
    for cd in ['Young','Old']:
        temp[cd+'_Ctrl'] = volcano_analysis(integrated[integrated.obs['annolv1']==ct],
                                            'group', cd+'_Control','TM_'+cd)
        temp[cd+'_FiNi'] = volcano_analysis(integrated[integrated.obs['annolv1']==ct],
                                            'group', cd+'_FiNi-seq','TM_'+cd)
    degdict[ct] = temp
In [370]:
for key in degdict['Endothelial']:
    temp = degdict['Endothelial'][key]
    print(key)
    temp = temp[temp['pval']<0.05]
    print(temp[temp['fc']>1].shape[0], temp[temp['fc']<-1].shape[0])
Young_Ctrl
430 4127
Young_FiNi
946 864
Old_Ctrl
112 5897
Old_FiNi
448 5302
In [371]:
for key in degdict['Mesenchyme']:
    temp = degdict['Mesenchyme'][key]
    print(key)
    temp = temp[temp['pval']<0.05]
    print(temp[temp['fc']>1].shape[0], temp[temp['fc']<-1].shape[0])
Young_Ctrl
0 0
Young_FiNi
0 0
Old_Ctrl
38 2220
Old_FiNi
93 2450
In [372]:
for key in degdict['Macrophage']:
    temp = degdict['Macrophage'][key]
    print(key)
    temp = temp[temp['pval']<0.05]
    print(temp[temp['fc']>1].shape[0], temp[temp['fc']<-1].shape[0])
Young_Ctrl
122 5602
Young_FiNi
178 1712
Old_Ctrl
413 7598
Old_FiNi
740 6243
In [433]:
fig, axes = plt.subplots(2,figsize=(5,10),sharey=True)
fig.tight_layout()

df = degdf[degdf['index'].str.contains('O')]
sns.barplot(data=df[df['variable']=='Endo'], x='variable', y='abs', hue='index', ax=axes[0])
df = degdf[degdf['index'].str.contains('Y')]
sns.barplot(data=df[df['variable']=='Endo'], x='variable', y='abs', hue='index', ax=axes[1])
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 26 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'O', 'Y', 'a', 'b', 'd', 'e', 'eight', 'four', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'r', 's', 'six', 'space', 'two', 'v', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 27, 38, 40, 41, 50, 60, 68, 69, 71, 72, 76, 79, 81, 82, 85, 86, 89, 91]
Closed glyph list over 'GSUB': 26 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'O', 'Y', 'a', 'b', 'd', 'e', 'eight', 'four', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'r', 's', 'six', 'space', 'two', 'v', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 27, 38, 40, 41, 50, 60, 68, 69, 71, 72, 76, 79, 81, 82, 85, 86, 89, 91]
Closing glyph list over 'MATH': 26 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'O', 'Y', 'a', 'b', 'd', 'e', 'eight', 'four', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'r', 's', 'six', 'space', 'two', 'v', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 27, 38, 40, 41, 50, 60, 68, 69, 71, 72, 76, 79, 81, 82, 85, 86, 89, 91]
Closed glyph list over 'MATH': 26 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'O', 'Y', 'a', 'b', 'd', 'e', 'eight', 'four', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'r', 's', 'six', 'space', 'two', 'v', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 27, 38, 40, 41, 50, 60, 68, 69, 71, 72, 76, 79, 81, 82, 85, 86, 89, 91]
Closing glyph list over 'glyf': 26 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'O', 'Y', 'a', 'b', 'd', 'e', 'eight', 'four', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'r', 's', 'six', 'space', 'two', 'v', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 27, 38, 40, 41, 50, 60, 68, 69, 71, 72, 76, 79, 81, 82, 85, 86, 89, 91]
Closed glyph list over 'glyf': 26 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'O', 'Y', 'a', 'b', 'd', 'e', 'eight', 'four', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'r', 's', 'six', 'space', 'two', 'v', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 27, 38, 40, 41, 50, 60, 68, 69, 71, 72, 76, 79, 81, 82, 85, 86, 89, 91]
Retaining 26 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [380]:
rdict = {}
for key in degdict['Endothelial']:
    temp = degdict['Endothelial'][key]
    print(key)
    temp = temp[temp['pval']<0.05]
    if len(temp[temp['fc']>1]['genelist']) > 0:
        rdict[key+'_pos'] = run_enrichr(temp[temp['fc']>1]['genelist'], gene_sets)
    if len(temp[temp['fc']>1]['genelist']) > 0:
        rdict[key+'_neg'] = run_enrichr(temp[temp['fc']<-1]['genelist'], gene_sets)
Young_Ctrl
Young_FiNi
Old_Ctrl
Old_FiNi
In [381]:
rdicts['Endothelial'] = rdict
In [374]:
rdict = {}
for key in degdict['Macrophage']:
    temp = degdict['Macrophage'][key]
    print(key)
    temp = temp[temp['pval']<0.05]
    if len(temp[temp['fc']>1]['genelist']) > 0:
        rdict[key+'_pos'] = run_enrichr(temp[temp['fc']>1]['genelist'], gene_sets)
    if len(temp[temp['fc']>1]['genelist']) > 0:
        rdict[key+'_neg'] = run_enrichr(temp[temp['fc']<-1]['genelist'], gene_sets)
Young_Ctrl
Young_FiNi
Old_Ctrl
Old_FiNi
In [375]:
rdicts['Macrophage'] = rdict
In [376]:
rdict = {}
for key in degdict['Mesenchyme']:
    temp = degdict['Mesenchyme'][key]
    print(key)
    temp = temp[temp['pval']<0.05]
    if len(temp[temp['fc']>1]['genelist']) > 0:
        rdict[key+'_pos'] = run_enrichr(temp[temp['fc']>1]['genelist'], gene_sets)
    if len(temp[temp['fc']>1]['genelist']) > 0:
        rdict[key+'_neg'] = run_enrichr(temp[temp['fc']<-1]['genelist'], gene_sets)
Young_Ctrl
Young_FiNi
Old_Ctrl
Old_FiNi
In [ ]:
rdicts['Mesenchymal'] = rdict
In [382]:
rdicts['Endothelial']['Old_FiNi_pos']
Out[382]:
Gene_set Term Overlap P-value Adjusted P-value Old P-value Old Adjusted P-value Odds Ratio Combined Score Genes
5228 MSigDB_Hallmark_2020 TNF-alpha Signaling via NF-kB 49/200 7.543581e-37 3.620919e-35 0 0 15.778669 1312.389987 BTG3;BTG2;CDKN1A;BTG1;SERPINE1;TNFAIP3;CXCL1;Z...
5229 MSigDB_Hallmark_2020 Hypoxia 31/200 1.795652e-17 4.309564e-16 0 0 8.526287 328.761495 ERRFI1;CDKN1A;TES;BTG1;CITED2;SERPINE1;STC1;TN...
3781 Reactome_2022 Signal Transduction R-HSA-162582 122/2465 5.600459e-18 5.292434e-15 0 0 2.748689 109.188044 CHRM3;CCNT1;ZFYVE9;SERPINE1;CLSTN1;WIPF3;STMN2...
5230 MSigDB_Hallmark_2020 Epithelial Mesenchymal Transition 25/200 3.598453e-12 5.757524e-11 0 0 6.544073 172.439707 FOXC2;SERPINE2;ELN;SERPINE1;TNFAIP3;PLOD2;CXCL...
465 GO_Biological_Process_2021 positive regulation of transcription, DNA-temp... 71/1183 2.325963e-14 6.628996e-11 0 0 3.123008 98.037652 CSRNP1;CSF3;CCNT1;CITED2;SERPINE1;RASL11A;RORA...
466 GO_Biological_Process_2021 positive regulation of transcription by RNA po... 60/908 5.068480e-14 7.222584e-11 0 0 3.410815 104.415793 CSRNP1;CSF3;CCNT1;CITED2;SERPINE1;RORA;CDC73;C...
467 GO_Biological_Process_2021 regulation of cell population proliferation (G... 53/764 2.641515e-13 2.509439e-10 0 0 3.555602 102.978242 BTG3;COL18A1;BTG2;CDKN1A;CSF3;TES;BTG1;ELN;CXC...
468 GO_Biological_Process_2021 cellular protein modification process (GO:0006... 60/1025 8.774665e-12 6.251949e-09 0 0 2.978527 75.830768 CHRM3;CCNT1;PLOD2;PLAT;PRSS23;DUSP16;PTAR1;PIM...
5231 MSigDB_Hallmark_2020 p53 Pathway 22/200 8.718849e-10 1.046262e-08 0 0 5.620984 117.255778 JAG2;PLK3;JUN;CDKN1A;BTG2;BTG1;RRAD;ITGB4;SPHK...
3782 Reactome_2022 Signaling By Receptor Tyrosine Kinases R-HSA-9... 37/496 1.734671e-10 8.196319e-08 0 0 3.744738 84.163102 RRAD;PDE3B;PDGFA;PLAT;CBL;PCSK5;THBS1;CRKL;SPR...
5233 MSigDB_Hallmark_2020 Inflammatory Response 20/200 2.626546e-08 2.101237e-07 0 0 5.029076 87.782573 CDKN1A;BTG2;EDN1;CSF3;SPHK1;RGS16;SERPINE1;PLA...
5232 MSigDB_Hallmark_2020 Apoptosis 18/161 2.332107e-08 2.101237e-07 0 0 5.681607 99.848037 BTG3;JUN;TGFB2;CDKN1A;BTG2;EGR3;GADD45B;TNFRSF...
5276 GTEx_Aging_Signatures_2021 GTEx Breast 20-29 vs 70-79 Up 24/250 2.394301e-09 2.921048e-07 0 0 4.840374 96.082268 EGR1;JUN;RGS16;SERPINE1;STC1;FOS;SELE;GEM;RND1...
5277 GTEx_Aging_Signatures_2021 GTEx Breast 20-29 vs 60-69 Up 24/250 2.394301e-09 2.921048e-07 0 0 4.840374 96.082268 EGR1;DUSP5;JUN;GDA;RGS16;SERPINE1;STMN2;STC1;F...
469 GO_Biological_Process_2021 regulation of transcription by RNA polymerase ... 93/2206 1.082457e-09 6.170004e-07 0 0 2.162104 44.634555 CSRNP1;CDKN1A;CSF3;CCNT1;CITED2;SERPINE1;ZBTB2...
3315 KEGG_2019_Mouse MAPK signaling pathway 26/294 2.962824e-09 6.636726e-07 0 0 4.433260 87.056476 PDGFA;DUSP16;CRKL;ELK4;RPS6KA3;MYC;GNA12;FLNC;...
3539 KEGG_2021_Human MAPK signaling pathway 26/294 2.962824e-09 7.170034e-07 0 0 4.433260 87.056476 PDGFA;DUSP16;CRKL;ELK4;RPS6KA3;MYC;GNA12;FLNC;...
5234 MSigDB_Hallmark_2020 IL-2/STAT5 Signaling 19/199 1.226792e-07 8.412286e-07 0 0 4.766485 75.852386 PRNP;GADD45B;AHNAK;PTCH1;RGS16;ODC1;EMP1;RORA;...
470 GO_Biological_Process_2021 negative regulation of cell population prolife... 30/379 2.482182e-09 1.179037e-06 0 0 3.949014 78.246259 BTG3;COL18A1;BTG2;CDKN1A;TES;BTG1;GATA6;TNFAIP...
5116 WikiPathways_2019_Mouse Endochondral Ossification WP1270 12/62 1.080156e-08 1.209774e-06 0 0 10.735046 196.919127 ADAMTS4;TGFB2;CHST11;ADAMTS1;PTCH1;MGP;SPP1;IG...
473 GO_Biological_Process_2021 extracellular matrix organization (GO:0030198) 26/300 4.531857e-09 1.435088e-06 0 0 4.334832 83.281381 COL18A1;COL15A1;ITGB4;ELN;SERPINE1;PDGFA;PLOD2...
471 GO_Biological_Process_2021 extracellular structure organization (GO:0043062) 22/216 3.736896e-09 1.435088e-06 0 0 5.153139 99.996712 COL18A1;COL15A1;VWF;ITGB4;ELN;SERPINE1;COL23A1...
472 GO_Biological_Process_2021 external encapsulating structure organization ... 22/217 4.073673e-09 1.435088e-06 0 0 5.126448 99.036409 COL18A1;COL15A1;VWF;ITGB4;ELN;SERPINE1;COL23A1...
0 GO_Molecular_Function_2021 sequence-specific DNA binding (GO:0043565) 43/707 3.213658e-09 1.494351e-06 0 0 3.020170 59.062001 NFAT5;CSRNP1;FOXC2;GATA6;ZBTB20;RORA;GATA2;CXX...
4728 WikiPathway_2021_Human Endochondral Ossification WP474 12/64 1.577048e-08 2.050162e-06 0 0 10.321101 185.419881 ADAMTS4;TGFB2;CHST11;ADAMTS1;PTCH1;MGP;SPP1;IG...
4726 WikiPathway_2021_Human VEGFA-VEGFR2 Signaling Pathway WP3888 31/432 1.367302e-08 2.050162e-06 0 0 3.550363 64.289405 ADRB2;GATA2;CBL;SLC7A1;APOLD1;RND1;ADAMTS1;CCL...
4727 WikiPathway_2021_Human Endochondral Ossification with Skeletal Dyspla... 12/64 1.577048e-08 2.050162e-06 0 0 10.321101 185.419881 ADAMTS4;TGFB2;CHST11;ADAMTS1;PTCH1;MGP;SPP1;IG...
3783 Reactome_2022 NGF-stimulated Transcription R-HSA-9031628 10/39 1.022799e-08 2.541437e-06 0 0 15.370020 282.779760 FOSL1;EGR1;EGR2;ARC;EGR3;JUND;RRAD;FOSB;FOS;MEF2D
3784 Reactome_2022 Extracellular Matrix Organization R-HSA-1474244 25/291 1.075740e-08 2.541437e-06 0 0 4.285092 78.621464 COL18A1;COL15A1;ITGB4;SERPINE1;NTN4;PDGFA;PLOD...
4729 WikiPathway_2021_Human TGF-beta Signaling Pathway WP366 16/132 4.492558e-08 4.380244e-06 0 0 6.205619 104.988273 JUN;CDKN1A;JUND;ZFYVE9;ITGB4;CAV1;FN1;FOS;THBS...
2 GO_Molecular_Function_2021 sequence-specific double-stranded DNA binding ... 41/712 3.527760e-08 5.468027e-06 0 0 2.834601 48.641802 NFAT5;FOXC2;GATA6;ZBTB20;GATA2;MEOX1;ELK4;HEY1...
1 GO_Molecular_Function_2021 double-stranded DNA binding (GO:0003690) 39/651 2.713059e-08 5.468027e-06 0 0 2.951004 51.414180 NFAT5;FOXC2;GATA6;ZBTB20;GATA2;MEOX1;ELK4;HEY1...
5235 MSigDB_Hallmark_2020 Angiogenesis 8/36 1.038891e-06 6.233348e-06 0 0 12.677922 174.668252 JAG2;JAG1;SPP1;STC1;PDGFA;S100A4;FSTL1;FGFR1
3317 KEGG_2019_Mouse Transcriptional misregulation in cancer 18/183 1.683190e-07 7.638871e-06 0 0 4.918478 76.715490 CDKN1A;CCNT1;GADD45B;FUS;IGFBP3;ZBTB16;JMJD1C;...
3316 KEGG_2019_Mouse Parathyroid hormone synthesis, secretion and a... 14/107 1.192146e-07 7.638871e-06 0 0 6.749566 107.603888 EGR1;CDKN1A;JUND;FOS;NR4A2;AKAP13;CREB3L2;GNA1...
3319 KEGG_2019_Mouse Pathways in cancer 33/535 1.705105e-07 7.638871e-06 0 0 3.017568 47.027199 CDKN1A;PDGFA;CBL;CRKL;EDNRB;HEY1;MYC;SUFU;GNA1...
3318 KEGG_2019_Mouse TNF signaling pathway 14/110 1.694024e-07 7.638871e-06 0 0 6.537634 101.928187 JUN;EDN1;JAG1;TNFAIP3;CXCL1;FOS;SELE;CX3CL1;SO...
474 GO_Biological_Process_2021 positive regulation of cell population prolife... 32/474 3.358816e-08 8.929009e-06 0 0 3.325792 57.233859 CDKN1A;CSF3;PDGFA;THBS1;CX3CL1;CRKL;GRK5;MYC;G...
475 GO_Biological_Process_2021 negative regulation of transcription by RNA po... 40/684 3.446284e-08 8.929009e-06 0 0 2.878456 49.461611 FOXC2;CITED2;GATA6;ENO1;AEBP1;CXXC5;CDC73;ELK4...
3 GO_Molecular_Function_2021 RNA polymerase II cis-regulatory region sequen... 55/1149 8.705869e-08 1.012057e-05 0 0 2.361225 38.385695 ZBTB20;RORA;MEOX1;ELK4;HEY1;MYC;CREB3L2;HOXA7;...
3540 KEGG_2021_Human Parathyroid hormone synthesis, secretion and a... 14/106 1.057482e-07 1.157024e-05 0 0 6.823282 109.596950 EGR1;CDKN1A;JUND;FOS;NR4A2;AKAP13;CREB3L2;GNA1...
3541 KEGG_2021_Human Pathways in cancer 33/531 1.434327e-07 1.157024e-05 0 0 3.042444 47.941015 CDKN1A;PDGFA;CBL;CRKL;EDNRB;HEY1;MYC;SUFU;GNA1...
5236 MSigDB_Hallmark_2020 UV Response Up 15/158 2.806387e-06 1.243071e-05 0 0 4.701869 60.106867 BTG3;BTG2;BTG1;CHKA;RRAD;AMD1;HSPA2;FOS;NR4A1;...
5237 MSigDB_Hallmark_2020 Myogenesis 17/200 2.848704e-06 1.243071e-05 0 0 4.174724 53.305574 PRNP;CDKN1A;COL15A1;GADD45B;ITGB4;SPHK1;IGFBP3...
5238 MSigDB_Hallmark_2020 KRAS Signaling Up 17/200 2.848704e-06 1.243071e-05 0 0 4.174724 53.305574 IGFBP3;RGS16;IGF2;PLAUR;AMMECR1;EMP1;TNFAIP3;P...
3542 KEGG_2021_Human TNF signaling pathway 14/112 2.127056e-07 1.286869e-05 0 0 6.403555 98.380099 JUN;EDN1;JAG1;TNFAIP3;CXCL1;FOS;SELE;CX3CL1;SO...
4730 WikiPathway_2021_Human MAPK Signaling Pathway WP382 21/246 1.816010e-07 1.416488e-05 0 0 4.224481 65.570085 MAP4K2;JUN;DUSP2;TGFB2;JUND;PDGFA;NFATC1;FOS;H...
3544 KEGG_2021_Human AGE-RAGE signaling pathway in diabetic complic... 13/100 3.641630e-07 1.468791e-05 0 0 6.686352 99.129614 EGR1;JUN;TGFB2;EDN1;SERPINE1;FN1;NFATC1;SELE;I...
3543 KEGG_2021_Human Transcriptional misregulation in cancer 18/192 3.462551e-07 1.468791e-05 0 0 4.661909 69.350972 CDKN1A;CCNT1;GADD45B;FUS;IGFBP3;ZBTB16;JMJD1C;...
3320 KEGG_2019_Mouse AGE-RAGE signaling pathway in diabetic complic... 13/101 4.095667e-07 1.529049e-05 0 0 6.610031 97.221439 EGR1;TGFB2;JUN;EDN1;SERPINE1;FN1;NFATC1;SELE;I...
In [326]:
rdicts['Macrophage']['Old_FiNi_pos']
Out[326]:
Gene_set Term Overlap P-value Adjusted P-value Old P-value Old Adjusted P-value Odds Ratio Combined Score Genes
6201 MSigDB_Hallmark_2020 TNF-alpha Signaling via NF-kB 30/200 4.464181e-11 2.187449e-09 0 0 4.829429 115.096634 BTG3;TNFAIP6;IRS2;CXCL1;CXCL3;AREG;NFIL3;DNAJB...
6202 MSigDB_Hallmark_2020 KRAS Signaling Up 29/200 2.161885e-10 5.296619e-09 0 0 4.634264 103.134955 SPON1;SATB1;F13A1;PLAT;IL1RL2;GPNMB;SPP1;SOX9;...
6203 MSigDB_Hallmark_2020 IL-2/STAT5 Signaling 28/199 8.949567e-10 1.461763e-08 0 0 4.468070 93.088872 BMPR2;AHNAK;RORA;IKZF2;CST7;IGF1R;SPRED2;NT5E;...
3981 KEGG_2019_Mouse Cytokine-cytokine receptor interaction 35/292 6.354081e-10 1.690185e-07 0 0 3.736784 79.132958 CX3CR1;CNTF;BMPR2;TNFRSF13B;CXCL1;IL1RAP;CXCL3...
4528 Reactome_2022 Signal Transduction R-HSA-162582 149/2465 1.646637e-10 1.809654e-07 0 0 1.884051 42.442226 CYFIP2;DGKG;TRIO;CCNT2;ZFYVE9;GPR68;WWC1;CLSTN...
4247 KEGG_2021_Human Cytokine-cytokine receptor interaction 35/295 8.381453e-10 2.355188e-07 0 0 3.693085 77.184841 CX3CR1;CNTF;BMPR2;TNFRSF13B;CXCL1;IL1RAP;CXCL3...
6205 MSigDB_Hallmark_2020 Inflammatory Response 25/200 7.849262e-08 7.692277e-07 0 0 3.880715 63.489516 TNFAIP6;PTAFR;SGMS2;ACVR1B;GPR132;IL18RAP;PDPN...
6204 MSigDB_Hallmark_2020 Epithelial Mesenchymal Transition 25/200 7.849262e-08 7.692277e-07 0 0 3.880715 63.489516 SERPINE2;ELN;FBLN1;CXCL1;AREG;THBS1;COMP;NT5E;...
598 GO_Biological_Process_2021 cytokine-mediated signaling pathway (GO:0019221) 53/621 8.381297e-09 2.835393e-05 0 0 2.585582 48.084742 CNTF;TNFRSF13B;FLT3;F13A1;IRS2;RORA;CXCL1;IL1R...
3982 KEGG_2019_Mouse Transcriptional misregulation in cancer 23/183 2.340330e-07 3.112639e-05 0 0 3.896950 59.497873 MEF2C;CCNT2;FLT1;BCL11B;EYA1;FLT3;ZBTB16;JMJD1...
4529 Reactome_2022 Cytokine Signaling In Immune System R-HSA-1280215 55/702 8.095941e-08 4.448719e-05 0 0 2.352554 38.415605 CNTF;TNFRSF13B;FLT3;CLSTN1;F13A1;IRS2;RORA;CXC...
4248 KEGG_2021_Human Transcriptional misregulation in cancer 23/192 5.567432e-07 7.822242e-05 0 0 3.687683 53.106920 MEF2C;CCNT2;FLT1;BCL11B;EYA1;FLT3;ZBTB16;JMJD1...
4249 KEGG_2021_Human Pathways in cancer 43/531 9.139886e-07 8.561027e-05 0 0 2.416274 33.599369 FLT3;TCF7;LEF1;CRKL;IGF1R;FRAT1;BCL2L11;FRAT2;...
599 GO_Biological_Process_2021 positive regulation of cell migration (GO:0030... 30/269 5.563139e-08 9.410050e-05 0 0 3.422750 57.175389 SEMA7A;BMPR2;FLT1;LEF1;ACVR1B;THBS1;CRKL;IGF1R...
3983 KEGG_2019_Mouse Pathways in cancer 43/535 1.114447e-06 9.881429e-05 0 0 2.396119 32.843967 FLT3;TCF7;LEF1;CRKL;IGF1R;FRAT1;BCL2L11;FRAT2;...
601 GO_Biological_Process_2021 regulation of cell migration (GO:0030334) 38/408 1.257160e-07 1.063243e-04 0 0 2.813459 44.703722 SEMA7A;FLT1;SERPINE2;ULK4;LEF1;FOXO3;THBS1;IGF...
600 GO_Biological_Process_2021 regulation of cell population proliferation (G... 58/764 1.047546e-07 1.063243e-04 0 0 2.276496 36.587032 BTG3;CNTF;TES;BMPR2;FLT1;FLT3;ELN;IRS2;CXCL1;A...
602 GO_Biological_Process_2021 cellular response to cytokine stimulus (GO:007... 42/482 1.744189e-07 1.180118e-04 0 0 2.620408 40.778283 CNTF;FLT3;MAOA;PTAFR;TCF7;LEF1;F13A1;RORA;CXCL...
6074 WikiPathways_2019_Mouse Endochondral Ossification WP1270 12/62 2.006758e-06 2.548583e-04 0 0 6.443128 84.527339 MEF2C;CHST11;PTCH1;MGP;SPP1;PLAT;SOX9;RUNX3;RU...
6206 MSigDB_Hallmark_2020 Angiogenesis 8/36 3.630518e-05 2.964923e-04 0 0 7.636508 78.072221 JAG2;VCAN;JAG1;SPP1;OLR1;S100A4;VEGFA;VAV2
5627 WikiPathway_2021_Human TGF-beta receptor signaling in skeletal dyspla... 12/58 9.466212e-07 4.231397e-04 0 0 7.004858 97.159949 CREBBP;IFNG;ZFYVE9;BAMBI;ADAMTSL2;LEF1;SPP1;LT...
5628 WikiPathway_2021_Human Endochondral Ossification with Skeletal Dyspla... 12/64 2.854367e-06 4.253007e-04 0 0 6.194671 79.085265 MEF2C;CHST11;PTCH1;MGP;SPP1;PLAT;SOX9;RUNX3;RU...
5629 WikiPathway_2021_Human Endochondral Ossification WP474 12/64 2.854367e-06 4.253007e-04 0 0 6.194671 79.085265 MEF2C;CHST11;PTCH1;MGP;SPP1;PLAT;SOX9;RUNX3;RU...
603 GO_Biological_Process_2021 positive regulation of protein kinase B signal... 20/161 1.706267e-06 8.022413e-04 0 0 3.832792 50.904093 CX3CR1;OSBPL8;RAMP3;F10;FLT3;OSM;IRS2;NRG1;ESR...
604 GO_Biological_Process_2021 positive regulation of signal transduction (GO... 26/252 1.884578e-06 8.022413e-04 0 0 3.121272 41.144000 NECAB2;CD63;LRRK2;AGPAT2;ZMIZ1;MGAT5;TNFSF11;T...
605 GO_Biological_Process_2021 positive regulation of intracellular signal tr... 43/546 1.897112e-06 8.022413e-04 0 0 2.342346 30.860824 CX3CR1;FLT1;RAMP3;FLT3;SCHIP1;WWC1;PELI2;IRS2;...
6075 WikiPathways_2019_Mouse TGF Beta Signaling Pathway WP113 10/52 1.520157e-05 9.652998e-04 0 0 6.376840 70.745381 CREBBP;IFNG;ZFYVE9;BAMBI;LEF1;SPP1;INHBA;RUNX3...
3984 KEGG_2019_Mouse Proteoglycans in cancer 21/203 1.734172e-05 1.153224e-03 0 0 3.115548 34.153868 FZD1;CD63;FZD5;PTCH1;FN1;PLAUR;ESR1;THBS1;VAV2...
4250 KEGG_2021_Human Proteoglycans in cancer 21/205 2.012051e-05 1.413466e-03 0 0 3.081360 33.321124 FZD1;CD63;FZD5;PTCH1;FN1;PLAUR;ESR1;THBS1;VAV2...
606 GO_Biological_Process_2021 positive regulation of cell population prolife... 38/474 4.977808e-06 1.783510e-03 0 0 2.379231 29.051656 CNTF;FLT1;FLT3;LEF1;IRS2;AREG;THBS1;CRKL;IGF1R...
609 GO_Biological_Process_2021 positive regulation of cell motility (GO:2000147) 23/221 6.326371e-06 1.783510e-03 0 0 3.142790 37.621655 SEMA4A;SEMA7A;FLT1;F10;SEMA4D;SPHK1;LEF1;THBS1...
608 GO_Biological_Process_2021 positive regulation of cytokine production (GO... 30/335 5.846591e-06 1.783510e-03 0 0 2.672789 32.206174 ITK;TXK;RORA;AGPAT2;MALT1;CCR7;MBP;CCR2;IL12RB...
607 GO_Biological_Process_2021 Wnt signaling pathway (GO:0016055) 14/92 5.753258e-06 1.783510e-03 0 0 4.825038 58.217671 FZD1;ZRANB1;FZD5;LRRK2;LEF1;TCF7;KLHL12;NR4A2;...
5630 WikiPathway_2021_Human TGF-beta Receptor Signaling WP560 10/54 2.153453e-05 2.406484e-03 0 0 6.086351 65.403031 CREBBP;IFNG;ZFYVE9;BAMBI;LEF1;SPP1;INHBA;RUNX3...
6077 WikiPathways_2019_Mouse Inflammatory Response Pathway WP458 7/30 8.050302e-05 2.436990e-03 0 0 8.125369 76.599611 COL1A2;CD40LG;IFNG;IL2RB;FN1;THBS1;IL2
6078 WikiPathways_2019_Mouse Osteoclast WP454 5/14 9.594448e-05 2.436990e-03 0 0 14.801752 136.941973 GPR68;IFNB1;CTSK;SPP1;TNFSF11
6076 WikiPathways_2019_Mouse Spinal Cord Injury WP2432 13/99 6.126300e-05 2.436990e-03 0 0 4.056237 39.346853 EPHA4;ANXA1;TNFSF13;XYLT1;CXCL1;IL2;VCAN;CHST1...
610 GO_Biological_Process_2021 cellular response to organic substance (GO:007... 16/123 1.013989e-05 2.520646e-03 0 0 4.024992 46.283517 BMPR2;RAMP3;IGFBP5;FLT3;LRRK2;SPHK1;LEF1;ACVR1...
611 GO_Biological_Process_2021 positive regulation of multicellular organisma... 30/345 1.043128e-05 2.520646e-03 0 0 2.586574 29.669816 ITK;BMPR2;TXK;LEF1;ENO1;ACVR1B;AGPAT2;IGF1R;PD...
6207 MSigDB_Hallmark_2020 Estrogen Response Early 18/200 3.915096e-04 2.740567e-03 0 0 2.659186 20.862644 EGR3;BCL11B;WWC1;ABHD2;KRT8;NAV2;AREG;CBFA2T3;...
4530 Reactome_2022 Immune System R-HSA-168256 107/1943 8.453575e-06 3.096826e-03 0 0 1.636313 19.113642 CYFIP2;CNTF;CLSTN1;F13A1;IRS2;RORA;IL1RAP;FBXO...
4251 KEGG_2021_Human Viral protein interaction with cytokine and cy... 13/100 6.811162e-05 3.827873e-03 0 0 4.009404 38.467680 CX3CR1;TNFSF14;CXCL1;CXCL3;CXCL14;IL2;IL18RAP;...
6208 MSigDB_Hallmark_2020 Wnt-beta Catenin Signaling 7/42 7.303012e-04 4.473095e-03 0 0 5.336200 38.538320 JAG2;FZD1;FRAT1;JAG1;PTCH1;LEF1;TCF7
5631 WikiPathway_2021_Human Endoderm differentiation WP2853 16/141 5.629188e-05 4.746152e-03 0 0 3.442157 33.681372 DUSP5;ATP8B2;WWC1;SCHIP1;TCF7;SLC2A12;LEF1;GDF...
5632 WikiPathway_2021_Human Selective expression of chemokine receptors du... 7/29 6.370674e-05 4.746152e-03 0 0 8.495146 82.073472 CD40LG;IFNG;CCR7;IL2;IL18R1;CCR2;IL12RB2
612 GO_Biological_Process_2021 positive regulation of transcription, DNA-temp... 71/1183 2.289350e-05 4.925052e-03 0 0 1.764835 18.856654 EHF;CCNT2;BMPR2;RORA;ELK4;SPIB;IL4I1;RPS6KA3;M...
613 GO_Biological_Process_2021 regulation of protein kinase B signaling (GO:0... 21/207 2.329318e-05 4.925052e-03 0 0 3.047908 32.513101 CX3CR1;OSBPL8;RAMP3;F10;FLT3;OSM;IRS2;NRG1;ARE...
614 GO_Biological_Process_2021 negative regulation of cell population prolife... 31/379 2.492249e-05 4.959576e-03 0 0 2.418592 25.636446 BTG3;TES;BMPR2;FBLN1;CXCL1;TOB1;GPNMB;PDPN;TNF...
0 GO_Molecular_Function_2021 purine ribonucleoside triphosphate binding (GO... 36/460 1.489582e-05 5.129737e-03 0 0 2.312575 25.702952 RRAD;LRRK2;DIRAS2;ARL1;ATP1A3;RND2;ACVR1B;THG1...
1 GO_Molecular_Function_2021 cytokine receptor activity (GO:0004896) 13/88 1.715631e-05 5.129737e-03 0 0 4.653818 51.067019 CX3CR1;FLT3;IL1RAP;IL1RL2;IL18RAP;IL3RA;IL2RB;...
In [327]:
rdicts['Mesenchymal']['Old_FiNi_pos']
Out[327]:
Gene_set Term Overlap P-value Adjusted P-value Old P-value Old Adjusted P-value Odds Ratio Combined Score Genes
3281 MSigDB_Hallmark_2020 TNF-alpha Signaling via NF-kB 29/200 1.734012e-28 7.109450e-27 0 0 25.860601 1653.059914 PPP1R15A;BTG2;CDKN1A;TNFAIP3;IRS2;CXCL1;SOCS3;...
3282 MSigDB_Hallmark_2020 Epithelial Mesenchymal Transition 21/200 7.572668e-18 1.552397e-16 0 0 16.838193 663.795002 TAGLN;JUN;PRRX1;SERPINE2;GADD45B;DST;TPM2;ELN;...
3283 MSigDB_Hallmark_2020 Apoptosis 15/161 2.722883e-12 3.721273e-11 0 0 14.150781 376.825810 TGFB2;CREBBP;JUN;BTG2;CDKN1A;GSN;EGR3;GADD45B;...
3284 MSigDB_Hallmark_2020 Hypoxia 13/200 7.032808e-09 7.208629e-08 0 0 9.423382 176.902130 PPP1R15A;JUN;CDKN1A;WSB1;DUSP1;TNFAIP3;IRS2;FO...
2899 WikiPathway_2021_Human IL-18 signaling pathway WP4754 15/272 4.436257e-09 1.304259e-06 0 0 7.993660 153.745700 SPON1;JUN;BTG2;TNFAIP3;FOS;NFKBIA;ACTA2;NR4A1;...
2900 WikiPathway_2021_Human Vitamin D Receptor Pathway WP2877 12/182 2.327398e-08 3.421275e-06 0 0 9.511039 167.165364 TGFB2;SFRP1;CDKN1A;IGFBP5;ID1;S100A6;SPP1;CD9;...
3286 MSigDB_Hallmark_2020 KRAS Signaling Up 11/200 5.675965e-07 3.878576e-06 0 0 7.781125 111.907014 PPP1R15A;AKAP12;SPON1;PRRX1;SPP1;ITGBL1;EMP1;T...
3285 MSigDB_Hallmark_2020 p53 Pathway 11/200 5.675965e-07 3.878576e-06 0 0 7.781125 111.907014 HEXIM1;PPP1R15A;JUN;BTG2;CDKN1A;RRAD;FOS;KLF4;...
2323 Reactome_2022 NGF-stimulated Transcription R-HSA-9031628 7/39 2.090137e-08 1.203919e-05 0 0 28.698262 507.484310 EGR1;EGR3;RRAD;NAB1;ID1;FOSB;FOS
3288 MSigDB_Hallmark_2020 UV Response Up 9/158 4.691632e-06 2.404461e-05 0 0 7.983289 97.952802 NFKBIA;NR4A1;BTG2;RRAD;FOSB;FOS;JUNB;ATF3;GLS
3287 MSigDB_Hallmark_2020 mTORC1 Signaling 10/200 4.423088e-06 2.404461e-05 0 0 6.988620 86.160410 PPP1R15A;BTG2;CDKN1A;PNP;IGFBP5;IFRD1;FGL2;CD9...
243 GO_Biological_Process_2021 extracellular matrix organization (GO:0030198) 15/300 1.656827e-08 2.801694e-05 0 0 7.198013 128.957984 COL18A1;TGFB2;COL15A1;GSN;DST;LAMB2;ELN;HTRA1;...
2324 Reactome_2022 Signal Transduction R-HSA-162582 44/2465 1.115798e-07 3.213499e-05 0 0 2.777321 44.460819 PPP1R15A;CDKN1A;BMPR2;RRAD;NAB1;CLSTN1;TNFAIP3...
245 GO_Biological_Process_2021 negative regulation of cell population prolife... 16/379 5.748984e-08 3.240510e-05 0 0 6.046328 100.802303 COL18A1;TGFB2;BTG2;CDKN1A;BMPR2;IGFBP5;TNFAIP3...
244 GO_Biological_Process_2021 positive regulation of extrinsic apoptotic sig... 4/6 5.555064e-08 3.240510e-05 0 0 257.662338 4304.499472 SFRP1;TIMP3;THBS1;ATF3
3193 WikiPathways_2019_Mouse Endochondral Ossification WP1270 7/62 5.740529e-07 5.051665e-05 0 0 16.677784 239.668840 TGFB2;MGP;SPP1;TIMP3;PLAT;SLC38A2;FGFR1
2902 WikiPathway_2021_Human Endochondral Ossification WP474 7/64 7.156037e-07 5.259687e-05 0 0 16.090972 227.689503 TGFB2;MGP;SPP1;TIMP3;PLAT;SLC38A2;FGFR1
2901 WikiPathway_2021_Human Endochondral Ossification with Skeletal Dyspla... 7/64 7.156037e-07 5.259687e-05 0 0 16.090972 227.689503 TGFB2;MGP;SPP1;TIMP3;PLAT;SLC38A2;FGFR1
2325 Reactome_2022 Signaling By NTRK1 (TRKA) R-HSA-187037 9/114 3.046370e-07 5.849030e-05 0 0 11.353979 170.356745 EGR1;NTRK2;EGR3;RRAD;NAB1;ID1;FOSB;IRS2;FOS
2903 WikiPathway_2021_Human TGF-beta Signaling Pathway WP366 9/132 1.056763e-06 6.213764e-05 0 0 9.683582 133.248993 CREBBP;JUN;CDKN1A;FOSB;SIK1;FOS;JUNB;THBS1;ATF3
2326 Reactome_2022 Nuclear Events (Kinase And Transcription Facto... 7/61 5.126154e-07 7.381662e-05 0 0 16.987491 246.042398 EGR1;EGR3;RRAD;NAB1;ID1;FOSB;FOS
2327 Reactome_2022 Signaling By NTRKs R-HSA-166520 9/132 1.056763e-06 1.217390e-04 0 0 9.683582 133.248993 EGR1;NTRK2;EGR3;RRAD;NAB1;ID1;FOSB;IRS2;FOS
3290 MSigDB_Hallmark_2020 Myogenesis 9/200 3.104726e-05 1.272938e-04 0 0 6.214519 64.506709 TAGLN;CDKN1A;COL15A1;GSN;PTGIS;GADD45B;TPM2;IF...
3289 MSigDB_Hallmark_2020 IL-2/STAT5 Signaling 9/199 2.984916e-05 1.272938e-04 0 0 6.247545 65.095382 PNP;BMPR2;GADD45B;FGL2;NFKBIZ;SPP1;PIM1;EMP1;S...
3194 WikiPathways_2019_Mouse PluriNetWork WP1763 12/292 3.705197e-06 1.630286e-04 0 0 5.742270 71.811533 KDM6B;CREBBP;CDKN1A;BMPR2;ID1;SMARCA5;SPP1;PIM...
2904 WikiPathway_2021_Human The Overlap Between Signal Transduction Pathwa... 6/55 4.653517e-06 2.280223e-04 0 0 15.944952 195.770318 CDKN1A;TGFB2;CREBBP;LMNA;SPP1;JUNB
246 GO_Biological_Process_2021 regulation of cell population proliferation (G... 21/764 6.644724e-07 2.313905e-04 0 0 3.940221 56.046772 COL18A1;NTRK2;TGFB2;JUN;BTG2;CDKN1A;BMPR2;ELN;...
247 GO_Biological_Process_2021 regulation of cell cycle (GO:0051726) 13/296 6.841824e-07 2.313905e-04 0 0 6.196345 87.957367 PPP1R15A;TGFB2;JUN;CDKN1A;GADD45B;DUSP1;THBS1;...
3291 MSigDB_Hallmark_2020 TGF-beta Signaling 5/54 6.682767e-05 2.490849e-04 0 0 13.200614 126.902691 PPP1R15A;BMPR2;ID1;JUNB;THBS1
2905 WikiPathway_2021_Human Corticotropin-releasing hormone signaling path... 7/93 9.012515e-06 3.785256e-04 0 0 10.649315 123.711985 NR4A2;NFKBIA;NR4A1;FOSB;FOS;JUNB;FOSL2
3292 MSigDB_Hallmark_2020 Coagulation 7/138 1.146316e-04 3.916578e-04 0 0 6.975229 63.291743 C3;GSN;HTRA1;TIMP3;CD9;PLAT;THBS1
1937 KEGG_2019_Mouse Small cell lung cancer 7/92 8.389271e-06 3.942957e-04 0 0 10.775146 125.945909 NFKBIA;CDKN1A;GADD45B;LAMB2;COL4A5;BIRC2;GADD45G
1936 KEGG_2019_Mouse Osteoclast differentiation 8/128 8.143139e-06 3.942957e-04 0 0 8.765333 102.715111 NFKBIA;SOCS3;TGFB2;JUN;FOSB;FOS;JUNB;FOSL2
1935 KEGG_2019_Mouse Protein digestion and absorption 7/90 7.249686e-06 3.942957e-04 0 0 11.035905 130.604998 COL18A1;COL15A1;ELN;COL4A5;ATP1A2;SLC1A5;SLC38A2
1934 KEGG_2019_Mouse TNF signaling pathway 8/110 2.630642e-06 3.942957e-04 0 0 10.321569 132.614431 NFKBIA;SOCS3;JUN;TNFAIP3;CXCL1;FOS;JUNB;BIRC2
2906 WikiPathway_2021_Human Small cell lung cancer WP4658 7/96 1.111706e-05 4.058626e-04 0 0 10.288786 117.364493 NFKBIA;CDKN1A;GADD45B;LAMB2;COL4A5;BIRC2;GADD45G
2907 WikiPathway_2021_Human Oncostatin M Signaling Pathway WP2374 6/65 1.242436e-05 4.058626e-04 0 0 13.235727 149.508803 NFKBIA;SOCS3;EGR1;TIMP3;FOS;JUNB
248 GO_Biological_Process_2021 cardiocyte differentiation (GO:0035051) 4/12 1.766590e-06 4.978838e-04 0 0 64.396104 853.020394 KDM6B;AKAP13;TGFB2;SIK1
2908 WikiPathway_2021_Human Glucocorticoid Receptor Pathway WP2880 6/70 1.909182e-05 5.347300e-04 0 0 12.198602 132.553065 AKAP13;JUN;GADD45B;TNFAIP3;BIRC2;CPEB4
2909 WikiPathway_2021_Human Senescence and Autophagy in Cancer WP615 7/105 2.000691e-05 5.347300e-04 0 0 9.339640 101.049615 JUN;CDKN1A;GSN;IGFBP5;PLAT;CXCL1;THBS1
249 GO_Biological_Process_2021 regulation of smooth muscle cell proliferation... 6/49 2.334102e-06 5.457610e-04 0 0 18.175337 235.695645 NR4A3;IGFBP5;ELN;OGN;TNFAIP3;THBS1
250 GO_Biological_Process_2021 negative regulation of cellular process (GO:00... 17/566 2.581956e-06 5.457610e-04 0 0 4.236988 54.517168 COL18A1;TGFB2;BTG2;CDKN1A;BMPR2;DUSP1;FBLN1;CX...
2122 KEGG_2021_Human TNF signaling pathway 8/112 3.012640e-06 5.620811e-04 0 0 10.122051 128.678538 NFKBIA;SOCS3;JUN;TNFAIP3;CXCL1;FOS;JUNB;BIRC2
2123 KEGG_2021_Human Osteoclast differentiation 8/127 7.685165e-06 5.620811e-04 0 0 8.839440 104.095176 NFKBIA;SOCS3;JUN;TGFB2;FOSB;FOS;JUNB;FOSL2
2124 KEGG_2021_Human Small cell lung cancer 7/92 8.389271e-06 5.620811e-04 0 0 10.775146 125.945909 NFKBIA;CDKN1A;GADD45B;LAMB2;COL4A5;BIRC2;GADD45G
2910 WikiPathway_2021_Human Chromosomal and microsatellite instability in ... 6/73 2.430902e-05 5.955711e-04 0 0 11.650628 123.784000 CDKN1A;TGFB2;JUN;GADD45B;FOS;GADD45G
2911 WikiPathway_2021_Human Gastrin signaling pathway WP4659 7/114 3.408778e-05 7.709083e-04 0 0 8.550164 87.951874 NFKBIA;EGR1;JUN;CDKN1A;FOS;KLF4;BIRC2
251 GO_Biological_Process_2021 cellular response to growth factor stimulus (G... 9/158 4.691632e-06 8.815054e-04 0 0 7.983289 97.952802 NR4A1;NTRK2;SFRP1;CLEC3B;EGR3;BMPR2;PDE3A;GAS1...
2125 KEGG_2021_Human Protein digestion and absorption 7/103 1.764719e-05 8.867715e-04 0 0 9.535182 104.361937 COL18A1;COL15A1;ELN;COL4A5;ATP1A2;SLC1A5;SLC38A2
2328 Reactome_2022 Signaling By Receptor Tyrosine Kinases R-HSA-9... 15/496 9.550242e-06 9.168233e-04 0 0 4.222192 48.804076 EGR1;NTRK2;EGR3;RRAD;NAB1;IRS2;PLAT;FOS;THBS1;...
In [328]:
rdicts['Mesenchymal']['Old_Ctrl_pos']
Out[328]:
Gene_set Term Overlap P-value Adjusted P-value Old P-value Old Adjusted P-value Odds Ratio Combined Score Genes
1665 MSigDB_Hallmark_2020 Epithelial Mesenchymal Transition 12/200 1.272063e-11 3.688984e-10 0 0 19.683511 493.815893 MFAP5;PRRX1;DST;LOX;PCOLCE2;MGP;DPYSL3;GAS1;TI...
1694 GTEx_Aging_Signatures_2021 GTEx Bladder 20-29 vs 50-59 Up 9/250 4.432860e-07 2.970016e-05 0 0 10.970892 160.493742 MFAP5;TPPP3;CCDC80;PCOLCE2;HTRA3;PENK;PI16;CRI...
1695 GTEx_Aging_Signatures_2021 GTEx Colon 20-29 vs 60-69 Up 9/250 4.432860e-07 2.970016e-05 0 0 10.970892 160.493742 TPPP3;PRRX1;FNDC1;OGN;MGP;DPT;FMO2;PI16;ASPN
1696 GTEx_Aging_Signatures_2021 GTEx Colon 20-29 vs 70-79 Up 7/250 4.600068e-05 1.541023e-03 0 0 8.216556 82.057552 TPPP3;FNDC1;MGP;PENK;DPT;FMO2;ASPN
1697 GTEx_Aging_Signatures_2021 GTEx SalivaryGland 20-29 vs 60-69 Up 7/250 4.600068e-05 1.541023e-03 0 0 8.216556 82.057552 TPPP3;CLEC3B;FNDC1;PCOLCE2;DPT;IGFBP6;PI16
1234 Reactome_2022 Elastic Fibre Formation R-HSA-1566948 4/39 1.431414e-05 2.102488e-03 0 0 31.569841 352.138302 MFAP5;LOX;FBLN1;FBLN2
1235 Reactome_2022 Extracellular Matrix Organization R-HSA-1474244 8/291 1.460061e-05 2.102488e-03 0 0 8.165038 90.913189 MFAP5;COL15A1;DST;LOX;PCOLCE2;FBLN1;FBLN2;ASPN
1666 MSigDB_Hallmark_2020 Coagulation 5/138 1.813608e-04 2.629732e-03 0 0 10.479191 90.278462 C3;GSN;CD9;TIMP3;PLAT
1623 WikiPathways_2019_Mouse Endochondral Ossification WP1270 4/62 9.087362e-05 3.816692e-03 0 0 19.028736 177.082190 MGP;TIMP3;PLAT;FGFR1
1522 WikiPathway_2021_Human Endochondral Ossification with Skeletal Dyspla... 4/64 1.029110e-04 5.197007e-03 0 0 18.392593 168.874271 MGP;TIMP3;PLAT;FGFR1
1523 WikiPathway_2021_Human Endochondral Ossification WP474 4/64 1.029110e-04 5.197007e-03 0 0 18.392593 168.874271 MGP;TIMP3;PLAT;FGFR1
1524 WikiPathway_2021_Human let-7 inhibition of ES cell reprogramming WP3299 2/6 2.116527e-04 7.125642e-03 0 0 134.594595 1138.746143 EGR1;KLF4
1699 GTEx_Aging_Signatures_2021 GTEx Colon 20-29 vs 50-59 Up 6/250 3.781082e-04 8.444417e-03 0 0 6.913349 54.479472 TPPP3;PENK;DPT;FMO2;PI16;ASPN
1698 GTEx_Aging_Signatures_2021 GTEx BloodVessel 20-29 vs 60-69 Down 6/250 3.781082e-04 8.444417e-03 0 0 6.913349 54.479472 SCARA5;CRISPLD2;OSR1;HTRA3;GAS1;ATP1A2
1236 Reactome_2022 Molecules Associated With Elastic Fibres R-HSA... 3/28 1.613220e-04 1.548691e-02 0 0 32.710685 285.633234 MFAP5;FBLN1;FBLN2
1673 MSigDB_Hallmark_2020 KRAS Signaling Up 4/200 7.107636e-03 2.290238e-02 0 0 5.591837 27.660499 AKAP12;PRRX1;PLAT;KLF4
1672 MSigDB_Hallmark_2020 Myogenesis 4/200 7.107636e-03 2.290238e-02 0 0 5.591837 27.660499 COL15A1;GSN;PTGIS;AEBP1
1671 MSigDB_Hallmark_2020 Estrogen Response Early 4/200 7.107636e-03 2.290238e-02 0 0 5.591837 27.660499 AR;MAST4;KLF4;NBL1
1670 MSigDB_Hallmark_2020 Adipogenesis 4/200 7.107636e-03 2.290238e-02 0 0 5.591837 27.660499 C3;COL15A1;ENPP2;SLC1A5
1669 MSigDB_Hallmark_2020 TNF-alpha Signaling via NF-kB 4/200 7.107636e-03 2.290238e-02 0 0 5.591837 27.660499 EGR1;NR4A1;KLF9;KLF4
1668 MSigDB_Hallmark_2020 Apoptosis 4/161 3.309905e-03 2.290238e-02 0 0 6.994692 39.945538 GSN;TIMP3;PLAT;IGFBP6
1667 MSigDB_Hallmark_2020 Cholesterol Homeostasis 3/74 2.816466e-03 2.290238e-02 0 0 11.491221 67.479583 ERRFI1;CD9;ANTXR2
1237 Reactome_2022 Collagen Formation R-HSA-1474290 4/90 3.841315e-04 2.765747e-02 0 0 12.815245 100.785825 COL15A1;DST;LOX;PCOLCE2
1624 WikiPathways_2019_Mouse Eicosanoid Synthesis WP318 2/18 2.096003e-03 4.401606e-02 0 0 33.628378 207.410525 PTGIS;DPEP1
1701 GTEx_Aging_Signatures_2021 GTEx Esophagus 20-29 vs 70-79 Up 5/250 2.632535e-03 4.409497e-02 0 0 5.656510 33.598585 MFAP5;NR4A1;TPPP3;PCOLCE2;PI16
1700 GTEx_Aging_Signatures_2021 GTEx Uterus 20-29 vs 50-59 Down 5/250 2.632535e-03 4.409497e-02 0 0 5.656510 33.598585 MFAP5;SCARA5;FNDC1;PI16;FBLN2
146 GO_Biological_Process_2021 regulation of BMP signaling pathway (GO:0030510) 4/76 2.007699e-04 4.454311e-02 0 0 15.317901 130.406673 HTRA3;PCSK6;SULF1;NBL1
147 GO_Biological_Process_2021 cellular response to hormone stimulus (GO:0032... 4/76 2.007699e-04 4.454311e-02 0 0 15.317901 130.406673 AR;KLF9;ATP1A2;SLIT3
149 GO_Biological_Process_2021 cellular response to growth factor stimulus (G... 5/158 3.395734e-04 4.454311e-02 0 0 9.100156 72.690416 NR4A1;CLEC3B;PDE3A;GAS1;KLF4
150 GO_Biological_Process_2021 collagen fibril organization (GO:0030199) 4/89 3.681118e-04 4.454311e-02 0 0 12.966667 102.529039 COL15A1;DST;LOX;DPT
151 GO_Biological_Process_2021 regulation of nitric oxide biosynthetic proces... 3/40 4.708530e-04 4.454311e-02 0 0 22.088486 169.219107 PTGIS;KLF4;CD34
152 GO_Biological_Process_2021 negative regulation of nitric oxide biosynthet... 2/9 5.042249e-04 4.454311e-02 0 0 76.899614 583.859416 PTGIS;CD34
153 GO_Biological_Process_2021 negative regulation of nitric oxide metabolic ... 2/9 5.042249e-04 4.454311e-02 0 0 76.899614 583.859416 PTGIS;CD34
154 GO_Biological_Process_2021 glomerular filtration (GO:0003094) 2/9 5.042249e-04 4.454311e-02 0 0 76.899614 583.859416 SULF1;CD34
155 GO_Biological_Process_2021 negative regulation of proteolysis (GO:0045861) 3/43 5.833473e-04 4.454311e-02 0 0 20.428767 152.127470 TIMP3;GAS1;PLAT
156 GO_Biological_Process_2021 negative regulation of sodium ion transmembran... 2/10 6.287301e-04 4.454311e-02 0 0 67.283784 496.003164 OSR1;ATP1A2
157 GO_Biological_Process_2021 renal filtration (GO:0097205) 2/10 6.287301e-04 4.454311e-02 0 0 67.283784 496.003164 SULF1;CD34
145 GO_Biological_Process_2021 cellular protein metabolic process (GO:0044267) 8/417 1.825140e-04 4.454311e-02 0 0 5.613404 48.324022 C3;RPL30;LOX;RPL34;PENK;PLAT;RPL26;IGFBP6
148 GO_Biological_Process_2021 glomerulus vasculature development (GO:0072012) 2/6 2.116527e-04 4.454311e-02 0 0 134.594595 1138.746143 OSR1;CD34
1238 Reactome_2022 Axon Guidance R-HSA-422475 8/519 7.819039e-04 4.503766e-02 0 0 4.469437 31.973364 RPL30;RPL34;DPYSL3;CLSTN1;SCN7A;SLIT3;RPL26;FGFR1
0 GO_Molecular_Function_2021 calcium ion binding (GO:0005509) 7/348 3.550473e-04 4.558294e-02 0 0 5.826044 46.277782 CLEC3B;GSN;S100A6;ENPP2;FBLN1;SLIT3;ASPN
1 GO_Molecular_Function_2021 hydrolase activity, acting on carbon-nitrogen ... 2/10 6.287301e-04 4.558294e-02 0 0 67.283784 496.003164 DPYSL3;DPEP1
1628 WikiPathways_2019_Mouse White fat cell differentiation WP2872 2/32 6.565377e-03 4.595764e-02 0 0 17.922523 90.077618 EBF1;KLF4
1627 WikiPathways_2019_Mouse Spinal Cord Injury WP2432 3/99 6.368744e-03 4.595764e-02 0 0 8.488014 42.918394 EGR1;NR4A1;SLIT3
1626 WikiPathways_2019_Mouse Prostaglandin Synthesis and Regulation WP374 2/31 6.170140e-03 4.595764e-02 0 0 18.541473 94.339639 PTGIS;S100A6
1625 WikiPathways_2019_Mouse Cytoplasmic Ribosomal Proteins WP163 3/92 5.196512e-03 4.595764e-02 0 0 9.158843 48.173383 RPL30;RPL34;RPL26
1525 WikiPathway_2021_Human NOTCH1 regulation of endothelial cell calcific... 2/17 1.867701e-03 4.715945e-02 0 0 35.872072 225.385913 MGP;PLAT
1239 Reactome_2022 Nervous System Development R-HSA-9675108 8/545 1.071335e-03 5.142407e-02 0 0 4.247344 29.046946 RPL30;RPL34;DPYSL3;CLSTN1;SCN7A;SLIT3;RPL26;FGFR1
1240 Reactome_2022 Assembly Of Collagen Fibrils And Other Multime... 3/57 1.331366e-03 5.477620e-02 0 0 15.121766 100.129525 COL15A1;DST;LOX
1629 WikiPathways_2019_Mouse Nuclear Receptors WP509 2/38 9.169706e-03 5.501824e-02 0 0 14.930931 70.053689 AR;NR4A1
In [512]:
df1 = df[((df['Old_Ctrl_pval']<0.05) | (df['Old_FiNi_pval']<0.05))]
df1 = df
plt.scatter(df1['Old_Ctrl_fc'], df1['Old_FiNi_fc'], color='lightgray', s=100)
geneint = ['Cx3cl1','Il6','Ackr1','Vwa1','Cdkn1a','Stab2']
df2 = df1[df1['Old_Ctrl_genelist'].isin(geneint)]
for gene in geneint:
    plt.scatter(df2['Old_Ctrl_fc'], df2['Old_FiNi_fc'], color='red', s=100)
    
plt.axhline(1, linestyle = '--', linewidth=0.5)
plt.axvline(1, linestyle = '--', linewidth=0.5)
plt.axline((0, 0), slope=1, linestyle = '-', color='black', linewidth=1)

plt.xlim(-7.5,7.5)
plt.ylim(-7.5,7.5)

savefig('scatter_degvstm_endothelial')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 9 glyphs before
Glyph names: ['.notdef', '.null', 'four', 'minus', 'nonmarkingreturn', 'six', 'space', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 3228]
Closed glyph list over 'GSUB': 9 glyphs after
Glyph names: ['.notdef', '.null', 'four', 'minus', 'nonmarkingreturn', 'six', 'space', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 3228]
Closing glyph list over 'MATH': 9 glyphs before
Glyph names: ['.notdef', '.null', 'four', 'minus', 'nonmarkingreturn', 'six', 'space', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 3228]
Closed glyph list over 'MATH': 9 glyphs after
Glyph names: ['.notdef', '.null', 'four', 'minus', 'nonmarkingreturn', 'six', 'space', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 3228]
Closing glyph list over 'glyf': 9 glyphs before
Glyph names: ['.notdef', '.null', 'four', 'minus', 'nonmarkingreturn', 'six', 'space', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 3228]
Closed glyph list over 'glyf': 9 glyphs after
Glyph names: ['.notdef', '.null', 'four', 'minus', 'nonmarkingreturn', 'six', 'space', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 21, 23, 25, 3228]
Retaining 9 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0, 38]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [378]:
rdicts['Endothelial']['Old_Ctrl_pos']
Out[378]:
Gene_set Term Overlap P-value Adjusted P-value Old P-value Old Adjusted P-value Odds Ratio Combined Score Genes
954 MSigDB_Hallmark_2020 Epithelial Mesenchymal Transition 5/200 0.000037 0.000876 0 0 15.358974 156.937740 PRRX1;MGP;GAS1;TIMP3;FBLN2
978 GTEx_Aging_Signatures_2021 GTEx Colon 20-29 vs 60-69 Up 5/250 0.000105 0.006514 0 0 12.193568 111.704777 PRRX1;OGN;MGP;DPT;FMO2
921 WikiPathways_2019_Mouse Endochondral Ossification WP1270 3/62 0.000221 0.007309 0 0 28.914770 243.321328 MGP;TIMP3;FGFR1
847 WikiPathway_2021_Human Endochondral Ossification WP474 3/64 0.000243 0.009126 0 0 27.963934 232.686269 MGP;TIMP3;FGFR1
846 WikiPathway_2021_Human Endochondral Ossification with Skeletal Dyspla... 3/64 0.000243 0.009126 0 0 27.963934 232.686269 MGP;TIMP3;FGFR1
922 WikiPathways_2019_Mouse Cytoplasmic Ribosomal Proteins WP163 3/92 0.000707 0.011668 0 0 19.139326 138.841903 RPL30;RPL34;RPL26
697 Reactome_2022 Nonsense Mediated Decay (NMD) Enhanced By Exon... 3/112 0.001250 0.015808 0 0 15.611796 104.354875 RPL30;RPL34;RPL26
696 Reactome_2022 GTP Hydrolysis And Joining Of 60S Ribosomal Su... 3/109 0.001156 0.015808 0 0 16.056065 108.581435 RPL30;RPL34;RPL26
695 Reactome_2022 SRP-dependent Cotranslational Protein Targetin... 3/108 0.001126 0.015808 0 0 16.209796 110.052282 RPL30;RPL34;RPL26
694 Reactome_2022 L13a-mediated Translational Silencing Of Cerul... 3/108 0.001126 0.015808 0 0 16.209796 110.052282 RPL30;RPL34;RPL26
693 Reactome_2022 Response Of EIF2AK4 (GCN2) To Amino Acid Defic... 3/98 0.000850 0.015808 0 0 17.925113 126.740388 RPL30;RPL34;RPL26
689 Reactome_2022 Eukaryotic Translation Elongation R-HSA-156842 3/90 0.000663 0.015808 0 0 19.581281 143.302333 RPL30;RPL34;RPL26
698 Reactome_2022 Selenoamino Acid Metabolism R-HSA-2408522 3/114 0.001316 0.015808 0 0 15.328958 101.683070 RPL30;RPL34;RPL26
691 Reactome_2022 Nonsense Mediated Decay (NMD) Independent Of E... 3/92 0.000707 0.015808 0 0 19.139326 138.841903 RPL30;RPL34;RPL26
690 Reactome_2022 Eukaryotic Translation Termination R-HSA-72764 3/90 0.000663 0.015808 0 0 19.581281 143.302333 RPL30;RPL34;RPL26
688 Reactome_2022 Viral mRNA Translation R-HSA-192823 3/90 0.000663 0.015808 0 0 19.581281 143.302333 RPL30;RPL34;RPL26
692 Reactome_2022 Formation Of A Pool Of Free 40S Subunits R-HSA... 3/98 0.000850 0.015808 0 0 17.925113 126.740388 RPL30;RPL34;RPL26
699 Reactome_2022 Cap-dependent Translation Initiation R-HSA-72737 3/116 0.001383 0.015808 0 0 15.056131 99.120147 RPL30;RPL34;RPL26
686 Reactome_2022 Peptide Chain Elongation R-HSA-156902 3/86 0.000581 0.015808 0 0 20.529088 152.963651 RPL30;RPL34;RPL26
687 Reactome_2022 Selenocysteine Synthesis R-HSA-2408557 3/90 0.000663 0.015808 0 0 19.581281 143.302333 RPL30;RPL34;RPL26
848 WikiPathway_2021_Human Cytoplasmic Ribosomal Proteins WP477 3/89 0.000642 0.016050 0 0 19.809967 145.621616 RPL30;RPL34;RPL26
702 Reactome_2022 Translation R-HSA-72766 4/281 0.001933 0.018196 0 0 8.360586 52.241281 LARS2;RPL30;RPL34;RPL26
701 Reactome_2022 Response To Elevated Platelet Cytosolic Ca2+ R... 3/130 0.001917 0.018196 0 0 13.386952 83.762099 CLEC3B;CD9;TIMP3
700 Reactome_2022 Platelet Degranulation R-HSA-114608 3/125 0.001714 0.018196 0 0 13.939110 88.779124 CLEC3B;CD9;TIMP3
703 Reactome_2022 Influenza Viral RNA Transcription And Replicat... 3/137 0.002226 0.019786 0 0 12.683156 77.463593 RPL30;RPL34;RPL26
704 Reactome_2022 Cellular Response To Starvation R-HSA-9711097 3/153 0.003043 0.025629 0 0 11.321143 65.603459 RPL30;RPL34;RPL26
705 Reactome_2022 Influenza Infection R-HSA-168255 3/157 0.003273 0.026184 0 0 11.024861 63.084897 RPL30;RPL34;RPL26
637 KEGG_2021_Human Parathyroid hormone synthesis, secretion and a... 3/106 0.001067 0.026666 0 0 16.526214 113.092861 EGR1;AKAP13;FGFR1
636 KEGG_2021_Human Coronavirus disease 4/232 0.000956 0.026666 0 0 10.182663 70.801626 C3;RPL30;RPL34;RPL26
955 MSigDB_Hallmark_2020 Coagulation 3/138 0.002272 0.027269 0 0 12.588571 76.625651 C3;CD9;TIMP3
706 Reactome_2022 Regulation Of Expression Of SLITs And ROBOs R-... 3/167 0.003893 0.029658 0 0 10.347387 57.414411 RPL30;RPL34;RPL26
707 Reactome_2022 Hemostasis R-HSA-109582 5/576 0.004456 0.032407 0 0 5.145412 27.854696 CLEC3B;CD9;TIMP3;CD47;GLG1
708 Reactome_2022 Major Pathway Of rRNA Processing In Nucleolus ... 3/179 0.004725 0.032868 0 0 9.636039 51.600221 RPL30;RPL34;RPL26
849 WikiPathway_2021_Human Prion disease pathway WP3995 2/33 0.001788 0.033530 0 0 35.718638 225.974224 EBF1;FGFR1
709 Reactome_2022 rRNA Processing In Nucleus And Cytosol R-HSA-8... 3/189 0.005495 0.036632 0 0 9.113364 47.425537 RPL30;RPL34;RPL26
710 Reactome_2022 rRNA Processing R-HSA-72312 3/199 0.006336 0.040551 0 0 8.644023 43.751578 RPL30;RPL34;RPL26
67 GO_Biological_Process_2021 lung epithelium development (GO:0060428) 2/10 0.000157 0.041125 0 0 138.569444 1214.062108 ERRFI1;PKD1
66 GO_Biological_Process_2021 circulatory system development (GO:0072359) 4/126 0.000094 0.041125 0 0 19.132112 177.416251 AKAP13;HEG1;PKD1;CRIP1
711 Reactome_2022 Signaling By ROBO Receptors R-HSA-376176 3/209 0.007251 0.044619 0 0 8.220250 40.498427 RPL30;RPL34;RPL26
68 GO_Biological_Process_2021 heart development (GO:0007507) 4/164 0.000259 0.045299 0 0 14.560294 120.257211 AKAP13;HEG1;PKD1;CRIP1
0 GO_Molecular_Function_2021 fibroblast growth factor binding (GO:0017134) 2/21 0.000722 0.047621 0 0 58.312865 421.842951 GLG1;FGFR1
591 KEGG_2019_Mouse Parathyroid hormone synthesis, secretion and a... 3/107 0.001096 0.049319 0 0 16.366484 111.555746 EGR1;AKAP13;FGFR1
638 KEGG_2021_Human Ribosome 3/158 0.003332 0.055533 0 0 10.953180 62.479036 RPL30;RPL34;RPL26
71 GO_Biological_Process_2021 cytoplasmic translation (GO:0002181) 3/93 0.000730 0.056463 0 0 18.925714 136.696482 RPL30;RPL34;RPL26
70 GO_Biological_Process_2021 translation (GO:0006412) 4/214 0.000707 0.056463 0 0 11.065546 80.269414 LARS2;RPL30;RPL34;RPL26
69 GO_Biological_Process_2021 SRP-dependent cotranslational protein targetin... 3/90 0.000663 0.056463 0 0 19.581281 143.302333 RPL30;RPL34;RPL26
72 GO_Biological_Process_2021 cotranslational protein targeting to membrane ... 3/94 0.000753 0.056463 0 0 18.716797 134.604908 RPL30;RPL34;RPL26
713 Reactome_2022 Activation Of C3 And C5 R-HSA-174577 1/6 0.011347 0.060519 0 0 107.875676 483.151041 C3
715 Reactome_2022 FGFR1b Ligand Binding And Activation R-HSA-190370 1/6 0.011347 0.060519 0 0 107.875676 483.151041 FGFR1
714 Reactome_2022 Uptake And Function Of Diphtheria Toxin R-HSA-... 1/6 0.011347 0.060519 0 0 107.875676 483.151041 CD9
In [325]:
rdicts['Macrophage']['Old_Ctrl_pos']
Out[325]:
Gene_set Term Overlap P-value Adjusted P-value Old P-value Old Adjusted P-value Odds Ratio Combined Score Genes
2912 KEGG_2019_Mouse Cytokine-cytokine receptor interaction 21/292 3.646834e-07 0.000094 0 0 4.027854 59.709857 CX3CR1;BMPR2;TNFRSF13B;TNFSF13;IL1F9;GDF3;IL1R...
3438 Reactome_2022 Cytokine Signaling In Immune System R-HSA-1280215 35/702 4.876566e-07 0.000215 0 0 2.776126 40.347254 TNFRSF13B;PELI2;PTAFR;CLSTN1;F13A1;RORA;IL1RAP...
3437 Reactome_2022 Signal Transduction R-HSA-162582 84/2465 2.504201e-07 0.000215 0 0 1.966735 29.894620 CYFIP2;DGKG;DOCK4;BMPR2;FLT1;PTPRS;ZFYVE9;GPR6...
3439 Reactome_2022 Signaling By Interleukins R-HSA-449147 26/453 1.200782e-06 0.000353 0 0 3.182204 43.381516 PELI2;PTAFR;CLSTN1;F13A1;RORA;IL1RAP;FOXO3;CRK...
3169 KEGG_2021_Human Cytokine-cytokine receptor interaction 20/295 1.736662e-06 0.000465 0 0 3.769340 49.994807 CX3CR1;BMPR2;TNFRSF13B;TNFSF13;GDF3;IL1RAP;INH...
4765 MSigDB_Hallmark_2020 IL-2/STAT5 Signaling 14/199 4.158379e-05 0.001032 0 0 3.878029 39.120781 RABGAP1L;BMPR2;AHNAK;PTCH1;RORA;IKZF2;HOPX;TIA...
4766 MSigDB_Hallmark_2020 KRAS Signaling Up 14/200 4.393012e-05 0.001032 0 0 3.856981 38.696742 SPON1;ADAMDEC1;RABGAP1L;ACE;SATB1;F13A1;INHBA;...
4660 WikiPathways_2019_Mouse Endochondral Ossification WP1270 8/62 2.769963e-05 0.002908 0 0 7.524002 78.957566 MEF2C;CHST11;PTCH1;FGF2;RUNX3;RUNX2;VEGFA;BMPR1A
3440 Reactome_2022 G Alpha (12/13) Signaling Events R-HSA-416482 9/78 2.197299e-05 0.004845 0 0 6.636549 71.181611 TIAM2;TIAM1;ARHGEF37;MCF2L;GNG7;GNA12;ARHGEF18...
439 GO_Biological_Process_2021 positive regulation of cell migration (GO:0030... 18/269 6.857935e-06 0.005658 0 0 3.701546 44.011765 BMPR2;FLT1;F10;SEMA4D;FN1;ACVR1B;THBS1;CRKL;VE...
438 GO_Biological_Process_2021 regulation of vascular associated smooth muscl... 7/37 6.638348e-06 0.005658 0 0 11.834111 141.093927 ERN1;MEF2C;NR4A3;IGFBP5;FGF2;MEF2D;BMPR1A
437 GO_Biological_Process_2021 positive regulation of vascular associated smo... 6/21 2.341955e-06 0.005658 0 0 20.250129 262.533299 ERN1;NR4A3;IGFBP5;FGF2;MEF2D;BMPR1A
440 GO_Biological_Process_2021 organophosphate biosynthetic process (GO:0090407) 7/39 9.587591e-06 0.005932 0 0 11.093345 128.184058 GK5;ITPKB;CPS1;GPAM;LPCAT1;FGF2;IP6K3
4320 WikiPathway_2021_Human Endochondral Ossification WP474 8/64 3.504331e-05 0.005975 0 0 7.254545 74.423843 MEF2C;CHST11;PTCH1;FGF2;RUNX3;RUNX2;VEGFA;BMPR1A
4319 WikiPathway_2021_Human Endochondral Ossification with Skeletal Dyspla... 8/64 3.504331e-05 0.005975 0 0 7.254545 74.423843 MEF2C;CHST11;PTCH1;FGF2;RUNX3;RUNX2;VEGFA;BMPR1A
4661 WikiPathways_2019_Mouse Spinal Cord Injury WP2432 9/99 1.452658e-04 0.007626 0 0 5.082552 44.914235 EPHA4;VCAN;ANXA1;CHST11;TNFSF13;XYLT1;MBP;IL2;...
441 GO_Biological_Process_2021 cytokine-mediated signaling pathway (GO:0019221) 29/621 1.661496e-05 0.008174 0 0 2.559006 28.162387 TNFRSF13B;PELI2;PTAFR;F13A1;RORA;IL1RAP;FOXO3;...
442 GO_Biological_Process_2021 regulation of vascular endothelial cell prolif... 5/18 1.981476e-05 0.008174 0 0 19.423077 210.334121 MEF2C;FLT1;AKT3;PLCG1;FGF2
443 GO_Biological_Process_2021 positive regulation of smooth muscle cell prol... 7/46 2.964392e-05 0.010481 0 0 9.098977 94.868242 ERN1;NR4A3;IGFBP5;FGF2;THBS1;MEF2D;BMPR1A
4321 WikiPathway_2021_Human Spinal Cord Injury WP2431 10/118 1.133195e-04 0.010582 0 0 4.714003 42.828125 EPHA4;VCAN;ANXA1;CHST11;TNFSF13;XYLT1;MBP;FOXO...
4322 WikiPathway_2021_Human B Cell Receptor Signaling Pathway WP23 9/97 1.241280e-04 0.010582 0 0 5.198597 46.757210 LAT2;MEF2C;CD19;PLCG1;PIK3AP1;MEF2D;MALT1;CRKL...
444 GO_Biological_Process_2021 small GTPase mediated signal transduction (GO:... 10/106 4.561041e-05 0.014111 0 0 5.306517 53.040621 TIAM2;TIAM1;KSR1;CCDC88C;USP50;ARHGEF18;RAB38;...
447 GO_Biological_Process_2021 cellular response to growth factor stimulus (G... 12/158 7.017321e-05 0.015080 0 0 4.198253 40.154372 ERN1;MEF2C;EGR3;BMPR2;FLT1;ANXA1;PLCG1;ACVR1B;...
448 GO_Biological_Process_2021 regulation of glial cell migration (GO:1903975) 3/5 7.311707e-05 0.015080 0 0 75.403846 718.104665 CX3CR1;GPR183;CRKL
446 GO_Biological_Process_2021 regulation of vascular associated smooth muscl... 4/12 6.414135e-05 0.015080 0 0 25.191517 243.209515 DOCK4;MEF2C;NR4A3;IGFBP5
445 GO_Biological_Process_2021 regulation of cell migration (GO:0030334) 21/408 6.348317e-05 0.015080 0 0 2.803618 27.096223 EPHA4;ACE;ANXA1;FLT1;F10;SEMA4D;IGFBP5;FOXO3;F...
2915 KEGG_2019_Mouse Graft-versus-host disease 7/64 2.541189e-04 0.016327 0 0 6.219889 51.486427 H2-DMB2;H2-T22;H2-Q6;KLRA3;H2-Q7;KLRC1;IL2
2913 KEGG_2019_Mouse Inflammatory bowel disease (IBD) 7/59 1.517837e-04 0.016327 0 0 6.819699 59.965984 H2-DMB2;IL18RAP;STAT4;RORA;IL2;IL18R1;IL12RB2
2914 KEGG_2019_Mouse Proteoglycans in cancer 13/203 1.994162e-04 0.016327 0 0 3.496136 29.787483 FZD1;PTCH1;FN1;FGF2;THBS1;VAV2;VEGFA;TIAM1;SMO...
4323 WikiPathway_2021_Human Hair Follicle Development: Organogenesis - Par... 5/32 3.714222e-04 0.020557 0 0 9.345170 73.809750 FZD1;SMO;PTCH1;INHBA;RUNX2
4325 WikiPathway_2021_Human PI3K-Akt signaling pathway WP4172 17/340 4.357255e-04 0.020557 0 0 2.699328 20.888746 FLT1;ITGA1;FN1;FOXO3;FGF2;THBS1;IL2;VEGFA;CDK6...
4326 WikiPathway_2021_Human Endoderm differentiation WP2853 10/141 4.822798e-04 0.020557 0 0 3.881769 29.645017 ELK4;DUSP5;ATP8B2;SCHIP1;TCF7;RAB38;WDFY2;GDF3...
4324 WikiPathway_2021_Human Chemokine signaling pathway WP3929 11/164 4.115875e-04 0.020557 0 0 3.661397 28.542379 TIAM2;CX3CR1;TIAM1;GNG7;AKT3;FOXO3;PLCB1;CXCL1...
3441 Reactome_2022 NRAGE Signals Death Thru JNK R-HSA-193648 7/57 1.216543e-04 0.021460 0 0 7.093212 63.940538 TIAM2;TIAM1;ARHGEF37;MCF2L;ARHGEF18;ARHGEF10L;...
4327 WikiPathway_2021_Human Urea cycle and related diseases WP4571 3/9 5.791533e-04 0.021943 0 0 25.129487 187.313774 CPS1;ASS1;SLC25A13
4768 MSigDB_Hallmark_2020 Inflammatory Response 11/200 2.083278e-03 0.024479 0 0 2.958503 18.265243 PTGIR;IL18RAP;SEMA4D;GPR183;PTAFR;SLC1A2;SGMS2...
4767 MSigDB_Hallmark_2020 TNF-alpha Signaling via NF-kB 11/200 2.083278e-03 0.024479 0 0 2.958503 18.265243 BTG3;DUSP5;EGR3;SERPINB2;NR4A3;NFIL3;GPR183;CL...
0 GO_Molecular_Function_2021 cytokine receptor activity (GO:0004896) 9/88 5.793918e-05 0.025319 0 0 5.793513 56.522185 CX3CR1;IL1RL2;IL18RAP;IL1RAP;IL7R;IL18R1;CCR2;...
449 GO_Biological_Process_2021 phosphorylation (GO:0016310) 20/400 1.396471e-04 0.026587 0 0 2.712996 24.081613 DGKG;PRRT1;MAP4K2;BMPR2;LRRK2;TXK;BMX;ACVR1B;R...
3170 KEGG_2021_Human Proteoglycans in cancer 13/205 2.195564e-04 0.029421 0 0 3.459361 29.141318 FZD1;PTCH1;FN1;FGF2;THBS1;VAV2;VEGFA;TIAM1;SMO...
450 GO_Biological_Process_2021 positive regulation of multicellular organisma... 18/345 1.775546e-04 0.031389 0 0 2.830092 24.441330 BMPR2;TXK;RFX3;ELOVL6;ENO1;INHBA;KSR2;ACVR1B;F...
3442 Reactome_2022 Signaling By GPCR R-HSA-372790 28/689 2.490306e-04 0.031420 0 0 2.198777 18.245310 DGKG;CX3CR1;RGS18;GPR68;PTAFR;ARHGEF10L;RPS6KA...
3443 Reactome_2022 GPCR Downstream Signaling R-HSA-388396 26/619 2.493688e-04 0.031420 0 0 2.271570 18.846255 DGKG;CX3CR1;RGS18;GPR68;PTAFR;ARHGEF10L;RPS6KA...
3444 Reactome_2022 Immune System R-HSA-168256 60/1943 2.857513e-04 0.031504 0 0 1.695971 13.839783 CYFIP2;TNFRSF13B;CLSTN1;LPCAT1;F13A1;RORA;IL1R...
4328 WikiPathway_2021_Human TGF-beta receptor signaling in skeletal dyspla... 6/58 9.471056e-04 0.032296 0 0 5.830352 40.591492 ZFYVE9;LTBP3;INHBA;RUNX3;THBS1;RUNX2
4329 WikiPathway_2021_Human Angiogenesis WP1539 4/24 1.142539e-03 0.035419 0 0 10.070437 68.222201 FLT1;PLCG1;FGF2;VEGFA
4331 WikiPathway_2021_Human Bone morphogenic protein (BMP) signaling and r... 3/12 1.451681e-03 0.038079 0 0 16.750427 109.464596 BMPR2;RUNX2;BMPR1A
4330 WikiPathway_2021_Human Biomarkers for urea cycle disorders WP4583 3/12 1.451681e-03 0.038079 0 0 16.750427 109.464596 F7;F10;ASS1
451 GO_Biological_Process_2021 cellular response to cytokine stimulus (GO:007... 22/482 2.403259e-04 0.039654 0 0 2.468264 20.569317 ANXA1;PTAFR;TCF7;FN1;F13A1;RORA;IL1RAP;FOXO3;F...
4770 MSigDB_Hallmark_2020 Angiogenesis 4/36 5.263455e-03 0.041230 0 0 6.290167 33.004303 VCAN;S100A4;VEGFA;VAV2

Fig2

In [11]:
senmayo = 'Acvr1b,Ang,Angpt1,Angptl4,Areg,Axl,Bex3,Bmp2,Bmp6,C3,Ccl1,Ccl2,Ccl20,Ccl24,Ccl26,Ccl3,Ccl4,Ccl5,Ccl7,Ccl8,Cd55,Cd9,Csf1,Csf2,Csf2rb,Cst10,Ctnnb1,Ctsb,Cxcl1,Cxcl10,Cxcl12,Cxcl16,Cxcl2,Cxcl3,Cxcr2,Dkk1,Edn1,Egf,Egfr,Ereg,Esm1,Ets2,Fas,Fgf1,Fgf2,Fgf7,Gdf15,Gem,Gmfg,Hgf,Hmgb1,Icam1,Icam5,Igf1,Igfbp1,Igfbp2,Igfbp3,Igfbp4,Igfbp5,Igfbp6,Igfbp7,Il10,Il13,Il15,Il18,Il1a,Il1b,Il2,Il6,Il6st,Il7,Inha,Iqgap2,Itga2,Itpka,Jun,Kitl,Lcp1,Mif,Mmp13,Mmp10,Mmp12,Mmp13,Mmp14,Mmp2,Mmp3,Mmp9,Nap1l4,Nrg1,Pappa,Pecam1,Pgf,Pigf,Plat,Plau,Plaur,Ptbp1,Ptger2,Ptges,Rps6ka5,Scamp4,Selplg,Sema3f,Serpinb3a,Serpine1,Serpine2,Spp1,Spx,Timp2,Tnf,Tnfrsf11b,Tnfrsf1a,Tnfrsf1b,Tubgcp2,Vegfa,Vegfc,Vgf,Wnt16,Wnt2'.split(',')
In [559]:
huvec_ca
Out[559]:
ENSEMBL Con_1 Con_2 Con_3 IR_1 IR_2 IR_3 baseMean log2FoldChange lfcSE pvalue padj ENTREZID SYMBOL GENENAME
0 ENSG00000000003 2888.782734 3002.198824 3030.268479 4158.677874 4407.910809 4142.107957 3604.991113 0.504070 0.049363 3.450000e-25 1.100000e-23 7105.0 TSPAN6 tetraspanin 6
1 ENSG00000000005 1.743907 1.028150 0.921054 11.892392 2.176746 5.785067 3.924553 0.103131 0.272165 4.748441e-02 NaN 64102.0 TNMD tenomodulin
2 ENSG00000000419 3922.047914 3942.956333 4007.507037 3270.407699 3221.584196 3133.192276 3582.949242 -0.295989 0.046441 8.160000e-11 9.450000e-10 8813.0 DPM1 dolichyl-phosphate mannosyltransferase subunit...
3 ENSG00000000457 716.745973 736.155602 735.001290 663.229533 739.005294 752.058707 723.699400 -0.021357 0.082014 7.814246e-01 8.930787e-01 57147.0 SCYL3 SCY1 like pseudokinase 3
4 ENSG00000000460 1416.924824 1423.988141 1586.976471 955.050528 804.307676 931.395784 1186.440571 -0.702565 0.081779 1.010000e-18 2.240000e-17 55732.0 FIRRM FIGNL1 interacting regulator of recombination ...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
62698 ENSG00000291297 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 NaN NaN NaN NaN NaN NaN NaN
62699 ENSG00000291298 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 NaN NaN NaN NaN NaN NaN NaN
62700 ENSG00000291299 44.469641 27.760058 47.894821 40.251172 42.446549 46.280536 41.517129 0.032702 0.200275 7.803469e-01 8.921253e-01 NaN NaN NaN
62701 ENSG00000291300 0.000000 0.000000 0.000000 0.000000 0.000000 1.157013 0.192836 0.007931 0.244336 7.833631e-01 NaN 124221.0 PRSS30P serine protease 30, pseudogene
62702 ENSG00000291301 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 NaN NaN NaN NaN NaN NaN NaN

62703 rows × 15 columns

In [566]:
sc.tl.score_genes(endothelial, gene_list=senmayo, score_name='senmayo')
computing score 'senmayo'
    finished: added
    'senmayo', score of gene set (adata.obs).
    844 total control genes are used. (0:00:00)
In [41]:
sc.tl.score_genes(endonew, gene_list=senmayo, score_name='senmayo')
computing score 'senmayo'
    finished: added
    'senmayo', score of gene set (adata.obs).
    645 total control genes are used. (0:00:00)
In [656]:
sc.pl.umap(endothelial, color='senmayo', vmax=0.5, cmap='RdBu_r', size=20, show=False)
savefig('endothelial_senmayo_umap')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 22 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'five', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closed glyph list over 'GSUB': 22 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'five', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closing glyph list over 'MATH': 22 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'five', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closed glyph list over 'MATH': 22 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'five', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closing glyph list over 'glyf': 22 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'five', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closed glyph list over 'glyf': 22 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'five', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Retaining 22 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [1407]:
scl.us(endothelial, 'Cdkn1a,Il6', frameon=False)
In [51]:
sc.pl.dotplot(endonew, 'senmayo' ,'subannotation_publish_1', vmax=0.25, show=False)
savefig('endonew_senmayo_dotplot')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 40 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'L', 'M', 'S', 'a', 'c', 'e', 'eight', 'f', 'five', 'four', 'g', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'percent', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'x', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 27, 38, 40, 41, 47, 48, 54, 66, 68, 70, 72, 73, 74, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88, 91, 92]
Closed glyph list over 'GSUB': 45 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'L', 'M', 'S', 'a', 'c', 'e', 'eight', 'f', 'fi', 'five', 'fl', 'four', 'g', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'percent', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'uniFB00', 'uniFB03', 'uniFB04', 'x', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 27, 38, 40, 41, 47, 48, 54, 66, 68, 70, 72, 73, 74, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88, 91, 92, 5038, 5039, 5040, 5041, 5042]
Closing glyph list over 'MATH': 45 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'L', 'M', 'S', 'a', 'c', 'e', 'eight', 'f', 'fi', 'five', 'fl', 'four', 'g', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'percent', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'uniFB00', 'uniFB03', 'uniFB04', 'x', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 27, 38, 40, 41, 47, 48, 54, 66, 68, 70, 72, 73, 74, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88, 91, 92, 5038, 5039, 5040, 5041, 5042]
Closed glyph list over 'MATH': 51 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'L', 'M', 'S', 'a', 'c', 'e', 'eight', 'f', 'fi', 'five', 'fl', 'four', 'g', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'percent', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'uni239B', 'uni239C', 'uni239D', 'uni239E', 'uni239F', 'uni23A0', 'uniFB00', 'uniFB03', 'uniFB04', 'x', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 27, 38, 40, 41, 47, 48, 54, 66, 68, 70, 72, 73, 74, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88, 91, 92, 3506, 3507, 3508, 3509, 3510, 3511, 5038, 5039, 5040, 5041, 5042]
Closing glyph list over 'glyf': 51 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'L', 'M', 'S', 'a', 'c', 'e', 'eight', 'f', 'fi', 'five', 'fl', 'four', 'g', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'percent', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'uni239B', 'uni239C', 'uni239D', 'uni239E', 'uni239F', 'uni23A0', 'uniFB00', 'uniFB03', 'uniFB04', 'x', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 27, 38, 40, 41, 47, 48, 54, 66, 68, 70, 72, 73, 74, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88, 91, 92, 3506, 3507, 3508, 3509, 3510, 3511, 5038, 5039, 5040, 5041, 5042]
Closed glyph list over 'glyf': 51 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'F', 'L', 'M', 'S', 'a', 'c', 'e', 'eight', 'f', 'fi', 'five', 'fl', 'four', 'g', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'percent', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'uni239B', 'uni239C', 'uni239D', 'uni239E', 'uni239F', 'uni23A0', 'uniFB00', 'uniFB03', 'uniFB04', 'x', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 17, 19, 20, 21, 22, 23, 24, 25, 27, 38, 40, 41, 47, 48, 54, 66, 68, 70, 72, 73, 74, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88, 91, 92, 3506, 3507, 3508, 3509, 3510, 3511, 5038, 5039, 5040, 5041, 5042]
Retaining 51 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [52]:
sns.set_style('ticks')
sns.set_context('paper')
sc.pl.violin(endonew, 'senmayo', groupby='subannotation_publish_1', jitter=False
             , stripplot=False, show=False)
savefig('endonew_senmayo')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 33 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'four', 'g', 'h', 'i', 'l', 'm', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 25, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 86, 87, 88, 92, 3228]
Closed glyph list over 'GSUB': 33 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'four', 'g', 'h', 'i', 'l', 'm', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 25, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 86, 87, 88, 92, 3228]
Closing glyph list over 'MATH': 33 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'four', 'g', 'h', 'i', 'l', 'm', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 25, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 86, 87, 88, 92, 3228]
Closed glyph list over 'MATH': 33 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'four', 'g', 'h', 'i', 'l', 'm', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 25, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 86, 87, 88, 92, 3228]
Closing glyph list over 'glyf': 33 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'four', 'g', 'h', 'i', 'l', 'm', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 25, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 86, 87, 88, 92, 3228]
Closed glyph list over 'glyf': 33 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'four', 'g', 'h', 'i', 'l', 'm', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24, 25, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 86, 87, 88, 92, 3228]
Retaining 33 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0, 38]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [1466]:
rnk = endonewdict[key][['genelist','fc']].rename(columns={'genelist':0,'fc':1})

pre_res = gp.prerank(rnk=rnk,
                 gene_sets={'Senmayo':senmayo,
                            },
                 threads=4,
                 min_size=5,
                 max_size=1000,
                 permutation_num=1000, # reduce number to speed up testing
                 outdir=None, # don't write to disk
                 seed=6,
                 verbose=True, # see what's going on behind the scenes
                )

terms = pre_res.res2d.Term
axs = pre_res.plot(terms=terms[0])
plt.show()
savefig('Senmayo')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 21 glyphs before
Glyph names: ['.notdef', '.null', 'E', 'G', 'R', 'S', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'y']
Glyph IDs:   [0, 1, 2, 3, 40, 42, 53, 54, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87, 92]
Closed glyph list over 'GSUB': 21 glyphs after
Glyph names: ['.notdef', '.null', 'E', 'G', 'R', 'S', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'y']
Glyph IDs:   [0, 1, 2, 3, 40, 42, 53, 54, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87, 92]
Closing glyph list over 'glyf': 21 glyphs before
Glyph names: ['.notdef', '.null', 'E', 'G', 'R', 'S', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'y']
Glyph IDs:   [0, 1, 2, 3, 40, 42, 53, 54, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87, 92]
Closed glyph list over 'glyf': 21 glyphs after
Glyph names: ['.notdef', '.null', 'E', 'G', 'R', 'S', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'y']
Glyph IDs:   [0, 1, 2, 3, 40, 42, 53, 54, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87, 92]
Retaining 21 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 31 glyphs before
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'l', 'nine', 'nonmarkingreturn', 'o', 'period', 'plus', 'r', 's', 'six', 'space', 't', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 14, 17, 19, 21, 23, 24, 25, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closed glyph list over 'GSUB': 31 glyphs after
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'l', 'nine', 'nonmarkingreturn', 'o', 'period', 'plus', 'r', 's', 'six', 'space', 't', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 14, 17, 19, 21, 23, 24, 25, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closing glyph list over 'MATH': 31 glyphs before
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'l', 'nine', 'nonmarkingreturn', 'o', 'period', 'plus', 'r', 's', 'six', 'space', 't', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 14, 17, 19, 21, 23, 24, 25, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closed glyph list over 'MATH': 31 glyphs after
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'l', 'nine', 'nonmarkingreturn', 'o', 'period', 'plus', 'r', 's', 'six', 'space', 't', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 14, 17, 19, 21, 23, 24, 25, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closing glyph list over 'glyf': 31 glyphs before
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'l', 'nine', 'nonmarkingreturn', 'o', 'period', 'plus', 'r', 's', 'six', 'space', 't', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 14, 17, 19, 21, 23, 24, 25, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closed glyph list over 'glyf': 31 glyphs after
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'l', 'nine', 'nonmarkingreturn', 'o', 'period', 'plus', 'r', 's', 'six', 'space', 't', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 14, 17, 19, 21, 23, 24, 25, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Retaining 31 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [13]:
def volcano_analysis(adata, variable, subject, control, quick=False):
    volcano = scl.markers.volcano_plot(adata, variable, subject, control, quick=quick)
    deg = pd.DataFrame(volcano.genelist, columns = ['genelist'])
    deg['fc'] = volcano.fc
    deg['pval'] = volcano.pval
    deg['pval'] = [np.min(deg['pval'][deg['pval']!=0]) if x==0 else x for x in deg['pval']]
    deg['-log10pval'] = -np.log10(deg['pval'])
    
    return deg
In [23]:
huvec_sorted = huvec_ca[huvec_ca['pvalue']<0.05]
huvec_sorted = huvec_sorted[huvec_sorted['log2FoldChange']>1]
In [33]:
huvec_sorted.dropna()
Out[33]:
ENSEMBL Con_1 Con_2 Con_3 IR_1 IR_2 IR_3 baseMean log2FoldChange lfcSE pvalue padj ENTREZID SYMBOL GENENAME
6 ENSG00000000971 456.031805 515.103291 535.132519 1299.929886 1419.238443 1268.086682 915.587104 1.395512 0.086817 2.500000e-59 4.070000e-57 3075.0 CFH complement factor H
60 ENSG00000004799 177.006609 232.361964 207.237206 472.951267 470.177153 550.738376 351.745429 1.252902 0.133660 4.570000e-22 1.220000e-20 5166.0 PDK4 pyruvate dehydrogenase kinase 4
156 ENSG00000006747 52.317224 62.717167 69.079069 131.731107 169.786194 141.155634 104.464399 1.188914 0.229616 1.440000e-08 1.330000e-07 85477.0 SCIN scinderin
223 ENSG00000008517 224.092111 228.249363 217.368803 468.377271 542.009774 465.119385 357.536118 1.115310 0.123110 9.690000e-21 2.420000e-19 9235.0 IL32 interleukin 32
327 ENSG00000013293 80.219744 64.773468 71.842231 276.269406 261.209529 218.675532 162.164985 1.763139 0.188013 4.440000e-22 1.190000e-20 57709.0 SLC7A14 solute carrier family 7 member 14
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
49149 ENSG00000267365 44.469641 48.323063 43.289550 101.542729 105.572185 90.247045 72.240702 1.017452 0.265778 8.580000e-06 5.530000e-05 400617.0 KCNJ2-AS1 KCNJ2 antisense RNA 1
50081 ENSG00000269720 5.231722 5.140751 3.684217 16.466388 27.209326 27.768321 14.250121 1.951419 0.690127 2.056000e-04 1.051304e-03 110806280.0 CCDC194 coiled-coil domain containing 194
51739 ENSG00000272668 26.158612 23.647456 28.552682 48.484366 66.390755 77.519898 45.125628 1.102492 0.361255 1.252580e-04 6.667070e-04 107985216.0 LOC107985216 uncharacterized LOC107985216
54283 ENSG00000277639 15.695167 16.450405 7.368434 45.739968 40.269802 53.222616 29.791065 1.603014 0.455563 2.130000e-05 1.292820e-04 105371267.0 CHD9NB CHD9 neighbor
59407 ENSG00000287159 13.951260 12.337803 11.052651 79.587544 66.390755 61.321710 40.773621 2.357634 0.383892 5.160000e-11 6.110000e-10 105370315.0 LOC105370315 uncharacterized LOC105370315

197 rows × 15 columns

In [571]:
sc.tl.score_genes(endothelial, gene_list=[x.lower().capitalize() for x in huvec_sorted.dropna()['SYMBOL']], score_name='huvec_ca')
computing score 'huvec_ca'
WARNING: genes are not in var_names and ignored: ['Il32', 'Ca11', 'Abcb1', 'Oas1', 'Znf423', 'Caps', 'Ms4a6a', 'Plaat4', 'Sectm1', 'Mx1', 'Znf233', 'Tp53inp1', 'Gramd2a', 'Znf467', 'Tp53tg1', 'Tmt1a', 'Akr1c3', 'Rnu1-136p', 'Rnu1-2', 'Mir217', 'Mir216a', 'Linc01811', 'Linc01317', 'Ttty10', 'Abca9-as1', 'Lnctam34a', 'Zscan31', 'Linc02154', 'Gpc5-as1', 'Mtx1p1', 'Apobec3g', 'Adamts9-as2', 'Apobec3c', 'Linc01252', 'Rn7sl689p', 'Mir548as', 'Gacat2', 'Sec24ap1', 'Kcnj2-as1', 'Ccdc194', 'Loc107985216', 'Chd9nb', 'Loc105370315']
    finished: added
    'huvec_ca', score of gene set (adata.obs).
    897 total control genes are used. (0:00:00)
In [572]:
scl.us(endothelial, 'huvec_ca')
In [8]:
class sample_volcano():
  
    def __init__(self,adata,patient_id,anno_key,comp1,comp2,P=0.01,quick=True,
                 fc_cut_pval=0.5,n_pos_cell=10,n_patient_cell=10):
        '''
        param P :pseudocount for fc calculation
        '''
        from scipy.stats import ttest_ind, mannwhitneyu
        self.genelist = adata.raw.var_names
        from collections import Counter
        
        # Removing Patients with cells less than n_patient_cell(10 by default)
        rmlist = []
        for f in Counter(adata.obs[patient_id]).items():
            if f[1]<n_patient_cell:
                rmlist.append(f[0])
            else:
                continue
        adata = adata[~adata.obs[patient_id].isin(rmlist)]
        
        adraw = adata.raw.to_adata()
        cond1 = adraw[adraw.obs[anno_key]==comp1]
        cond2 = adraw[adraw.obs[anno_key]==comp2]
        
        cond1 = pd.DataFrame(data=cond1.X.toarray(),index=cond1.obs[patient_id],columns=cond1.var_names)
        cond2 = pd.DataFrame(data=cond2.X.toarray(),index=cond2.obs[patient_id],columns=cond2.var_names)
        
        exp1 = cond1.groupby(cond1.index).mean()
        exp2 = cond2.groupby(cond2.index).mean()
        
        self.pval = []
        self.fc = []
        
        for i in adraw.var_names:
            # Calculating number of cell count with positive gene exp
            n_pos1 = np.sum(cond1[i]>0)
            n_pos2 = np.sum(cond2[i]>0)
            n_max = np.sum([n_pos1,n_pos2])
            
            # Calculating mean exp of each patient
            norm_count1 = np.mean(exp1[i])+P
            norm_count2 = np.mean(exp2[i])+P

            self.fc.append(np.log2(norm_count1/norm_count2))
            
            if quick:
                if np.abs(self.fc[-1])< fc_cut_pval:
                    self.pval.append(1)
                elif n_max < n_pos_cell:
                    self.pval.append(1)
                else:
                    self.pval.append(mannwhitneyu(exp1[i],exp2[i])[1])
            else:
                self.pval.append(mannwhitneyu(exp1[i],exp2[i])[1])

        self.pval = np.array(self.pval)
        self.fc = np.array(self.fc)
            
    def draw(self, title=None, pvalue_cut=100, to_show = 0.2, adjust_lim = 5, show=True, sig_mode = 'auto',adjust = True):
        '''
        draw volcano plot
        param pvalue_cut :-log10Pvalue for cutoff
        sig_mode: ['auto','complex','pval']
        '''
        from adjustText import adjust_text
        plt.figure(figsize=(6,6))

        xpos = np.array(self.fc)
        ypos = -np.log10(np.array(self.pval))
        ypos[ypos==np.inf] = np.max(ypos[ypos!=np.inf])

        if sig_mode == 'complex':
            index = (np.abs(xpos))*ypos
            index_cut = np.percentile(index,100-to_show)
            sig = (np.abs(xpos) > 1) & (ypos > 2) & ((np.abs(xpos))*ypos > index_cut)
        elif sig_mode =='pval':
            sig = (np.abs(xpos) > 1) & (ypos > pvalue_cut)
        elif sig_mode =='auto':
            index_cut = np.percentile(ypos,100-to_show)
            sig = (np.abs(xpos) > 1) & (ypos > index_cut)
        else:
            print('error, check sig_mode')
            raise SystemError

        if title:
            plt.title(title)
        plt.xlabel('log2FoldChange',fontsize=12)
        plt.ylabel('-log10Pval',fontsize=12)
        plt.xticks(fontsize=10)
        plt.yticks(fontsize=10)
        plt.scatter(xpos,ypos,s=1, color='k', alpha =0.5, rasterized=True)
        plt.scatter(xpos[sig],ypos[sig],s=3,color='red', rasterized=True)

        texts = []
        for i, gene in enumerate(self.genelist[sig]):
            texts.append(plt.text(xpos[sig][i],ypos[sig][i],gene,fontsize=5))
        
        if adjust:
            adjust_text(texts,only_move={'texts':'xy'},lim=adjust_lim)
        else:
            pass
        if show:
            plt.show()
In [1435]:
scl.us(endothelial, 'fibrotic_ec')
In [28]:
volcano_plot(fib_deg, int_genes='Il6,Cdkn1a,Cdkn2a,Stab2,Scarb1,Scarb2,Stab1,Cx3cl1,Cxcl12'.split(','), adjust=(0,0), fccut=100, pvalcut=10)
In [24]:
pre_res = gp.prerank(rnk=rnk,
                     gene_sets={'Senmayo':senmayo,
                                'HUVEC_ca':[x.lower().capitalize() for x in huvec_sorted.dropna()['SYMBOL']]},
                     threads=4,
                     min_size=5,
                     max_size=1000,
                     permutation_num=1000, # reduce number to speed up testing
                     outdir=None, # don't write to disk
                     seed=6,
                     verbose=True, # see what's going on behind the scenes
                    )
2024-04-01 14:00:24,921 [INFO] Parsing data files for GSEA.............................
2024-04-01 14:00:24,923 [INFO] 0000 gene_sets have been filtered out when max_size=1000 and min_size=5
2024-04-01 14:00:24,923 [INFO] 0002 gene_sets used for further statistical testing.....
2024-04-01 14:00:24,924 [INFO] Start to run GSEA...Might take a while..................
2024-04-01 14:00:25,188 [INFO] Congratulations. GSEApy runs successfully................

In [25]:
terms = pre_res.res2d.Term
axs = pre_res.plot(terms=terms[0])
In [630]:
axs = pre_res.plot(terms=terms[1])
savefig('Fib_ec_gsea_huvec_ca')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 25 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'G', 'H', 'R', 'S', 'U', 'V', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 38, 40, 42, 43, 53, 54, 56, 57, 66, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87]
Closed glyph list over 'GSUB': 25 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'G', 'H', 'R', 'S', 'U', 'V', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 38, 40, 42, 43, 53, 54, 56, 57, 66, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87]
Closing glyph list over 'glyf': 25 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'G', 'H', 'R', 'S', 'U', 'V', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 38, 40, 42, 43, 53, 54, 56, 57, 66, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87]
Closed glyph list over 'glyf': 25 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'G', 'H', 'R', 'S', 'U', 'V', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 38, 40, 42, 43, 53, 54, 56, 57, 66, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87]
Retaining 25 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 35 glyphs before
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'eight', 'five', 'four', 'g', 'hyphen', 'l', 'nine', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closed glyph list over 'GSUB': 35 glyphs after
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'eight', 'five', 'four', 'g', 'hyphen', 'l', 'nine', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closing glyph list over 'MATH': 35 glyphs before
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'eight', 'five', 'four', 'g', 'hyphen', 'l', 'nine', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closed glyph list over 'MATH': 35 glyphs after
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'eight', 'five', 'four', 'g', 'hyphen', 'l', 'nine', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closing glyph list over 'glyf': 35 glyphs before
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'eight', 'five', 'four', 'g', 'hyphen', 'l', 'nine', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closed glyph list over 'glyf': 35 glyphs after
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'eight', 'five', 'four', 'g', 'hyphen', 'l', 'nine', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Retaining 35 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned

proportion

In [633]:
endonew
Out[633]:
AnnData object with n_obs × n_vars = 707 × 32285
    obs: 'pct_counts_mt', 'n_genes', 'n_counts', 'age', 'sample', 'DQ', 'annotation_publish', 'age_status', 'dysfunctional', 'SAEc_1', 'SAEc_2', 'SAEc', 'Human_endo(1)', 'Human_endo(2)', 'Human_endo(3)', 'Human_endo(4)', 'Human_endo(5)', 'anno_transfer', 'annotation_endonew_publish', 'annotation_endonew_publish_1', 'subannotation_publish', 'leiden_0.2', 'leiden_0.4', 'leiden_0.6', 'leiden_0.8', 'leiden_1.0', 'leiden_1.2', 'leiden_1.4', 'leiden_1.6', 'leiden_1.8', 'leiden_2.0', 'subannotation_publish_1', 'temp'
    var: 'highly_variable', 'means', 'dispersions', 'dispersions_norm', 'mean', 'std'
    uns: 'age_status_colors', 'anno_transfer_colors', 'annotation_endonew_publish_2_colors', 'cdm_leiden_0.4', 'hvg', 'leiden', 'leiden_0.2_colors', 'leiden_0.4_colors', 'leiden_0.6_colors', 'neighbors', 'pca', 'status_colors', 'subannotation_publish_1_colors', 'subannotation_publish_colors', 'temp_colors', 'umap'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'connectivities', 'distances'
In [636]:
scl.us(endonew, 'subannotation_publish_1', frameon=False, size=500, show=False)
savefig('endonew_umap_annotation')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 27 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'g', 'h', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'r', 's', 'space', 't', 'three', 'u', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 20, 22, 24, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88]
Closed glyph list over 'GSUB': 27 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'g', 'h', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'r', 's', 'space', 't', 'three', 'u', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 20, 22, 24, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88]
Closing glyph list over 'MATH': 27 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'g', 'h', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'r', 's', 'space', 't', 'three', 'u', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 20, 22, 24, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88]
Closed glyph list over 'MATH': 27 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'g', 'h', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'r', 's', 'space', 't', 'three', 'u', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 20, 22, 24, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88]
Closing glyph list over 'glyf': 27 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'g', 'h', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'r', 's', 'space', 't', 'three', 'u', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 20, 22, 24, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88]
Closed glyph list over 'glyf': 27 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'E', 'L', 'S', 'a', 'b', 'e', 'five', 'g', 'h', 'i', 'l', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'r', 's', 'space', 't', 'three', 'u', 'underscore']
Glyph IDs:   [0, 1, 2, 3, 20, 22, 24, 38, 40, 47, 54, 66, 68, 69, 72, 74, 75, 76, 79, 80, 81, 82, 83, 85, 86, 87, 88]
Retaining 27 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [632]:
scl.us(endonew, 'Ackr1,Vwa1', frameon=False, size=700)
savefig('endonew_umap_ackr1_vwa1')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 17 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'V', 'a', 'c', 'five', 'four', 'k', 'nonmarkingreturn', 'one', 'r', 'space', 'three', 'two', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 20, 21, 22, 23, 24, 36, 57, 68, 70, 78, 85, 90]
Closed glyph list over 'GSUB': 17 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'V', 'a', 'c', 'five', 'four', 'k', 'nonmarkingreturn', 'one', 'r', 'space', 'three', 'two', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 20, 21, 22, 23, 24, 36, 57, 68, 70, 78, 85, 90]
Closing glyph list over 'MATH': 17 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'V', 'a', 'c', 'five', 'four', 'k', 'nonmarkingreturn', 'one', 'r', 'space', 'three', 'two', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 20, 21, 22, 23, 24, 36, 57, 68, 70, 78, 85, 90]
Closed glyph list over 'MATH': 17 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'V', 'a', 'c', 'five', 'four', 'k', 'nonmarkingreturn', 'one', 'r', 'space', 'three', 'two', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 20, 21, 22, 23, 24, 36, 57, 68, 70, 78, 85, 90]
Closing glyph list over 'glyf': 17 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'V', 'a', 'c', 'five', 'four', 'k', 'nonmarkingreturn', 'one', 'r', 'space', 'three', 'two', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 20, 21, 22, 23, 24, 36, 57, 68, 70, 78, 85, 90]
Closed glyph list over 'glyf': 17 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'V', 'a', 'c', 'five', 'four', 'k', 'nonmarkingreturn', 'one', 'r', 'space', 'three', 'two', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 19, 20, 21, 22, 23, 24, 36, 57, 68, 70, 78, 85, 90]
Retaining 17 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [1490]:
endo_ave_1, endo_frac_1 = expression_pattern(endothelial, 'subannotation_publish')
z_endo_ave_1 = endo_ave_1.copy()
for col in endo_ave_1.columns:
    z_endo_ave_1[col] = scipy.stats.zscore(endo_ave_1[col])
In [1493]:
# reduced

plt.rcParams['figure.figsize'] = (9,9)


x = 'Cdkn2a'
y = 'Cdkn1a'
data = endo_ave_1.copy()
data.index = [x.replace('_EC','') for x in data.index]
data.index = [x.replace('Old Control','OC') for x in data.index]
data.index = [x.replace('Old FiNi-seq','OF') for x in data.index]
data.index = [x.replace('Young FiNi-seq','YF') for x in data.index]

fig, ax = plt.subplots() 

for index in data.index:
    if 'OC' in index:
        shape = 'o'
    if 'OF' in index:
        shape = '^'
    if 'YF' in index:
        shape = ','
        
    if 'portal' in index:
        color = 'mediumseagreen'
    if 'LSEC' in index:
        color = 'steelblue'
    if 'central' in index:
        color = 'darkkhaki'
    if 'LyEC' in index:
        color = 'sienna'
    if 'dysfunctional' in index:
        color = 'salmon'

        
    ax.scatter(x=data[x][index], y=data[y][index], color=color,
               s=1200, edgecolor='black', linewidth=3, alpha=0.5)
    plt.text(x=data[x][index], y=data[y][index], s=index, fontsize=20, fontweight='bold')
    
[x.set_linewidth(2) for x in ax.spines.values()]

plt.xlabel(x+' Relative Expression', fontsize=20)
plt.ylabel(y+' Relative Expression', fontsize=20)

plt.xticks(fontsize=15)
plt.yticks(fontsize=15)

from adjustText import adjust_text

adjust_text(plt.gca().texts,endo_move={'texts':'xy'})
Out[1493]:
10
In [621]:
volcano_plot3(fib_deg, pvalcut=10, fccut=1.5,
            fontsize=25, figsize=(10,10), title='DEG in Fibrotic_EC')
In [663]:
vsmc
Out[663]:
AnnData object with n_obs × n_vars = 327 × 32285
    obs: 'label', 'age', 'status', 'age_status', 'DQ', 'annotation_publish', 'subannotation_publish', 'subannotation_publish_1', 'subannotation_publish_2', 'subannotation_publish_3', 'sample', 'subannotation_publish_4'
    var: 'highly_variable', 'means', 'dispersions', 'dispersions_norm', 'mean', 'std'
    uns: 'age_colors', 'cdm_subannotation_publish', 'cdm_subannotation_publish_2', 'cdm_subannotation_publish_3', 'hvg', 'label_colors', 'neighbors', 'pca', 'sample_colors', 'status_colors', 'subannotation_publish_1_colors', 'subannotation_publish_2_colors', 'subannotation_publish_3_colors', 'umap', 'subannotation_publish_4_colors'
    obsm: 'X_pca', 'X_pca_harmony', 'X_umap'
    varm: 'PCs'
    obsp: 'connectivities', 'distances'
In [664]:
scl.us(vsmc, 'subannotation_publish_2')
In [870]:
vsmc_sv = sample_volcano(vsmc_again,'sample', 'subannotation_publish_2', 'VSMC_Il-6-high','VSMC_Il-6-low')
In [871]:
vsmc_sv.draw()
In [1508]:
df[df['genelist'].str.contains('Cxcl')]
Out[1508]:
pval fc -log10pval genelist
8268 0.012837 1.772511 1.891551 Cxcl1
In [1509]:
df[df['genelist'].str.contains('Ccl')]
Out[1509]:
pval fc -log10pval genelist
In [1399]:
def volcano_plot3 (deg1, pathway_genes=None, int_genes=None, fccut=1, pvalcut=10
                  , adjust=(-0.1,1), fontsize = 15, figsize = (15,15), title=''):
        import math
        
        deg = deg1.copy()
#         deg.loc[deg['fc']>=5.5, 'fc'] = 5.5
#         deg.loc[deg['-log10pval']>=350, '-log10pval'] = 350

        
        plt.gcf().set_size_inches(figsize[0],figsize[1])
        
        


        
        
        # label variable
        fcposcut = fccut     
        fcnegcut = -fccut
 
       
        # plot variable
        scattersize = 300
        font_size = fontsize 

        


        # plot scatter
        plt.scatter(x=deg['fc'], y=deg['-log10pval'], s=scattersize, alpha=0.1, c='lightgray')
        deg_pos = deg[(deg['pval'] < 0.05) & (deg['fc'] > 1)]
        plt.scatter(x=deg_pos['fc'], y=deg_pos['-log10pval'], s=scattersize, alpha=0.8, c='grey', linewidth=0.4)
        deg_neg = deg[(deg['pval'] < 0.05) & (deg['fc'] < -1)]
        plt.scatter(x=deg_neg['fc'], y=deg_neg['-log10pval'], s=scattersize, alpha=0.8, c='grey')

        deg_pos_label = deg_pos[(deg_pos['-log10pval'] > pvalcut) & (deg_pos['fc'] > fcposcut)]

#         for index in list(deg_pos_label.index):
#             plt.text(x=deg_pos_label['fc'][index], y=deg_pos_label['-log10pval'][index], 
#                      s=deg_pos_label['genelist'][index], fontsize=font_size, alpha=1.0)
        
        
        # color pathway genes
        if pathway_genes != None:
            a = list(deg_pos_label.sort_values('fc', ascending=False)['genelist'])
            a_set = set(a)
            inter = a_set.intersection(pathway_genes)    
            b = deg_pos_label[deg_pos_label['genelist'].isin(list(inter))].index.values
            for index in b:
                plt.text(x=deg_pos_label['fc'][index], y=deg_pos_label['-log10pval'][index], 
                         s=deg_pos_label['genelist'][index], fontsize=font_size, color = 'purple')


               
                
        deg_neg_label = deg_neg[(deg_neg['-log10pval'] > pvalcut) & (deg_neg['fc'] < fcnegcut)]


#         for index in list(deg_neg_label.index):
#              plt.text(x=deg_neg_label['fc'][index], y=deg_neg_label['-log10pval'][index], 
#                       s=deg_neg_label['genelist'][index], fontsize=font_size, alpha=1.0)

                
        # color pathway genes                
        if pathway_genes != None:
            c = list(deg_neg_label.sort_values('fc', ascending=False)['genelist'])
            c_set = set(c)
            inter1 = c_set.intersection(pathway_genes)    
            d = deg_neg_label[deg_neg_label['genelist'].isin(list(pathway_genes))].index.values
            for index in d:
                plt.text(x=deg_neg_label['fc'][index], y=deg_neg_label['-log10pval'][index], 
                         s=deg_neg_label['genelist'][index], fontsize=font_size, color = 'yellow')    

        
        # gene_of_interest
        if int_genes!=None:
            degint = deg[deg['genelist'].isin(set(int_genes))]
            degpos = degint[degint['fc']>0]
            degneg = degint[degint['fc']<0]
            for index in list(degpos.index):
                plt.scatter(x=degpos['fc'], y=degpos['-log10pval'], s=(scattersize//2)*3, alpha=1, c='red')
            for index in list(degneg.index):
                plt.scatter(x=degneg['fc'], y=degneg['-log10pval'], s=(scattersize//2)*3, alpha=1, c='blue')
            for index in list(degint.index):    
                plt.text(x=degint['fc'][index], y=degint['-log10pval'][index], 
                     s=degint['genelist'][index], fontsize=font_size, alpha=1.0, color='black')


        
            
            
        # set boarder
        fclim = round(max(deg['fc']), 0)
        if max(deg['fc'])-fclim > 0:
            fclim = fclim+1

        pvallim = max(deg[~deg['-log10pval'].isna()]['-log10pval'])   
        pvallim = math.ceil(pvallim)
        
        
        from adjustText import adjust_text
        adjust_text(plt.gca().texts, only_move={'texts':'xy'}, arrowprops=dict(arrowstyle="-", color='k', lw=1.5))
#                                                                               alpha=0.7))
                    
        
        # draw 
        plt.xlim(0, 5)
        plt.ylim(0, 4)    
#         plt.axvline(x=1, color='tab:orange', linestyle='--', linewidth=0.5)
#         plt.axvline(x=-1, color='tab:orange', linestyle='--', linewidth=0.5)
#         plt.axhline(y=-math.log10(0.05))
        # plt.axhspan(0, 300, xmin=0.5, xmax=1, alpha=0.1, color='tab:red')
        # plt.axhspan(0, 300, xmin=-2, xmax=0.3, alpha=0.1, color='tab:blue')
#         plt.grid(visible=None)
        plt.xticks(fontsize=30, rotation=0)
        plt.yticks(fontsize=30, rotation=0)
        plt.xlabel('-log'+r'$_{2}$'+'(Fold Change)', fontsize=20, fontweight='bold')
        plt.ylabel('-log'+r'$_{10}$'+'(Adjusted P-value)', fontsize=20, fontweight='bold')
        if pathway_genes != None:
            if len(inter)!=0:
                print('pos'+str(inter))
            if len(inter1)!=0:
                print('neg'+str(inter1))
                
        sns.set_style('ticks')
        sns.set_context('paper')
        
        plt.title(title, fontsize=30, fontweight='bold')
In [899]:
def volcano_plot2 (deg, pathway_genes=None, int_genes=None, fccut=1, pvalcut=10, adjust=(-0.1,1), fontsize = 15, figsize = (15,15), sum_cut = None):
        import math
        
        

        # sum_cut = (x, slope)
        
        plt.gcf().set_size_inches(figsize[0],figsize[1])
        
        # label variable
        fcposcut = fccut     
        fcnegcut = -fccut
 
       
        # plot variable
        scattersize = 100
        font_size = fontsize 
        
        xadjust =  adjust[0]
        yadjust =  adjust[1]
    
        sns.set_style('ticks')
        sns.set_context('paper')           


        # plot scatter
        plt.scatter(x=deg['fc'], y=deg['-log10pval'], s=scattersize, alpha=0.1, c='lightgray')
        deg_pos = deg[(deg['pval'] < 0.05) & (deg['fc'] > 1)]
        plt.scatter(x=deg_pos['fc'], y=deg_pos['-log10pval'], s=scattersize, alpha=1, c='darkgray')
        deg_neg = deg[(deg['pval'] < 0.05) & (deg['fc'] < -1)]
        plt.scatter(x=deg_neg['fc'], y=deg_neg['-log10pval'], s=scattersize, alpha=1, c='darkgray')

        deg_pos_label = deg_pos[(deg_pos['-log10pval'] > pvalcut) & (deg_pos['fc'] > fcposcut)]


        
#         for index in list(deg_pos_label.index):
#             plt.text(x=deg_pos_label['fc'][index]+xadjust, y=deg_pos_label['-log10pval'][index]+yadjust, 
#                      s=deg_pos_label['genelist'][index], fontsize=font_size, alpha=1.0)
        
        
        # color pathway genes
        if pathway_genes != None:
            a = list(deg_pos_label.sort_values('fc', ascending=False)['genelist'])
            a_set = set(a)
            inter = a_set.intersection(pathway_genes)    
            b = deg_pos_label[deg_pos_label['genelist'].isin(list(inter))].index.values
            for index in b:
                plt.text(x=deg_pos_label['fc'][index]+xadjust, y=deg_pos_label['-log10pval'][index]+yadjust, 
                         s=deg_pos_label['genelist'][index], fontsize=font_size, color = 'purple')


               
                
        deg_neg_label = deg_neg[(deg_neg['-log10pval'] > pvalcut) & (deg_neg['fc'] < fcnegcut)]


#         for index in list(deg_neg_label.index):
#             plt.text(x=deg_neg_label['fc'][index]+xadjust, y=deg_neg_label['-log10pval'][index]+yadjust, 
#                       s=deg_neg_label['genelist'][index], fontsize=font_size, alpha=1.0)

                
        # color pathway genes                
        if pathway_genes != None:
            c = list(deg_neg_label.sort_values('fc', ascending=False)['genelist'])
            c_set = set(c)
            inter1 = c_set.intersection(pathway_genes)    
            d = deg_neg_label[deg_neg_label['genelist'].isin(list(pathway_genes))].index.values
            for index in d:
                plt.text(x=deg_neg_label['fc'][index]+xadjust, y=deg_neg_label['-log10pval'][index]+yadjust, 
                         s=deg_neg_label['genelist'][index], fontsize=font_size, color = 'yellow')    

        
        # gene_of_interest
        if int_genes!=None:
            degint = deg[deg['genelist'].isin(set(int_genes))]
            for index in list(degint.index):
                plt.scatter(x=degint['fc'], y=degint['-log10pval'], s=(scattersize//3+1)*3, alpha=1, c='lightcoral')
                plt.text(x=degint['fc'][index]+xadjust, y=degint['-log10pval'][index]+yadjust, 
                         s=degint['genelist'][index], fontsize=font_size, alpha=1.0, color='lightcoral')


#         from adjustText import adjust_text
#         adjust_text(plt.gca().texts, only_move={'texts':'xy'}, arrowprops=dict(arrowstyle="-", color='k', lw=1.5))
#                                                                               alpha=0.7))   
            
            
        # set boarder
        fclim = round(max(deg['fc']), 0)
        if max(deg['fc'])-fclim > 0:
            fclim = fclim+1

        pvallim = max(deg[~deg['-log10pval'].isna()]['-log10pval'])   
        pvallim = ((pvallim //10)+1) * 10
        
    
        
        
        # draw 
        plt.xlim(-fclim, fclim)
        plt.ylim(0, pvallim)    
#         plt.axvline(x=1, color='tab:orange', linestyle='--', linewidth=0.5)
#         plt.axvline(x=-1, color='tab:orange', linestyle='--', linewidth=0.5)
#         plt.axhline(y=-math.log10(0.05))
        # plt.axhspan(0, 300, xmin=0.5, xmax=1, alpha=0.1, color='tab:red')
        # plt.axhspan(0, 300, xmin=-2, xmax=0.3, alpha=0.1, color='tab:blue')
#         plt.grid(visible=None)
        plt.xticks(fontsize=10, rotation=0)
        plt.yticks(fontsize=10, rotation=0)
        plt.xlabel('log2 (fold change)', fontsize=10)
        plt.ylabel('-log10 (p value)', fontsize=10)
        if pathway_genes != None:
            if len(inter)!=0:
                print('pos'+str(inter))
            if len(inter1)!=0:
                print('neg'+str(inter1))
In [914]:
vsmc_df[vsmc_df['genelist']=='Cdkn2a']
Out[914]:
pval fc -log10pval genelist
6377 1.0 3.232876 -0.0 Cdkn2a
In [900]:
volcano_plot2(vsmc_df, pvalcut=2, sum_cut=(4,-4), figsize=(9,7))
savefig('vsmc_volcano_new')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 27 glyphs before
Glyph names: ['.notdef', '.null', 'a', 'c', 'd', 'e', 'eight', 'f', 'four', 'g', 'h', 'hyphen', 'l', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'six', 'space', 'two', 'u', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 19, 20, 21, 23, 25, 27, 68, 70, 71, 72, 73, 74, 75, 79, 81, 82, 83, 88, 89, 3228]
Closed glyph list over 'GSUB': 30 glyphs after
Glyph names: ['.notdef', '.null', 'a', 'c', 'd', 'e', 'eight', 'f', 'fl', 'four', 'g', 'h', 'hyphen', 'l', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'six', 'space', 'two', 'u', 'uniFB00', 'uniFB04', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 19, 20, 21, 23, 25, 27, 68, 70, 71, 72, 73, 74, 75, 79, 81, 82, 83, 88, 89, 3228, 5038, 5040, 5042]
Closing glyph list over 'MATH': 30 glyphs before
Glyph names: ['.notdef', '.null', 'a', 'c', 'd', 'e', 'eight', 'f', 'fl', 'four', 'g', 'h', 'hyphen', 'l', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'six', 'space', 'two', 'u', 'uniFB00', 'uniFB04', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 19, 20, 21, 23, 25, 27, 68, 70, 71, 72, 73, 74, 75, 79, 81, 82, 83, 88, 89, 3228, 5038, 5040, 5042]
Closed glyph list over 'MATH': 36 glyphs after
Glyph names: ['.notdef', '.null', 'a', 'c', 'd', 'e', 'eight', 'f', 'fl', 'four', 'g', 'h', 'hyphen', 'l', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'six', 'space', 'two', 'u', 'uni239B', 'uni239C', 'uni239D', 'uni239E', 'uni239F', 'uni23A0', 'uniFB00', 'uniFB04', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 19, 20, 21, 23, 25, 27, 68, 70, 71, 72, 73, 74, 75, 79, 81, 82, 83, 88, 89, 3228, 3506, 3507, 3508, 3509, 3510, 3511, 5038, 5040, 5042]
Closing glyph list over 'glyf': 36 glyphs before
Glyph names: ['.notdef', '.null', 'a', 'c', 'd', 'e', 'eight', 'f', 'fl', 'four', 'g', 'h', 'hyphen', 'l', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'six', 'space', 'two', 'u', 'uni239B', 'uni239C', 'uni239D', 'uni239E', 'uni239F', 'uni23A0', 'uniFB00', 'uniFB04', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 19, 20, 21, 23, 25, 27, 68, 70, 71, 72, 73, 74, 75, 79, 81, 82, 83, 88, 89, 3228, 3506, 3507, 3508, 3509, 3510, 3511, 5038, 5040, 5042]
Closed glyph list over 'glyf': 36 glyphs after
Glyph names: ['.notdef', '.null', 'a', 'c', 'd', 'e', 'eight', 'f', 'fl', 'four', 'g', 'h', 'hyphen', 'l', 'minus', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'parenleft', 'parenright', 'six', 'space', 'two', 'u', 'uni239B', 'uni239C', 'uni239D', 'uni239E', 'uni239F', 'uni23A0', 'uniFB00', 'uniFB04', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 19, 20, 21, 23, 25, 27, 68, 70, 71, 72, 73, 74, 75, 79, 81, 82, 83, 88, 89, 3228, 3506, 3507, 3508, 3509, 3510, 3511, 5038, 5040, 5042]
Retaining 36 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0, 38]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [731]:
sc.tl.score_genes(vsmc, gene_list=senmayo, score_name='senmayo')
computing score 'senmayo'
    finished: added
    'senmayo', score of gene set (adata.obs).
    594 total control genes are used. (0:00:00)
In [756]:
vsmc_again = again(vsmc)
extracting highly variable genes
    finished (0:00:00)
--> added
    'highly_variable', boolean vector (adata.var)
    'means', float vector (adata.var)
    'dispersions', float vector (adata.var)
    'dispersions_norm', float vector (adata.var)
... as `zero_center=True`, sparse input is densified and may lead to large memory consumption
computing PCA
    on highly variable genes
    with n_comps=50
    finished (0:00:00)
computing neighbors
    using 'X_pca' with n_pcs = 50
    finished: added to `.uns['neighbors']`
    `.obsp['distances']`, distances for each pair of neighbors
    `.obsp['connectivities']`, weighted adjacency matrix (0:00:01)
computing UMAP
    finished: added
    'X_umap', UMAP coordinates (adata.obsm) (0:00:01)
In [845]:
scl.us(vsmc_again, 'subannotation_publish_2', frameon=False, show=False, size=700)
savefig('vsmc_umap_new')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 26 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'S', 'V', 'a', 'b', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'p', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w']
Glyph IDs:   [0, 1, 2, 3, 16, 21, 25, 38, 44, 48, 54, 57, 66, 68, 69, 74, 75, 76, 79, 81, 82, 83, 86, 87, 88, 90]
Closed glyph list over 'GSUB': 26 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'S', 'V', 'a', 'b', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'p', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w']
Glyph IDs:   [0, 1, 2, 3, 16, 21, 25, 38, 44, 48, 54, 57, 66, 68, 69, 74, 75, 76, 79, 81, 82, 83, 86, 87, 88, 90]
Closing glyph list over 'MATH': 26 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'S', 'V', 'a', 'b', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'p', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w']
Glyph IDs:   [0, 1, 2, 3, 16, 21, 25, 38, 44, 48, 54, 57, 66, 68, 69, 74, 75, 76, 79, 81, 82, 83, 86, 87, 88, 90]
Closed glyph list over 'MATH': 26 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'S', 'V', 'a', 'b', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'p', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w']
Glyph IDs:   [0, 1, 2, 3, 16, 21, 25, 38, 44, 48, 54, 57, 66, 68, 69, 74, 75, 76, 79, 81, 82, 83, 86, 87, 88, 90]
Closing glyph list over 'glyf': 26 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'S', 'V', 'a', 'b', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'p', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w']
Glyph IDs:   [0, 1, 2, 3, 16, 21, 25, 38, 44, 48, 54, 57, 66, 68, 69, 74, 75, 76, 79, 81, 82, 83, 86, 87, 88, 90]
Closed glyph list over 'glyf': 26 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'S', 'V', 'a', 'b', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'p', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w']
Glyph IDs:   [0, 1, 2, 3, 16, 21, 25, 38, 44, 48, 54, 57, 66, 68, 69, 74, 75, 76, 79, 81, 82, 83, 86, 87, 88, 90]
Retaining 26 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [846]:
sc.pl.umap(vsmc_again, color='senmayo', cmap='RdBu_r', vmax=0.45, show=False, size=700)
savefig('vsmc_senmayo_umap')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 21 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closed glyph list over 'GSUB': 21 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closing glyph list over 'MATH': 21 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closed glyph list over 'MATH': 21 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closing glyph list over 'glyf': 21 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Closed glyph list over 'glyf': 21 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'M', 'P', 'U', 'a', 'e', 'four', 'm', 'n', 'nonmarkingreturn', 'o', 'one', 'period', 's', 'space', 'three', 'two', 'y', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 36, 48, 51, 56, 68, 72, 80, 81, 82, 86, 92]
Retaining 21 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [892]:
pre_res_vsmc = gp.prerank(rnk=rnk,
                     gene_sets={'Senmayo':senmayo,
                                'HUVEC_ca':[x.lower().capitalize() for x in huvec_sorted.dropna()['SYMBOL']]},
                     threads=4,
                     min_size=5,
                     max_size=1000,
                     permutation_num=1000, # reduce number to speed up testing
                     outdir=None, # don't write to disk
                     seed=6,
                     verbose=True, # see what's going on behind the scenes
                    )
2023-12-21 14:03:44,523 [INFO] Parsing data files for GSEA.............................
2023-12-21 14:03:44,524 [INFO] 0001 gene_sets have been filtered out when max_size=1000 and min_size=5
2023-12-21 14:03:44,525 [INFO] 0001 gene_sets used for further statistical testing.....
2023-12-21 14:03:44,525 [INFO] Start to run GSEA...Might take a while..................
2023-12-21 14:03:44,560 [INFO] Congratulations. GSEApy runs successfully................

In [893]:
terms = pre_res_vsmc.res2d.Term
axs = pre_res_vsmc.plot(terms=terms[0])
savefig('Senmayo_vsmc')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 21 glyphs before
Glyph names: ['.notdef', '.null', 'E', 'G', 'R', 'S', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'y']
Glyph IDs:   [0, 1, 2, 3, 40, 42, 53, 54, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87, 92]
Closed glyph list over 'GSUB': 21 glyphs after
Glyph names: ['.notdef', '.null', 'E', 'G', 'R', 'S', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'y']
Glyph IDs:   [0, 1, 2, 3, 40, 42, 53, 54, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87, 92]
Closing glyph list over 'glyf': 21 glyphs before
Glyph names: ['.notdef', '.null', 'E', 'G', 'R', 'S', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'y']
Glyph IDs:   [0, 1, 2, 3, 40, 42, 53, 54, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87, 92]
Closed glyph list over 'glyf': 21 glyphs after
Glyph names: ['.notdef', '.null', 'E', 'G', 'R', 'S', 'a', 'c', 'd', 'e', 'h', 'i', 'k', 'm', 'n', 'nonmarkingreturn', 'o', 'r', 'space', 't', 'y']
Glyph IDs:   [0, 1, 2, 3, 40, 42, 53, 54, 68, 70, 71, 72, 75, 76, 78, 80, 81, 82, 85, 87, 92]
Retaining 21 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 33 glyphs before
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'hyphen', 'l', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closed glyph list over 'GSUB': 33 glyphs after
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'hyphen', 'l', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closing glyph list over 'MATH': 33 glyphs before
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'hyphen', 'l', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closed glyph list over 'MATH': 33 glyphs after
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'hyphen', 'l', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closing glyph list over 'glyf': 33 glyphs before
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'hyphen', 'l', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Closed glyph list over 'glyf': 33 glyphs after
Glyph names: ['.notdef', '.null', 'D', 'E', 'F', 'N', 'P', 'R', 'S', 'Z', 'a', 'c', 'colon', 'e', 'five', 'four', 'g', 'hyphen', 'l', 'nonmarkingreturn', 'o', 'one', 'period', 'r', 's', 'seven', 'six', 'space', 't', 'three', 'two', 'v', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 29, 39, 40, 41, 49, 51, 53, 54, 61, 68, 70, 72, 74, 79, 82, 85, 86, 87, 89]
Retaining 33 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [1495]:
sc.pl.violin(vsmc_again, 'Plaur,Il6,Cxcl2'.split(','), groupby='subannotation_publish_2', show=False)
savefig('vsmc_senmayo_leadgene_violin')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 36 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'P', 'S', 'V', 'a', 'b', 'c', 'five', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'w', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 38, 44, 48, 51, 54, 57, 66, 68, 69, 70, 74, 75, 76, 79, 81, 82, 83, 85, 86, 87, 88, 90, 91]
Closed glyph list over 'GSUB': 36 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'P', 'S', 'V', 'a', 'b', 'c', 'five', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'w', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 38, 44, 48, 51, 54, 57, 66, 68, 69, 70, 74, 75, 76, 79, 81, 82, 83, 85, 86, 87, 88, 90, 91]
Closing glyph list over 'MATH': 36 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'P', 'S', 'V', 'a', 'b', 'c', 'five', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'w', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 38, 44, 48, 51, 54, 57, 66, 68, 69, 70, 74, 75, 76, 79, 81, 82, 83, 85, 86, 87, 88, 90, 91]
Closed glyph list over 'MATH': 36 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'P', 'S', 'V', 'a', 'b', 'c', 'five', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'w', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 38, 44, 48, 51, 54, 57, 66, 68, 69, 70, 74, 75, 76, 79, 81, 82, 83, 85, 86, 87, 88, 90, 91]
Closing glyph list over 'glyf': 36 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'P', 'S', 'V', 'a', 'b', 'c', 'five', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'w', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 38, 44, 48, 51, 54, 57, 66, 68, 69, 70, 74, 75, 76, 79, 81, 82, 83, 85, 86, 87, 88, 90, 91]
Closed glyph list over 'glyf': 36 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'I', 'M', 'P', 'S', 'V', 'a', 'b', 'c', 'five', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'p', 'period', 'r', 's', 'six', 'space', 't', 'three', 'two', 'u', 'underscore', 'w', 'x', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 17, 19, 20, 21, 22, 23, 24, 25, 38, 44, 48, 51, 54, 57, 66, 68, 69, 70, 74, 75, 76, 79, 81, 82, 83, 85, 86, 87, 88, 90, 91]
Retaining 36 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [841]:
proportion_bargraph(vsmc_again, 'subannotation_publish_2' ,'age_status')
savefig('vsmc_prop_bar_new')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 14 glyphs before
Glyph names: ['.notdef', '.null', 'P', 'i', 'n', 'nonmarkingreturn', 'o', 'p', 'parenleft', 'parenright', 'percent', 'r', 'space', 't']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 51, 76, 81, 82, 83, 85, 87]
Closed glyph list over 'GSUB': 14 glyphs after
Glyph names: ['.notdef', '.null', 'P', 'i', 'n', 'nonmarkingreturn', 'o', 'p', 'parenleft', 'parenright', 'percent', 'r', 'space', 't']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 51, 76, 81, 82, 83, 85, 87]
Closing glyph list over 'glyf': 14 glyphs before
Glyph names: ['.notdef', '.null', 'P', 'i', 'n', 'nonmarkingreturn', 'o', 'p', 'parenleft', 'parenright', 'percent', 'r', 'space', 't']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 51, 76, 81, 82, 83, 85, 87]
Closed glyph list over 'glyf': 14 glyphs after
Glyph names: ['.notdef', '.null', 'P', 'i', 'n', 'nonmarkingreturn', 'o', 'p', 'parenleft', 'parenright', 'percent', 'r', 'space', 't']
Glyph IDs:   [0, 1, 2, 3, 8, 11, 12, 51, 76, 81, 82, 83, 85, 87]
Retaining 14 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 35 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'F', 'I', 'M', 'N', 'O', 'S', 'V', 'Y', 'd', 'e', 'eight', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'q', 'r', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 19, 20, 21, 23, 25, 27, 38, 41, 44, 48, 49, 50, 54, 57, 60, 66, 71, 72, 74, 75, 76, 79, 81, 82, 84, 85, 86, 87, 88, 90]
Closed glyph list over 'GSUB': 35 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'F', 'I', 'M', 'N', 'O', 'S', 'V', 'Y', 'd', 'e', 'eight', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'q', 'r', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 19, 20, 21, 23, 25, 27, 38, 41, 44, 48, 49, 50, 54, 57, 60, 66, 71, 72, 74, 75, 76, 79, 81, 82, 84, 85, 86, 87, 88, 90]
Closing glyph list over 'MATH': 35 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'F', 'I', 'M', 'N', 'O', 'S', 'V', 'Y', 'd', 'e', 'eight', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'q', 'r', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 19, 20, 21, 23, 25, 27, 38, 41, 44, 48, 49, 50, 54, 57, 60, 66, 71, 72, 74, 75, 76, 79, 81, 82, 84, 85, 86, 87, 88, 90]
Closed glyph list over 'MATH': 35 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'F', 'I', 'M', 'N', 'O', 'S', 'V', 'Y', 'd', 'e', 'eight', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'q', 'r', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 19, 20, 21, 23, 25, 27, 38, 41, 44, 48, 49, 50, 54, 57, 60, 66, 71, 72, 74, 75, 76, 79, 81, 82, 84, 85, 86, 87, 88, 90]
Closing glyph list over 'glyf': 35 glyphs before
Glyph names: ['.notdef', '.null', 'C', 'F', 'I', 'M', 'N', 'O', 'S', 'V', 'Y', 'd', 'e', 'eight', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'q', 'r', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 19, 20, 21, 23, 25, 27, 38, 41, 44, 48, 49, 50, 54, 57, 60, 66, 71, 72, 74, 75, 76, 79, 81, 82, 84, 85, 86, 87, 88, 90]
Closed glyph list over 'glyf': 35 glyphs after
Glyph names: ['.notdef', '.null', 'C', 'F', 'I', 'M', 'N', 'O', 'S', 'V', 'Y', 'd', 'e', 'eight', 'four', 'g', 'h', 'hyphen', 'i', 'l', 'n', 'nonmarkingreturn', 'o', 'one', 'q', 'r', 's', 'six', 'space', 't', 'two', 'u', 'underscore', 'w', 'zero']
Glyph IDs:   [0, 1, 2, 3, 16, 19, 20, 21, 23, 25, 27, 38, 41, 44, 48, 49, 50, 54, 57, 60, 66, 71, 72, 74, 75, 76, 79, 81, 82, 84, 85, 86, 87, 88, 90]
Retaining 35 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
<Figure size 1250x1250 with 0 Axes>
In [1382]:
fb.obs['temp'] = 'no'
fb.obs.loc[fb.obs['annolv2'].str.contains('Smoc1'), 'temp'] = 'yes'
In [1383]:
smoc1_sv = sample_volcano(fb, 'sample','temp','yes','no')
In [1384]:
smoc1_deg = pd.DataFrame()
smoc1_deg['pval'] = smoc1_sv.pval
smoc1_deg['fc'] = smoc1_sv.fc
smoc1_deg['genelist'] = smoc1_sv.genelist
smoc1_deg[
    '-log10pval'] = -np.log10(smoc1_deg['pval'])
In [1385]:
smoc1_deg[smoc1_deg['genelist']=='Thbs2']
Out[1385]:
pval fc genelist -log10pval
27265 0.016851 1.024429 Thbs2 1.773364
In [1302]:
fb.obs['temp'] = 'no'
fb.obs.loc[fb.obs['annolv2'].str.contains('Wif1'), 'temp'] = 'yes'
In [1400]:
volcano_plot3(smoc1_deg)
savefig('smoc1_vol_new')
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 24 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'C', 'F', 'P', 'a', 'd', 'e', 'g', 'h', 'hyphen', 'j', 'l', 'n', 'nonmarkingreturn', 'o', 'parenleft', 'parenright', 's', 'space', 't', 'u', 'v']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 36, 38, 41, 51, 68, 71, 72, 74, 75, 77, 79, 81, 82, 86, 87, 88, 89]
Closed glyph list over 'GSUB': 24 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'C', 'F', 'P', 'a', 'd', 'e', 'g', 'h', 'hyphen', 'j', 'l', 'n', 'nonmarkingreturn', 'o', 'parenleft', 'parenright', 's', 'space', 't', 'u', 'v']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 36, 38, 41, 51, 68, 71, 72, 74, 75, 77, 79, 81, 82, 86, 87, 88, 89]
Closing glyph list over 'glyf': 24 glyphs before
Glyph names: ['.notdef', '.null', 'A', 'C', 'F', 'P', 'a', 'd', 'e', 'g', 'h', 'hyphen', 'j', 'l', 'n', 'nonmarkingreturn', 'o', 'parenleft', 'parenright', 's', 'space', 't', 'u', 'v']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 36, 38, 41, 51, 68, 71, 72, 74, 75, 77, 79, 81, 82, 86, 87, 88, 89]
Closed glyph list over 'glyf': 24 glyphs after
Glyph names: ['.notdef', '.null', 'A', 'C', 'F', 'P', 'a', 'd', 'e', 'g', 'h', 'hyphen', 'j', 'l', 'n', 'nonmarkingreturn', 'o', 'parenleft', 'parenright', 's', 'space', 't', 'u', 'v']
Glyph IDs:   [0, 1, 2, 3, 11, 12, 16, 36, 38, 41, 51, 68, 71, 72, 74, 75, 77, 79, 81, 82, 86, 87, 88, 89]
Retaining 24 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
maxp pruned
cmap pruned
kern dropped
post pruned
FFTM dropped
GPOS pruned
GSUB pruned
name pruned
glyf pruned
Added gid0 to subset
Added first four glyphs to subset
Closing glyph list over 'GSUB': 11 glyphs before
Glyph names: ['.notdef', '.null', 'five', 'four', 'nonmarkingreturn', 'one', 'period', 'space', 'three', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24]
Closed glyph list over 'GSUB': 11 glyphs after
Glyph names: ['.notdef', '.null', 'five', 'four', 'nonmarkingreturn', 'one', 'period', 'space', 'three', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24]
Closing glyph list over 'MATH': 11 glyphs before
Glyph names: ['.notdef', '.null', 'five', 'four', 'nonmarkingreturn', 'one', 'period', 'space', 'three', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24]
Closed glyph list over 'MATH': 11 glyphs after
Glyph names: ['.notdef', '.null', 'five', 'four', 'nonmarkingreturn', 'one', 'period', 'space', 'three', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24]
Closing glyph list over 'glyf': 11 glyphs before
Glyph names: ['.notdef', '.null', 'five', 'four', 'nonmarkingreturn', 'one', 'period', 'space', 'three', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24]
Closed glyph list over 'glyf': 11 glyphs after
Glyph names: ['.notdef', '.null', 'five', 'four', 'nonmarkingreturn', 'one', 'period', 'space', 'three', 'two', 'zero']
Glyph IDs:   [0, 1, 2, 3, 17, 19, 20, 21, 22, 23, 24]
Retaining 11 glyphs
head subsetting not needed
hhea subsetting not needed
maxp subsetting not needed
OS/2 subsetting not needed
hmtx subsetted
cmap subsetted
fpgm subsetting not needed
prep subsetting not needed
cvt  subsetting not needed
loca subsetting not needed
post subsetted
gasp subsetting not needed
GDEF subsetted
GPOS subsetted
GSUB subsetted
MATH subsetted
name subsetting not needed
glyf subsetted
head pruned
OS/2 Unicode ranges pruned: [0]
glyf pruned
GDEF pruned
GPOS pruned
GSUB pruned
In [1544]:
temp = smoc1_deg.drop(['-log10pval'], axis=1)
In [1546]:
temp.to_csv('/home/kytak/kwonyongtak/02_aging/write/supple/smoc1_deg.csv')
In [1401]:
volcano_plot(smoc1_deg, adjust=(0,0),
             int_genes=['Sfrp1','Thbs2','Cntfr','Nxph1','Lbp','Smoc1','Mdk','Plxna4','Igfbp3','Fmod','Tnnt2','Smoc1','Adamtsl1','Vegfd'])
In [1580]:
smoc1_deg
Out[1580]:
pval fc genelist -log10pval
0 0.650595 0.505343 Xkr4 0.186689
1 1.000000 0.000000 Gm1992 -0.000000
2 0.419260 1.721888 Gm19938 0.377517
3 1.000000 0.000000 Gm37381 -0.000000
4 1.000000 0.000000 Rp1 -0.000000
... ... ... ... ...
32280 1.000000 0.000000 AC124606.1 -0.000000
32281 1.000000 0.000000 AC133095.2 -0.000000
32282 1.000000 0.000000 AC133095.1 -0.000000
32283 1.000000 0.000000 AC234645.1 -0.000000
32284 1.000000 -0.079976 AC149090.1 -0.000000

32285 rows × 4 columns

In [1583]:
volcano_plot3(smoc1_deg)
In [1203]:
human_ptn = pd.read_csv('/home/kytak/kwonyongtak/Human_protein.csv')
human_ptn.columns = [x.lower().capitalize() for x in human_ptn.columns]
In [1396]:
sns.set_style('ticks')
sns.set_context('paper')

df = smoc1_deg[smoc1_deg['fc']>1]
df = df[df['pval']<0.05]
for gene in df.sort_values(by='pval').head(200)['genelist']:
    if gene in human_ptn.columns:
        sns.regplot(data=human_ptn, x='Age', y=gene, color='mediumpurple', scatter_kws={'s':50})

        print(gene)
        
        print(scipy.stats.pearsonr(x=human_ptn['Age'], y=human_ptn[gene]))
        print(-np.log10(scipy.stats.pearsonr(x=human_ptn['Age'], y=human_ptn[gene])[1]))
        
        
#         figfolder = '/home/kytak/kwonyongtak/picture/raw/'
#         plt.savefig(figfolder+'Ageregplot_Smoc1_pval_'+gene+'.pdf', format='pdf', dpi=600, bbox_inches='tight', transparent=True)
        plt.show()
Smoc1
PearsonRResult(statistic=0.7026351879831716, pvalue=9.136965435089844e-27)
26.03919801801021
Nxph1
PearsonRResult(statistic=0.3448494870945204, pvalue=3.857792198300677e-06)
5.413661169528294
Cntfr
PearsonRResult(statistic=0.06231527490631728, pvalue=0.4181192742962249)
0.37869981205361536
Thbs2
PearsonRResult(statistic=0.39607828161929665, pvalue=8.214654336752724e-08)
7.085410706458898
Tnnt2
PearsonRResult(statistic=0.46818114721010246, pvalue=1.0671661424572826e-10)
9.971767961891944
Chrdl1
PearsonRResult(statistic=0.7502730979782355, pvalue=3.4549866899952915e-32)
31.46155362136438
Cxcl5
PearsonRResult(statistic=0.1449086503443642, pvalue=0.05862148548401624)
1.2319431806205932
Lrrtm3
PearsonRResult(statistic=0.2444921988188771, pvalue=0.001269648313318761)
2.896316559938997
F3
PearsonRResult(statistic=0.06459517955964594, pvalue=0.4012599599967456)
0.3965741744800517
In [1281]:
temp = wif1_deg[wif1_deg['pval']<0.05]
temp = temp[temp['fc']>1]
In [1283]:
sns.set_style('ticks')
sns.set_context('paper')

df = wif1_deg[wif1_deg['fc']>1]
df = df[df['pval']<0.05]
for gene in df.sort_values(by='-log10pval',ascending=False).head(200)['genelist']:
    if gene in human_ptn.columns:
        sns.regplot(data=human_ptn, x='Age', y=gene, color='mediumpurple', scatter_kws={'s':50})

        print(gene)
        
        print(scipy.stats.pearsonr(x=human_ptn['Age'], y=human_ptn[gene]))
        print(-np.log10(scipy.stats.pearsonr(x=human_ptn['Age'], y=human_ptn[gene])[1]))
        
        
#         figfolder = '/home/kytak/kwonyongtak/picture/raw/'
#         plt.savefig(figfolder+'Ageregplot_wif1_pval_'+gene+'.pdf', format='pdf', dpi=600, bbox_inches='tight', transparent=True)
        plt.show()
Tnfrsf19
PearsonRResult(statistic=0.5393854644362346, pvalue=2.7061592767106798e-14)
13.56764664566861
Gfra2
PearsonRResult(statistic=0.1403589338400654, pvalue=0.06709397956731615)
1.1733164479084648
Wif1
PearsonRResult(statistic=0.11348363683341078, pvalue=0.13943852581812646)
0.8556172173527199
Ntrk2
PearsonRResult(statistic=-0.16733702108822374, pvalue=0.028697695895378215)
1.54215297086506
Ptn
PearsonRResult(statistic=0.8172829253410565, pvalue=2.601777469003598e-42)
41.58472985155486
Nrg1
PearsonRResult(statistic=0.08650739445777822, pvalue=0.26057028587713155)
0.5840751105549795
Fgfr2
PearsonRResult(statistic=0.031846128272837115, pvalue=0.6792457284973761)
0.16797308400444327
Epha3
PearsonRResult(statistic=0.11671682670298761, pvalue=0.12844142944273904)
0.8912948697542484
Spon1
PearsonRResult(statistic=0.6195530126977921, pvalue=1.6597270262867084e-19)
18.77996333408394
Cadm1
PearsonRResult(statistic=-0.11858072504089787, pvalue=0.12241252662953776)
0.9121741380097227
C2
PearsonRResult(statistic=0.24217505495173852, pvalue=0.0014165231139295247)
2.848776334542663
Lepr
PearsonRResult(statistic=-0.02624762425324569, pvalue=0.7332741293319767)
0.1347336370916159
Il34
PearsonRResult(statistic=0.03414561670660553, pvalue=0.6575008792238747)
0.18210366209018652
Il11
PearsonRResult(statistic=0.29986722206528205, pvalue=6.75937264919226e-05)
4.170093609921851
Inhba
PearsonRResult(statistic=-0.02882280454201562, pvalue=0.7082403731841407)
0.1498193199510766
Gsta3
PearsonRResult(statistic=-0.00561044924693066, pvalue=0.9419425112805062)
0.025975602297916102
Arid3a
PearsonRResult(statistic=0.20280302736323483, pvalue=0.007808388014561851)
2.107438613835707
Tnfsf8
PearsonRResult(statistic=0.15669537992643695, pvalue=0.0406885753754447)
1.390527515784817
Ntrk1
PearsonRResult(statistic=0.22699899547624783, pvalue=0.002829292452189504)
2.5483221590090293
In [76]:
proportion_statistics_bar(mes, annotation='subannotation_publish_4',classification='sample', hue='status')
plt.savefig('/home/kytak/kwonyongtak/picture/raw/mes_prop_stat_bar.pdf', format='pdf', dpi=600, bbox_inches='tight', transparent=True)
<Figure size 1250x1250 with 0 Axes>
In [409]:
proportion_bargraph(mye, 'anno_transfer','age_status')
<Figure size 1250x1250 with 0 Axes>
In [165]:
# pvalue 어떻게 할지 고민 필요. age로 할지 status로 할지
def proportion_statistics_bar(adata, annotation, *,order = False , title='',
                              classification, hue='status', hue_order=['Young Control', 'Young FiNi-seq','Old Control','Old FiNi-seq']
                              , palette=['peachpuff','orangered', 'lightskyblue','navy']):
    

    sns.set_style('ticks')
    sns.set_context('paper')
    
    sns.despine(top=True, right=True)
    

    standard = classification
    variable = annotation
    if order == False:
        order = adata.obs[variable].cat.categories
    ctint = order

    title = ''


    df = pd.crosstab(adata.obs[standard], adata.obs[variable], normalize=0)
    df.columns = df.columns.astype(str)
    df.reset_index(inplace=True)
    df = pd.melt(df, id_vars=standard, value_name='proportion')


    df['DQ'] = 'Control'
    df['status'] = 'Old Control'
    for x in df.index:
        if 'DQ' in df.loc[x,standard]:
            df.loc[x,'DQ'] = df.loc[x,standard].split('_')[1]
        if 'FiNi' in df.loc[x,standard]:
            df.loc[x, 'status'] = 'Old FiNi-seq'
        if 'Young' in df.loc[x,standard]:
            if 'FiNi' in df.loc[x,standard]:
                df.loc[x, 'status'] = 'Young FiNi-seq'
            if 'FiNi' not in df.loc[x,standard]:
                df.loc[x, 'status'] = 'Young Control'            


    df['age'] = 'Old'
    for x in df.index:
        if 'Young' in df.loc[x,standard]:
            df.loc[x,'age'] = 'Young'

    orderdict = dict(zip(order, range(0,len(order))))

    df['xtick'] = df[variable].replace(orderdict)

    #
    box_pairs = []
    for x in ctint:
        temp1 = ()
        temp2 = []
        for y in ['Young Control','Old Control','Young FiNi-seq','Old FiNi-seq']:
            a = tuple([x]) + tuple([y])
            temp2.append(a)
        box_pairs.append(tuple(temp2))


    fig, ax = plt.subplots(figsize=(2*len(order),10))


    ax1 = sns.barplot(data=df, x='xtick', y='proportion', hue=hue, hue_order=hue_order, palette=palette,
                      ax=ax, capsize=0.2, errorbar='sd', errwidth=1, errcolor='dimgrey', saturation=0.7, zorder=1)

    # Plot the stripplot
    sns.stripplot(data=df, x='xtick', y='proportion', hue=hue, hue_order=hue_order, 
                  palette=['black']*len(hue_order), dodge=True, ax=ax, jitter=True, size=7, zorder=2)


#     star = pd.DataFrame(index = order, columns=['pvalue'])
#     for ct in order:
#         temp =df[df[variable]==ct]
#         star.loc[ct, 'pvalue'] = scipy.stats.kruskal(list(temp[temp['status']=='Old Control']['proportion']),list(temp[temp['status']=='Old FiNi-seq']['proportion']), list(temp[temp['status']=='Young FiNi-seq']['proportion'])).pvalue


#     ctint = []
#     for ct in order:
#         if star.loc[ct, 'pvalue'] < 0.1:
#             ctint.append(ct)

#     linelength = 0.3
#     for ct in ctint:
#         x = orderdict[ct]
#         y = df[df[variable]==ct]['proportion'].max()
#         plt.plot([x-linelength/2, x+linelength/2], [y+0.03, y+0.03], color='black')

#         if star.loc[ct, 'pvalue'] < 0.0001:
#             plt.text(x-0.05, y+0.04, s='****', fontweight='bold')

#         elif star.loc[ct, 'pvalue'] < 0.001:
#             plt.text(x-0.05, y+0.04, s='***', fontweight='bold')

#         elif star.loc[ct, 'pvalue'] < 0.01:
#             plt.text(x-0.055, y+0.04, s='**', fontweight='bold')

#         elif star.loc[ct, 'pvalue'] < 0.1:
#             plt.text(x-0.035, y+0.04, s='*', fontweight='bold')


    for patch in ax.patches:
        clr = patch.get_facecolor()
        patch.set_edgecolor('black')
        patch.set_linewidth(3)




    labels = order.copy()
    ax.set_xticklabels(labels=labels, fontweight='bold', rotation=90)

    handles, labels = ax.get_legend_handles_labels()
    handles = handles[0:4]
    labels = labels[0:4]
    legend1 = ax.legend(handles=handles, loc='upper right', fontsize=20)

    [x.set_linewidth(3) for x in ax.spines.values()]
    sns.despine(top=True, right=True)
    
    plt.xlabel('')
    plt.ylabel('Proportion', fontsize=30, fontweight='bold')
    plt.xticks(fontsize=25)
    plt.yticks(fontsize=20)
In [74]:
df
Out[74]:
sample annolv2 proportion DQ status age xtick
0 Old_Control_1 KC 0.000000 Control Old Control Old 0
1 Old_Control_2 KC 0.115385 Control Old Control Old 0
2 Old_Control_3 KC 0.141388 Control Old Control Old 0
3 Old_DQ1d_Control_1 KC 0.240000 DQ1d Old Control Old 0
4 Old_DQ1d_Control_2 KC 0.120000 DQ1d Old Control Old 0
... ... ... ... ... ... ... ...
131 Young_Control_2 pDC 0.261800 Control Young Control Young 7
132 Young_Control_3 pDC 0.248813 Control Young Control Young 7
133 Young_FiNi-seq_1 pDC 0.016807 Control Young FiNi-seq Young 7
134 Young_FiNi-seq_2 pDC 0.022263 Control Young FiNi-seq Young 7
135 Young_FiNi-seq_3 pDC 0.120507 Control Young FiNi-seq Young 7

136 rows × 7 columns

In [27]:
mye
Out[27]:
AnnData object with n_obs × n_vars = 21277 × 29814
    obs: 'pct_counts_mt', 'n_genes', 'n_counts', 'age', 'status', 'sample', 'DQ', 'age_status', 'annotation_publish', 'doublet_scores', 'predicted_doublets', 'n_genes_by_counts', 'log1p_n_genes_by_counts', 'total_counts', 'log1p_total_counts', 'pct_counts_in_top_50_genes', 'pct_counts_in_top_100_genes', 'pct_counts_in_top_200_genes', 'pct_counts_in_top_500_genes', 'total_counts_mt', 'log1p_total_counts_mt', 'condition', 'annolv1', 'annolv2'
    var: 'highly_variable', 'means', 'dispersions', 'dispersions_norm', 'mean', 'std'
    uns: 'age_status_colors', 'anno_transfer_colors', 'annotation_publish_1_colors', 'annotation_publish_colors', 'hvg', 'neighbors', 'pca', 'predicted_labels_colors', 'sample_colors', 'subannotation_publish_1_colors', 'subannotation_publish_colors', 'umap'
    obsm: 'X_pca', 'X_pca_harmony', 'X_umap'
    varm: 'PCs'
    obsp: 'connectivities', 'distances'
In [116]:
proportion_statistics_bar(mye, annotation='annolv2',classification='sample', hue='status')
plt.savefig('/home/kytak/kwonyongtak/picture/raw/mye_bar_prop.pdf', format='pdf', dpi=600, bbox_inches='tight', transparent=True)
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
<Figure size 1250x1250 with 0 Axes>
In [166]:
proportion_statistics_bar(mes, annotation='annolv2',classification='sample', hue='status')
plt.savefig('/home/kytak/kwonyongtak/picture/raw/mes_bar_prop.pdf', format='pdf', dpi=600, bbox_inches='tight', transparent=True)
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
<Figure size 1250x1250 with 0 Axes>
In [124]:
proportion_statistics_bar(endo, annotation='subannotation_publish',classification='sample_refined', hue='status')
plt.savefig('/home/kytak/kwonyongtak/picture/raw/endo_bar_prop.pdf', format='pdf', dpi=600, bbox_inches='tight', transparent=True)
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.
<Figure size 1250x1250 with 0 Axes>
In [550]:
figfolder = '/home/kytak/kwonyongtak/picture/raw/'
In [552]:
endo.obs['subannotation_publish'] = endo.obs['subannotation_publish'].cat.reorder_categories(['dysfunctional EC','portal EC','LSEC','central vein EC','LyEC'])
In [556]:
endo.uns['subannotation_publish_colors']= [ 'salmon','mediumseagreen', 'steelblue', 'darkkhaki', 'sienna']
In [554]:
prop
Out[554]:
Old Control Old FiNi-seq Young Control Young FiNi-seq
subannotation_publish
dysfunctional EC 5900 40300 0 6200
portal EC 18200 5600 9600 29900
LSEC 898500 22700 1181600 441700
central vein EC 36400 9600 29400 55900
LyEC 2300 10000 1100 4400
In [18]:
def proportion_bargraph(adata, annotation, classification, xticklabels = False, ylabel ='Proportion (%)', title=''):
    # proportion df
    prop = pd.crosstab(adata.obs[classification], adata.obs[annotation], normalize=0).T
    prop.columns = prop.columns.astype(str)
    prop = pd.concat([prop, pd.DataFrame(adata.uns[annotation+'_colors'], columns=[annotation], index=prop.index)], axis=1)
    prop_colors = list(reversed(list(prop.pop(annotation))))
    prop = prop*100
    
    
    # draw
    
    sns.set_style('ticks')
    sns.set_context('paper')
    
    sns.despine(top=True, right=True)
    

    prop = prop.T[list(reversed(list(adata.obs[annotation].cat.categories)))].T
    ax = prop.T.plot.bar(stacked=True, legend=False, edgecolor='black', width=0.7, color=prop_colors)
    [x.set_linewidth(2) for x in ax.spines.values()] 
    
    handles, labels = ax.get_legend_handles_labels()
    
    ax.legend(reversed(handles), reversed(labels), bbox_to_anchor=(1, 1.02), fontsize=15)

    plt.grid(visible=False)
    plt.xlabel('')

    if xticklabels:
        ax.set_xticklabels(labels=xticklabels,fontsize=13, fontweight='bold', rotation=0)
    plt.yticks(fontsize=15, rotation=0)


    plt.ylim(0,102)

    plt.ylabel(ylabel, fontsize=22, fontweight='bold')
    
    plt.gcf().set_size_inches((4*(len(prop.columns)/3),8))
    
    plt.title(title)
In [19]:
def again(adata):
    bdata = scl.get_raw(adata)
    bdata = bdata.copy()

    sc.pp.highly_variable_genes(bdata, min_mean=0.0125, max_mean=4, min_disp=0.5)
    sc.pl.highly_variable_genes(bdata)

    scl.sc_process(bdata, 'spku')
    
    return bdata


def leiden_auto(adata):
    for x in np.arange(0.2,2.2,0.2):
        a = format(x, ".1f")
        sc.tl.leiden(adata, resolution=float(a), key_added='leiden_'+str(a))



def harmony_umap(adata, batch, max_harmony=10, max_kmeans=20):
    sc.external.pp.harmony_integrate(adata, batch,  max_iter_harmony=max_harmony, max_iter_kmeans=max_kmeans)

    sc.pp.neighbors(adata, use_rep='X_pca_harmony')

    scl.sc_process(adata, 'u')
In [20]:
def volcano_analysis(adata, variable, subject, control, quick=False):
    volcano = scl.markers.volcano_plot(adata, variable, subject, control, quick=quick)
    deg = pd.DataFrame(volcano.genelist, columns = ['genelist'])
    deg['fc'] = volcano.fc
    deg['pval'] = volcano.pval
    deg['pval'] = [np.min(deg['pval'][deg['pval']!=0]) if x==0 else x for x in deg['pval']]
    deg['-log10pval'] = -np.log10(deg['pval'])
    
    return deg
In [21]:
def undo_normalize_log(adata):
    X = adata.raw.to_adata().to_df().copy()
    X = np.exp(X)  - 1

    X1 = np.repeat(adata.obs['n_counts'].values, X.shape[1])
    X2 = np.array(X1).reshape(-1, X.shape[1])
    
    X = np.array(X).astype(float)
    X2 = X2.astype(float)
    
    sumcount = np.rint(np.sum(X, axis=1))[0]
    
    X3 = np.multiply(X,X2) / sumcount
    
    X3 = np.rint(X3)
    
    X3df = pd.DataFrame(X3, index = adata.raw.to_adata().to_df().index, columns=adata.raw.to_adata().to_df().columns)
    
    return X3df
In [16]:
def volcano_plot (deg, pathway_genes=None, int_genes=None, fccut=1, pvalcut=10, adjust=(-0.1,1), fontsize = 15, figsize = (15,15), sum_cut = None):
        import math
        
        # sum_cut = (x, slope)
        
        plt.gcf().set_size_inches(figsize[0],figsize[1])
        
        # label variable
        fcposcut = fccut     
        fcnegcut = -fccut
 
       
        # plot variable
        scattersize = 10
        font_size = fontsize 
        
        xadjust =  adjust[0]
        yadjust =  adjust[1]
    
        


        # plot scatter
        plt.scatter(x=deg['fc'], y=deg['-log10pval'], s=scattersize, alpha=0.1, c='tab:gray')
        deg_pos = deg[(deg['pval'] < 0.05) & (deg['fc'] > 1)]
        plt.scatter(x=deg_pos['fc'], y=deg_pos['-log10pval'], s=scattersize, alpha=1, c='tab:red')
        deg_neg = deg[(deg['pval'] < 0.05) & (deg['fc'] < -1)]
        plt.scatter(x=deg_neg['fc'], y=deg_neg['-log10pval'], s=scattersize, alpha=1, c='tab:blue')

        deg_pos_label = deg_pos[(deg_pos['-log10pval'] > pvalcut) & (deg_pos['fc'] > fcposcut)]


        for index in list(deg_pos_label.index):
            plt.text(x=deg_pos_label['fc'][index]+xadjust, y=deg_pos_label['-log10pval'][index]+yadjust, 
                     s=deg_pos_label['genelist'][index], fontsize=font_size, alpha=1.0)

        
        # color pathway genes
        if pathway_genes != None:
            a = list(deg_pos_label.sort_values('fc', ascending=False)['genelist'])
            a_set = set(a)
            inter = a_set.intersection(pathway_genes)    
            b = deg_pos_label[deg_pos_label['genelist'].isin(list(inter))].index.values
            for index in b:
                plt.text(x=deg_pos_label['fc'][index]+xadjust, y=deg_pos_label['-log10pval'][index]+yadjust, 
                         s=deg_pos_label['genelist'][index], fontsize=font_size, color = 'purple')


               
                
        deg_neg_label = deg_neg[(deg_neg['-log10pval'] > pvalcut) & (deg_neg['fc'] < fcnegcut)]

        
             
        for index in list(deg_neg_label.index):
             plt.text(x=deg_neg_label['fc'][index]+xadjust, y=deg_neg_label['-log10pval'][index]+yadjust, 
                      s=deg_neg_label['genelist'][index], fontsize=font_size, alpha=1.0)

        

   
                
        # color pathway genes                
        if pathway_genes != None:
            c = list(deg_neg_label.sort_values('fc', ascending=False)['genelist'])
            c_set = set(c)
            inter1 = c_set.intersection(pathway_genes)    
            d = deg_neg_label[deg_neg_label['genelist'].isin(list(pathway_genes))].index.values
            for index in d:
                plt.text(x=deg_neg_label['fc'][index]+xadjust, y=deg_neg_label['-log10pval'][index]+yadjust, 
                         s=deg_neg_label['genelist'][index], fontsize=font_size, color = 'yellow')    

        
        # gene_of_interest
        if int_genes!=None:
            degint = deg[deg['genelist'].isin(set(int_genes))]
            for index in list(degint.index):
                plt.scatter(x=degint['fc'], y=degint['-log10pval'], s=(scattersize//3+1)*3, alpha=1, c='lightcoral')
                plt.text(x=degint['fc'][index]+xadjust, y=degint['-log10pval'][index]+yadjust, 
                         s=degint['genelist'][index], fontsize=font_size, alpha=1.0, color='lightcoral')


        from adjustText import adjust_text
        adjust_text(plt.gca().texts, only_move={'texts':'xy'}, arrowprops=dict(arrowstyle="-", color='k', lw=1.5))
#                                                                               alpha=0.7))   
            
            
        # set boarder
        fclim = round(max(deg['fc']), 0)
        if max(deg['fc'])-fclim > 0:
            fclim = fclim+1

        pvallim = max(deg[~deg['-log10pval'].isna()]['-log10pval'])   
        pvallim = ((pvallim //5)+1) * 5
        
        
        
        
        # draw 
        plt.xlim(-fclim, fclim)
        plt.ylim(0, pvallim)    
        plt.axvline(x=1, color='tab:orange', linestyle='--', linewidth=0.5)
        plt.axvline(x=-1, color='tab:orange', linestyle='--', linewidth=0.5)
        plt.axhline(y=-math.log10(0.05))
        # plt.axhspan(0, 300, xmin=0.5, xmax=1, alpha=0.1, color='tab:red')
        # plt.axhspan(0, 300, xmin=-2, xmax=0.3, alpha=0.1, color='tab:blue')
        plt.grid(visible=None)
        plt.xticks(fontsize=10, rotation=0)
        plt.yticks(fontsize=10, rotation=0)
        plt.xlabel('log2 (fold change)', fontsize=10)
        plt.ylabel('-log10 (p value)', fontsize=10)
        if pathway_genes != None:
            if len(inter)!=0:
                print('pos'+str(inter))
            if len(inter1)!=0:
                print('neg'+str(inter1))
In [1430]:
def expression_pattern(adata, groups):
    gene_ids = adata.raw.var.index.values
    clusters = adata.obs[groups].cat.categories
    obs = adata.raw[:,gene_ids].X.toarray()
    obs = pd.DataFrame(obs,columns=gene_ids,index=adata.obs[groups])
    average_obs = obs.groupby(level=0).mean()
    obs_bool = obs.astype(bool)
    fraction_obs = obs_bool.groupby(level=0).sum()/obs_bool.groupby(level=0).count()
    

    return average_obs, fraction_obs