get_assembly
#
- biotite.structure.io.pdbx.get_assembly(pdbx_file, assembly_id=None, model=None, data_block=None, altloc='first', extra_fields=None, use_author_fields=True, include_bonds=False)[source]#
Build the given biological assembly.
This function receives the data from the
pdbx_struct_assembly_gen
,pdbx_struct_oper_list
andatom_site
categories in the file. Consequently, these categories must be present in the file.- Parameters:
- pdbx_fileCIFFile or CIFBlock or BinaryCIFFile or BinaryCIFBlock
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 insted of the first model. If this parameter is omitted, anAtomArrayStack
containing all models will be returned, even if the structure contains only one model.- data_blockstr, optional
The name of the data block. Default is the first (and most times only) data block of the file. If the data block object is passed directly to pdbx_file, this parameter is ignored.
- 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, thealtloc_id
annotation array is added to the returned structure.
- extra_fieldslist of str, optional
The strings in the list are entry names, that are additionally added as annotation arrays. The annotation category name will be the same as the PDBx subcategory name. The array type is always str. An exception are the special field identifiers:
'atom_id'
,'b_factor'
,'occupancy'
and'charge'
. These will convert the fitting subcategory into an annotation array with reasonable type.- use_author_fieldsbool, optional
Some fields can be read from two alternative sources, for example both,
label_seq_id
andauth_seq_id
describe the ID of the residue. While, thelabel_xxx
fields can be used as official pointers to other categories in the file, theauth_xxx
fields are set by the author(s) of the structure and are consistent with the corresponding values in PDB files. If use_author_fields is true, the annotation arrays will be read from theauth_xxx
fields (if applicable), otherwise from the thelabel_xxx
fields.- include_bondsbool, optional
If set to true, a
BondList
will be created for the resultingAtomArray
containing the bond information from the file. Bonds, whose order could not be determined from the Chemical Component Dictionary (e.g. especially inter-residue bonds), haveBondType.ANY
, since the PDB format itself does not support bond orders.
- Returns:
- assemblyAtomArray or AtomArrayStack
The assembly. The return type depends on the model parameter.
Examples
>>> import os.path >>> file = CIFFile.read(os.path.join(path_to_structures, "1f2n.cif")) >>> assembly = get_assembly(file, model=1)
Gallery#
Biological assembly of a structure