Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions esm/utils/structure/molecular_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,10 @@ def to_mmcif(self) -> str:
atom_array.atom_name = np.array(atom_names, dtype="U4")
atom_array.add_annotation("b_factor", dtype=float)
atom_array.b_factor = atom_bfactors
atom_array.add_annotation("occupancy", dtype=float)
atom_array.occupancy = np.ones(
n_atoms, dtype=np.float32
) # Necessary for BioPython MMCIFParser
atom_array.add_annotation("entity_id", dtype=int)
atom_array.entity_id = atom_entity_ids

Expand Down
2 changes: 2 additions & 0 deletions esm/utils/structure/protein_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def atom_array(self) -> bs.AtomArray:
atom_name=residue_constants.atom_types[i],
element=residue_constants.atom_types[i][0],
b_factor=float(b_factor),
occupancy=1.0, # Necessary for BioPython MMCIFParser
)
atoms.append(atom)
return bs.array(atoms)
Expand Down Expand Up @@ -262,6 +263,7 @@ def atom_array_no_insertions(self) -> bs.AtomArray:
atom_name=residue_constants.atom_types[i],
element=residue_constants.atom_types[i][0],
b_factor=float(b_factor),
occupancy=1.0, # Necessary for BioPython MMCIFParser
)
atoms.append(atom)
return bs.array(atoms)
Expand Down
Loading