PyComplexHeatmap

Contents:

  • Installation
    • Dependencies
    • How to install?
  • Get Started
    • 1. Import packages
    • 2. Plot heatmap annotations
    • 3. Plot the heatmap with rows and columns split
    • 4. Plot the annotations along side with main heatmap
  • Clustermap
    • A quick example
    • Plotting annotations
      • Only plot the row/column annotation
      • anno_label:
      • anno_simple:
      • To add a annotation quickly, you just need a dataframe
      • Plot the figure and legend separately
    • Top, bottom, left ,right annotations
  • dotHeatmap
    • Load an example brain networks dataset from seaborn
      • Dot Heatmap
    • Plot traditional heatmap using square marker marker='s'
    • Simple dot heatmap using fixed dot size
    • Changing the size of point
    • Add parameter hue and use different colors for different groups
    • Add parameter hue and use different cmap and marker for different groups
      • Dot Clustermap
    • Plot clustermap using seaborn brain networks dataset
    • Visualize up to five dimension data using DotClustermapPlotter
    • Visualizing gene set enrichment analysis results (clusterProfiler) using dotHeatmap
      • Why do we need a better way to visualize the gene set enrichment analysis result?
      • Read data
      • Plot
      • How to select marker:
  • oncoPrint
    • oncoPrint: visualizing TCGA Lung Adenocarcinoma Carcinoma Variants Dataset
    • Visualizing categorical variables using oncoPrint
  • Advanced Usage
    • Generate dataset
    • Add selected rows labels
    • Add annotations on the top of heatmap cells
    • Only plot the annotations
    • Change orentation to down and add extra space
    • Change orentation to the left
    • Change orentation to the right
    • Changing orientation using parameter orientation
    • Add multiple heatmap annotations using for loop
    • Cluster between groups and cluster within groups
      • clsuter within groups: col_split=*, col_cluster=True
      • cluster_between_groups: col_split=*, col_split_order="cluster_between_groups",col_cluster=False
      • cluster_within_groups && cluster_between_groups: col_split=*, col_split_order="cluster_between_groups",col_cluster=True
    • Custom annotation
    • Custom linkage
    • Image annotation
    • How to force display all row/col ticklabels?
  • More Examples
    • Visualizing Differential Expression Genes
    • Visualizing Single Cell DNA Methylation Data (Loyfer2023)
    • Composite two heatmaps horizontally for mouse DNA methylation array dataset
      • What if the number of column (or row) annotations are different
    • Plot correlation matrix for CpG modules using DotClustermap
      • Processing the data
      • Plotting the Dot clustermap
      • A smaller dot clustermap
  • Kwargs
    • label_kws, xticklabels_kws and yticklabels_kws: Modifying the heatmap annotations labels and xticklabels, yticklabels
    • xlabel_kws and ylabel_kws: Modifying xlabel and ylabel
    • Control legend using legend_kws
    • Control gap & pad in heatmap
      • hgap and wgap for HeatmapAnnotation
      • subplot_gap
      • row_split_gap and col_split_gap
    • How to remove arrow in anno_label
  • colormap
    • Default matplotlib colormaps
    • Build-in colormaps (Not included in matplotlib default cmaps)
    • How to use the Build-in cmap?
  • Gallery
  • For Developers
    • Understand the layout:
    • Bezier dendrogram
    • anno_label
    • anno_img
      • extent
    • Color palette design
  • PyComplexHeatmap
    • PyComplexHeatmap package
      • Submodules
        • PyComplexHeatmap.annotations module
          • AnnotationBase
            • AnnotationBase.get_label_width()
            • AnnotationBase.get_max_label_width()
            • AnnotationBase.get_ticklabel_width()
            • AnnotationBase.reorder()
            • AnnotationBase.set_axes_kws()
            • AnnotationBase.set_label()
            • AnnotationBase.set_legend()
            • AnnotationBase.set_orientation()
            • AnnotationBase.update_plot_kws()
          • HeatmapAnnotation
            • HeatmapAnnotation.collect_legends()
            • HeatmapAnnotation.get_legend_list()
            • HeatmapAnnotation.plot_annotations()
            • HeatmapAnnotation.plot_legends()
            • HeatmapAnnotation.set_axes_kws()
            • HeatmapAnnotation.show_ticklabels()
          • anno_barplot
            • anno_barplot.plot()
          • anno_boxplot
            • anno_boxplot.plot()
          • anno_dendrogram
            • anno_dendrogram.plot()
          • anno_img
            • anno_img.plot()
            • anno_img.read_img()
          • anno_label
            • anno_label.get_ticklabel_width()
            • anno_label.plot()
            • anno_label.set_plot_kws()
          • anno_lineplot
            • anno_lineplot.plot()
          • anno_scatterplot
            • anno_scatterplot.plot()
          • anno_simple
            • anno_simple.plot()
          • anno_spacer
            • anno_spacer.get_label_width()
            • anno_spacer.get_max_label_width()
            • anno_spacer.get_ticklabel_width()
            • anno_spacer.plot()
            • anno_spacer.reorder()
            • anno_spacer.set_label()
            • anno_spacer.set_legend()
            • anno_spacer.set_orientation()
        • PyComplexHeatmap.clustermap module
          • Branch
            • Branch.create_branch()
          • ClusterMapPlotter
            • ClusterMapPlotter.cal_cold_between_groups()
            • ClusterMapPlotter.cal_rowd_between_groups()
            • ClusterMapPlotter.calculate_col_dendrograms()
            • ClusterMapPlotter.calculate_row_dendrograms()
            • ClusterMapPlotter.collect_legends()
            • ClusterMapPlotter.format_data()
            • ClusterMapPlotter.get_legend_list()
            • ClusterMapPlotter.plot()
            • ClusterMapPlotter.plot_dendrograms()
            • ClusterMapPlotter.plot_legends()
            • ClusterMapPlotter.plot_matrix()
            • ClusterMapPlotter.post_processing()
            • ClusterMapPlotter.set_axes_labels_kws()
            • ClusterMapPlotter.set_height()
            • ClusterMapPlotter.set_width()
            • ClusterMapPlotter.set_xy_labels()
            • ClusterMapPlotter.standard_scale()
            • ClusterMapPlotter.tight_layout()
            • ClusterMapPlotter.z_score()
          • DenTree
            • DenTree.create_tree()
          • DendrogramPlotter
            • DendrogramPlotter.calculate_dendrogram()
            • DendrogramPlotter.calculated_linkage
            • DendrogramPlotter.check_array()
            • DendrogramPlotter.get_coords()
            • DendrogramPlotter.plot()
            • DendrogramPlotter.reordered_ind
          • composite()
          • heatmap()
          • heatmapPlotter
            • heatmapPlotter.plot()
          • plot_heatmap()
        • PyComplexHeatmap.colors module
          • define_cmap()
          • generate_quantive_colors()
          • get_palettable_colors()
          • identify_color_format()
          • interpolate_colors()
          • register_cmap()
          • register_palettable()
        • PyComplexHeatmap.dotHeatmap module
          • DotClustermapPlotter
            • DotClustermapPlotter.collect_legends()
            • DotClustermapPlotter.format_data()
            • DotClustermapPlotter.plot_matrix()
            • DotClustermapPlotter.post_processing()
          • dotHeatmap2d()
          • scale()
        • PyComplexHeatmap.oncoPrint module
          • oncoPrintPlotter
            • oncoPrintPlotter.add_default_annotations()
            • oncoPrintPlotter.collect_legends()
            • oncoPrintPlotter.format_data()
            • oncoPrintPlotter.get_samples_order()
            • oncoPrintPlotter.plot_matrix()
            • oncoPrintPlotter.post_processing()
          • oncoprint()
        • PyComplexHeatmap.utils module
          • adjust_cmap()
          • axis_ticklabels_overlap()
          • cal_legend_width()
          • cluster_labels()
          • comb()
          • define_cmap()
          • despine()
          • evaluate_bezier()
          • getControlPoints()
          • get_bezier_curve()
          • get_colormap()
          • plot_cmap_legend()
          • plot_color_dict_legend()
          • plot_legend_list()
          • plot_marker_legend()
          • to_utf8()
          • use_pch_style()
      • Module contents
    • setup module
  • Citation
PyComplexHeatmap
  • Gallery
  • Edit on GitHub

GalleryΒΆ

Click the picuture to view the source code.

Previous Next

© Copyright 2022, Wubin Ding.

Built with Sphinx using a theme provided by Read the Docs.