Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Python Ternary | 611 | 10 | 11 | 3 months ago | 11 | February 17, 2021 | 33 | mit | Python | |
:small_red_triangle: Ternary plotting library for python with matplotlib | ||||||||||
Iheatmapr | 252 | 2 | 1 | a year ago | 6 | July 07, 2020 | 45 | other | R | |
Complex, interactive heatmaps in R | ||||||||||
Plotille | 200 | 1 | 10 | 4 months ago | 26 | February 19, 2022 | 1 | mit | Python | |
Plot in the terminal using braille dots. | ||||||||||
Calmap | 170 | 2 years ago | mit | Python | ||||||
Calendar heatmaps from Pandas time series data -- See https://github.com/MarvinT/calmap/ for the maintained version | ||||||||||
Heatmaps | 104 | a year ago | 4 | April 12, 2020 | 6 | bsd-3-clause | Jupyter Notebook | |||
Better heatmaps in Python | ||||||||||
Calplot | 79 | 1 | 5 months ago | 15 | April 04, 2022 | 7 | mit | Python | ||
Calendar heatmaps from Pandas time series data. | ||||||||||
Pycomplexheatmap | 64 | a day ago | 4 | mit | Python | |||||
PyComplexHeatmap: A Python package to plot complex heatmap (clustermap) | ||||||||||
Gnuplotcsharp | 52 | 3 years ago | 2 | March 12, 2014 | 4 | other | C# | |||
Make gnuplot graphs with C#, including by passing arrays (data) and using "hold on" to have several layers of graphs | ||||||||||
Plotluck | 50 | 2 months ago | 3 | June 26, 2019 | other | R | ||||
R tool for automated creation of ggplots. Examines one, two, or three variables and creates, based on their characteristics, a scatter, violin, box, bar, density, hex or spine plot, or a heat map. Also automates handling of observation weights, log-scaling of axes, reordering of factor levels, and overlays of smoothing curves and median lines. | ||||||||||
Plotly Plots | 50 | 10 months ago | 1 | gpl-3.0 | Jupyter Notebook | |||||
IPython notebooks for Plotly plots |
PyComplexHeatmap is a Python package to plot complex heatmap (clustermap). Please click here for documentation.
https://dingwb.github.io/PyComplexHeatmap
PYPI:
https://pypi.org/project/PyComplexHeatmap/
pip install --ignore-install matplotlib==3.5.1 numpy==1.20.3 pandas==1.4.1
pip install seaborn #only needed when call functions in tools.py
pip install PyComplexHeatmap
#upgrade from older version
pip install --upgrade PyComplexHeatmap
pip install git+https://github.com/DingWB/PyComplexHeatmap
if you have installed it previously and want to update it, please run
pip uninstall PyComplexHeatmap
and install from github again
OR
git clone https://github.com/DingWB/PyComplexHeatmap
cd PyComplexHeatmap
python setup.py install
from PyComplexHeatmap import *
#Generate example dataset (random)
df = pd.DataFrame(['GroupA'] * 5 + ['GroupB'] * 5, columns=['AB'])
df['CD'] = ['C'] * 3 + ['D'] * 3 + ['G'] * 4
df['EF'] = ['E'] * 6 + ['F'] * 2 + ['H'] * 2
df['F'] = np.random.normal(0, 1, 10)
df.index = ['sample' + str(i) for i in range(1, df.shape[0] + 1)]
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_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_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_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
#Annotate the rows with sample4 > 0.5
df_rows = df_heatmap.apply(lambda x:x.name if x.sample4 > 0.5 else None,axis=1)
df_rows=df_rows.to_frame(name='Selected')
df_rows['XY']=df_rows.index.to_series().apply(lambda x:'A' if int(x.replace('Fea',''))>=15 else 'B')
row_ha = HeatmapAnnotation(
Scatter=anno_scatterplot(df_heatmap.sample4.apply(lambda x:round(x,2)),
height=12,cmap='jet',legend=False),
Bar=anno_barplot(df_heatmap.sample4.apply(lambda x:round(x,2)),
height=16,cmap='rainbow',legend=False),
selected=anno_label(df_rows,colors='red',relpos=(-0.05,0.4)),
label_kws={'rotation':30,'horizontalalignment':'left','verticalalignment':'bottom'},
axis=0,verbose=0)
col_ha = HeatmapAnnotation(label=anno_label(df.AB, merge=True,rotation=10),
AB=anno_simple(df.AB,add_text=True),axis=1,
CD=anno_simple(df.CD,add_text=True),
EF=anno_simple(df.EF,add_text=True,
legend_kws={'frameon':True}),
G=anno_boxplot(df_box, cmap='jet',legend=False),
verbose=0)
plt.figure(figsize=(5.5, 6.5))
cm = ClusterMapPlotter(data=df_heatmap, top_annotation=col_ha,right_annotation=row_ha,
col_cluster=True,row_cluster=True,
col_split=df.AB,row_split=2,
col_split_gap=0.5,row_split_gap=0.8,
label='values',row_dendrogram=True,
show_rownames=False,show_colnames=True,
tree_kws={'row_cmap': 'Set1'},verbose=0,legend_gap=5,
cmap='RdYlBu_r',xticklabels_kws={'labelrotation':-45,'labelcolor':'blue'})
#plt.savefig("example0.pdf", bbox_inches='tight')
plt.show()
https://dingwb.github.io/PyComplexHeatmap/build/html/more_examples.html
The PyComplexHeatmap project welcomes your expertise and enthusiasm!
Small improvements or fixes are always appreciated. If you are considering larger contributions to the source code, please contact us ([email protected]).
Writing code isnt the only way to contribute to PyComplexHeatmap. You can also: