今天在NCBI下载了酵母的参考基因组,没有找到gff格式的基因组注释文件,只找到了genbank格式的基因组注释文件。应该会有现成的工具来实现常用的基因组注释文件不同格式之间的相互转换。比如gtf、gff、和genbank之间的相互转换。
经过搜索找到三款工具可以把gb格式文件转换成gff格式注释文件。
参考
https://www.biostars.org/p/140013/
使用conda安装EMBOSS
conda install emboss
seqret命令转化
seqret -feature -osformat2 gff3 -outseq chr01.gff chr01.gb
参考链接
http://lindenb.github.io/jvarkit/GenbankToGff3.html
这是一个java程序 我没有安装成功
最开始服务器上没有安装java,运行java命令的时候提示我
Command 'java' not found, but can be installed with:
apt install default-jre
apt install openjdk-11-jre-headless
apt install openjdk-8-jre-headless
不知道这三个有什么区别,然后使用命令apt install openjdk-8-jre-headless安装了第三个
需要安装biopython和bcbio-gff 直接使用pip安装
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple biopython
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple bcbio-gf
直接自己写脚本,参考的是
https://biopython.org/wiki/GFF_Parsing
脚本内容
import sys
from Bio import SeqIO
from BCBio import GFF
in_file = sys.argv[1]
out_file = sys.argv[2]
in_handle = open(in_file)
out_handle = open(out_file,'w')
GFF.write(SeqIO.parse(in_handle,'gb'),out_handle)
in_handle.close()
out_handle.close()
使用方式
python convert_gb_to_gff3.py input.gb output.gff