Bio. DBC.实体模块
剩余类、链类、模型类和结构类的基本类。
它是一个简单的容器类,具有类似列表和字典的属性。
- class Bio.PDB.Entity.Entity(id)
基类:
Generic
[_Parent
,_Child
]PDB层次结构的基本容器对象。
结构、模型、链和剩余是实体的子集。它处理存储和查找。
- level: str
- __init__(id)
初始化课程。
- parent: _Parent | None
- child_list: list[_Child]
- child_dict: dict[Any, _Child]
- __len__()
返回孩子人数。
- __getitem__(id)
带着给定身份证归还孩子。
- __delitem__(id)
带走一个孩子。
- __contains__(id)
检查是否存在具有给定id的子元素。
- __iter__()
迭代儿童。
- __eq__(other)
平等测试。这会比较full_id,包括所有父母的ID。
- __ne__(other)
不平等性测试。
- __gt__(other)
测试大于。
- __ge__(other)
测试更大或等于。
- __lt__(other)
测试少于。
- __le__(other)
测试更少或等于。
- __hash__()
散列方法允许唯一性(设置)。
- property id
返回标识符。
- strictly_equals(other: _Self, compare_coordinates: bool = False) bool
将此实体与其他实体进行比较,以确定是否平等。
将此实体的子实体与其他实体的子实体进行循环比较。比较大多数属性,包括名称和ID。
- 参数:
other (Entity) -- 要与此实体进行比较的实体
compare_coordinates (bool) -- 是否比较原子坐标
- 返回:
两个实体是否严格平等
- 返回类型:
bool
- get_level()
返回层次结构中的级别。
A -原子R -残基C -链M -模型S -结构
- set_parent(entity: _Parent)
设置父实体对象。
- detach_parent()
分离父母。
- detach_child(id)
带走一个孩子。
- add(entity: _Child)
将子项添加到实体。
- insert(pos: int, entity: _Child)
将子项添加到实体的指定位置。
- get_iterator()
在子级上返回迭代器。
- get_list()
返回孩子名单的副本。
- has_id(id)
检查是否存在具有给定id的孩子。
- get_parent()
返回父实体对象。
- get_id()
返回id。
- get_full_id()
返回完整的id。
完整id是一个元组,包含从顶部对象(Structure)到当前对象的所有id。一个Residue对象的完整id例如是这样的:
(“1abc”,0,“A”,(“”,10,“A”))
这相当于:
id为“1abc”的结构id为0的模型id为“A”的链剩余id为(“”,10,“A”)
残基id表明该残基不是异源残基(或水),因为它具有空白异源字段,其序列标识符是10,其插入代码是“A”。
- transform(rot, tran)
将旋转和平移应用于原子坐标。
- 参数:
rot (3x3 NumPy array) -- 右乘旋转矩阵
tran (size 3 NumPy array) -- 平移向量
示例
这是一个不完整但具有说明性的例子::
from numpy import pi, array from Bio.PDB.vectors import Vector, rotmat rotation = rotmat(pi, Vector(1, 0, 0)) translation = array((0, 0, 1), 'f') entity.transform(rotation, translation)
- center_of_mass(geometric=False)
将实体的重心返回为numpy数组。
如果geographical为True,则返回几何形状的中心。
- copy()
递归复制实体。
- __annotations__ = {'child_dict': dict[typing.Any, ~_Child], 'child_list': list[~_Child], 'level': <class 'str'>, 'parent': typing.Optional[~_Parent]}
- __firstlineno__ = 35
- __orig_bases__ = (typing.Generic[~_Parent, ~_Child],)
- __parameters__ = (~_Parent, ~_Child)
- __static_attributes__ = ('_id', 'child_dict', 'child_list', 'full_id', 'parent', 'xtra')
- class Bio.PDB.Entity.DisorderedEntityWrapper(id)
基类:
object
将等效实体分组的包装类。
这个类是一个简单的包装类,它将许多等效的实体分组,并将所有方法调用转发到其中一个实体(当前选定的对象)。DisorderedResidue和DisorderedAtom是这个类的子类。
例如:DisorderedAtom对象包含多个Atom对象,其中每个Atom对象代表结构中无序原子的特定位置。
- __init__(id)
初始化课程。
- __getattr__(method)
将方法调用转发到选定的子级。
- __getitem__(id)
使用给定的id返回孩子。
- __setitem__(id, child)
添加与某个id关联的孩子。
- __contains__(id)
检查孩子是否有给定的ID。
- __iter__()
返回孩子人数。
- __len__()
返回孩子人数。
- __sub__(other)
用另一个对象减去。
- __gt__(other)
如果孩子大于其他孩子,则返回。
- __ge__(other)
如果孩子大于或等于其他孩子,则返回。
- __lt__(other)
如果孩子小于其他孩子,则返回。
- __le__(other)
如果孩子小于或等于其他孩子,则返回。
- copy()
循环复制混乱的实体。
- get_id()
返回id。
- strictly_equals(other: DisorderedEntityWrapper, compare_coordinates: bool = False) bool
使用严格的平等定义将此实体与其他实体进行比较。
将此实体的子实体与其他实体的子实体进行循环比较。比较大多数属性,包括选定的子项、名称和ID。
- 参数:
other (DisorderedEntityWrapper) -- 要与此实体进行比较的实体
compare_coordinates (bool) -- 是否比较原子坐标
- 返回:
两个实体是否严格平等
- 返回类型:
bool
- disordered_has_id(id)
检查是否存在与此id关联的对象。
- detach_parent()
分离父母。
- get_parent()
返回父级。
- set_parent(parent)
设置对象及其子级的父级。
- disordered_select(id)
选择具有给定id的对象作为当前活动对象。
未捕获的方法调用将转发到所选子对象。
- disordered_add(child)
添加无序条目。
这是由DisorderedAtom和DisorderedResidue实现的。
- disordered_remove(child)
删除混乱的条目。
这是由DisorderedAtom和DisorderedResidue实现的。
- __annotations__ = {}
- __firstlineno__ = 400
- __static_attributes__ = ('child_dict', 'id', 'parent', 'selected_child')
- is_disordered()
返回2,指示此实体是实体的集合。
- disordered_get_id_list()
返回一个ID列表。
- disordered_get(id=None)
获取与id关联的子对象。
如果id为无,则返回当前选择的子项。
- disordered_get_list()
返回孩子名单。