Bcbio-gff 文件创建问题

问题描述 投票:1回答:1

当使用GFF.write()创建文件时,我得到了一行新的 "注释备注 "作为来源,后面是序列区域的ASCII编码。

##gff-version 3
##sequence-region NC_011594.1 1 16779
NC_011594.1 annotation  remark  1   16779   .   .   .   gff-version=3;sequence-region=%28%27NC_011594.1%27%2C 0%2C 16971%29,%28%27NC_042493.1%27%2C 0%2C 132544852%29, (continues on and on)
NC_011594.1 RefSeq  gene    1   1531    .   +   .   Dbxref=GeneID:7055888;ID=gene-COX1;Name=COX1;gbkey=Gene;gene=COX1;gene_biotype=protein_coding

有什么想法,为什么会出现在这里,有什么作用,我如何避免?我担心在第三方软件中使用时可能会出现问题。

我只导入了 bcbio-gff 包,但我相信它是 Biopython 的一部分,链接。https:/biopython.orgwikiGFF_Parsing

python bioinformatics biopython gff
1个回答
0
投票

对于你的第一个问题--"为什么它在那里?"

  • 我只是推测,默认情况下,软件包的作者想尽可能多的导出信息。

对于你的下一个问题--"我怎样才能避免它?"

  • 不幸的是,没有关闭的开关。对我来说,解决方案是从导出的序列中删除任何注释。(即在导出的序列中设置 annotations 属性为空字典,然后再调用 GFF.write().

例子:

from Bio import SeqIO
from BCBio import GFF

g = SeqIO.read('NC_003888.3.gb','gb')

g.annotations = {}

with open('t2.gff', 'w') as f:
    GFF.write([g], f)

输出文件头--无 # annotation remark

head t2.gff 
##gff-version 3
##sequence-region NC_003888.3 1 8667507
NC_003888.3 feature source  1   8667507 ... removed for clarity ....
© www.soinside.com 2019 - 2024. All rights reserved.