[hewm2008/RectChr](https://github.com/hewm2008/RectChr)
+ + 2.1. linux/MaxOS [Download](https://github.com/hewm2008/RectChr/archive/v1.38.tar.gz) + + 2.2 Pre-install + RectChr is for Linux/Unix/macOS only. Before installing,please make sure the following pre-requirements are ready to use. + 1) [Perl](https://www.perl.org/) with the [SVG.pm](https://metacpan.org/release/SVG) in Perl should be installed. SVG is not necessary,We have provided a built-in SVG module in the package. + 2) [convert](https://linux.die.net/man/1/convert) command is recommended to be pre-installed, although it is not required + + 2.3 Install + Users can install it with the following options: + Option 1: ++ git clone https://github.com/hewm2008/RectChr.git + cd RectChr; chmod 755 -R bin/* + ./bin/RectChr -h ++ + +### 3 Parameter description +------------ +3.1 RectChr +3.1.1 Main parameter + +```php + Usage: RectChr -InConfi in.cofi -OutPut OUT + + -InConfi
+ # 用法和circos相似,主要一个配置文件一样,具体见pdf,简要功能介绍如下 + 1) chr可以横放or纵放,间隙和高度均可以自己定义 + 2) 各chr中可以定义多层,各层可以用不同的画图展示方式。 + 3) 画图方式 共有12种,分别是线,点,柱状,泛链接,自链接,彩虹链接,热度高亮和文本文档 [line, scatter/point, histogram , PairWiseLink,link,LinkS, heatmap(highlights)和text等] + 4) 颜色渐变(ColorBrewer)和等分等均可以自己修改,数据可以限高低 + 5) 开放所有参数,可以自我修改细节等 + 6) ... + ++ +3.1.2 Other parameters +```php + 输入文件格式见 pdf.主要为chr start end Value1 ... 的格式 +``` + +3.2.2 Detail parameters +```php + # 具体见pdf +SetParaFor = global + +File1 = ./scaf2chr.format2 ## 这个是必须输入参数,并且尽量放在最前,格式为[Chr Start End Value1 Value2 ... ValueN] + ## 其中用NA表示不画,chr End End NA不画但End可以用来贝记为chr的长度 +#ValueX = 2 ## 多少层,类同circos多少个圈,这不设默认是N,即根据File1的格式来的,可以自己设 +#ChrSpacingRatio =0.2 ## 不同染色体chr之间的间隔比例(ChrWidth*ChrSpacingRatio) +#Main = "Scaf2Chr" ## the Figtur Name: MainRatioFontSize MainCor ShiftMainX ShiftMainY +#ColorsConf = col.file ## 通过在主配置文件 input 自定义颜色和 Value的对应关系;( P1 = "#FE0808" ) +#ChrArrayDirection = vertical ## horizontal/vertical chr是按纵排列还是横排列 +##其它当很少用到的参数 BGChrEndCurve=1/ 等等 + +################################ Figure ############################################################ + + + +############################## 画布 和 图片 参数配置 ################################# +#Chromosomes_order = ## chr的顺序和只列某些chr出来画,若没有配置,程序会按chr名自动排序 chr1,chr2,chr3 +#ZoomRegion ## Zoom the specific Region,format (ZoomRegion=chr2:1000:5000) +#body=1200 ## 默认是1200,主画布大小设置 另外:up/down/left/right) = (55,25,100,120); #CanvasHeightRitao=1.0 CanvasWidthRitao=1.0 +#RotatePng = 90 ## 对Figure进行旋转的角度 +#RotateChrName = -90 ## 旋转chr名字 text +#ChrSpacingRatio=0.2 ## 不同染色体chr之间的间隔比例(Sum(ChrWidthX*X)*ChrSpacingRatio) + + + +###### 默认各层的配置参数 若各层没有配置的会,则会用这儿的参数 ###### + +SetParaFor = LevelALL ## 下面是处理初始化参数 SetParaFor 参数处理,若为 LevelALL,即先为所有层设置的默认值 +#File2 = ## 可以输入别的文件 +PType = heatmap ## 线,散点,直方图,热图,文本, line, scatter, histogram , heatmap(highlights)和text,shape等等 +#ShowColumn = ## 若SetParaFor为LevelALL时,N层的ShowColumn默认为File1的第ValueN所的Column(N+3) + ## 参数格式可以设为 ShowColumn=File1:4 File2:4,5 + ## File2:4,5 表示file1的第四和第五列用heatmap表示 +#crBG="#B8B8B8" ## 此层(ValueX)背景色 的配色 +#TopVHigh=0.95 ## 此层Top of ValueX 用最高点颜色[0.95],其它再等分 +#TopVLow=0 ## 此层Top of ValueX 用最低点颜色[0],其它再等分 +##YMax= ## 设置此层(ValueX)的最大值,默认自动 +##YMin= ## 设置此层(ValueX)的最小值,默认自动 +##LimitYMax/LimitYMin ## 超过某个值就附为此值 +#Gradien=10 ## 此层(ValueX)多少等分颜色 +#ChrWidth=20 ## 此层(ValueX)在画布的宽度 +#BGWidthRatio =1 ## 此层(ValueX)的背景(backgroup)的宽度默认和ChrWidth一样(0-1]) +#LogP=0 ## 此层(ValueX)不作 0-log10(Value) 处理 +#ValueSpacingRatio=0 ## 同一染色体中此层(ValueX)之间的间隔比例(ChrWidth*ValueSpacingRatio) +#SizeGradienRatio= ##设置渐变条的大小 +#NoShowGradien=0 ## 若要不显示渐变条 可设为1 +#ShowYaxis=0 ## 是否显示所有层的Y axis的起终点值,默认值此:0 不显示 + +######## 更多配置的参数 可以自己设,没有的话会自动设置 ####### +##Rotate/fill/Cutline/strokewidth/stroke//font-size/font-family/fill-opacity/strokeWidthBG/crStrokeBG/NoShowBackGroup ### 等等 +##ShiftGradienX=0 ## 渐变条左右移动 ##ShiftGradienY=0 ## 渐变条上下移动 +##ShiftChrNameX=0/ShiftChrNameY=0 ## chrName移动 ChrNameRatio=1.0 +#text-font-size TextFontRatio=1.0 + +## LevelName = "Name" ## the Level Name :NameRatioFontSize NameCol ShiftNameX ShiftNameY NameRotate + +#ColorBrewer= ## 颜色配色画板 即不起作用。数值 : GnYlRd; Text为:Paired, see more RColorBrewer +#crBegin="#006400" ## 此层(ValueX)最低值Value 的配色 +#crMid="#FFFF00" ## 此层(ValueX)中间值Value 的配色 +#crEnd="#FF0000" ## 此层(ValueX)最大值Value 的配色 +.... #等等 + + +``` + +3.3 Output files +
+out.svg: Output plot in SVG format +out.png: Output plot in png format ++ + +### 4 Example +------------ + +See more detailed usage in the [Chinese Documentation](https://github.com/hewm2008/RectChr/blob/main/类circos功能的RectChr_Manual_Chinese.pdf) +See more detailed usage in the [English Documentation](https://github.com/hewm2008/RectChr/blob/main/类circos功能的RectChr_Manual_Chinese.pdf) +See the example directory and Manual.pdf for more detail. +具体见这儿 Manual.pdf for more detail 里面的实例和配置,后期将在某些网址释放一些教程 + +../../bin/RectChr -InConfi in.cofi -OutPut OUT + 目录 Example/example*/ 里面有输入和输出和脚本用法。 + + +* Example 1) Sca2chr 示意结果图 +如下主要画两层 text 和 highlight(高亮)两种配合 , 然后旋转一下。 +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example1/OUT.png) + +* Example 2) 遗传图谱+maker +两层 即 画text 层和 高亮层两种配合。 其中高亮层的背色条宽度缩小了点. +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example2/OUT.png) + + +* Example 3)某一变量的分布图 +一层, 用户可以结果数据(可以是不是数字)用point高低 柱状图 和lines及结合颜色来 + +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example3/OUT.png) + + +* Example 4) BinMap+maker的分布图 +两层 都是高亮层两种配合 +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example4/OUT.png) + + +* Example 5) 群体遗传变量+受选择区域 +多层 多种画图方式 +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example5/OUT.png) +![out2.png](https://github.com/hewm2008/RectChr/blob/main/Example/example5/OUT2.png) + + +* Example 6) 多个基因组的共线性图 +两层 link和其它画图方式结合。可以横放chr 和纵排 +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example6/OUT1.png) + +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example6/OUT4.png) + +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example6/OUT5.png) + + +* Example 7) 区域link(关联彩虹图) + 两层,彩虹链接和其它画图方式结合 + +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example7/OUT.png) +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example7/OUT2.png) + + +* Example 8) GWAS的图 +两层上层为点图,层高度调高点; 下层为chr啥都不画仅背影条(可以其它画图方式),主要说明可以横放chr +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example8/OUT.png) +![out2.png](https://github.com/hewm2008/RectChr/blob/main/Example/example8/OUT2.png) +![out4.png](https://github.com/hewm2008/RectChr/blob/main/Example/example8/OUT4.png) + +* Example 9) binMap的图 +多层heatmap,横放chr +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example9/OUT.png) + +* Example 10) 动态热度图和动态柱状图 +某一层为动态svg,须要下载svg到本地,用较新的浏览器打开即可,别外可以用其它软件将svg转为gif格式 + +* Example 11) shape的一个展示 +![out.png](https://github.com/hewm2008/RectChr/blob/main/Example/example11/OUT.png) + + + + +### 5 Advantages + +速度快,少内存 +可以自我定义组合多层次 +有perl即可以运行,免安装 + + +### 6 An example image generated by RectChr. +------------ + +具体实际见程序目录里面的Example/example* +在这搜索了一些在网上的其它人的配置和示意,点击可以找开网页,查看 + [RectChr总简介](https://zhuanlan.zhihu.com/p/352026153) + [RectChr之 两个群体比较 之 受择选信号+选择区域](https://zhuanlan.zhihu.com/p/352900660) + [RectChr之一个群体遗传多态](https://zhuanlan.zhihu.com/p/352886319) + [RectChr之几种方法受选择区域](https://zhuanlan.zhihu.com/p/352798284) + [RectChr之 两个群体比较 之 受择选信号+选择区域 横放chr ](https://zhuanlan.zhihu.com/p/353999839) + [RectChr之 群体sweep +QTLS+IBD作图](https://zhuanlan.zhihu.com/p/366244372) + [RectChr之 两个基因组共线性分析](https://zhuanlan.zhihu.com/p/354274078) + [RectChr之 多个基因组(3或更多)共线性分析](https://zhuanlan.zhihu.com/p/361324138) + [RectChr之 多样品某一区域 genotype/gene/单倍型 热度图](https://zhuanlan.zhihu.com/p/358342096) + [RectChr之 多样品多区域 binmap 热度图](https://zhuanlan.zhihu.com/p/360097194) + [RectChr之 动态heatmap和动态柱状图 svg](https://zhuanlan.zhihu.com/p/362705487) + [RectChr之 高级感的GWAS曼哈顿图](https://zhuanlan.zhihu.com/p/375048543) + + +### 7 Discussing +------------ +- [:email:](https://github.com/hewm2008/RectChr) hewm2008@gmail.com / hewm2008@qq.com +- join the QQ Group : 125293663 + +######################swimming in the sky and flying in the sea ############################# + diff --git a/bin/RectChr b/bin/RectChr new file mode 100644 index 0000000..d59c9ff Binary files /dev/null and b/bin/RectChr differ diff --git a/bin/in.cofi b/bin/in.cofi new file mode 100644 index 0000000..dfc18d8 --- /dev/null +++ b/bin/in.cofi @@ -0,0 +1,89 @@ + +##################################### 全局参数 ####################################################### + +SetParaFor = global + +File1 = ./InPut.file ## 这个是必须输入参数,并且尽量放在最前,格式为[Chr Start End Value1 Value2 ... ValueN] + ## 其中用NA表示不画,chr End End NA不画但End可以用来贝记为chr的长度 +#ValueX = ## 多少层,类同circos多少个圈,这不设默认是N,即根据File1的格式来的,可以自己设 +#ChrSpacingRatio =0.2 ## 不同染色体chr之间的间隔比例(ChrWidth*ChrSpacingRatio) +#Main = "main_Figure" ## the Fig Name :MainRatioFontSize MainCor ShiftMainX ShiftMainY +#ColorsConf = col.file ## 通过在主配置文件 input 自定义颜色和 Value的对应关系;( P1 = "#FE0808" ) +#ChrArrayDirection = horizontal ## horizontal/vertical chr是按纵排列还是横排列 +##其它当很少用到的参数 BGChrEndCurve=1/ 等等 +################################ Figure ############################################################ + + + + + + +############################## 画布 和 图片 参数配置 ################################# +#ZoomRegion ## Zoom the specific Region,format (ZoomRegion=chr2:1000:5000) +#Chromosomes_order = ## chr的顺序和只列某些chr出来画,若没有配置,程序会按chr名自动排序 chr1,chr2,chr3 +#body=1200 ## 默认是1200,主画布大小设置 另外:up/down/left/right) = (55,25,100,120); #CanvasHeightRitao=1.0 CanvasWidthRitao=1.0 +#RotatePng = 0 ## 对Figure进行旋转的角度 +#RotateChrName = 0 ## 旋转chr名字 text +#ChrSpacingRatio=0.2 ## 不同染色体chr之间的间隔比例(Sum(ChrWidthX*X)*ChrSpacingRatio) + + + + +###### 默认各层的配置参数 若各层没有配置的会,则会用这儿的参数 ###### + +SetParaFor = LevelALL ## 下面是处理初始化参数 SetParaFor 参数处理,若为 LevelALL,即先为所有层设置的默认值 +#File2 = ## 可以输入别的文件 +PType = heatmap ## 线,散点,直方图,热图,文本和共线性link, line, scatter/point, histogram,link,LinkS heatmap(highlights)和text,PairWiseLink,heatmapAnimated/histAnimated,LinkS,shape/ridgeline/PairWiseLinkV2 +#ShowColumn = ## 若SetParaFor为LevelALL时,N层的ShowColumn默认为File1的第ValueN所的Column(N+3) + ## 参数格式可以设为 ShowColumn=File1:4 File2:4,5 + ## File1:4,5 表示file1的第四和第五列用heatmap表示 +#crBegin="#006400" ## 此层(ValueX)最低值Value 的配色 +#crMid="#FFFF00" ## 此层(ValueX)中间值Value 的配色 +#crEnd="#FF0000" ## 此层(ValueX)最大值Value 的配色 +#crBG="#B8B8B8" ## 此层(ValueX)背景色 的配色 +#TopVHigh=0.95 ## 此层Top of ValueX 用最高点颜色[0.95],其它再等分 默认有可能是1.0/0.95 +#TopVLow=0 ## 此层Top of ValueX 用最低点颜色[0],其它再等分 +##YMax= ## 设置此层(ValueX)的最大值,默认自动 ## Cutoff CrCutoff +##YMin= ## 设置此层(ValueX)的最小值,默认自动 ## LimitYMax LimitYMin +#Gradien=8 ## 此层(ValueX)多少等分颜色 +#ChrWidth=20 ## 此层(ValueX)在画布的宽度 +#BGWidthRatio =1 ## 此层(ValueX)的背景(backgroup)的宽度默认和ChrWidth一样(0-1]) +#LogP=0 ## 此层(ValueX)不作 0-log10(Value) 处理 +#ValueSpacingRatio=0 ## 同一染色体中此层(ValueX)之间的间隔比例(ChrWidth*ValueSpacingRatio) +#SizeGradienRatio= ##设置渐变条的大小 +#ShowYaxis=0 ## 是否显示所有层的Y axis的起终点值,默认值此:0 不显示 +#NoShowGradien=0 ## 若要不显示渐变条 可设为1 +######## 更多配置的参数 可以自己设,没有的话会自动设置 ####### + +##ShiftGradienX=0 ## 渐变条左右移动 ##ShiftGradienY=0 ## 渐变条上下移动 +##ShiftChrNameX=0/ShiftChrNameY=0 ## chrName移动 ChrNameRatio=1.0 +##LimitYMax/LimitYMin + + + + +##################################### 这些只可在各层的设置的参数 ####################################################### +### 具体某层的具体配置 把 DealLevePara 设为具体正数(<=ValueX),然后可以具体修改此层要改变的部分 +#ColorBrewer= ## 这个一设,crBegin,crMid,crEnd 即不起作用。数值 : GnYlRd; Text为:Paired +# ## "BrBG","PiYG","PRGn","Paired","Pastel1","Pastel2","Set1",","BuPu","GnBu","Greens","Greys"... +#ReverseColor = 0 ## 对配色渐变条进行反向 + ## see more https://www.r-graph-gallery.com/38-rcolorbrewers-palettes.html +##Rotate/fill/Cutline/strokewidth/stroke//font-size/font-family/fill-opacity/strokeWidthBG/crStrokeBG/NoShowBackGroup ### 等等 +#text-font-size TextFontRatio=1.0 + + + + + + + +##################################### 各层的参数 ####################################################### +#SetParaFor=Level2 ## 下面开始处理第 2 层 参数处理 +#File2 = ## 可以输入别的文件 file1 +#PType = hist ## 散点 +#ShowColumn = File2:5 ## 把file1的第五列用散点图形式画出来) +##LevelName = "Name" ## the Level Name :NameRatioFontSize NameCol ShiftNameX ShiftNameY NameRotate + +#SetParaFor=Level3 +#PType = lines +#ShowColumn = File1:5,6 diff --git a/bin/script/GenotypeShow.pl b/bin/script/GenotypeShow.pl new file mode 100644 index 0000000..c87e256 --- /dev/null +++ b/bin/script/GenotypeShow.pl @@ -0,0 +1,251 @@ +#!/usr/bin/perl -w +use strict; +use FindBin qw($Bin); +#explanation:this program is edited to VCF2GenotypShow +#edit by hewm; Mon Jun 28 09:30:07 CST 2021 + +die "\tVersion 1.2.1\thewm2008\t2021-06-28;\n\tUsage: $0