Skip to content

ceRNA-axis correlation analysis for a cohort

ceRNA-axis correlation analysis for a cohort

Load the SCZ data

%load_ext autoreload

import scanpy as sc
import anndata as ad

lncRNA_adata = sc.read_h5ad('../../demo/lncRNA_adata.h5ad')
lncRNA_adata.var_names_make_unique()

miRNA_adata = sc.read_h5ad('../../demo/miRNA_adata.h5ad')
miRNA_adata.var_names_make_unique()

mRNA_adata = sc.read_h5ad('../../demo/mRNA_adata.h5ad')
mRNA_adata.var_names_make_unique()

adata = ad.concat([mRNA_adata, miRNA_adata, lncRNA_adata], axis=1)
adata.obs = mRNA_adata.obs
adata.layers['count'] = adata.X
adata
/Users/chenlingxi/miniconda3/envs/dev/lib/python3.11/site-packages/anndata/_core/anndata.py:1758: UserWarning: Variable names are not unique. To make them unique, call `.var_names_make_unique`.
  utils.warn_names_duplicates("var")

AnnData object with n_obs × n_vars = 11 × 80573
    obs: 'type'
    layers: 'count'

Calculate the correlation of ceRNA axis

%autoreload
import sys

sys.path.append('../../../../1_GREA')
sys.path.append('../../')

from cernatax.cernatax import CERNATAX

# initialize CERNATAX object
cernatax = CERNATAX()

import anndata as ad
# merge the mRNA, miRNA, and lncRNA expression profiles
adata = ad.concat([mRNA_adata.T, miRNA_adata.T, lncRNA_adata.T], merge="same").T
# set the interested ceRNA axis 
ceRNA_axis_list = [('ARHGAP8', 'hsa-miR-485-5p'), ('ARHGAP8', 'ENST00000522525'), ('hsa-miR-485-5p', 'ENST00000522525')]
# calculate the correlation
corr_df = cernatax.cohort_ceRNA_corr(adata, ceRNA_axis_list)
corr_df.to_csv('../../demo_out/axis_correlation.csv')
# output correlation
corr_df
patient gene1 gene2 correlation type correlation p value
0 All ARHGAP8 hsa-miR-485-5p Pearson Correlation -0.306925 0.358586
1 All ARHGAP8 hsa-miR-485-5p Spearman Correlation -0.353139 0.286743
2 All ARHGAP8 hsa-miR-485-5p Kendall's tau -0.288960 0.266716
3 All ARHGAP8 ENST00000522525 Pearson Correlation 0.125301 0.713554
4 All ARHGAP8 ENST00000522525 Spearman Correlation 0.316645 0.342765
5 All ARHGAP8 ENST00000522525 Kendall's tau 0.255377 0.350808
6 All hsa-miR-485-5p ENST00000522525 Pearson Correlation -0.301535 0.367519
7 All hsa-miR-485-5p ENST00000522525 Spearman Correlation -0.601782 0.050138
8 All hsa-miR-485-5p ENST00000522525 Kendall's tau -0.522233 0.057589