Bio.SeqIO.AceIO模块

Bio.SeqIO支持“ace”文件格式。

您需要通过Bio.SeqIO功能使用此模块。另请参阅Bio.Sequencing.Ace模块,它提供的不仅仅是访问ACE文件中的重叠群共识序列作为SeqRecord对象。

class Bio.SeqIO.AceIO.AceIterator(source: IO[str] | PathLike | str | bytes)

基类:SequenceIterator

从ACE文件返回SeqRecord对象。

modes = 't'
__init__(source: IO[str] | PathLike | str | bytes) None

迭代从ACE文件读取的SeqRecord对象。

论点:
  • 源-以文本模式打开的输入流,或文件的路径

这使用生物测序。ACE模块来完成这项艰巨的工作。 请注意,通过在单个通道中迭代文件,我们被迫忽略任何WA,CT,RT或WR页脚标记。

Ace文件包括每个位置的基本质量,这些质量被视为PHRED风格的分数。就像您使用Bio.SeqIO使用PHRED分数阅读FASTQ或QUAL文件一样,这些分数存储在SeqRecord的letter_annotations字典中的“phred_quality”键下。

>>> from Bio import SeqIO
>>> with open("Ace/consed_sample.ace") as handle:
...     for record in SeqIO.parse(handle, "ace"):
...         print("%s %s... %i" % (record.id, record.seq[:10], len(record)))
...         print(max(record.letter_annotations["phred_quality"]))
Contig1 agccccgggc... 1475
90

然而,ACE文件不包括共识序列中任何缺口的碱基质量,并且这些在Biopython中以零质量表示。使用零可能具有误导性,因为可能有非常强有力的证据支持共识中的差距。因此,Biopython的早期版本使用了无,但这种使用很复杂,并且阻止了将间隔序列输出为FASTQ格式。

>>> from Bio import SeqIO
>>> with open("Ace/contig1.ace") as handle:
...     for record in SeqIO.parse(handle, "ace"):
...         print("%s ...%s..." % (record.id, record.seq[85:95]))
...         print(record.letter_annotations["phred_quality"][85:95])
...         print(max(record.letter_annotations["phred_quality"]))
Contig1 ...AGAGG-ATGC...
[57, 57, 54, 57, 57, 0, 57, 72, 72, 72]
90
Contig2 ...GAATTACTAT...
[68, 68, 68, 68, 68, 68, 68, 68, 68, 68]
90
__next__()

返回下一个SeqRecord。

此方法必须由子类实现。

__abstractmethods__ = frozenset({})
__annotations__ = {}
__firstlineno__ = 22
__parameters__ = ()
__static_attributes__ = ('ace_contigs',)