2-2. Low-dimensional analysis of a scRNA-seq data (UMAP:DBSCAN)#

Baron (Pancreas)#

datasets = ['./dataset/baron_sc.h5']
label_filter = ['epsilon', 'alpha', 'beta', 'duct', 'activated', 'schwann', 'gamma', 'quiescent', 'delta', 'macrophage', 'endothelial', 'acinar', 'mast']
X_, y_, b_, file_names = h5_data_loader(datasets, label_filter)
logging.info(f'Data loaded. {datasets}')
import matplotlib.pyplot as plt
from umap import UMAP
from utils import run_plot
import src.utils as my_u
from src.utils import df_cp
from src.utils import df_log
from src.utils import df_total20000
from src.utils import df_minmax
from src.utils import df_l2norm
from src.utils import df_zscore
from src.utils import df_meansquare
from src.utils import run_plot

total_data = X_
labels = y_

#latent_space = TSNE(n_components=2)
latent_space = umap.UMAP(n_components=2, init='spectral', random_state=0)
clustering_method = 'dbscan'

############################################
plt.figure(figsize=(16,16), dpi=300)
ax00 = plt.subplot2grid((4,4), (0,0)) 
ax10 = plt.subplot2grid((4,4), (0,1))  
ax20 = plt.subplot2grid((4,4), (0,2))  
ax30 = plt.subplot2grid((4,4), (0,3))  

ax01 = plt.subplot2grid((4,4), (1,0)) 
ax11 = plt.subplot2grid((4,4), (1,1))  
ax21 = plt.subplot2grid((4,4), (1,2))  
ax31 = plt.subplot2grid((4,4), (1,3))  

ax02 = plt.subplot2grid((4,4), (2,0)) 
ax12 = plt.subplot2grid((4,4), (2,1))  
ax22 = plt.subplot2grid((4,4), (2,2))  
ax32 = plt.subplot2grid((4,4), (2,3))  

ax03 = plt.subplot2grid((4,4), (3,0)) 
ax13 = plt.subplot2grid((4,4), (3,1))  
ax23 = plt.subplot2grid((4,4), (3,2))  
ax33 = plt.subplot2grid((4,4), (3,3))

############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_cp(total_data), \
         ax00, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_cp(total_data)), \
         ax10, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_total20000(df_cp(total_data)), \
         ax20, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_total20000(df_cp(total_data))), \
         ax30, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_cp(total_data)), \
         ax01, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_cp(total_data))), \
         ax11, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_total20000(df_cp(total_data))), \
         ax21, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_total20000(df_cp(total_data)))), \
         ax31, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_cp(total_data)), \
         ax02, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_cp(total_data))), \
         ax12, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_total20000(df_cp(total_data))), \
         ax22, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_total20000(df_cp(total_data)))), \
         ax32, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_cp(total_data)), \
         ax03, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_cp(total_data))), \
         ax13, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_total20000(df_cp(total_data))), \
         ax23, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_total20000(df_cp(total_data)))), \
         ax33, labels, latent_space, clustering_method)
############################################
ax00.set_ylabel('raw' , fontsize=14)
ax01.set_ylabel('min-max norm' , fontsize=14)
ax02.set_ylabel('l2 norm' , fontsize=14)
ax03.set_ylabel('z-score' , fontsize=14)

ax03.set_xlabel('raw', fontsize=13)
ax13.set_xlabel('log2', fontsize=13)
ax23.set_xlabel('total', fontsize=13)
ax33.set_xlabel('total_log2', fontsize=13)
ax33.legend(bbox_to_anchor=(1.1,0), loc='lower left',borderaxespad=0)
<matplotlib.legend.Legend at 0x7fd7024168f0>
../_images/9912d7f7e963a9ee3dddeb8259b4ea88581dd19726f414701296537d55607979.png

Muraro (Pancreas)#

datasets = ['./dataset/muraro_sc.h5']
label_filter = ['epsilon', 'alpha', 'beta', 'duct', 'activated', 'schwann', 'gamma', 'quiescent', 'delta', 'macrophage', 'endothelial', 'acinar', 'mast']
X_, y_, b_, file_names = h5_data_loader(datasets, label_filter)
logging.info(f'Data loaded. {datasets}')
import matplotlib.pyplot as plt
from umap import UMAP
from utils import run_plot
import src.utils as my_u
from src.utils import df_cp
from src.utils import df_log
from src.utils import df_total20000
from src.utils import df_minmax
from src.utils import df_l2norm
from src.utils import df_zscore
from src.utils import df_meansquare
from src.utils import run_plot

total_data = X_
labels = y_

#latent_space = TSNE(n_components=2)
latent_space = umap.UMAP(n_components=2, init='spectral', random_state=0)
clustering_method = 'dbscan'

