biotite.structure.io.mmtf.get_structure¶
- biotite.structure.io.mmtf.get_structure(file, model=None, altloc=[], extra_fields=[], include_bonds=False)[source]¶
Get an
AtomArray
orAtomArrayStack
from the MMTF file.- Parameters:
- fileMMTFFile
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.- 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 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 resultingAtomArray
containing the bond information from the file.
- Returns:
- arrayAtomArray or AtomArrayStack
The return type depends on the model parameter.
Examples
>>> import os.path >>> file = MMTFFile.read(os.path.join(path_to_structures, "1l2y.mmtf")) >>> array = get_structure(file, model=1) >>> print(array.array_length()) 304 >>> stack = get_structure(file) >>> print(stack.stack_depth(), stack.array_length()) 38 304
Gallery¶

Visualization of normal modes from an elastic network model

Structural alignment of lysozyme variants using ‘Protein Blocks’

Four ways to get the secondary structure of a protein