import os,sys %matplotlib inline import matplotlib.pylab as plt import numpy as np import pandas as pd plt.rcParams['figure.dpi'] = 100 plt.rcParams['savefig.dpi']=300 plt.rcParams['font.family']='sans serif'#please remove this line if font is not installed plt.rcParams['font.sans-serif']='Arial'# please remove this line if Arial font is not installed plt.rcParams['pdf.fonttype']=42 # sys.path.append(os.path.expanduser("~/Projects/Github/PyComplexHeatmap/")) import PyComplexHeatmap as pch print(pch.__version__)
df_box = pd.DataFrame(np.random.randn(10, 4), columns=['Gene' + str(i) for i in range(1, 5)]) df_box.index = ['sample' + str(i) for i in range(1, df_box.shape[0] + 1)] df_box
箱线图的数据:
df_bar = pd.DataFrame(np.random.uniform(0, 10, (10, 2)), columns=['TMB1', 'TMB2']) df_bar.index = ['sample' + str(i) for i in range(1, df_box.shape[0] + 1)] df_bar
散点图数据:
df_scatter = pd.DataFrame(np.random.uniform(0, 10, 10), columns=['Scatter']) df_scatter.index = ['sample' + str(i) for i in range(1, df_box.shape[0] + 1)] df_scatter
箱线图bar1数据:
df_bar1 = pd.DataFrame(np.random.uniform(0, 10, (10, 2)), columns=['T1-A', 'T1-B']) df_bar1.index = ['sample' + str(i) for i in range(1, df_box.shape[0] + 1)] df_bar1
箱线图bar4数据:
df_bar4 = pd.DataFrame(np.random.uniform(0, 10, (10, 1)), columns=['T4']) df_bar4.index = ['sample' + str(i) for i in range(1, df_box.shape[0] + 1)] df_bar4.iloc[7,0]=np.nan df_bar4
df_heatmap = pd.DataFrame(np.random.randn(30, 10), columns=['sample' + str(i) for i in range(1, 11)]) df_heatmap.index = ["Fea" + str(i) for i in range(1, df_heatmap.shape[0] + 1)] df_heatmap.iloc[1, 2] = np.nan df_heatmap.head()