############################################
plt.figure(figsize=(16,16), dpi=300)
ax00 = plt.subplot2grid((4,4), (0,0)) 
ax10 = plt.subplot2grid((4,4), (0,1))  
ax20 = plt.subplot2grid((4,4), (0,2))  
ax30 = plt.subplot2grid((4,4), (0,3))  

ax01 = plt.subplot2grid((4,4), (1,0)) 
ax11 = plt.subplot2grid((4,4), (1,1))  
ax21 = plt.subplot2grid((4,4), (1,2))  
ax31 = plt.subplot2grid((4,4), (1,3))  

ax02 = plt.subplot2grid((4,4), (2,0)) 
ax12 = plt.subplot2grid((4,4), (2,1))  
ax22 = plt.subplot2grid((4,4), (2,2))  
ax32 = plt.subplot2grid((4,4), (2,3))  

ax03 = plt.subplot2grid((4,4), (3,0)) 
ax13 = plt.subplot2grid((4,4), (3,1))  
ax23 = plt.subplot2grid((4,4), (3,2))  
ax33 = plt.subplot2grid((4,4), (3,3))

############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_cp(total_data), \
         ax00, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_cp(total_data)), \
         ax10, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_total20000(df_cp(total_data)), \
         ax20, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_total20000(df_cp(total_data))), \
         ax30, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_cp(total_data)), \
         ax01, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_cp(total_data))), \
         ax11, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_total20000(df_cp(total_data))), \
         ax21, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_total20000(df_cp(total_data)))), \
         ax31, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_cp(total_data)), \
         ax02, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_cp(total_data))), \
         ax12, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_total20000(df_cp(total_data))), \
         ax22, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_total20000(df_cp(total_data)))), \
         ax32, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_cp(total_data)), \
         ax03, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_cp(total_data))), \
         ax13, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_total20000(df_cp(total_data))), \
         ax23, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_total20000(df_cp(total_data)))), \
         ax33, labels, latent_space, clustering_method)
############################################
ax00.set_ylabel('raw' , fontsize=14)
ax01.set_ylabel('min-max norm' , fontsize=14)
ax02.set_ylabel('l2 norm' , fontsize=14)
ax03.set_ylabel('z-score' , fontsize=14)

ax03.set_xlabel('raw', fontsize=13)
ax13.set_xlabel('log2', fontsize=13)
ax23.set_xlabel('total', fontsize=13)
ax33.set_xlabel('total_log2', fontsize=13)
ax33.legend(bbox_to_anchor=(1.1,0), loc='lower left',borderaxespad=0)
<matplotlib.legend.Legend at 0x7fd6f15f7880>
../_images/5aeab0f42edeef104995672f03a85822f0edc2531331e9c252487a5fee1b4052.png

Segerstolpe (Pancreas)#

datasets = ['./dataset/segerstolpe_sc.h5']
label_filter = ['epsilon', 'alpha', 'beta', 'duct', 'activated', 'schwann', 'gamma', 'quiescent', 'delta', 'macrophage', 'endothelial', 'acinar', 'mast']
X_, y_, b_, file_names = h5_data_loader(datasets, label_filter)
logging.info(f'Data loaded. {datasets}')
import matplotlib.pyplot as plt
from umap import UMAP
from utils import run_plot
import src.utils as my_u
from src.utils import df_cp
from src.utils import df_log
from src.utils import df_total20000
from src.utils import df_minmax
from src.utils import df_l2norm
from src.utils import df_zscore
from src.utils import df_meansquare
from src.utils import run_plot

total_data = X_
labels = y_

#latent_space = TSNE(n_components=2)
latent_space = umap.UMAP(n_components=2, init='spectral', random_state=0)
clustering_method = 'dbscan'

############################################
plt.figure(figsize=(16,16), dpi=300)
ax00 = plt.subplot2grid((4,4), (0,0)) 
ax10 = plt.subplot2grid((4,4), (0,1))  
ax20 = plt.subplot2grid((4,4), (0,2))  
ax30 = plt.subplot2grid((4,4), (0,3))  

ax01 = plt.subplot2grid((4,4), (1,0)) 
ax11 = plt.subplot2grid((4,4), (1,1))  
ax21 = plt.subplot2grid((4,4), (1,2))  
ax31 = plt.subplot2grid((4,4), (1,3))  

ax02 = plt.subplot2grid((4,4), (2,0)) 
ax12 = plt.subplot2grid((4,4), (2,1))  
ax22 = plt.subplot2grid((4,4), (2,2))  
ax32 = plt.subplot2grid((4,4), (2,3))  

