Skip to content

ceRNA expression visualization for a cohort

ceRNA expression visualization for a cohort

%load_ext autoreload

'''
Given the mRNA expression profiles for a cohort, plot the disease and control expression 
for the ceRNA axis
'''
import sys
sys.path.append('../../')

from cernatax.cernatax import CERNATAX

# initialize CERNATAX object
cernatax = CERNATAX()


import scanpy as sc

# Read one mRNA expression profiles from a SCZ cohort;
# this could be self-sequenced, or downloaded from the public GEO resources;
# the expression and phenotype information should be curated.
mRNA_adata = sc.read_h5ad('../../demo/mRNA_adata.h5ad')
mRNA_adata.var_names_make_unique()
# show the expression profile
print('expression\n', mRNA_adata.X)
# show the phenotype information
print('meta info\n', mRNA_adata.obs)

# set the groupby as the cohort sample type
groupby = 'type'
# set the ceRNAs to be plotted
ceRNA_list = ['ARHGAP8']
# plot the expression of ceRNA_list
cernatax.plot_cohort_ceRNA_exp(mRNA_adata, groupby, ceRNA_list)
The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
expression
 [[2457    0    0 ... 1179    8 1039]
 [2662    0    0 ... 1462    3 1412]
 [2395    0    0 ... 1372    2 2603]
 ...
 [4437    0    0 ... 1736    0 1187]
 [4113    0    0 ... 1922    2  669]
 [2746    0    0 ... 1298    0 1708]]
meta info
              type
Case-A52      SCZ
Case-A53      SCZ
Case-A54      SCZ
Case-A55      SCZ
Case-A56      SCZ
Case-A58      SCZ
Con-B02   Control
Con-B04   Control
Con-B08   Control
Con-B21   Control
Con-B22   Control

C:\Users\User\AppData\Roaming\Python\Python312\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")

No description has been provided for this image
%autoreload
'''
Given the miRNA expression profiles for a cohort, plot the disease and control expression 
for the ceRNA axis
'''

import scanpy as sc

# Read one miRNA expression profiles from a SCZ cohort;
# this could be self-sequenced, or downloaded from the public GEO resources;
# the expression and phenotype information should be curated.
miRNA_adata = sc.read_h5ad('../../demo/miRNA_adata.h5ad')
miRNA_adata.var_names_make_unique()
# show the expression profile
print('expression\n', miRNA_adata.X)
# show the phenotype information
print('meta info\n', miRNA_adata.obs)

# set the groupby as the cohort sample type
groupby = 'type'
# set the ceRNAs to be plotted
ceRNA_list = ['hsa-miR-485-5p']
# plot the expression of ceRNA_list
cernatax.plot_cohort_ceRNA_exp(miRNA_adata, groupby, ceRNA_list)
expression
 [[   296  71449    671 ...      0      3      2]
 [   292 164761    304 ...      0      0      7]
 [   641  41266   1013 ...      0      2      5]
 ...
 [  1119 159204    612 ...      5      0     17]
 [    86  11125    596 ...      2      1      5]
 [   235   6160    311 ...      1      1      1]]
meta info
              type
Case-A52      SCZ
Case-A53      SCZ
Case-A54      SCZ
Case-A55      SCZ
Case-A56      SCZ
Case-A58      SCZ
Con-B02   Control
Con-B04   Control
Con-B08   Control
Con-B21   Control
Con-B22   Control

No description has been provided for this image
%autoreload
'''
Given the lncRNA expression profiles for a cohort, plot the disease and control expression 
for the ceRNA axis
'''

import scanpy as sc

# Read one lncRNA expression profiles from a SCZ cohort;
# this could be self-sequenced, or downloaded from the public GEO resources;
# the expression and phenotype information should be curated.
lncRNA_adata = sc.read_h5ad('../../demo/lncRNA_adata.h5ad')
lncRNA_adata.var_names_make_unique()
# show the expression profile
print('expression\n', lncRNA_adata.X)
# show the phenotype information
print('meta info\n', lncRNA_adata.obs)
# set the groupby as the cohort sample type
groupby = 'type'
# set the ceRNAs to be plotted
ceRNA_list = ['ENST00000522525'] # the ens id of 'THUMPD3-AS1'
# plot the expression of ceRNA_list
cernatax.plot_cohort_ceRNA_exp(lncRNA_adata, groupby, ceRNA_list)
expression
 [[  7 239 461 ...   0   0   0]
 [  2 179   0 ...   0   0   0]
 [  0 245  47 ...   0   0   0]
 ...
 [  4 358  55 ...   0   0  33]
 [  2 151 390 ...   0   0   0]
 [  4 200 720 ...   0   0   0]]
meta info
              type
Case-A52      SCZ
Case-A53      SCZ
Case-A54      SCZ
Case-A55      SCZ
Case-A56      SCZ
Case-A58      SCZ
Con-B02   Control
Con-B04   Control
Con-B08   Control
Con-B21   Control
Con-B22   Control

No description has been provided for this image