Bio.PDB.mmcifio 模組

寫入一個 mmCIF 檔案。

請參考 https://www.iucr.org/resources/cif/spec/version1.1/cifsyntax 以了解語法。

class Bio.PDB.mmcifio.MMCIFIO

基底類別: StructureIO

將 Structure 物件或 mmCIF 字典寫入為 mmCIF 檔案。

範例

>>> from Bio.PDB import MMCIFParser
>>> from Bio.PDB.mmcifio import MMCIFIO
>>> parser = MMCIFParser()
>>> structure = parser.get_structure("1a8o", "PDB/1A8O.cif")
>>> io=MMCIFIO()
>>> io.set_structure(structure)
>>> io.save("bio-pdb-mmcifio-out.cif")
>>> import os
>>> os.remove("bio-pdb-mmcifio-out.cif")  # tidy up
__init__()

初始化。

set_dict(dic)

設定要寫出的 mmCIF 字典。

save(filepath, select=_select, preserve_atom_numbering=False)

將結構儲存到檔案。

參數:
  • filepath (字串檔案控制代碼) – 輸出檔案

  • select (物件) – 選擇要寫入的實體。

通常 select 是 L{Select} 的子類別,它應該具有以下方法

  • accept_model(model)

  • accept_chain(chain)

  • accept_residue(residue)

  • accept_atom(atom)

如果實體要寫出,這些方法應傳回 1,否則傳回 0。