當前位置: 首頁>>代碼示例>>Python>>正文


Python SffWriter._key_sequence方法代碼示例

本文整理匯總了Python中Bio.SeqIO.SffIO.SffWriter._key_sequence方法的典型用法代碼示例。如果您正苦於以下問題:Python SffWriter._key_sequence方法的具體用法?Python SffWriter._key_sequence怎麽用?Python SffWriter._key_sequence使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Bio.SeqIO.SffIO.SffWriter的用法示例。


在下文中一共展示了SffWriter._key_sequence方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: list

# 需要導入模塊: from Bio.SeqIO.SffIO import SffWriter [as 別名]
# 或者: from Bio.SeqIO.SffIO.SffWriter import _key_sequence [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):
     assert str(old.seq) == str(new.seq)
開發者ID:BioGeek,項目名稱:biopython,代碼行數:33,代碼來源:test_SffIO.py


注:本文中的Bio.SeqIO.SffIO.SffWriter._key_sequence方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。