Bio.UniProt.GOA模块

来自UniProt-Goa的GAF、GPA和GPI格式的解析器。

uniprot-goa自述文件+gaf格式说明:ftp://ftp.ebi.ac.uk/pub/databases/GO/goa/UNIPROT/README

基因关联文件,GAF格式:http://geneontology.org/docs/go-annotation-file-gaf-format-2.1/http://geneontology.org/docs/go-annotation-file-gaf-format-2.0/

基因产品关联数据(gpa格式)自述文件:http://geneontology.org/docs/gene-product-association-data-gpad-format/

基因产品信息(gpi格式)自述文件:http://geneontology.org/docs/gene-product-information-gpi-format/

GO注释文件位于以下位置:ftp://ftp.ebi.ac.uk/pub/databases/GO/goa/

Bio.UniProt.GOA.gpi_iterator(handle)

读取GPI格式文件。

应该调用此函数来读取gp_information ation.goa_UniProt文件。目前,只有一种格式,但这可能会改变,所以这个函数是占位符,是未来的包装器。

Bio.UniProt.GOA.gpa_iterator(handle)

阅读GPA格式文件。

应该调用此函数来读取gene_Association.goa_UniProt文件。读取第一条记录并根据需要返回GPA 1.1或GPA 1.0迭代器

Bio.UniProt.GOA.gafbyproteiniterator(handle)

迭代基因关联文件中的记录。

返回具有相同DB_OBJECT_ID的所有连续记录的列表。应调用此函数来读取gene_Association.goa_UniProt文件。读取第一条记录并根据需要返回GAF 2.0或GAF 1.0迭代器2016-04-09:添加了GAF 2.1迭代器并修复了迭代器赋值中的错误,同时GAF 2.1使用GAF 2.0迭代器

Bio.UniProt.GOA.gafiterator(handle)

迭代GAF 1.0或2.0文件。

应该调用此函数来读取gene_Association.goa_UniProt文件。读取第一条记录,并根据需要返回GAF2.0或GAF1.0迭代器

示例:打开、阅读、互动和过滤结果。

原始数据文件已裁剪为~600行。

原始源ftp://ftp.ebi.ac.uk/pub/databases/GO/goa/YEAST/goa_yeast.gaf.gz

>>> from Bio.UniProt.GOA import gafiterator, record_has
>>> Evidence = {'Evidence': set(['ND'])}
>>> Synonym = {'Synonym': set(['YA19A_YEAST', 'YAL019W-A'])}
>>> Taxon_ID = {'Taxon_ID': set(['taxon:559292'])}
>>> with open('UniProt/goa_yeast.gaf', 'r') as handle:
...     for rec in gafiterator(handle):
...         if record_has(rec, Taxon_ID) and record_has(rec, Evidence) and record_has(rec, Synonym):
...             for key in ('DB_Object_Name', 'Evidence', 'Synonym', 'Taxon_ID'):
...                 print(rec[key])
...
Putative uncharacterized protein YAL019W-A
ND
['YA19A_YEAST', 'YAL019W-A']
['taxon:559292']
Putative uncharacterized protein YAL019W-A
ND
['YA19A_YEAST', 'YAL019W-A']
['taxon:559292']
Putative uncharacterized protein YAL019W-A
ND
['YA19A_YEAST', 'YAL019W-A']
['taxon:559292']
Bio.UniProt.GOA.writerec(outrec, handle, fields=GAF20FIELDS)

将单个UniProt-Goa记录写入输出流。

呼叫者应该知道格式版本。默认值:GAF-2.0如果标题有值,则假定这是第一条记录,写入标题。

Bio.UniProt.GOA.writebyproteinrec(outprotrec, handle, fields=GAF20FIELDS)

将GAF记录列表写入输出流。

呼叫者应该知道格式版本。默认值:GAF-2.0如果标题有值,则假定这是第一条记录,写入标题。通常,该列表是由fafbyprotein rec读取的列表,它包含具有相同DB_OBJECT_ID的所有连续行

Bio.UniProt.GOA.record_has(inrec, fieldvals)

接受记录和字段值字典。

格式为{‘field_name’:set( [val1、val2] )}。如果记录中的任何字段具有匹配值,则函数返回True。否则,返回FALSE。