【比较基因组】McScan jcvi比较两个基因组共线性细节记录
软件的安装
Python版McScan(jcvi工具包):https://github.com/tanghaibao/jcvi
以前只有python2,现在已有python3版本,建议用py3。安装可用pip:
pip install jcvi
##或开发版
pip install git+git://github.com/tanghaibao/jcvi.git
pip可能会安装很慢。建议还是用conda,要快很多,最好新建环境。
conda install -c bioconda jcvi
这时,你已经能使用命令,表面上安装成功了,实际上可能还缺少很多依赖。比如last,latex,dvipng等。否则在后面运行过程,可能遇到如下错误:
##未安装last
/bin/bash: lastdb: command not found
##未安装latex、dvipng
RuntimeError: Failed to process string with tex because latex could not be found
只有一个个解决,有的可以直接conda(如last),有些则需要编译,若有root权限,倒也好办。
conda install -c bioconda last
sudo yum install -y texlive texlive-latex texlive-xetex texlive-collection-latexrecommended
sudo yum install dvipng
基因组的准备
若是已知物种,直接可从公共数据库中下载gff和cds序列,jcvi提供了下载方式:
$ python -m jcvi.apps.fetch
Usage:
python -m jcvi.apps.fetch ACTION
Available ACTIONs:
bisect | Determine the version of the accession by querying entrez
ensembl | Retrieve genomes and annotations from ensembl
entrez | Fetch records from entrez using a list of GenBank accessions
phytozome | Retrieve genomes and annotations from phytozome
phytozome9 | Retrieve genomes and annotations from phytozome version 9.0 (legacy)
sra | Retrieve files from SRA via the sra-instant FTP
比如从Phytozome下载,要提前注册好,如下命令提示输入账号密码。
python -m jcvi.apps.fetch phytozome Vvinifera,Ppersica
下载后无需解压。
自己准备的基因组数据也只需gff3和cds.fa(蛋白序列也可)。
gff3只保留染色体水平的ID,如:
grep '^chr' Vvinifera_145_Genoscope.12X.gene.gff3 > apricot.filter.gff3
gff3文件转化bed文件时注意type和key类型对应gff中第三列和第九列信息。type一般为mRNA,但是key注意你的gff文件是取Name还是ID。如:
python -m jcvi.formats.gff bed --type=mRNA --key=Name Vvinifera_145_Genoscope.12X.gene.gff3 -o grape.bed
python -m jcvi.formats.gff bed --type=mRNA --key=ID Ppersica_298_v2.1.gene.gff3 -o peach.bed
若后续作图仍报错,可尝试去除fasta ID中多余的描述信息(我自己不用也可跑通)。如:
# clean headers to remove description fiedls from Phytozome FASTA files.
python -m jcvi.formats.fasta format --sep="|" Vvinifera_145_cds.fa.gz grape.cds
python -m jcvi.formats.fasta format --sep="|" Ppersica_139_cds.fa.gz peach.cds
一些细节
结果文件
last比对结果,last.filtered比对过滤串联重复和低分比对结果,anchors: 高质量的共线性块,lifted.anchors增加额外锚点的最终共线性区块,simple简化的anchors文件。anchors文件中每个共线性区块以###分隔, 第一和第二列分别是两基因组的基因ID,第三列BLAST的bit score,越大可靠性越高。调图细节
两个配置文件seqid(展示染色体),layout(序列位置)。
seqid文件中,基因组的染色体编号与其gff3文件一致(按大小顺序写,而非gff文件染色体顺序,转化bed时软件会排序)。如:
chr1,chr2,chr3,chr4,chr5,chr6,chr7,chr8,chr9,chr10,chr11,chr12,chr13,chr14,chr15,chr16,chr17,chr18,chr19
Pp01,Pp02,Pp03,Pp04,Pp05,Pp06,Pp07,Pp08
layout文件绘制一些选项,若要个性化,多多修改尝试(尤其时三个物种比较时)。如:
# y, xstart, xend, rotation, color, label, va, bed
.6, .1, .8, 0, red, Grape, top, grape.bed
.4, .1, .8, 0, blue, Peach, bottom, peach.bed
# edges
e, 0, 1, grape.peach.anchors.simple
若要突出显示某一共线性区块,可以在anchors.simple文件对应的区块前添加g*(g代表绿色,也可以改成其他颜色,如红色r)。
建议和示例
建议先用示例数据跑一遍,也很快。再换自己的数据,报错对照着寻找原因,总能解决。
示例代码:
# 准备数据(输入帐号密码)
python -m jcvi.apps.fetch phytozome Vvinifera,Ppersica
#去掉chr以外的序列
grep '^chr' Vvinifera_145_Genoscope.12X.gene.gff3 > apricot.filter.gff3
#gff convert to bed
python -m jcvi.formats.gff bed --type=mRNA --key=Name Vvinifera_145_Genoscope.12X.gene.gff3 -o grape.bed
python -m jcvi.formats.gff bed --type=mRNA --key=Name Ppersica_298_v2.1.gene.gff3 -o peach.bed
#reformat fasta
python -m jcvi.formats.fasta format Vvinifera_145_Genoscope.12X.cds.fa.gz grape.cds
python -m jcvi.formats.fasta format Ppersica_298_v2.1.cds.fa.gz peach.cds
#identify blocks
python -m jcvi.compara.catalog ortholog grape peach --no_strip_names
#plot dotplot
python -m jcvi.graphics.dotplot grape.peach.anchors
# get synteny
python -m jcvi.compara.synteny screen --minspan=30 --simple grape.peach.anchors grape.peach.anchors.new
##prepare for seqid and layout file
# plot synteny
python -m jcvi.graphics.karyotype seqid layout

