作图

编译|mummer2circos画环状细菌基因组圈图

2024-03-28  本文已影响0人  zd200572

mummer2circos 是一个用于绘制细菌基因组的圈图(circos图)的工具。它基于 BLAST 或 NUCMER/PROMER 的比对结果,生成 SVG 和 PNG 格式的图像,可以直观地展示基因组的结构和特征。

安装

方法一: 用conda

先下载yaml文件,发现直接装conda直接conda装不行,因为依赖于blast等,测试环境windows,在wsl2上经过多次尝试,耗费时间很久,能docker还是docker


许久还在转圈。。。
conda install -c bioconda -c conda-forge mummer2circos

方法二:Docker或类似的Singularity等容器方法

# Docker
windows下先根据官方说明安装docker desktop,然后打开,发现登陆账户由于国内网络原因很折腾,直接wsl命令行进行。
sudo docker pull metagenlab/mummer2circos:1.4.2
# Singularity
# 准备镜像
singularity build mummer2circos.simg docker://metagenlab/mummer2circos:1.4.2
# 运行
singularity exec mummer2circos.simg mummer2circos -r <reference.fna> -q <query.fna>  -l

比对方法

简单图

sudo docker run --rm -v /home/:/data -it metagenlab/mummer2circos:1.4.2
(base) mambauser@8561c1b8f8de:/data$ mummer2circos -l -r source/mummer2circos/examples/genomes/NZ_CP008827.fna -q source/mummer2circos/examples/genomes/*fna -f
14:07:36 INFO Genomes will be aligned with:     nucmer
14:07:36 INFO Reference genome: source/mummer2circos/examples/genomes/NZ_CP008827.fna
14:07:36 INFO running nucmer: nucmer -b 200 -c 65 -g 90 -l 20 -p circos_tmp/CP006659 source/mummer2circos/examples/genomes/NZ_CP008827.fna source/mummer2circos/examples/genomes/CP006659.fna
...
14:09:08 INFO Query genome 10/10: source/mummer2circos/examples/genomes/NZ_FO834906.fna
14:09:08 INFO Track file list ['CP006659.heat', 'KpFR_13.heat', 'NZ_CP008827.heat', 'NZ_CP008929.heat', 'NZ_CP012426.heat', 'NZ_CP012745.heat', 'NZ_CP014647.heat', 'NZ_CP015822.heat', 'NZ_CP016811.heat', 'NZ_FO834906.heat']
14:09:08 INFO Plotting heatmap type plot...
14:09:27 INFO Circos plot generated sucessfully, see nucmer2circos.svg & nucmer2circos.png
14:09:27 INFO Circos files saved in circos_data:
        - main configuration file:              circos.config
        - Contigs definition:                   circos_contigs.txt
        - GC skew:                              circos_GC_skew.txt
        - GC content:                           circos_GC_content.txt
        - Heatmap track 1:                      CP006659.heat
        - Heatmap track 2:                      KpFR_13.heat
        - Heatmap track 3:                      NZ_CP008827.heat
        - Heatmap track 4:                      NZ_CP008929.heat
        - Heatmap track 5:                      NZ_CP012426.heat
        - Heatmap track 6:                      NZ_CP012745.heat
        - Heatmap track 7:                      NZ_CP014647.heat
        - Heatmap track 8:                      NZ_CP015822.heat
        - Heatmap track 9:                      NZ_CP016811.heat
        - Heatmap track 10:                     NZ_FO834906.heat
14:09:27 INFO The plot can be modified (to change color scales, remove or add tracks...) by modifining the file "circos.config" and excuting the command "circos -conf circos.config"

工作目录下,3种格式的图片已经生成啦!



加上基因轨

参考 Fasta 文件染色体(和最终质粒)的标题应与 GenBank 文件的位点加入相同。请参阅示例文件 NZ_CP008828.fna。
LOCUS NZ_CP008828 15096 bp DNA CON 16-AUG-2015

mummer2circos -l -r genomes/NZ_CP008827.fna -q genomes/*.fna -gb GCF_000281535_merged.gbk

标记特定基因

mummer2circos -l -r genomes/NZ_CP008827.fna -q genomes/*.fna -gb GCF_000281535_merged.gbk -b VF.faa 

# 显示沿染色体(和质粒)的映射深度

mummer2circos -l -r genomes/NZ_CP008827.fna -q genomes/*.fna -gb GCF_000281535_merged.gbk -b VF.faa -s GCF_000281535.depth

根据坐标文件添加标签

mummer2circos -l -r genomes/NZ_CP008827.fna -q genomes/NZ_FO834906.fna -gb GCF_000281535_merged.gbk -b VF.faa -s GCF_000281535.depth -lf labels.txt

显示两个基因组之间的联系

mummer2circos -r genomes/NZ_CP012745.fna -q genomes/*.fna -gb GCF_000281535_merged.gbk -b VF.faa -s GCF_000281535.depth -lf labels.txt

One More Thing

P.S.豆豆小编表示软件里的这个脚本mummer2circos/GC.py非常实用,计算GC和GC skew 这两个在比较基因组中经常使用,之前使用bedtools计算的,非常值得学习!

上一篇下一篇

猜你喜欢

热点阅读