IMP Reference Guide
develop.63b38c487d,2024/12/25
The Integrative Modeling Platform
|
Stores a named protein chain. More...
Inherits _SystemBase.
Stores a named protein chain.
This class is constructed from within the State class. It wraps an IMP.atom.Molecule and IMP.atom.Copy. Structure is read using this class. Resolutions and copies can be registered, but are only created when build() is called.
A Molecule acts like a simple Python list of residues, and can be indexed by integer (starting at zero) or by string (starting at 1).
Definition at line 394 of file pmi/topology/__init__.py.
Public Member Functions | |
def | __init__ |
The user should not call this directly; instead call State.create_molecule() More... | |
def | add_representation |
Set the representation for some residues. More... | |
def | add_structure |
Read a structure and store the coordinates. More... | |
def | build |
Create all parts of the IMP hierarchy including Atoms, Residues, and Fragments/Representations and, finally, Copies. More... | |
def | create_clone |
Create a Molecule clone (automatically builds same structure and representation) More... | |
def | create_copy |
Create a new Molecule with the same name and sequence but a higher copy number. More... | |
def | get_atomic_residues |
Return a set of TempResidues that have associated structure coordinates. More... | |
def | get_hierarchy |
Return the IMP Hierarchy corresponding to this Molecule. More... | |
def | get_ideal_helices |
Returns list of OrderedSets with requested ideal helices. More... | |
def | get_name |
Return this Molecule name. More... | |
def | get_non_atomic_residues |
Return a set of TempResidues that don't have associated structure coordinates. More... | |
def | get_particles_at_all_resolutions |
Helpful utility for getting particles at all resolutions from this molecule. More... | |
def | get_represented |
Return set of TempResidues that have representation. More... | |
def | get_residues |
Return all modeled TempResidues as a set. More... | |
def | get_state |
Return the State containing this Molecule. More... | |
def | residue_range |
Get residue range from a to b, inclusive. More... | |
def IMP.pmi.topology.Molecule.__init__ | ( | self, | |
state, | |||
name, | |||
sequence, | |||
chain_id, | |||
copy_num, | |||
mol_to_clone = None , |
|||
alphabet = IMP.pmi.alphabets.amino_acid , |
|||
uniprot = None |
|||
) |
The user should not call this directly; instead call State.create_molecule()
state | The parent PMI State |
name | The name of the molecule (string) |
sequence | Sequence (string) |
chain_id | The chain of this molecule |
copy_num | Store the copy number |
mol_to_clone | The original molecule (for cloning ONLY) |
Definition at line 406 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.add_representation | ( | self, | |
residues = None , |
|||
resolutions = [] , |
|||
bead_extra_breaks = [] , |
|||
bead_ca_centers = True , |
|||
bead_default_coord = [0 , |
|||
density_residues_per_component = None , |
|||
density_prefix = None , |
|||
density_force_compute = False , |
|||
density_voxel_size = 1.0 , |
|||
setup_particles_as_densities = False , |
|||
ideal_helix = False , |
|||
color = None |
|||
) |
Set the representation for some residues.
Some options (beads, ideal helix) operate along the backbone. Others (density options) are volumetric. Some of these you can combine e.g., beads+densities or helix+densities See Resolution in PMI
residues | Set of PMI TempResidues for adding the representation. Can use Molecule slicing to get these, e.g. mol[a:b]+mol[c:d] If None, will select all residues for this Molecule. |
resolutions | Resolutions for beads representations. If structured, will average along backbone, breaking at sequence breaks. If unstructured, will just create beads. Pass an integer or list of integers |
bead_extra_breaks | Additional breakpoints for splitting beads. The value can be the 0-ordered position, after which it'll insert the break. Alternatively pass PDB-style (1-ordered) indices as a string. I.e., bead_extra_breaks=[5,25] is the same as ['6','26'] |
bead_ca_centers | Set to True if you want the resolution=1 beads to be at CA centers (otherwise will average atoms to get center). Defaults to True. |
bead_default_coord | Advanced feature. Normally beads are placed at the nearest structure. If no structure provided (like an all bead molecule), the beads go here. |
density_residues_per_component | Create density (Gaussian Mixture Model) for these residues. Must also supply density_prefix |
density_prefix | Prefix (assuming '.txt') to read components from or write to. If exists, will read unless you set density_force_compute=True. Will also write map (prefix+'.mrc'). Must also supply density_residues_per_component. |
density_force_compute | Set true to force overwrite density file. |
density_voxel_size | Advanced feature. Set larger if densities taking too long to rasterize. Set to 0 if you don't want to create the MRC file |
setup_particles_as_densities | Set to True if you want each particle to be its own density. Useful for all-atom models or flexible beads. Mutually exclusive with density_ options |
ideal_helix | Create idealized helix structures for these residues at resolution 1. Any other resolutions passed will be coarsened from there. Resolution 0 will not work; you may have to use MODELLER to do that (for now). |
color | the color applied to the hierarchies generated. Format options: tuple (r,g,b) with values 0 to 1; float (from 0 to 1, a map from Blue to Green to Red); a Chimera name; a hex RGB string (e.g. "#ff0000"); an IMP.display.Color object |
Definition at line 628 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.add_structure | ( | self, | |
pdb_fn, | |||
chain_id, | |||
res_range = [] , |
|||
offset = 0 , |
|||
model_num = None , |
|||
ca_only = False , |
|||
soft_check = False |
|||
) |
Read a structure and store the coordinates.
pdb_fn | The file to read (in PDB or mmCIF format) |
chain_id | Chain ID to read |
res_range | Add only a specific set of residues from the PDB file. res_range[0] is the starting and res_range[1] is the ending residue index. |
offset | Apply an offset to the residue indexes of the PDB file. This number is added to the PDB sequence. PMI uses 1-based FASTA numbering internally (the first residue in the sequence is numbered 1, and so on). If the PDB chain is not also numbered starting from 1, apply an offset to make it match the FASTA. For example, if the PDB is numbered starting from -5, use an offset of 6 (-5 + 6 = 1). |
model_num | Read multi-model PDB and return that model |
ca_only | Only read the CA positions from the PDB file |
soft_check | If True, it only warns if there are sequence mismatches between the PDB and the Molecule (FASTA) sequence, and uses the sequence from the PDB. If False (Default), it raises an error when there are sequence mismatches. |
Definition at line 565 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.build | ( | self, | |
protocol_output = True |
|||
) |
Create all parts of the IMP hierarchy including Atoms, Residues, and Fragments/Representations and, finally, Copies.
Will only build requested representations.
Definition at line 826 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.create_clone | ( | self, | |
chain_id | |||
) |
Create a Molecule clone (automatically builds same structure and representation)
chain_id | If you want to set the chain ID of the copy to something |
Definition at line 539 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.create_copy | ( | self, | |
chain_id | |||
) |
Create a new Molecule with the same name and sequence but a higher copy number.
Returns the Molecule. No structure or representation will be copied!
chain_id | Chain ID of the new molecule |
Definition at line 526 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.get_atomic_residues | ( | self | ) |
Return a set of TempResidues that have associated structure coordinates.
Definition at line 508 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.get_hierarchy | ( | self | ) |
Return the IMP Hierarchy corresponding to this Molecule.
Definition at line 469 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.get_ideal_helices | ( | self | ) |
Returns list of OrderedSets with requested ideal helices.
Definition at line 481 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.get_name | ( | self | ) |
Return this Molecule name.
Definition at line 473 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.get_non_atomic_residues | ( | self | ) |
Return a set of TempResidues that don't have associated structure coordinates.
Definition at line 517 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.get_particles_at_all_resolutions | ( | self, | |
residue_indexes = None |
|||
) |
Helpful utility for getting particles at all resolutions from this molecule.
Can optionally pass a set of residue indexes
Definition at line 926 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.get_represented | ( | self | ) |
Return set of TempResidues that have representation.
Definition at line 504 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.get_residues | ( | self | ) |
Return all modeled TempResidues as a set.
Definition at line 499 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.get_state | ( | self | ) |
Return the State containing this Molecule.
Definition at line 477 of file pmi/topology/__init__.py.
def IMP.pmi.topology.Molecule.residue_range | ( | self, | |
a, | |||
b, | |||
stride = 1 |
|||
) |
Get residue range from a to b, inclusive.
Use integers to get 0-indexing, or strings to get PDB-indexing
Definition at line 485 of file pmi/topology/__init__.py.