Ref:
https://www.jianshu.com/p/a748d3a5421d
https://www.cnblogs.com/zhanmaomao/p/12525411.html
https://sr-c.github.io/2019/01/11/jcvi-MCscan/
【比较基因组】McScan jcvi比较两个基因组共线性细节记录的更多相关文章
- 【豆科基因组】绿豆Mungbean, Vigna radiata基因组2014NC
目录 来源 一.简介 二.结果 基因组组装 重复序列和转座子 基因组特征和基因注释 绿豆的驯化 豆科基因组复制历史 基于转录组分析的豇豆属形成 绿豆育种基因组资源 三.讨论 四.方法 材料 组装 SN ...
- MySQL如何查询两个日期之间的记录
baidu出来的结果多是下面答案:<quote> MySQL中,如何查询两个日期之间的记录,日期所在字段的类型为datetime(0000-00-00 00:00:00) 解决方案: 直接 ...
- SqlServer表中两条全然同样的记录,怎样删除当中1条
描写叙述:表无主键ID,误插入两遍数据,怎样删除内容同样的记录,而仅仅留下1条. SELECT DISTINCT * INTO #temp FROM grade; DROP TABLE grade; ...
- NOI2019赛前两周被吊打记录
7.1 T1看了半天发现会个暴力FWT,然后突然返发现随便容斥一下就好了 T2猜了个只有13和23的,结果打个表发现伪了,然后标号不只一种连搜索都写错了,也没想过可以轮廓线dp,菜哭了o(╥﹏╥)o ...
- sql 删除两条完全相同的记录
delete a from ( select *,ps=row_number()over(PARTITION by cCaption order by getdate()) from AA_Colu ...
- Bedtools如何比较两个参考基因组注释版本的基因?
目录 问题 思路 问题 原问题来自:How to calculate overlapping genes between two genome annotation versions? 其实可分为两个 ...
- 微生物组学数据分析工具综述 | 16S+宏基因组+宏病毒组+宏转录组--转载
转载:https://mp.weixin.qq.com/s/xsL9GuLs7b3nRF8VeRtinQ 建立在高通量测序基础上的微生物群落研究,当前主要有三大类:基于16S/18S/ITS等扩增子做 ...
- 全基因组测序 Whole Genome Sequencing
全基因组测序 Whole Genome Sequencing 全基因组测序(Whole Genome Sequencing,WGS)是利用高通量测序平台对一种生物的基因组中的全部基因进行测序,测定其 ...
- 【豆科基因组】大豆(Soybean, Glycine max)经典文章梳理2010-2020
目录 2010年1月:大豆基因组首次发表(Nature) 2010年12月:31个大豆基因组重测序(Nature Genetics) 2014年10月:野生大豆泛基因组(Nature Biotechn ...
随机推荐
- Elasticsearch 中为什么选择倒排索引而不选择 B 树索引
目录 前言 为什么全文索引不使用 B+ 树进行存储 全文检索 正排索引 倒排索引 倒排索引如何存储数据 FOR 压缩 RBM 压缩 倒排索引如何存储 字典树(Tria Tree) FST FSM 构建 ...
- netty入门实现简单的echo程序
最近看以往在程序中编写的代码,发现有一个功能是使用socket通讯来实现的,而那个时候使用的是基于bio的阻塞io来实现的,最近在看netty,发现可以使用netty来使用nio的方式来实现,此博客记 ...
- vs编译问题总结
编译遇到MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the ...
- OKhttp3的使用教程
首先在build.gradle下的dependencies下添加引用. implementation "com.squareup.okhttp3:okhttp:4.9.0" 然后编 ...
- vim实用插件
转载:Vim 实用插件推荐(2017) - 知乎 (zhihu.com) 1.插件管理器 ----------------------------------------- Vundle.vim - ...
- hdu 1058 Humble Numbers(构造?枚举?)
题意: 一个数的质因子如果只是2,3,5,7中的若干个.则这个数叫做humble number. 例如:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 1 ...
- Centos7 升级过内核 boot分区无法挂载修
参考连接:https://www.cnblogs.com/heqiuyong/p/11186301.html 故障图 挂载系统盘,光盘启动,急救模式, chroot /mnt/sysimage 报错 ...
- GoLang设计模式12 - 空对象模式
空对象设计模式是一种行为型设计模式,主要用于应对空对象的检查.使用这种设计模式可以避免对空对象进行检查.也就是说,在这种模式下,使用空对象不会造成异常. 空对象模式的组件包括: Entity:接口,定 ...
- 【数据结构&算法】09-队列概念&参考源码
目录 前言 队列的定义 队列的抽象数据类型 循环队列与链式队列对比 循环队列 特点 定义 循环队列相关计算 链式队列 定义 阻塞队列 并发队列 代码实现 循环队列代码 链式队列实现 前言 李柱明博客: ...
- Spring的轻量级实现
作者: Grey 原文地址:Spring的轻量级实现 本文是参考公众号:码农翻身 的从零开始造Spring 教程的学习笔记 源码 github 开发方法 使用TDD的开发方法,TDD的开发流程是: 写 ...