多层次染色体可视化工具 — 命令行 + 图形界面
Multi-level visualization of genomic statistical variables on rectangular chromosomes — CLI + GUI
RectChr 是一款聚焦于染色体(Chr)水平的多层次可视化工具,提供图形界面(GUI)和命令行(CLI)两种使用方式。
图形界面支持实时预览、参数可视化配置、14 种绘图类型一键切换,并可导出 SVG / PDF 格式,适合快速探索和交互式绘图。命令行模式则适合批量处理和自动化流程,使用方式与经典的 circos 工具类似,但将圈圈图转化为长方形布局,支持横放与纵排。
核心功能包括:
- 14 种绘图类型:散点(point)、形状(shape)、线图(line)、柱状图(hist)、热图(heatmap)、高亮(highlights)、文本(text)、山脊线(ridgeline)、彩虹链接(PairWiseLink)、自连接(LinkS)、动态热图(heatmapAnimated)、动态柱状图(histAnimated)、动态高亮(highlightsAnimated)
- 灵活组合:用户可自由搭配各层颜色、样式和参数
- 默认配置:常见分析(如 SNP GC 密度)可直接输入文件完成可视化
- 跨平台:Windows / Linux / macOS 均可运行
RectChr 已被引用超过 70 次以上,广泛应用于基因组学、遗传学等领域。
RectChr is a multi-level visualization tool that focuses on the chromosome (Chr) level, available as both a graphical user interface (GUI) and a command-line interface (CLI).
The GUI supports real-time preview, visual parameter configuration, 14 plot types with one-click switching, and SVG/PDF export — ideal for rapid exploration and interactive plotting. The CLI is suited for batch processing and automation, with a workflow similar to the classic circos tool but using rectangular layouts instead of circles, supporting both horizontal and vertical orientations.
Key features:
- 14 plot types: scatter/point, shape, line, histogram, heatmap, highlights, text, ridgeline, PairWiseLink, LinkS, heatmapAnimated, histAnimated, highlightsAnimated
- Flexible combinations: freely mix colors, styles, and parameters across tracks
- Default configurations: common analyses (e.g., SNP GC density) work out of the box
- Cross-platform: runs on Windows, Linux, and macOS
RectChr has been cited over 70 times in published research.
图形界面提供以下功能:
- 左侧:数据文件管理 + 前 20 行数据预览
- 中间:SVG 实时预览,支持刷新 / 自动刷新,可导出 SVG / PDF
- 右侧:参数面板,按类别分组(染色体、坐标轴、轨道、颜色与图例等)
- 底部:运行日志
- 工具栏:新建、打开配置、刷新预览、运行绘图、引用、帮助、中英文切换
详细使用说明请参阅:
The new version will be updated and maintained in hewm2008/RectChr, please click below website to download the latest version
2.1 下载 Download
Linux / macOS / Windows: Download v1.50
Windows 用户可直接使用图形界面(GUI),需安装 Perl和Python3。
2.2 预依赖 Pre-install
命令行模式需要以下依赖:
1) Perl with the SVG.pm in Perl should be installed. SVG is not necessary, We have provided a built-in SVG module in the package.
2) convert command is recommended to be pre-installed, although it is not required
图形界面需要 Python 3 + PySide6(命令行自动安装依赖)
2.3 安装与启动
命令行模式(CLI):
git clone https://github.com/hewm2008/RectChr.git
cd RectChr; chmod -R 755 bin/*
./bin/RectChr -h
图形界面模式(GUI):
# Linux / macOS
sh gui/RectChrGUI.sh
# Windows
双击RectChrGUI.bat ## python gui\main.py
3.1 RectChr
3.1.1 Main parameter
Usage: RectChr -InConf in.conf -OutPut OUT
-InConf <s> : Input Configuration File
-OutPut <s> : OutPut svg file result
-help See more help *Manual.pdf
[hewm2008 v1.50]
brief description for function:
# RectChr has rich and flexible visualization capabilities, and here is a brief description of its features: 1) Chromosome layout customization: You can freely set the placement direction (chr_orientation) and order (chr_order) of chromosomes, and you can choose horizontal or vertical orientation. At the same time, you can also define the gap between chromosomes (padding_ratio), the height of each layer (track_height), and the background color (background_color). 2) Multi-layer drawing structure: Each chromosome can define a multi-layer structure, the number of layers is determined by track_num (level), and each layer can be displayed in different drawing methods. 3) Diverse drawing methods: 14 drawing types (plot_type are available), including scatter/point, shape, line, histogram, heatmap, highlights, text, ridgeline, PairWiseLink, LinkS, heatmapAnimated, histAnimated, highlightsAnimated to meet different visualization needs. 4) Color and Data Range Adjustments: Supports custom modifications to color artboards (such as colormap_brewer_name), color gradients, and aliquots (colormap_nlevels). At the same time, the range of data can be limited, for example by parameters such as YMax, upper_outlier_ratio, cap_max_value, etc. 5) Unified input format: The input format is unified, and it is very easy to specify statistics, such as show_columns = File2:4, where the first three columns represent the region, and File2:4 uses the fourth column of the second file as the graphing statistics. 6) Area Magnification Function: Using the chr_zoom_region parameter, it can realize the function of zooming in to view specific areas, making it easy to focus on details. 7) Open customization of parameters: All parameters are open to the public, and users can modify the details according to their needs. 8) ...
3.1.2 InPut files
Data frame format. The input file format is shown in pdf. The format is mainly fixed for the first three columns:
chr start end Flag1 Flag2 ...
3.2.2 Detail parameters
For a list and description of all parameters, see the file doc/NewParaList.xlsx. Below is a diagram of the parameters and controls.

See the example directory and Manual.pdf for more detail.
See more detailed usage in the Chinese GUI Documentation
See more detailed usage in the English GUI Documentation
See more detailed usage in the Chinese Documentation
See more detailed usage in the English Documentation
# see more at pdf
################################### ##Global Parameters #######################################################
SetParaFor = global ##Sets the current paragraph scope to global, applicable to the entire graphic configuration
File1 = ./InPut.df ##Main data file path. Required input. Format: [Chr Start End Value1 ...], where NA means this region is not drawn.
#File2 = ##Optional second data file path for multi-source data overlay. FileX = ./InPut.fileX
#track_num = ##Specifies the number of tracks (layers) in the plot. Default is automatically inferred based on the number of columns in File1 (e.g., Value1 to ValueN)
#chr_spacing_ratio = 0.2 ##Spacing ratio between different chromosomes, calculated based on track height (track_height * chr_spacing_ratio)
#title = "main_Figure" ##Graphic title and style settings. Supports title_color, title_size, title_shift_x, title_shift_y, etc.
#colormap_conf = col.file ##Custom color mapping file path, used to define value-to-color mappings (e.g., P1 = "#FE0808")
#chr_orientation = horizontal ##Chromosome orientation, options: horizontal or vertical
###################################### ##Global Chromosome Configuration ####################################################
#chr_zoom_region = ##Zoom into a specific region, format: chr:start:end (e.g., chr2:1000:5000)
#chr_order = ##Specify chromosome order or filter list (if not specified, sorted alphabetically)
#chr_spacing_ratio = 0.2 ##Spacing ratio between chromosomes (based on Sum(track_height))
#chr_label_rotation = 0 ##Rotation angle of chromosome label text
################################ ##Canvas and Image Parameters #################################
#canvas_body = 1200 ##Main canvas size, #canvas_margin_top = 55 #canvas_margin_bottom = 25 #canvas_margin_left = 100 canvas_margin_right = 120
################################# ALL Track Default Parameters (Used If Not Set Individually) #########
SetParaFor = trackALL ##Sets default parameters for all tracks; subsequent unconfigured trackX will inherit these settings
plot_type = heatmap ##Supported plot types: heatmap, line, scatter, histogram, LinkS
##line, scatter/point, histogram, link, LinkS, heatmap(highlights), text, PairWiseLink
##PairWiseLinkV2, heatmapAnimated/histAnimated, LinkS, shape, ridgeline
#show_columns = ##Specifies which columns to display, e.g., File1:4 or File2:4,5
#colormap_brewer_name = ##Use predefined color palettes (overrides manual colors), e.g., GnYlRd (numeric) or Paired (categorical)
#colormap_reverse = 0 ##Whether to reverse the color gradient (0=normal, 1=reversed)
#colormap_low_color = "#006400" ##Color for the lowest value #colormap_mid_color = "#FFFF00" #colormap_high_color = "#FF0000"
#background_color = "#B8B8B8" ##Background color
#upper_outlier_ratio = 0.95 ##Upper outlier threshold, values above this use the max color
#lower_outlier_ratio = 0 ##Lower outlier threshold, values below this use the min color
#Ymax = ##Manually set the maximum value for this layer, overriding auto-calculation
#Ymin = ##Manually set the minimum value for this layer, overriding auto-calculation
#cap_max_value = ##Cap the maximum value #cap_min_value = ##Cap the minimum value
#colormap_nlevels = 8 ##Number of color levels in the gradient
#track_height = 20 ##Height of the current track
#track_bg_height_ratio = 1 ##Background height as a proportion of track_height (0-1]
#log_p = 0 ##Whether to apply log10 transformation to values (0=no, 1=yes)
#padding_ratio = 0 ##Vertical spacing between adjacent tracks within the same chromosome (track_height * padding_ratio)
#colormap_legend_sizeratio = ##Size of the color legend (width and height)
#yaxis_tick_show = 0 ##Whether to show Y-axis tick labels (0=hide, 1=show)
#colormap_legend_show = 1 ##Whether to show the color gradient legend (0=hide, 1=show)
#colormap_legend_shift_x = 0 ##Horizontal shift of the color legend #colormap_legend_shift_y = 0 ##Vertical shift of the color legend
#chr_label_shift_x = 0 ##Horizontal shift of chromosome labels #chr_label_shift_y = 0 ##Vertical shift of chromosome labels
#chr_label_size_ratio = 1.0 ##Font size ratio for chromosome labels (relative to default)
#track_shift_x = 0 ##track shift of x #track_shift_y = 0 ##track shift of y
################################### ##trackALL. Other Less Common Parameters #######################################################
#text-font-size = ##Text font size setting
#track_text_size = 1.0 ##Text font size ratio (relative to default)
#... ####More parameters
################################### ##trackX Layer Parameters, Inherit All trackALL Parameters #######################################################
#SetParaFor = track2 ##Begin configuring parameters for track 2, numbering starts from 1
#File2 = ##Can specify another input file as the data source
#plot_type = hist ##Plot type: histogram
#show_columns = File2:5 ##Display column 5 from File2 (can be used for scatter plots or other chart types)
#label = "Name" ##Label and style settings for this track (label_size label_color label_shift_x label_shift_y label_angle)
#SetParaFor = track3
#plot_type = lines ##Plot type: line plot
#show_columns = File1:5,6 ##Display columns 5 and 6 from File1
.... #etc
3.3 Output files
out.svg: Output plot in SVG format out.png: Output plot in png format
Here are some examples of basic usage tutorials, and the specific data and configuration can be found in the Basic_Tutorials of the software
The following is a simple list of 14 drawing methods,see

-
Example 1) Density_heatmap

-
Example 2) T2T Genome

-
Example 3) ParentalMaker

-
Example 4) binMap Fig Multi - track heatmap, horizontally placed chromosomes

-
Example 5) Regin Genotype

-
Example 6) T2T Depth info

-
Example 7) Genetics Stat
ZoomRegion1
ZoomRegion2

-
Example 8)maker Flag
-
Example 9) GWAS Fig Two layers: the upper layer is a dot plot with increased layer height; the lower layer is for chromosomes, just showing a background bar (other drawing methods are also okay), mainly to illustrate that chromosomes can be placed horizontally.

-
Example 10) QTL region

-
Example 11) LD Map

- 图形界面 + 命令行:GUI 实时预览,CLI 批量处理,两种模式自由切换
- 14 种可视化类型:散点、线图、热图、山脊线、动态图等,满足多样化的染色体可视化需求
- 跨平台:Windows / Linux / macOS 均可运行,GUI 需安装 Perl
- 灵活定制:层数、颜色、布局、参数全面开放,支持任意组合
- 高效轻量:速度快、内存低,适合大规模基因组数据
- 开箱即用:提供默认配置,常见分析直接输入文件即可出图
There are also many articles published in the paper, which can also prove that there are many examples. RectChr have been cited in more than 60 times by searching against google scholar
- 📧 hewm2008@gmail.com/hewm2008@qq.com
- join the QQ Group : 125293663
######################swimming in the sky and flying in the sea #############################


