import numpy as np
import pandas as pd
import seaborn as sns
from sklearn import preprocessing
import matplotlib.pyplot as plt
#将数据转化为数据框,gene_id作为索引列
retu = pd.read_table("Embro_Gene_ID.bed",index_col="gene_id")
retu.index.name='Z-score normalization'
#Zscore标准化
values = retu.values
data = preprocessing.scale(values,axis=1)
df = pd.DataFrame(data)
df.columns = retu.columns
df.index = retu.index
#聚类热图
g=sns.clustermap(df,center=0,cmap='RdBu',figsize=(10,20))
ax = g.ax_heatmap
plt.title=("Embro")
plt.savefig("聚类热图.pdf")
plt.show()