Package: hmap
Author:Matthias Bieghmap: Python Heatmap PackageThis package implements a convenient heatmap plotting package in python. It offers low level functions forPlottingHeatmapsDendrogramsAnnotationsLegendsFigure layoutingClustered heatmapGrouped clustered heatmapFigure layoutThe hmap package comes with a module for defining the layout of a figure using absolute length measurements. Currently the only unit supported is milimeters. The layout of a figure is defined as a grid. You have to specifythe number of rows,the number of columns,the widths of the columns,the heights of the rows,the vertical distance between adjacent rows,the horizontal distance between adjacent columns,the size of the bottom border margin,the size of the top border margin,the size of the left border margin, andthe size of theright border margin
As said before, the sizes are given in milimeters.Exampleimportsysimporthmapimportmatplotlib.pyplotaspltfig,gs=hmap.layout.layout.layoutGrid(4,5,[10.,2.,40.,40.,40],[10.,2.,40.,40.],1.,1.,20.,15.,15.,20.)col_widths=["10 mm","2 mm","40 mm","40 mm","40 mm"]row_heights=["10 mm","2 mm","40 mm","40 mm"]forrow_idxinrange(4):forcol_idxinrange(5):ax=plt.subplot(gs[row_idx,col_idx])plt.xticks([],[])plt.yticks([],[])if(row_idx==0):ax.xaxis.set_label_position("top")plt.xlabel(col_widths[col_idx],fontsize=7,rotation=90)if(col_idx==0):plt.ylabel(row_heights[row_idx],fontsize=7,rotation=0,horizontalalignment="right",verticalalignment="center")InstallationpipinstallhmapUsage ExamplePlease check thejupyter notebookfor an example of how to use hmap.AcknowledgementsThis package was implemented during my time at theGerman Cancer Research Centerin the group ofTheoretical Bioinformaticsheaded by Prof. Dr. Roland Eils, where i was part of the core bioinformatics team of theHeidelberg Institute of Personalized Oncology (HIPO). Further refinment and final upload to PyPI was done during my time atCharite, Universitaetsmedizin Berlin, Berlin Institute of Health (BIH) in the Department of Digital Healthheaded by Prof. Roland Eils.LicenseCopyright (c) 2021, Matthias BiegRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.