CLUMPAK
是一个perl脚本,需要提前按照说明书使用cpanm或conda安装所需模块
官网
structure官网发现这个软件,好像是整合了clumpp与distruct的功能,
网页版CLUMPAK有两种格式input,除了structure还有admicture,这个运行速度快,好像只使用snp数据。
admixture下载
CLUMPAK 的网页版的使用速度慢,使用本地版本。本地版本是perl脚本,网上没有相关的教程,先看软件的手册。
1输入文件及参数
有3中 输入文件格式,2种stucture 格式1种admixture格式。手册里有Q-matrices这个概念,不清楚。要是使用structure,手册建议 POP_DATE = 1.
所有k一起压缩,或分k压缩再压缩为一个文件
1.1 Advanced options’ files
关于label color 的参数文件
1.2 Additional parameters
(1) input format
命令行更改输入的格式
(2) MCL threshold
不太懂这个参数的意义
(3) CLUMPP options within single K values
选择不同算法、更改input orders (REPEATS)不懂、更改check-up的threshold(与工作时间有关)
(4) CLUMPP options between K values
大概是根据不同的k 选择不同的比对算法,up to k=8 使用 consider all possible permutations,较大的使用greedy procedure.
2.Usage options
main pipeline, ‘DISTRUCT for many K’s’, ‘Compare’, and ‘Best K'. 四个模块功能
2.1 main pipeline
recommend using POP_DATE = 1. 含有群体分类,=0是需橙色群体分类文件,如无认为是一个群体
The basic command-line for the main pipeline is as follows:
2.1.1 软件基本操作
perl CLUMPAK.pl --id <INTEGER> --dir <CLUMPAK_OUTPUT_DIR> --file <results.zip>
Can't locate List/MoreUtils.pm in @INC (you may need to install the Lis t::MoreUtils module) (@INC contains: /root/miniconda2/lib/site_perl/5.2 6.2/x86_64-linux-thread-multi /root/miniconda2/lib/site_perl/5.26.2 /ro ot/miniconda2/lib/5.26.2/x86_64-linux-thread-multi /root/miniconda2/lib /5.26.2 .) at StructureOutputFilesAccessor.pm line 7.
BEGIN failed--compilation aborted at StructureOutputFilesAccessor.pm li ne 7.
Compilation failed in require at CLUMPAK.pl line 8.
BEGIN failed--compilation aborted at CLUMPAK.pl line 8.
需要先安装需要的模块,使用cpanm安装所需模块,需要模块较多。
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
安装cpanm
也可以使用conda安装perl模块,比cpanm简便
运行 CLUMPAK.pl 报错 K=2/CLUMPP.files/ClumppCommands.sh: line 5: CLUMPP/CLUMPP: Permission denied ,需给CLUMPP/CLUMPP 等可执行权限,此外在运行过程中也会报错其他问题主要是相关模块等没有安装,搜索报错,一般会有解决方案。
使用数据得到如下结果,软件运行结束会生成一下结果,包括不同K值的相关结果及summary file。 CLUMPAK.pl 使用后,一个K值(包含多个run)会得到一个图,
CLUMPAK结果文件
其中的Summary 为不同k值的structure图,如下
CLUMPAK得到的structure图
但是目前上边这个图还没有显示样本id及种群id,需指定其他参数
2.1.2 Additional options and parameters
其他参数可能是用于进一步美化图形,展示更多的信息
作为clumpak 的输入文件,structure的result结果文件里是有样本id信息的
2.2 DISTRUCT for many K’s
每个k的每个run都得到一个图形,不是一个k中得到一个结果
DISTRUCT for many K’ summary
cp: cannot copy a directory, ‘./’, into itself, ‘1’ 先忽略这个错误
Creating summary zip 1.zip
Finished creating zip
Done!
distruct
因为画图需要调用这个,也得看下手册
2. Input file
2.1 Population Q-matrix file
第一列为种群id , 这k列分别为k个structure划分的cluster的membership coefficients,最后一列为种群的大小
Population Q-matrix file
2.2 Individual Q-matrix file
需要 NUMINDS is the number of individuals and PRINT INDIVS is set to 1,即根据 Individual的情况画图。Column 2 gives a code number for the individual. Column 4 gives the code number for thepopulationto which the individual belongs. Columns 1, 3, and 5 are ignored. Columns 6 to K + 5 show membership coefficients for clusters 1, 2, ..., K。会根据输入文件中个体的顺序画图,并根据种群分组。
Individual Q-matrix file
2.3 Labels below the figure
需设置 PRINT LABEL BELOW to 1 及 INFILE LABEL BELOW文件(第一列为population code,第二列为种群名称),默认打印种群id作为label. 种群顺序跟 INFILE LABEL BELOW文件保持一致。
2.4 Labels atop the figure
与上条目一致
2.5 Vertical cluster order and cluster colors
设置图形中的颜色选用,颜色很多。INFILE CLUST PERM指定k个颜色,无指定则默认使用颜色表顺序颜色。GRAYSCALE 设置为1 使用灰度颜色(黑白)。
image.png
3 Usage options
程序与需要使用的文件在同一个目录。drawparams里的参数以#define开头,#应该不是注释作用。//后的内容是注释内容,对参数的顺序不敏感
3.1 Data settings and main options
INFILE POPQ: 种群矩阵
INFILE INDIVQ:个体矩阵
INFILE LABEL ATOP:图上边的lable
INFILE LABEL BELOW:图下边的label
INFILE CLUST PERM:图形颜色
PRINT INDIVS: 1 plot 个体。0 plot 群体
PRINT SEP: 不同种群间有黑色线条
3.2 Figure appearance and additional options
BOXHEIGHT :单个个体图形中的高度
ORIENTATION:设置图形方向
PRINT INFILE NAME:print INFILE POPQ 文件到图形
看完手册 还是不清楚怎么在图形上显示个体名称
显示个体lable
而期望的图形为,还需要显示一个标尺
期望结果
或许需要对数据进行排序。
drawparams 参数
(1)define PRINT_INDIVS
define PRINT_INDIVS 0 时,只画population Q-matrix,种群视为一个整体样本
define PRINT_INDIVS 0
define PRINT_INDIVS 1 时,画Individual Q-matrix,可看到每个个体样本的情况,
define PRINT_INDIVS 1














网友评论