本文整理汇总了Python中Bio.SeqIO.SffIO.SffWriter._index_start方法的典型用法代码示例。如果您正苦于以下问题:Python SffWriter._index_start方法的具体用法?Python SffWriter._index_start怎么用?Python SffWriter._index_start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bio.SeqIO.SffIO.SffWriter
的用法示例。
在下文中一共展示了SffWriter._index_start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from Bio.SeqIO.SffIO import SffWriter [as 别名]
# 或者: from Bio.SeqIO.SffIO.SffWriter import _index_start [as 别名]
assert len(index) % 8 == 0
# Ugly bit of code to make a fake index at start
records = list(SffIterator(
open("Roche/E3MFGYR02_random_10_reads.sff", "rb")))
out_handle = open(
"Roche/E3MFGYR02_alt_index_at_start.sff", "w")
index = ".diy1.00This is a fake index block (DIY = Do It Yourself), which is allowed under the SFF standard.\0"
padding = len(index) % 8
if padding:
padding = 8 - padding
index += chr(0) * padding
w = SffWriter(out_handle, index=False, xml=None)
# Fake the header...
w._number_of_reads = len(records)
w._index_start = 0
w._index_length = 0
w._key_sequence = records[0].annotations["flow_key"]
w._flow_chars = records[0].annotations["flow_chars"]
w._number_of_flows_per_read = len(w._flow_chars)
w.write_header()
w._index_start = out_handle.tell()
w._index_length = len(index)
out_handle.seek(0)
w.write_header() # this time with index info
w.handle.write(index)
for record in records:
w.write_record(record)
out_handle.close()
records2 = list(SffIterator(
open("Roche/E3MFGYR02_alt_index_at_start.sff", "rb")))