biotite.structure.io.mmtf.get_assembly

biotite.structure.io.mmtf.get_assembly(file, assembly_id=None, model=None, altloc='first', extra_fields=[], include_bonds=False)[source]

Build the given biological assembly.

This function receives the data from bioAssemblyList field in the file. Consequently, this field must be present in the file.

Parameters
fileMMTFFile

The file object.

assembly_idstr

The assembly to build. Available assembly IDs can be obtained via list_assemblies().

modelint, optional

If this parameter is given, the function will return an AtomArray from the atoms corresponding to the given model number (starting at 1). Negative values are used to index models starting from the last model instead of the first model. If this parameter is omitted, an AtomArrayStack containing all models will be returned, even if the structure contains only one model.

altloc{‘first’, ‘occupancy’, ‘all’}
This parameter defines how altloc IDs are handled:
  • 'first' - Use atoms that have the first

    altloc ID appearing in a residue.

  • 'occupancy' - Use atoms that have the altloc ID

    with the highest occupancy for a residue.

  • 'all' - Use all atoms.

    Note that this leads to duplicate atoms. When this option is chosen, the altloc_id annotation array is added to the returned structure.

extra_fieldslist of str, optional

The strings in the list are optional annotation categories that should be stored in the output array or stack. These are valid values: 'atom_id', 'b_factor', 'occupancy' and 'charge'.

include_bondsbool, optional

If set to true, a BondList will be created for the resulting AtomArray containing the bond information from the file. All bonds have BondType.ANY, since the PDB format does not support bond orders.

Returns
assemblyAtomArray or AtomArrayStack

The assembly. The return type depends on the model parameter.

Raises
NotImplementedError

If any transformation required by the assembly only affects a part of the atoms (not every chain) and the number of chains as detected by get_chain_count() is different from the chainNameList field. This limitation of this function exists, as the AtomArray of the asymmetric unit used for constructing the assembly has not the chain index information required by the bioAssemblyList field. In short, get_assembly() does not work for a significant portion of the PDB. If you require reliable assembly building for any PDB entry, you should use the analogous function for PDB or mmCIF files instead.

Examples

>>> import os.path
>>> file = MMTFFile.read(os.path.join(path_to_structures, "1f2n.mmtf"))
>>> assembly = get_assembly(file, model=1)