ax03 = plt.subplot2grid((4,4), (3,0)) 
ax13 = plt.subplot2grid((4,4), (3,1))  
ax23 = plt.subplot2grid((4,4), (3,2))  
ax33 = plt.subplot2grid((4,4), (3,3))

############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_cp(total_data), \
         ax00, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_cp(total_data)), \
         ax10, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_total20000(df_cp(total_data)), \
         ax20, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_total20000(df_cp(total_data))), \
         ax30, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_cp(total_data)), \
         ax01, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_cp(total_data))), \
         ax11, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_total20000(df_cp(total_data))), \
         ax21, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_total20000(df_cp(total_data)))), \
         ax31, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_cp(total_data)), \
         ax02, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_cp(total_data))), \
         ax12, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_total20000(df_cp(total_data))), \
         ax22, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_total20000(df_cp(total_data)))), \
         ax32, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_cp(total_data)), \
         ax03, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_cp(total_data))), \
         ax13, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_total20000(df_cp(total_data))), \
         ax23, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_total20000(df_cp(total_data)))), \
         ax33, labels, latent_space, clustering_method)
############################################
ax00.set_ylabel('raw' , fontsize=14)
ax01.set_ylabel('min-max norm' , fontsize=14)
ax02.set_ylabel('l2 norm' , fontsize=14)
ax03.set_ylabel('z-score' , fontsize=14)

ax03.set_xlabel('raw', fontsize=13)
ax13.set_xlabel('log2', fontsize=13)
ax23.set_xlabel('total', fontsize=13)
ax33.set_xlabel('total_log2', fontsize=13)
ax33.legend(bbox_to_anchor=(1.1,0), loc='lower left',borderaxespad=0)
<matplotlib.legend.Legend at 0x7fd6f10ad960>
../_images/82008bbee35bb9673e9c10c5159dc9336d76536e86564e6579c3a473b2095a52.png

Wang (Pancreas)#

datasets = ['./dataset/wang_sc.h5']
label_filter = ['epsilon', 'alpha', 'beta', 'duct', 'activated', 'schwann', 'gamma', 'quiescent', 'delta', 'macrophage', 'endothelial', 'acinar', 'mast']
X_, y_, b_, file_names = h5_data_loader(datasets, label_filter)
logging.info(f'Data loaded. {datasets}')
import matplotlib.pyplot as plt
from umap import UMAP
from utils import run_plot
import src.utils as my_u
from src.utils import df_cp
from src.utils import df_log
from src.utils import df_total20000
from src.utils import df_minmax
from src.utils import df_l2norm
from src.utils import df_zscore
from src.utils import df_meansquare
from src.utils import run_plot

total_data = X_
labels = y_

#latent_space = TSNE(n_components=2)
latent_space = umap.UMAP(n_components=2, init='spectral', random_state=0)
clustering_method = 'dbscan'

############################################
plt.figure(figsize=(16,16), dpi=300)
ax00 = plt.subplot2grid((4,4), (0,0)) 
ax10 = plt.subplot2grid((4,4), (0,1))  
ax20 = plt.subplot2grid((4,4), (0,2))  
ax30 = plt.subplot2grid((4,4), (0,3))  

ax01 = plt.subplot2grid((4,4), (1,0)) 
ax11 = plt.subplot2grid((4,4), (1,1))  
ax21 = plt.subplot2grid((4,4), (1,2))  
ax31 = plt.subplot2grid((4,4), (1,3))  

ax02 = plt.subplot2grid((4,4), (2,0)) 
ax12 = plt.subplot2grid((4,4), (2,1))  
ax22 = plt.subplot2grid((4,4), (2,2))  
ax32 = plt.subplot2grid((4,4), (2,3))  

ax03 = plt.subplot2grid((4,4), (3,0)) 
ax13 = plt.subplot2grid((4,4), (3,1))  
ax23 = plt.subplot2grid((4,4), (3,2))  
ax33 = plt.subplot2grid((4,4), (3,3))

############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_cp(total_data), \
         ax00, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_cp(total_data)), \
         ax10, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_total20000(df_cp(total_data)), \
         ax20, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_total20000(df_cp(total_data))), \
         ax30, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_cp(total_data)), \
         ax01, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_cp(total_data))), \
         ax11, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_total20000(df_cp(total_data))), \
         ax21, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_total20000(df_cp(total_data)))), \
         ax31, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_cp(total_data)), \
         ax02, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_cp(total_data))), \
         ax12, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_total20000(df_cp(total_data))), \
         ax22, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_total20000(df_cp(total_data)))), \
         ax32, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_cp(total_data)), \
         ax03, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_cp(total_data))), \
         ax13, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_total20000(df_cp(total_data))), \
         ax23, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_total20000(df_cp(total_data)))), \
         ax33, labels, latent_space, clustering_method)
