pestifer.core.objmanager module¶
A dictionary object for containing all objs from a task specification. Objs are objects that handle various modifications
to a molecular structure, such as cleavages, translations, rotations, and so on. These are all defined in the pestifer.objs subpackage.
This module defines the ObjManager class, which is responsible for managing these objects and their organization.
It provides methods for ingesting objects, filtering them, and managing their categories.
The ObjManager inherits from collections.UserDict, allowing it to behave like a dictionary
while providing additional functionality specific to managing molecular objects.
It also includes methods for counting objects, retiring categories, and expelling objects based on specific criteria.
- class pestifer.core.objmanager.ObjManager(input_specs={})[source]¶
Bases:
UserDict[str,UserDict[str,BaseObjList]]A class for initializing and collecting all objs into a single, organized object. Outermost key is the object category and the innermost is the object type name.
- Parameters:
input_specs (dict, optional) – A dictionary of object specifications to be ingested into the ObjManager. If not provided, an empty dictionary is used.
- used¶
A dictionary that stores retired objects, allowing for retrieval of previously used objects.
- Type:
- counts_by_header() dict[source]¶
Counts the number of objects in each category and header. This method logs the counts of objects in each category and header. It iterates through the object classes and their corresponding categories and headers, counting the number of objects in each header within each category.
- expel(expelled_residues: ResidueList) ObjManager[source]¶
Expel all objects that match the given residues from the ObjManager.
- Parameters:
expelled_residues (list) – list of residues to expel; each residue should have a resseqnum and insertion attribute
- Returns:
a new ObjManager containing the expelled objects; the original ObjManager is modified to remove these objects
- Return type:
- filter_copy(condition: Callable[[BaseObj], bool], objnames: list[str] = []) ObjManager[source]¶
Returns a copy of the ObjManager with only the objects that match the given fields.
- Parameters:
- Returns:
a new ObjManager containing only the objects that match the given fields. If no object names are provided, an empty ObjManager is returned.
- Return type: