get_structure
#
- biotite.structure.io.pdbx.get_structure(pdbx_file, model=None, data_block=None, altloc='first', extra_fields=None, use_author_fields=True, include_bonds=False)[source]#
Create an
AtomArray
orAtomArrayStack
from theatom_site
category in a file.- Parameters:
- pdbx_fileCIFFile or CIFBlock or BinaryCIFFile or BinaryCIFBlock
The file object.
- 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. If the requested field is not available, the respective other field is taken as fallback.- include_bondsbool, optional
If set to true, a
BondList
will be created for the resultingAtomArray
containing the bond information from the file. Inter-residue bonds, will be read from thestruct_conn
category. Intra-residue bonds will be read from thechem_comp_bond
, if available, otherwise they will be derived from the Chemical Component Dictionary.
- Returns:
- arrayAtomArray or AtomArrayStack
The return type depends on the model parameter.
Examples
>>> import os.path >>> file = CIFFile.read(os.path.join(path_to_structures, "1l2y.cif")) >>> arr = get_structure(file, model=1) >>> print(len(arr)) 304
Gallery#

Mutual information as measure for coevolution of residues

Three ways to get the secondary structure of a protein

Visualization of normal modes from an elastic network model

Multiple Structural alignment of orthologous proteins

Searching for structural homologs in a protein structure database