############################################
ax00.set_ylabel('raw' , fontsize=14)
ax01.set_ylabel('min-max norm' , fontsize=14)
ax02.set_ylabel('l2 norm' , fontsize=14)
ax03.set_ylabel('z-score' , fontsize=14)

ax03.set_xlabel('raw', fontsize=13)
ax13.set_xlabel('log2', fontsize=13)
ax23.set_xlabel('total', fontsize=13)
ax33.set_xlabel('total_log2', fontsize=13)
ax33.legend(bbox_to_anchor=(1.1,0), loc='lower left',borderaxespad=0)
<matplotlib.legend.Legend at 0x7fd6f03b92a0>
../_images/1b538960fd73b9a778fc911bc8b1b4f6d95fc9f67b7ae055398d3508cbed1545.png

Xin (Pancreas)#

datasets = ['./dataset/xin_sc.h5']
label_filter = ['epsilon', 'alpha', 'beta', 'duct', 'activated', 'schwann', 'gamma', 'quiescent', 'delta', 'macrophage', 'endothelial', 'acinar', 'mast']
X_, y_, b_, file_names = h5_data_loader(datasets, label_filter)
logging.info(f'Data loaded. {datasets}')
import matplotlib.pyplot as plt
from umap import UMAP
from utils import run_plot
import src.utils as my_u
from src.utils import df_cp
from src.utils import df_log
from src.utils import df_total20000
from src.utils import df_minmax
from src.utils import df_l2norm
from src.utils import df_zscore
from src.utils import df_meansquare
from src.utils import run_plot

total_data = X_
labels = y_

#latent_space = TSNE(n_components=2)
latent_space = umap.UMAP(n_components=2, init='spectral', random_state=0)
clustering_method = 'dbscan'

############################################
plt.figure(figsize=(16,16), dpi=300)
ax00 = plt.subplot2grid((4,4), (0,0)) 
ax10 = plt.subplot2grid((4,4), (0,1))  
ax20 = plt.subplot2grid((4,4), (0,2))  
ax30 = plt.subplot2grid((4,4), (0,3))  

ax01 = plt.subplot2grid((4,4), (1,0)) 
ax11 = plt.subplot2grid((4,4), (1,1))  
ax21 = plt.subplot2grid((4,4), (1,2))  
ax31 = plt.subplot2grid((4,4), (1,3))  

ax02 = plt.subplot2grid((4,4), (2,0)) 
ax12 = plt.subplot2grid((4,4), (2,1))  
ax22 = plt.subplot2grid((4,4), (2,2))  
ax32 = plt.subplot2grid((4,4), (2,3))  

ax03 = plt.subplot2grid((4,4), (3,0)) 
ax13 = plt.subplot2grid((4,4), (3,1))  
ax23 = plt.subplot2grid((4,4), (3,2))  
ax33 = plt.subplot2grid((4,4), (3,3))

############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_cp(total_data), \
         ax00, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_cp(total_data)), \
         ax10, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_total20000(df_cp(total_data)), \
         ax20, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_log(df_total20000(df_cp(total_data))), \
         ax30, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_cp(total_data)), \
         ax01, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_cp(total_data))), \
         ax11, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_total20000(df_cp(total_data))), \
         ax21, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_minmax(df_log(df_total20000(df_cp(total_data)))), \
         ax31, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_cp(total_data)), \
         ax02, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_cp(total_data))), \
         ax12, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_total20000(df_cp(total_data))), \
         ax22, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_l2norm(df_log(df_total20000(df_cp(total_data)))), \
         ax32, labels, latent_space, clustering_method)
############################################
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_cp(total_data)), \
         ax03, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_cp(total_data))), \
         ax13, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_total20000(df_cp(total_data))), \
         ax23, labels, latent_space, clustering_method)
latent_space = UMAP(n_components=2, init='spectral', random_state=0)
run_plot(df_zscore(df_log(df_total20000(df_cp(total_data)))), \
         ax33, labels, latent_space, clustering_method)
############################################
ax00.set_ylabel('raw' , fontsize=14)
ax01.set_ylabel('min-max norm' , fontsize=14)
ax02.set_ylabel('l2 norm' , fontsize=14)
ax03.set_ylabel('z-score' , fontsize=14)

ax03.set_xlabel('raw', fontsize=13)
ax13.set_xlabel('log2', fontsize=13)
ax23.set_xlabel('total', fontsize=13)
ax33.set_xlabel('total_log2', fontsize=13)
ax33.legend(bbox_to_anchor=(1.1,0), loc='lower left',borderaxespad=0)
<matplotlib.legend.Legend at 0x7fd6f11aeb30>
../_images/31222d6f712e8c4346050a7f76f7bc4861587d3f0e98e09ca51014cfc5bccfe1.png