本文整理匯總了Python中Bio.SeqIO.SffIO.SffWriter._index_length方法的典型用法代碼示例。如果您正苦於以下問題:Python SffWriter._index_length方法的具體用法?Python SffWriter._index_length怎麽用?Python SffWriter._index_length使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bio.SeqIO.SffIO.SffWriter
的用法示例。
在下文中一共展示了SffWriter._index_length方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: list
# 需要導入模塊: from Bio.SeqIO.SffIO import SffWriter [as 別名]
# 或者: from Bio.SeqIO.SffIO.SffWriter import _index_length [as 別名]
# 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")))
for old, new in zip(records, records2):