Skip to content

Are cif Documents from Structure and read directly from filesystem equal? #168

Closed Answered by wojdyr
hlvlad asked this question in Q&A
Discussion options

You must be logged in to vote

To preserve Document you can read the structure in two steps:

doc = gemmi.cif.read('./3gqc.cif')
structure = gemmi.make_structure_from_block(doc[0])

The same is done internally in read_structure(), except that Document is not preserved.
(Update 2023: you can call read_structure() with option save_doc to preserve Document.)

Then, after changing the structure, you can modify only selected categories in cif:

groups = gemmi.MmcifOutputGroups(False)  # False -> start with all groups disabled
groups.atoms = True  # enable _atom_site and _atom_site_anisotrop
structure.update_mmcif_block(doc[0], groups)

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@lobnaOmar20
Comment options

@wojdyr
Comment options

@lobnaOmar20
Comment options

@wojdyr
Comment options

@lobnaOmar20
Comment options

Answer selected by hlvlad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants