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

Baron (Pancreas)#

Fixed the number of cell types with 13.

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 = 'kmean'

############################################
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 0x7f4cec377d90>
../_images/5a042aa9c3587cd8e83a53c72e8277ae8599421202da149bda87a522f99d4541.png

UMAP and K-means

Muraro (Pancreas)#

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 = 'kmean'

############################################
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 0x7f659df9d960>
../_images/4b97f0a37773a2893817e11e5503e1f87956f6d49c0e2b64d18cce498cab50fd.png

Segerstolpe (Pancreas)#

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 = 'kmean'

############################################
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 0x7f657e97c730>
../_images/ddd5bcf61c042b8c545f00b88ba4f835dcbd7485191b4adff195cff5f2d0f94f.png

Wang (Pancreas)#

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 = 'kmean'

############################################
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 0x7f667c1b28c0>
../_images/087c40aadb78a6ef1df0860dae6c19d4963c7f234cc91ff1ece1e33366a18508.png

Xin (Pancreas)#

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 = 'kmean'

############################################
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 0x7f657ce69e70>
../_images/366da821df5cae32aa135adb8c508f6944ff6e0169904a8ac649eb8bd266a80d.png