Bio. DBC.内部_coords模块

支持蛋白质结构内部坐标的类。

内部坐标包括沿着蛋白质骨架的Psi、Omega和Phi二面角、沿着侧链的Chi角以及定义蛋白质链的所有3原子角和键长。 这些例程可以根据原子XYZ坐标计算内部坐标,并根据内部坐标计算原子XYZ坐标。

次要优点包括能够对齐和比较3D结构中的残基环境,支持2D原子距离图,将距离图加上手性信息转换为结构,生成用于3D打印的结构的OpenSCAD描述,以及读取/写入结构作为内部坐标数据文件。

Usage:

from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.Chain import Chain
from Bio.PDB.internal_coords import *
from Bio.PDB.PICIO import write_PIC, read_PIC, read_PIC_seq
from Bio.PDB.ic_rebuild import write_PDB, IC_duplicate, structure_rebuild_test
from Bio.PDB.SCADIO import write_SCAD
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.PDB.PDBIO import PDBIO
import numpy as np

# load a structure as normal, get first chain
parser = PDBParser()
myProtein = parser.get_structure("7rsa", "pdb7rsa.ent")
myChain = myProtein[0]["A"]

# compute bond lengths, angles, dihedral angles
myChain.atom_to_internal_coordinates(verbose=True)

# check myChain makes sense (can get angles and rebuild same structure)
resultDict = structure_rebuild_test(myChain)
assert resultDict['pass'] == True

# get residue 1 chi2 angle
r1 = next(myChain.get_residues())
r1chi2 = r1.internal_coord.get_angle("chi2")

# rotate residue 1 chi2 angle by 120 degrees (loops w/in +/-180)
r1.internal_coord.set_angle("chi2", r1chi2 + 120.0)
# or
r1.internal_coord.bond_rotate("chi2", 120.0)
# update myChain XYZ coordinates with chi2 changed
myChain.internal_to_atom_coordinates()
# write new conformation with PDBIO
write_PDB(myProtein, "myChain.pdb")
# or just the ATOM records without headers:
io = PDBIO()
io.set_structure(myProtein)
io.save("myChain2.pdb")

# write chain as 'protein internal coordinates' (.pic) file
write_PIC(myProtein, "myChain.pic")
# read .pic file
myProtein2 = read_PIC("myChain.pic")

# create default structure for random sequence by reading as .pic file
myProtein3 = read_PIC_seq(
    SeqRecord(
        Seq("GAVLIMFPSTCNQYWDEHKR"),
        id="1RND",
        description="my random sequence",
    )
)
myProtein3.internal_to_atom_coordinates()
write_PDB(myProtein3, "myRandom.pdb")

# access the all-dihedrals array for the chain, e.g. residue 1 chi2 angle:
r1chi2_obj = r1.internal_coord.pick_angle("chi2")
# or same thing: r1chi2_obj = r1.internal_coord.pick_angle("CA:CB:CG:CD")
r1chi2_key = r1chi2_obj.atomkeys
# r1chi2_key is tuple of AtomKeys (1_K_CA, 1_K_CB, 1_K_CG, 1_K_CD)
r1chi2_index = myChain.internal_coord.dihedraNdx[r1chi2_key]
# or same thing: r1chi2_index = r1chi2_obj.ndx
r1chi2_value = myChain.internal_coord.dihedraAngle[r1chi2_index]
# also true: r1chi2_obj == myChain.internal_coord.dihedra[r1chi2_index]

# access the array of all atoms for the chain, e.g. residue 1 C-beta
r1_cBeta_index = myChain.internal_coord.atomArrayIndex[AtomKey("1_K_CB")]
r1_cBeta_coords = myChain.internal_coord.atomArray[r1_cBeta_index]
# r1_cBeta_coords = [ x, y, z, 1.0 ]

# the Biopython Atom coord array is now a view into atomArray, so
assert r1_cBeta_coords[1] == r1["CB"].coord[1]
r1_cBeta_coords[1] += 1.0  # change the Y coord 1 angstrom
assert r1_cBeta_coords[1] == r1["CB"].coord[1]
# they are always the same (they share the same memory)
r1_cBeta_coords[1] -= 1.0  # restore

# create a selector to filter just the C-alpha atoms from the all atom array
atmNameNdx = AtomKey.fields.atm
atomArrayIndex = myChain.internal_coord.atomArrayIndex
CaSelect = [
    atomArrayIndex.get(k) for k in atomArrayIndex.keys() if k.akl[atmNameNdx] == "CA"
]
# now the ordered array of C-alpha atom coordinates is:
CA_coords = myChain.internal_coord.atomArray[CaSelect]
# note this uses Numpy fancy indexing, so CA_coords is a new copy

# create a C-alpha distance plot
caDistances = myChain.internal_coord.distance_plot(CaSelect)
# display with e.g. MatPlotLib:
# import matplotlib.pyplot as plt
# plt.imshow(caDistances, cmap="hot", interpolation="nearest")
# plt.show()

# build structure from distance plot:
## create the all-atom distance plot
distances = myChain.internal_coord.distance_plot()
## get the sign of the dihedral angles
chirality = myChain.internal_coord.dihedral_signs()
## get new, empty data structure : copy data structure from myChain
myChain2 = IC_duplicate(myChain)[0]["A"]
cic2 = myChain2.internal_coord
## clear the new atomArray and di/hedra value arrays, just for proof
cic2.atomArray = np.zeros((cic2.AAsiz, 4), dtype=np.float64)
cic2.dihedraAngle[:] = 0.0
cic2.hedraAngle[:] = 0.0
cic2.hedraL12[:] = 0.0
cic2.hedraL23[:] = 0.0
## copy just the first N-Ca-C coords so structures will superimpose:
cic2.copy_initNCaCs(myChain.internal_coord)
## copy distances to chain arrays:
cic2.distplot_to_dh_arrays(distances, chirality)
## compute angles and dihedral angles from distances:
cic2.distance_to_internal_coordinates()
## generate XYZ coordinates from internal coordinates:
myChain2.internal_to_atom_coordinates()
## confirm result atomArray matches original structure:
assert np.allclose(cic2.atomArray, myChain.internal_coord.atomArray)

# superimpose all phe-phe pairs - quick hack just to demonstrate concept
# for analyzing pairwise residue interactions.  Generates PDB ATOM records
# placing each PHE at origin and showing all other PHEs in environment
## shorthand for key variables:
cic = myChain.internal_coord
resNameNdx = AtomKey.fields.resname
aaNdx = cic.atomArrayIndex
## select just PHE atoms:
pheAtomSelect = [aaNdx.get(k) for k in aaNdx.keys() if k.akl[resNameNdx] == "F"]
aaF = cic.atomArray[ pheAtomSelect ]  # numpy fancy indexing makes COPY not view

for ric in cic.ordered_aa_ic_list:  # internal_coords version of get_residues()
    if ric.rbase[2] == "F":  # if PHE, get transform matrices for chi1 dihedral
        chi1 = ric.pick_angle("N:CA:CB:CG")  # chi1 space has C-alpha at origin
        cst = np.transpose(chi1.cst)  # transform TO chi1 space
        # rcst = np.transpose(chi1.rcst)  # transform FROM chi1 space
        cic.atomArray[pheAtomSelect] = aaF.dot(cst)  # transform just the PHEs
        for res in myChain.get_residues():  # print PHEs in new coordinate space
            if res.resname in ["PHE"]:
                print(res.internal_coord.pdb_residue_string())
        cic.atomArray[pheAtomSelect] = aaF  # restore coordinate space from copy

# write OpenSCAD program of spheres and cylinders to 3d print myChain backbone
## set atom load filter to accept backbone only:
IC_Residue.accept_atoms = IC_Residue.accept_backbone
## delete existing data to force re-read of all atoms:
myChain.internal_coord = None
write_SCAD(myChain, "myChain.scad", scale=10.0)

看到 ''Internal coordinates module''Biopython Tutorial and Cookbook 供进一步讨论。

Terms and key data structures: 内部坐标定义在跨越残基或沿着侧链遵循公认的命名法的原子序列上。 为了管理这些序列并支持Biopython的疾病机制, AtomKey 实现说明符以捕获单个对象中的残基、原子和变体标识。 一 Hedron 对象被指定为三个顺序的AtomKeys,包括两个键长和它们之间的键角。 一 Dihedron 由四个顺序的AtomKeys组成,将两个Hedra连接起来,它们之间有二面角。

Algorithmic overview: 内部坐标模块将连接原子的规范结合在 ic_data 文件,这里具有例程,用于在局部坐标系和例如在TSB或mmCif数据文件中提供的世界坐标之间转换这些原子集的XYZ坐标。 局部坐标系将面体的中心原子置于原点(0,0,0),一条腿位于+Z轴上,另一条腿位于XZ平面上(请参阅 Hedron ).局部坐标空间中面体和二面体的测量和创建或操纵是简单的,计算出的转换矩阵使得能够从初始N-Ca-C原子的提供(DBC)坐标开始将这些亚基组装成蛋白质链。

Psi和Phi角定义在蛋白质链中邻近残基的原子上,参见例如 pick_angle()ic_data 用于残基和骨架二面角之间的相关映射。

上述二面体局部坐标空间的转换可通过 IC_Chain.dCoordSpaceDihedron 属性.cst和.rcst,并且可以应用于残基及其环境与代码的对齐和比较::

chi1 = ric0.pick_angle("chi1") # chi1 space defined with CA at origin
cst = np.transpose(chi1.cst) # transform TO chi1 local space
newAtomCoords = oldAtomCoords.dot(cst)

核心算法于1993-4年间独立开发, ''Development and Application of a Three-dimensional Description of Amino Acid Environments in Protein,'' Miller, Douthart, and Dunker, Advances in Molecular Bioinformatics, IOS Press, 1994, ISBN 90 5199 172 x, pp. 9-30.

定义蛋白质内部坐标(.pic)文件格式,以捕获足够的细节,以从链起始坐标(第一个残基N、Ca、C XYZ坐标)和剩余内部坐标再现DBC文件。这些文件在内部用于验证给定结构是否可以从其内部坐标重新生成。 看到 PICIO 用于读取和写入.pic文件和 structure_rebuild_test() 确定特定的DBC或mmCif数据是否具有足够的信息来在旋转坐标和内部坐标之间进行相互转换。

内部坐标也可以导出为 OpenSCAD 用于生成3D打印蛋白质模型的数据阵列。 OpenSCAD软件是生成此类模型的起点和概念验证。看到 SCADIO 而这 Thingiverse project 一个更高级的例子。

参阅 distance_plot()distance_to_internal_coordinates() 用于将结构数据转换为2D距离图/从2D距离图转换。

以下类构成处理内部坐标的核心功能,并且充分相关和耦合,以便将它们放在此模块中:

IC_Chain :在.internal_coord属性上扩展Biopython Chain。

管理残基和断链的连接序列;为所有原子坐标和键几何形状保存麻木的数组。对于“并行”处理,IC_Chain方法通过单个numpy命令对这些阵列进行操作。

IC_Residue :在.internal_coord属性上扩展Biopython Residue。

访问内部坐标和连续(逐个残基)组装方法的每个残基视图。

Dihedron :四个相连的原子形成二面角。

二面角、局部坐标空间中的齐次原子坐标、对相关Hedra和IC_Residue的引用。 残基二面角、键角和键长的Getter方法。

Hedron :三个相连的原子形成一个平面。

包含局部坐标空间中的均匀原子坐标以及它们之间的键长和角度。

Edron :Hedron和Dihedron类的基本类。

AtomKeys组包括子级、字符串ID、主线成员资格布尔值以及Hedra和Dihedra常见的其他例程。 实现丰富的比较。

AtomKey :用于引用原子序列的键(字典和字符串)。

捕获残留和无序/占用信息,为.pic文件提供无空格键,并实现丰富的比较。

自定义异常类: HedronMatchErrorMissingAtomError

class Bio.PDB.internal_coords.IC_Chain(parent, verbose: bool = False)

基类:object

使用内部坐标数据扩展Biopython Chain的类。

属性:
chain: object reference

生物蟒蛇 Bio.PDB.Chain.Chain 对象这延伸

MaxPeptideBond: float

Class 用于检测链断裂的属性。检查具有一些非常长键的完全连续链-例如,对于3D打印(OpenSCAD输出)具有缺失残基的结构。 MaxPeptideBond

ParallelAssembleResidues: bool

Class 影响internal_to_atom_coords的属性。短链(50个残基或更少)组装起来更快,无需创建麻木阵列的费用,而且该算法更容易理解和跟踪一次处理单个残基。 清除(设置为False)此标志将切换到序列算法

ordered_aa_ic_list: list

IC_Residue对象internal_coords算法可以处理(例如没有水)

initNCaC: List of N, Ca, C AtomKey tuples (NCaCKeys).

NCaCKey开始链段(第一个残基或链断裂后)。这3个原子定义了连续链段的坐标空间,最初由TSB或mminf文件指定。

AAsiz = int

AtomArray大小,此链中的原子数量

atomArray: numpy array

齐次原子坐标( [x,, y, z, 1.0] 对于链中的每个原子,

atomArrayIndex: dict

将AtomKeys映射到atomArray索引

hedra: dict

Hedra在此链中形成残基;由AtomKeys的3-二元组索引。

hedraLen: int

面纹长度

hedraNdx: dict

将hedra AtomKeys映射到hedra数据数组的数字索引,例如下面的hedraL 12

a2ha_map: [hedraLen x 3]

按hedraNdx顺序排列的原子索引

dihedra: dict

在此链中形成残基的二面体;由AtomKeys的4个字节索引。

dihedraLen: int

二面体铭文的长度

dihedraNdx: dict

将二面体AtomKeys映射到二面体数据数组,例如dihedraAngle

a2da_map[dihedraLen x 4]

AtomNdx的顺序为dihedraNdx

d2a_map[dihedraLen x [4] ]

每个二面体的AtomNdx(重塑a2da_map)

Numpy arrays for vector processing of chain di/hedra:
hedraL12: numpy array

面体第一和第二原子之间的键长

hedraAngle: numpy array

每个面体的键角,单位为度

hedraL23: numpy array

面体第二和第三原子之间的键长

id3_dh_index: dict

将面体关键点映射到从面体开始的二面体列表,由assign和bond_rotate使用来查找具有h1关键点的二面体

id32_dh_index: dict

就像id3_dh_index一样,从h2密钥找到二面体

hAtoms: numpy array

面体的齐次原子坐标(3x 4),中心原子位于原点

hAtomsR: numpy array

反方向的h原子

hAtoms_needs_update: numpy array of bool

指示hAtoms是否代表hedraL 12/A/L23

dihedraAngle: numpy array

每个二面体的二面角(度)

dAtoms: numpy array

二面体的均匀原子坐标(4x4),原点处的第二个原子

dAtoms_needs_update: numpy array of bool

指示dAtoms是否代表dihedraAngle

dCoordSpace: numpy array

标准化第一面体位置的正向和反向变换矩阵。 看到 dCoordSpace .

dcsValid: bool

指示dCoordSpace最新

See also attributes generated by :meth:`build_edraArrays` for indexing
di/hedra data elements.

方法

internal_to_atom_coordinates:

将ic数据处理为Residue/Atom坐标;调用assemble_resides()

assemble_residues:

从内部坐标生成IC_Chain原子坐标(平行)

assemble_residues_ser:

从内部坐标生成IC_Residue原子坐标(序列)

atom_to_internal_coordinates:

计算Atom数据的二面体、角度、键长(内部坐标)

write_SCAD:

为组成链的内部坐标数据编写OpenSCAD矩阵;这是一个支持例程,请参阅 SCADIO.write_SCAD() 生成蛋白质链的OpenSCAD描述。

distance_plot:

使用可选滤镜生成原子间距离的2D图

distance_to_internal_coordinates:

从距离图和二面角符号阵列计算内部坐标。

make_extended:

临时将所有磅/英寸和磅/英寸主干角设置为123和-104度。

MaxPeptideBond = 1.4

比这更大的C-N距离将是断链

ParallelAssembleResidues = True

启用并行内部_to_atom算法,对于短链来说速度较慢

AAsiz = 0

此链中的原子数量(atomArray的大小)

atomArray: array = None

AAsiz x [4] of float np.float64均匀原子坐标,所有原子都在链中。

dCoordSpace = None

[2] [dihedraLen] [4] [4] : 2 arrays of 4x4 coordinate space transforms for each dihedron. The first [0] converts TO standard space with first atom on the XZ plane, the second atom at the origin, the third on the +Z axis, and the fourth placed according to the dihedral angle. The second [1] transform returns FROM the standard space to world coordinates (PDB file input or whatever is current). Also accessible as .cst (forward transform) and .rcst (reverse transform) in Dihedron .

dcsValid = None

如果dCoordSpace是最新的,则为真。 使用 update_dCoordSpace() 如果需要

__init__(parent, verbose: bool = False) None

初始化IC_Chain对象,带或不带residue/Atom数据。

参数:

parent (Bio.PDB.Chain) -- Biopython Chain对象此扩展的Chain对象

__deepcopy__(memo) IC_Chain

为IC_Chain实施深度复制。

clear_ic()

清除此链的残留internal_coord设置。

build_atomArray() None

构建 IC_Chain 来自生物神话原子的麻木坐标阵列。

另见 init_edra() 用于更完整的IC_Chain初始化。

输入:
self.akset设置

AtomKey s在这个链条上

产生:
self.AAsizint

链中的原子数(len(akset))

self.aktupleAasiz x AtomKeys

排序akset AtomKeys

self.atomArrayIndex[AAsiz] 向int

aktuple中每个AtomKey的数字索引

self.atomArrayValidAAsiz x bool

atomArray坐标当前,内部坐标如果为True

self.atomArrayAAsiz x np.float64 [4]

齐次原子坐标; Biopython Atom 执行后将坐标查看到此数组中

rak_cachedict

每个残基的AtomKeys查找缓存

build_edraArrays() None

构建链级面体和二面体阵列。

使用 init_edra()_hedraDict2chain() . 应该是私人方法,但公开以供文档使用。

输入:
self.dihedraLenint

需要的二面体数量

self.hedraLenint

需要的面体数量

self.AAsizint

atomArray的长度

self.hedraNdxdict

将面体关键点映射到范围(hedraLen)

self.dihedraNdxdict

将两面体关键点映射到范围(dihedraLen)

self.hedradict

将Hedra钥匙映射到Hedra以获取链

self.atomArrayAAsiz x np.float64 [4]

链的齐次原子坐标

self.atomArrayIndexdict

将AtomKeys映射到atomArray

self.atomArrayValidAAsiz x bool

表明coord是最新的

产生:
self.dCoordSpace[2] [dihedraLen] [4] [4]

转换到/从二面体坐标空间

self.dcsValiddihedraLen x bool

指示dCoordSpace是当前的

self.hAtomshedraLen x 3 x np.float64 [4]

hCoordSpace中的原子坐标

self.hAtomsRhedraLen x 3 x np.float64 [4]

hAtoms in reverse order(用空间换取时间)

self.hAtoms_needs_update赫德拉伦x布尔

表示hAtoms,hAtoms当前

self.a2h_mapAAsiz x [int ...]

将atomArrayIndex映射到带有该原子的hedraNdx

self.a2ha_map[hedraLen x 3]

AtomNdx按hedraNdx顺序排列

self.h2aa赫德拉·伦x [int ...]

将hedraNdx映射到atomNdx在面体中(稍后重塑)

Hedron.ndxint

self.hedraNdx值存储在Hedron对象内

self.dRevdihedraLen x bool

如果为真,则颠倒二面体

self.dH1ndx,dH2ndx[dihedraLen]

hedraNdx代表第一面体和第二面体

self.h1d_maphedraLen x []

hedraNdx -> [dihedra using hedron]

Dihedron.h1key,h2key[AtomKey ...]

二面体的面键,根据需要颠倒

Dihedron.hedron1,hedron2海德隆

二面体内部到面体的引用

Dihedron.ndxint

self.dihedraNdx在二面体对象内的信息

两面.cst,rcstnp.float64p4] [4]

二面体内部的dCoordSpace引用

self.a2da_map[dihedraLen x 4]

AtomNdx的顺序为dihedraNdx

self.d2a_map[dihedraLen x [4] ]

每个二面体的AtomNdx(重塑a2da_map)

self.dFwdbool

如果为真,则二面体不反向

self.a2d_mapAAsiz x [[dihedraNdx]

[atom ndx 0-3 of atom in dihedron] ],将原子索引映射到二面体和其中的原子

self.dAtoms_needs_updatedihedraLen x bool

如果为假,h1、h2中的原子为当前原子

assemble_residues(verbose: bool = False) None

从内部坐标生成原子坐标(载体化)。

这是“Numpy并行”版本 assemble_residues_ser() .

从已经形成的两面体开始, init_atom_coords() 将每个从二面体局部坐标空间转换到蛋白质链坐标空间。 迭代直到满足所有依赖关系。

不更新 dCoordSpace 作为 assemble_residues_ser() 可以这 呼叫 update_dCoordSpace() 如果需要 一旦所有原子坐标完成,单次操作就会更快。

参数:

verbose (bool) -- 默认为假。报告计算更改二面体的迭代次数

产生:
self.dSet:AAsiz x dihedraLen x 4

将二面体中的原子映射到原子数组

self.dSetValid[dihedraLen] [4] 布尔

将有效原子映射到二面体中,以检测3或4个有效原子

写入的输出坐标 atomArray . Biopython Bio.PDB.Atom 坐标是该数据的视图。

assemble_residues_ser(verbose: bool = False, start: int | None = None, fin: int | None = None) None

从内部坐标生成IC_Residue原子坐标(串行)。

看到 assemble_residues() 对于“麻木平行”版本。

过滤起点和鳍之间的位置(如果已设置),为每个残基找到适当的起点坐标并传递到 assemble()

参数:
  • verbose (bool) -- 默认为假。描述运行时问题

  • start,fin (int) -- 默认无。要生成坐标的子区域开始、结束的序列位置。

init_edra(verbose: bool = False) None

创建链和残基二面体结构、数组、atomArray。

输入:

self.ordered_aa_ic_list:IC_Residue列表

产生:
  • edra对象,self.di/hedra(执行 _create_edra() )

  • atomArray和支持(执行 build_atomArray() )

  • self.hedraLen:结构中的面体数

  • hedraL 12:长度、角度的numpy数组(空)

  • hedraAngel..

  • hedraL 23..

  • self.hedraNdx:将hedrakeys映射到hedraL12等

  • self.dihedraLen:结构中二面体的数量

  • dihedraAngle..

  • dihedraAngleRads:角度的NP数组(空)

  • self.dihedraNdx:将dihedrakeys映射到dihedraAngle

init_atom_coords() None

从角度和距离设置链级二面体初始坐标。

多面体和二面体的局部坐标空间中的双原子坐标,稍后将通过 dCoordSpace 用于组装的矩阵。

update_dCoordSpace(workSelector: ndarray | None = None) None

计算/更新链面体的坐标空间变换。

需要更新所有原子,以便调用 assemble_residues() (如果所有原子都已组装好,立即返回)。

参数:

workSelector ([bool]) -- 可选面具,用于选择要更新的二面体

propagate_changes() None

跟踪二面体以使依赖原子无效。

internal_to_atom_coordinates(verbose: bool = False, start: int | None = None, fin: int | None = None) None

将IC数据处理为残留/Atom坐标。

参数:
  • verbose (bool) -- 默认为假。描述运行时问题

  • start,fin (int) -- 要处理的子区域开始、结束的可选序列位置。

备注

设置开始或鳍激活序列 assemble_residues_ser() 而不是(Numpy parallel) assemble_residues() .开始C-Alpha将位于起点。

atom_to_internal_coordinates(verbose: bool = False) None

计算原子数据的二面角,角度,键长。

生成atomArray(通过iter_edra)、面体和二面体的值数组以及二面体的坐标空间变换。

生成Gly C-Beta(如果指定),请参阅 IC_Residue.gly_Cbeta

参数:

verbose (bool) -- 默认为假。描述运行时问题

distance_plot(filter: ndarray | None = None) ndarray

从atomArray生成2D距离图。

默认值是计算所有原子的距离。 要生成经典的C阿尔法距离图,请传递布尔屏蔽数组,例如:

atmNameNdx = internal_coords.AtomKey.fields.atm
CaSelect = [
    atomArrayIndex.get(k)
    for k in atomArrayIndex.keys()
    if k.akl[atmNameNdx] == "CA"
]
plot = cic.distance_plot(CaSelect)

或者,这将选择所有骨架原子::

backboneSelect = [
    atomArrayIndex.get(k)
    for k in atomArrayIndex.keys()
    if k.is_backbone()
]
参数:

filter ([bool]) -- 限制原子进行计算

参见

distance_to_internal_coordinates() ,这需要默认的全原子距离图。

dihedral_signs() ndarray

为链dihedraAngle数组的每个元素获取符号数组(+1/-1)。

所需 distance_to_internal_coordinates()

distplot_to_dh_arrays(distplot: ndarray, dihedra_signs: ndarray) None

从Distplot加载二面距离数组。

填充 IC_Chain 数组hedraL 12、L23、L13和dihedraL 14来自输入Distplot的距离值数组,来自输入dihedra_sars的dihedra_sars数组。 Distplot和二面距离数组必须根据AtomKey映射索引 IC_Chain .hedraNdx和.dihedraNdx(创建于 IC_Chain.init_edra() )

呼叫 atom_to_internal_coordinates() (or至少 init_edra() )在运行此之前生成a2ha_map和d2a_map。

明确删除 distance_to_internal_coordinates() 因此用户可以通过其他方法填充这些链面/面体阵列。

distance_to_internal_coordinates(resetAtoms: bool | None = True) None

根据距离和手征数据计算链面形。

面体L12、L23、L13和二面体L14上的距离属性配置如下 distplot_to_dh_arrays() 或替代装载机。

dihedraAngles结果在最后一步乘以dihedra_sights,恢复距离图中丢失的手征信息(结构的镜像具有相同的距离,但符号相反的二面角)。

请注意,链断裂将导致重建结构中的错误,使用 copy_initNCaCs() 为了避免这种

基于Blue,Hedronmeter对 The dihedral angles of a tetrahedron in terms of its edge lengthsmath.stackexchange.com . 参见: "Heron-like Hedronometric Results for Tetrahedral Volume" .

该分析的其他值包含在此处作为完整性评论:

  • oa = hedron 1 L12,如果相反,否则hedron 1 L23

  • ob = hedron 1 L23,如果相反,否则hedron 1 L12

  • ac = hedron 2 L12,如果相反,否则hedron 2 L23

  • ab = hedron 1 L13 = OA、OB上的cos定律(hedron 1 L12、L23)

  • oc = hedron 2 L13 = OA、AC上的cos定律(hedron 2 L12、L23)

  • BC =二面体L14

目标是OA,即沿着边缘oa的二面角。

参数:

resetAtoms (bool) -- 默认为真。标记di/hedra和atomArray中的所有原子以进行更新 internal_to_atom_coordinates() . 或者将其设置为False并操纵 atomArrayValid , dAtoms_needs_updatehAtoms_needs_update 直接减少计算量。

copy_initNCaCs(other: IC_Chain) None

从其他IC_Chain复制initNCaC原子的原子坐标。

复制坐标并为初始NCaC和任何链中断后设置atomArrayValid标志True。

所需 distance_to_internal_coordinates() 如果目标有断链(否则每个片段将从原点开始)。

如果从另一个链复制内部坐标,也很有用。

N.B. IC_Residue.set_angle()IC_Residue.set_length() 使其相关原子无效,因此在调用此函数之前应用它们。

make_extended()

将所有磅/平方英寸和磅角设置为扩展构造(123,-104)。

__annotations__ = {'atomArray': <built-in function array>, 'atomArrayIndex': 'dict[AtomKey, int]', 'bpAtomArray': 'list[Atom]', 'ordered_aa_ic_list': 'list[IC_Residue]'}
__firstlineno__ = 312
__static_attributes__ = ('AAsiz', 'a2d_map', 'a2da_map', 'a2h_map', 'a2ha_map', 'a4_pre_rotation', 'akset', 'aktuple', 'atomArray', 'atomArrayIndex', 'atomArrayValid', 'bpAtomArray', 'chain', 'd2a_map', 'dAtoms', 'dAtoms_needs_update', 'dCoordSpace', 'dFwd', 'dH1ndx', 'dH2ndx', 'dRev', 'dSet', 'dSetValid', 'dcsValid', 'dihedra', 'dihedraAngle', 'dihedraAngleRads', 'dihedraL14', 'dihedraLen', 'dihedraNdx', 'dihedra_signs', 'h1d_map', 'h2aa', 'hAtoms', 'hAtomsR', 'hAtoms_needs_update', 'hedra', 'hedraAngle', 'hedraL12', 'hedraL13', 'hedraL23', 'hedraLen', 'hedraNdx', 'id32_dh_index', 'id3_dh_index', 'initNCaCs', 'ordered_aa_ic_list', 'sqMaxPeptideBond')
class Bio.PDB.internal_coords.IC_Residue(parent: Residue)

基类:object

使用内部坐标数据扩展Biopython Residue的类。

参数:
parent: biopython Residue object this class extends
属性:
no_altloc: bool default False

Class 变量,如果为True,则禁用ALTSYS原子的处理,仅使用选定的原子。

accept_atoms: tuple

Class 可变 accept_atoms ,生成内部坐标时使用的DBC原子名称列表。默认为::

accept_atoms = accept_mainchain + accept_hydrogens

要排除内部坐标和生成的DBC文件中的氢原子,请重写为::

IC_Residue.accept_atoms = IC_Residue.accept_mainchain

要仅获得主线原子和胺质子,请用途::

IC_Residue.accept_atoms = IC_Residue.accept_mainchain + ('H',)

为了将D原子转化为H, AtomKey.d2h =正确并用途::

IC_Residue.accept_atoms = (
    accept_mainchain + accept_hydrogens + accept_deuteriums
)

注意 accept_mainchain = accept_backbone + accept_sidechain .因此,要生成序列不可知的conformance数据,例如二面角空间中的结构排列,请用途::

IC_Residue.accept_atoms = accept_backbone

或设置gly_CBeta = True并用途::

IC_Residue.accept_atoms = accept_backbone + ('CB',)

更改accept_atoms将导致默认值 structure_rebuild_testic_rebuild 如果某些原子被过滤(显然),就会失败。 使用 quick=True 选择仅测试过滤原子的坐标以避免这种情况。

目前没有选择输出带有D而不是H的内部坐标。

accept_resnames: tuple

Class 可变 accept_resnames ,HETATM在从原子生成内部坐标时接受的3个字母残基名称的列表。 HETATM侧链将被忽略,但正常骨架原子(N、CA、C、O、CB)将被包括在内。 目前只有CYG,YCM和UNK;覆盖在您自己的风险。 要生成侧链,请将适当的条目添加到 ic_data_sidechainsic_data 和支持 IC_Chain.atom_to_internal_coordinates() .

gly_Cbeta: bool default False

Class 可变 gly_Cbeta ,重写为True以生成中的甘氨CB原子的内部坐标 IC_Chain.atom_to_internal_coordinates()

IC_Residue.gly_Cbeta = True
pic_accuracy: str default "17.13f"

Class 可变 pic_accuracy 设置.pic文件中数值(角度、长度)的准确性。 默认设置为高,以支持重建测试中的mminf文件准确性。 如果您发现重建测试失败,并出现“WRIGHT-CORDINATES-”并且verbose=True仅显示微小差异,请尝试提高此值(或如果仅使用TSB格式文件,则将其降低到9.5)。

IC_Residue.pic_accuracy = "9.5f"
residue: Biopython Residue object reference

Residue 对象这延伸

hedra: dict indexed by 3-tuples of AtomKeys

赫德拉形成这个残留物

dihedra: dict indexed by 4-tuples of AtomKeys

二面体形成(重叠)该残基

rprev, rnext: lists of IC_Residue objects

对链中邻近(键合、未缺失、可能无序)残基的引用

atom_coords: AtomKey indexed dict of numpy [4] arrays

removed 如果需要,使用AtomKeys和atomArrayIndex进行构建

ak_set: set of AtomKeys in dihedra

所有二面体中的AtomKeys与此残基重叠(请参阅__包含__())

alt_ids: list of char

DBC文件中的AltLoc ID

bfactors: dict

AtomKey对从TSB文件读取的B因子进行索引

NCaCKey: List of tuples of AtomKeys

N、Ca、C骨架原子的二元组列表AtomKeys;通常只有1,但如果骨架替代物则更多。

is20AA: bool

如果残基是20种标准氨基酸之一(基于残基重新名称),则为真

isAccept: bool

如果是20 AA或在下面的accept_resnames中,则为真

rbase: tuple

残基位置、插入代码或不插入代码、重新命名(如果是标准氨基酸,则1个字母)

cic: IC_Chain default None

母链 IC_Chain 对象

scale: optional float

用于OpenSCAD输出以生成gly_CBeta键长

方法

assemble(atomCoordsIn, resetLocation, verbose)

根据内部坐标计算该残基的原子坐标

get_angle()

已传递关键点的返回角度

get_length()

指定对的返回绑定长度

pick_angle()

找到传递的密钥的Hedron或Dihedron

pick_length()

查找传递的AtomKey对的面体

set_angle()

为传递的关键点设置角度(没有位置更新)

set_length()

在指定对的所有相关面中设置键长

bond_rotate(delta)

通过增量调整相关二面角,例如旋转si(N-Ca-C-N)将以相同的量调整相邻的N-Ca-C-O以避免冲突

bond_set(angle)

使用bond_rotate将指定二面面体设置为角度并相应调整相关二面面体

rak(atom info)

该残留物的缓存AtomKeys

accept_resnames = ('CYG', 'YCM', 'UNK')

对于具有正常骨架的非标准残基,此处添加3字母残基名称。 测试用例4LGY(1305个残基连续链)包含CYG。 可以安全地为N-CA-C-O主干线添加更多名称,任何复杂性都需要添加 accept_atoms , ic_data_sidechainsic_data 和支持 IC_Chain.atom_to_internal_coordinates()

no_altloc: bool = False

设置True以过滤输入上的altloc原子,并且仅与Biopython默认原子一起工作

gly_Cbeta: bool = False

在所有Gly残基上产生β碳。

将其设置为True将生成Gly C-β碳的内部坐标, atom_to_internal_coordinates() .

2019年9月Dunbrack cullpdb_pc20_res2.2_R1.0的平均数据仅限于酰胺质子结构。请参阅

PISCES: A Protein Sequence Culling Server <https://dunbrack.fccc.edu/pisces/> _

'G. Wang and R. L. Dunbrack, Jr. PISCES: a protein sequence culling server. Bioinformatics, 19:1589-1591, 2003.'

来自NCACO查询的OCCACB的Ala平均旋转::

select avg(g.rslt) as avg_rslt, stddev(g.rslt) as sd_rslt, count(*)
from
(select f.d1d, f.d2d,
(case when f.rslt > 0 then f.rslt-360.0 else f.rslt end) as rslt
from (select d1.angle as d1d, d2.angle as d2d,
(d2.angle - d1.angle) as rslt from dihedron d1,
dihedron d2 where d1.re_class='AOACACAACB' and
d2.re_class='ANACAACAO' and d1.pdb=d2.pdb and d1.chn=d2.chn
and d1.res=d2.res) as f) as g

结果:

| avg_rslt          | sd_rslt          | count   |
| -122.682194862932 | 5.04403040513919 | 14098   |
pic_accuracy: str = '17.13f'
accept_backbone = ('N', 'CA', 'C', 'O', 'OXT')
accept_sidechain = ('CB', 'CG', 'CG1', 'OG1', 'OG', 'SG', 'CG2', 'CD', 'CD1', 'SD', 'OD1', 'ND1', 'CD2', 'ND2', 'CE', 'CE1', 'NE', 'OE1', 'NE1', 'CE2', 'OE2', 'NE2', 'CE3', 'CZ', 'NZ', 'CZ2', 'CZ3', 'OD2', 'OH', 'CH2', 'NH1', 'NH2')
accept_mainchain = ('N', 'CA', 'C', 'O', 'OXT', 'CB', 'CG', 'CG1', 'OG1', 'OG', 'SG', 'CG2', 'CD', 'CD1', 'SD', 'OD1', 'ND1', 'CD2', 'ND2', 'CE', 'CE1', 'NE', 'OE1', 'NE1', 'CE2', 'OE2', 'NE2', 'CE3', 'CZ', 'NZ', 'CZ2', 'CZ3', 'OD2', 'OH', 'CH2', 'NH1', 'NH2')
accept_hydrogens = ('H', 'H1', 'H2', 'H3', 'HA', 'HA2', 'HA3', 'HB', 'HB1', 'HB2', 'HB3', 'HG2', 'HG3', 'HD2', 'HD3', 'HE2', 'HE3', 'HZ1', 'HZ2', 'HZ3', 'HG11', 'HG12', 'HG13', 'HG21', 'HG22', 'HG23', 'HZ', 'HD1', 'HE1', 'HD11', 'HD12', 'HD13', 'HG', 'HG1', 'HD21', 'HD22', 'HD23', 'NH1', 'NH2', 'HE', 'HH11', 'HH12', 'HH21', 'HH22', 'HE21', 'HE22', 'HE2', 'HH', 'HH2')
accept_deuteriums = ('D', 'D1', 'D2', 'D3', 'DA', 'DA2', 'DA3', 'DB', 'DB1', 'DB2', 'DB3', 'DG2', 'DG3', 'DD2', 'DD3', 'DE2', 'DE3', 'DZ1', 'DZ2', 'DZ3', 'DG11', 'DG12', 'DG13', 'DG21', 'DG22', 'DG23', 'DZ', 'DD1', 'DE1', 'DD11', 'DD12', 'DD13', 'DG', 'DG1', 'DD21', 'DD22', 'DD23', 'ND1', 'ND2', 'DE', 'DH11', 'DH12', 'DH21', 'DH22', 'DE21', 'DE22', 'DE2', 'DH', 'DH2')
accept_atoms = ('N', 'CA', 'C', 'O', 'OXT', 'CB', 'CG', 'CG1', 'OG1', 'OG', 'SG', 'CG2', 'CD', 'CD1', 'SD', 'OD1', 'ND1', 'CD2', 'ND2', 'CE', 'CE1', 'NE', 'OE1', 'NE1', 'CE2', 'OE2', 'NE2', 'CE3', 'CZ', 'NZ', 'CZ2', 'CZ3', 'OD2', 'OH', 'CH2', 'NH1', 'NH2', 'H', 'H1', 'H2', 'H3', 'HA', 'HA2', 'HA3', 'HB', 'HB1', 'HB2', 'HB3', 'HG2', 'HG3', 'HD2', 'HD3', 'HE2', 'HE3', 'HZ1', 'HZ2', 'HZ3', 'HG11', 'HG12', 'HG13', 'HG21', 'HG22', 'HG23', 'HZ', 'HD1', 'HE1', 'HD11', 'HD12', 'HD13', 'HG', 'HG1', 'HD21', 'HD22', 'HD23', 'NH1', 'NH2', 'HE', 'HH11', 'HH12', 'HH21', 'HH22', 'HE21', 'HE22', 'HE2', 'HH', 'HH2')

更改accept_atoms以限制处理的原子。看到 IC_Residue 供使用。

__init__(parent: Residue) None

使用父Biopython Residue初始化IC_Residue。

参数:

parent (Residue) -- Biopython残留物对象。该物体扩展的Biopython残留物

__deepcopy__(memo)

IC_Residue的深度复制实现。

__contains__(ak: AtomKey) bool

如果atomkey在这个residue中,返回True。

rak(atm: str | Atom) AtomKey

缓存对AtomKey的调用以获取此残留。

__repr__() str

打印字符串是父剩余ID。

pretty_str() str

很好的残留ID字符串。

set_flexible() None

对于OpenSCAD,将N-CA和CA-C粘合标记为柔性接头。

看到 SCADIO.write_SCAD()

set_hbond() None

对于OpenSCAD,将H-N和C-O键标记为hbond(磁铁)。

看到 SCADIO.write_SCAD()

clear_transforms()

在组装之前使二面体坐标空间属性无效()。

坐标空间属性为Dihedron.cst和.rcst,以及 IC_Chain.dCoordSpace

assemble(resetLocation: bool = False, verbose: bool = False) dict[AtomKey, array] | dict[tuple[AtomKey, AtomKey, AtomKey], array] | None

根据内部坐标计算该残基的原子坐标。

这是的IC_残留部分 assemble_residues_ser() 连续版本,请参阅 assemble_residues() 对于在 IC_Chain 水平

从N-CA-C和N-CA-CB面体开始加入准备好的二面体,计算骨架和侧链原子的蛋白质空间坐标

在每个二面体上设置正向和反向变换,以从蛋白质坐标转换为前三个原子的二面体空间坐标(请参阅 IC_Chain.dCoordSpace )

呼叫 init_atom_coords() 要在来到这里之前更新任何修改的二面体,这只会将二面体组装到蛋白质坐标空间中。

Algorithm

形成双端队列,从c-ca-n、o-c-ca、n-ca-cb、n-ca-c开始。

如果resetLocate =True,则使用生成n-ca-c初始位置二面体的初始坐标(导致二面体坐标空间)

当队列不空时

获取3原子面体密钥

对于从面键开始的每个面体(面体的第一面体)

如果已经拥有所有4个原子的坐标

将第二面体键添加到队列后面

否则,如果有第一个3个原子的坐标

计算正向和反向变换,以将第一个3个原子带入/移出二面体初始坐标空间

利用逆变换从二面体初始坐标得到当前坐标中第四个原子的位置

将第二面体键添加到队列后面

其他

排序失败,将面体密钥放在队列后面,并希望下次我们有第一个3个原子位置(不应该发生)

循环终止(队列耗尽),因为不启动任何二面体的面体键被删除而不采取任何行动

参数:

resetLocation (bool) -- 默认为假。- 选择忽略开始位置并将初始N-Ca-C面体定位在原点。

返回:

AtomKey的Dict->蛋白质空间中残基相对于先前残基的同质原子坐标 Also 直接更新 IC_Chain.atomArray 作为 assemble_residues() 可以这

split_akl(lst: tuple[AtomKey, ...] | list[AtomKey], missingOK: bool = False) list[tuple[AtomKey, ...]]

获取AtomKeys通用列表中的此剩余(ak_set)的AtomKeys。

更改和/或扩展“通用”AtomKeys列表(例如“N、C、C”)以特定于此Residue的替代位置等,例如“(N-Ca_A_0.3-C,N-Ca_B_0.7-C)”

给定Hedron或Dihedron的AtomKeys列表,
返回:

此残基中具有id3_dh的匹配atomkey列表(如果占用,ak可能会改变!= 1.00)

为所有atom altlocs扩展了多个匹配atomkeys列表

如果atom_coord(ak)中的任何一个缺失且未缺失,则为空列表OK

参数:
  • lst (list) -- 列表 [3] 或 [4] AtomKeys的。非altloc AtomKeys与此残基的特定AtomKeys相匹配

  • missingOK (bool) -- 默认为假,见上文。

atom_sernum = None
atom_chain = None
pdb_residue_string() str

将此残基的DBC ATOM记录生成为字符串。

PDBIO.py中未公开功能的便捷方法。增量 IC_Residue.atom_sernum 如果不是没有

参数:
  • IC_Residue.atom_sernum -- 类变量默认无。如果不是,则删除并增加原子序列号无

  • IC_Residue.atom_chain -- 类变量。如果不是,则删除原子链id无

待处理

转移到PD比奥

pic_flags = (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 496, 525, 1021, 1024, 2048, 4096, 7168, 8192, 16384)

使用 PICIO.write_PIC() 以控制要默认的值类别。

picFlagsDefault = 31744

默认为所有二面体+初始tau原子+b因子。

picFlagsDict = {'all': 7168, 'bFactors': 16384, 'chi': 496, 'chi1': 16, 'chi2': 32, 'chi3': 64, 'chi4': 128, 'chi5': 256, 'classic': 1021, 'classic_b': 525, 'hedra': 1024, 'initAtoms': 8192, 'omg': 2, 'phi': 4, 'pomg': 512, 'primary': 2048, 'psi': 1, 'secondary': 4096, 'tau': 8}

根据需要使用的pic_flags值字典。

pick_angle(angle_key: tuple[AtomKey, AtomKey, AtomKey] | tuple[AtomKey, AtomKey, AtomKey, AtomKey] | str) Hedron | Dihedron | None

获取angle_key的Hedron或Dihedron。

参数:

angle_key --

  • 3或4个AtomKeys的数组

  • 原子名称字符串(“CA”),由:' s分隔

  • 串 [-1, 0, 1] <atom name>用&#39;:&#39; s分开。-1是上一个残基,0是这个残基,1是下一个残基

  • si,phy,omg,欧米茄,chi 1,chi 2,chi 3,chi 4,chi 5

  • tau(N-CA-C角)参见Richardson 1981

  • AtomKeys的字节组仅可访问交替的无序原子

观察残基的phi和欧米茄二面体,以及组成它们的面体(包括N:Ca:C tau 面体),存储在n-1个二面体集合中;这种重叠在这里处理,但如果直接访问,可能会出现问题。

以下打印命令是等效的(除了chi 2具有非碳原子的侧链)::

ric = r.internal_coord
print(
    r,
    ric.get_angle("psi"),
    ric.get_angle("phi"),
    ric.get_angle("omg"),
    ric.get_angle("tau"),
    ric.get_angle("chi2"),
)
print(
    r,
    ric.get_angle("N:CA:C:1N"),
    ric.get_angle("-1C:N:CA:C"),
    ric.get_angle("-1CA:-1C:N:CA"),
    ric.get_angle("N:CA:C"),
    ric.get_angle("CA:CB:CG:CD"),
)

请参阅ic_data.py了解所列举的侧链角和不跨越网袋的骨架角中的原子的详细信息。使用“s”表示当前残基(“self”),使用“n”表示下一个残基,跨越(重叠)角为::

(sN, sCA, sC, nN)   # psi
(sCA, sC, nN, nCA)  # omega i+1
(sC, nN, nCA, nC)   # phi i+1
(sCA, sC, nN)
(sC, nN, nCA)
(nN, nCA, nC)       # tau i+1
返回:

匹配Hedron、Dihedron或无。

get_angle(angle_key: tuple[AtomKey, AtomKey, AtomKey] | tuple[AtomKey, AtomKey, AtomKey, AtomKey] | str) float | None

获取指定关键点的二面体或面角。

看到 pick_angle() 关键规格。

set_angle(angle_key: tuple[AtomKey, AtomKey, AtomKey] | tuple[AtomKey, AtomKey, AtomKey, AtomKey] | str, v: float, overlap=True)

为指定关键点设置二面体或面角。

如果角度是a Dihedron and overlap is True (default), overlapping dihedra are also changed as appropriate. The overlap is a result of protein chain definitions in ic_data and :meth:`_ Create_edra '(例如,si与N-CA-C-O重叠)。

默认重叠=True可能就是您想要的: set_angle("chi1", val)

当处理链或残基中的所有两面体(例如从另一个结构复制)时,默认值可能不是您想要的,因为重叠的两面体也可能在集合中。

N.B.允许设置例如PRO chi 2,且没有错误或警告!

看到 pick_angle() 有关angle_key规格。看到 bond_rotate() 将二面角改变几度

参数:
  • angle_key -- 角度标识符。

  • v (float) -- 以度为单位的新角度(结果调整为+/-180)。

  • overlap (bool) -- 默认为真。根据需要修改重叠二面体

bond_rotate(angle_key: tuple[AtomKey, AtomKey, AtomKey] | tuple[AtomKey, AtomKey, AtomKey, AtomKey] | str, delta: float)

将重叠的二面角集旋转增量度。

将二面角更改一个给定的增量,即new_angle = current_angle + delta值被调整,因此new_angle将在+/-180内。

更改重叠二面体,如中所示 set_angle()

看到 pick_angle() 关键规格。

bond_set(angle_key: tuple[AtomKey, AtomKey, AtomKey] | tuple[AtomKey, AtomKey, AtomKey, AtomKey] | str, val: float)

将二面体设置为val,更新相同的量重叠二面体。

多余 set_angle() ,以保持兼容性。 不像 set_angle() 这仅适用于二面体,并且没有不更新重叠二面体的选项。

看到 pick_angle() 关键规格。

pick_length(ak_spec: str | tuple[AtomKey, AtomKey]) tuple[list[Hedron] | None, tuple[AtomKey, AtomKey] | None]

获取包含指定原子对的面体列表。

参数:

ak_spec --

  • 两个AtomKeys的数组

  • 字符串:由“:”分隔的两个原子名称,例如“N:CA”,带有相对于自身的可选位置说明符,例如“-1C:N”代表前面的肽键。 位置说明符为-1,0,1。

以下是等效的::

ric = r.internal_coord
print(
    r,
    ric.get_length("0C:1N"),
)
print(
    r,
    None
    if not ric.rnext
    else ric.get_length((ric.rak("C"), ric.rnext[0].rak("N"))),
)

如果当前残基上未发现原子,则将查看rprev [0] 处理Gly N:CA等案件。 如需更好的控制,请访问 IC_Chain.hedra 直接.

返回:

包含指定原子对作为AtomKeys二元组的面体列表

get_length(ak_spec: str | tuple[AtomKey, AtomKey]) float | None

获取指定原子对的键长。

看到 pick_length() 了解ak_spec和详细信息。

set_length(ak_spec: str | tuple[AtomKey, AtomKey], val: float) None

设置指定原子对的键长。

看到 pick_length() 对于ak_spec.

applyMtx(mtx: array) None

将矩阵应用于此IC_Residue的atom_coords。

__annotations__ = {'_AllBonds': <class 'bool'>, 'gly_Cbeta': <class 'bool'>, 'no_altloc': <class 'bool'>, 'pic_accuracy': <class 'str'>}
__firstlineno__ = 2220
__static_attributes__ = ('NCaCKey', 'ak_set', 'akc', 'alt_ids', 'bfactors', 'dihedra', 'hedra', 'is20AA', 'isAccept', 'lc', 'rbase', 'residue', 'rnext', 'rprev')
class Bio.PDB.internal_coords.Edron(*args: list[AtomKey] | tuple[AtomKey, AtomKey, AtomKey] | tuple[AtomKey, AtomKey, AtomKey, AtomKey], **kwargs: str)

基类:object

Hedron和Dihedron类的基本类。

支持基于AtomKeys列表的丰富比较。

属性:
atomkeys: tuple

3(面体)或4(二面体) AtomKey 定义这个二面体

id: str

':'-这个二面体的加入AtomKeys字符串

needs_update: bool

指示二面体局部原子_坐标不反映面体局部坐标空间中当前二面体角度和长度值

e_class: str

包含二面体的原子序列(没有位置或残基)用于统计

re_class: str

残基序列,原子包括二面体用于统计

cre_class: str

包含用于统计的二面体的共价半径类序列

edron_re: compiled regex (Class Attribute)

匹配Hedron和Dihedron对象的字符串ID的已编译的正规表达

cic: IC_Chain reference

链内部坐标对象包含该面体

ndx: int

索引到IC_Chain级别的numpy数据数组中,用于二面体/多面体。中设置 IC_Chain.init_edra()

rc: int

该edron涉及的残留物数量

方法

gen_key([AtomKey, ...] or AtomKey, ...) (Static Method)

生成AtomKey ID的“:”-连接字符串

is_backbone()

如果所有原子键原子都是N、Ca、C或O,则返回True

edron_re = re.compile('^(?P<pdbid>\\w+)?\\s(?P<chn>[\\w|\\s])?\\s(?P<a1>[\\w\\-\\.]+):(?P<a2>[\\w\\-\\.]+):(?P<a3>[\\w\\-\\.]+)(:(?P<a4>[\\w\\-\\.]+))?\\s+(((?P<len12>\\S+)\\s+(?P<angle>\\S+)\\s+(?P<len23>\\S+)\\s*$)|((?P<)

匹配Hedron和Dihedron对象的字符串ID的已编译的正规表达

static gen_key(lst: list[AtomKey]) str

从输入生成“:”-连接AtomKey字符串的字符串。

从(2_A_C,3_P_N,3_P_CA)生成“2_A_C:3_P_N:3_P_CA”:参数列表lst:AtomKey对象列表

static gen_tuple(akstr: str) tuple

为“:”-加入的AtomKey字符串生成AtomKey数组。

从“2_A_C:3_P_N:3_P_CA”生成(2_A_C,3_P_N,3_P_CA):param stra akstra:字符串“:”-分隔AtomKey字符串

__init__(*args: list[AtomKey] | tuple[AtomKey, AtomKey, AtomKey] | tuple[AtomKey, AtomKey, AtomKey, AtomKey], **kwargs: str) None

使用AtomKeys序列初始化Edron。

可接受的输入:

[ AtomKey, ... ] : list of AtomKeys AtomKey, ... : sequence of AtomKeys as args {'a1': str, 'a2': str, ... } : dict of AtomKeys as 'a1', 'a2' ...

__deepcopy__(memo)

Edron的深度复制实现。

__contains__(ak: AtomKey) bool

如果atomkey在此edron中,则返回True。

is_backbone() bool

对于仅包含N、C、CA、O、H原子,报告True。

__repr__() str

AtomKeys的Tuple是默认的repr字符串。

__hash__() int

在初始化时从atomkeys数组计算哈希。

__eq__(other: object) bool

平等测试。

__ne__(other: object) bool

不平等性测试。

__gt__(other: object) bool

测试大于。

__ge__(other: object) bool

测试更大或等于。

__lt__(other: object) bool

测试少于。

__le__(other: object) bool

测试更少或等于。

__firstlineno__ = 3888
__static_attributes__ = ('_hash', 'atomkeys', 'cre_class', 'e_class', 'id', 'needs_update', 'rc', 're_class')
class Bio.PDB.internal_coords.Hedron(*args: list[AtomKey] | tuple[AtomKey, AtomKey, AtomKey], **kwargs: str)

基类:Edron

类表示形成平面的三个相连的原子。

包含局部坐标空间中的原子坐标:中心原子位于原点,一个末端原子位于XZ平面,另一个末端原子位于+Z轴。以两个方向存储,第三个(正向)或第一个(反向)原子在+Z轴上。 看到 Dihedron 用于使用向前和反向方向。

属性:
len12: float

第一个和第二个原子之间的距离

len23: float

第二和第三原子之间的距离

angle: float

面体中三个原子形成的角度(度)

xrh_class: string

仅对于跨越2个残基的面体,将具有'X',表示仅贡献一个原子的残基

方法

get_length()

获取指定原子对的键长

set_length()

为指定原子对设置键长

angle(), len12(), len23()

相关属性的设定器(角度,单位为度)

__init__(*args: list[AtomKey] | tuple[AtomKey, AtomKey, AtomKey], **kwargs: str) None

使用AtomKeys、kwargs序列初始化Hedron。

可接受的输入:

至于Edron,加上可选的“len 12”、“angle”、“len 23”关键字值。

__repr__() str

打印Hedron对象的字符串。

property angle: float

得到这个面角。

property len12

获取Hedron的第一个长度。

property len23: float

获得Hedron的第二个长度。

get_length(ak_tpl: tuple[AtomKey, AtomKey]) float | None

获取指定原子对的键长。

参数:

ak_tpl (tuple) -- AtomKeys的数组。这个刺猬中的一对原子

set_length(ak_tpl: tuple[AtomKey, AtomKey], newLength: float)

设置指定原子对的键长;设置needs_Update。

参数:

.ak_tpl (tuple) -- AtomKeys的多元组这个刺猬中的一对原子

__annotations__ = {}
__firstlineno__ = 4119
__static_attributes__ = ('xrh_class',)
class Bio.PDB.internal_coords.Dihedron(*args: list[AtomKey] | tuple[AtomKey, AtomKey, AtomKey, AtomKey], **kwargs: str)

基类:Edron

类表示形成二面角的四个连接原子。

属性:
angle: float

二面角的测量或规格(以度为单位);首选 IC_Residue.bond_set() 设置

hedron1, hedron2: Hedron object references

构成二面角的两个面体

h1key, h2key: tuples of AtomKeys

hedron 1和hedron 2的哈希键

id3,id32: tuples of AtomKeys

前3个和后3个原子组成二面体; hxkey顺序可能不同

ric: IC_Residue object reference

IC_Residue 包含这个二面角的物体

reverse: bool

表示二面体中原子的顺序与面体中原子的顺序相反

primary: bool

如果这是磅/平方英寸、磅/加或侧链chi角,则为真

pclass: string (primary angle class)

根据命名法(磅/平方米、欧米茄/平方米)对相邻残基进行X重新分类

cst, rcst: numpy [4][4] arrays

变换到(cst)和从(rcst)在原点处用原子2(Hedron 1中心原子)定义的二面体坐标空间。 意见 IC_Chain.dCoordSpace .

方法

angle()

吸气剂/定位器,用于度角;首选 IC_Residue.bond_set()

bits()

返回 IC_Residue.pic_flags 二面体的位屏蔽si、欧米茄等

__init__(*args: list[AtomKey] | tuple[AtomKey, AtomKey, AtomKey, AtomKey], **kwargs: str) None

使用AtomKey序列和可选的二面角初始化二面角。

可接受的输入:

至于Edron,加上可选的“二面角”关键字角度值。

__repr__() str

打印二面体对象的字符串。

property angle: float

获得二面角。

static angle_dif(a1: float | ndarray, a2: float | ndarray)

获得两个+/- 180个角度之间的角度差。

https://stackoverflow.com/a/36001014/2783487

static angle_avg(alst: list, in_rads: bool = False, out_rads: bool = False)

获取+/-180个角度列表的平均值。

参数:
  • alst (List) -- 平均角度列表

  • in_rads (bool) -- 输入值以弧度为单位

  • out_rads (bool) -- 报告结果(以弧度为单位)

static angle_pop_sd(alst: list, avg: float)

获取+/-180个角度列表的总体标准差。

应该是示例std dev,但避免len(alst)=1 -> dis by 0

difference(other: Dihedron) float

获取这个角度与其他角度+/- 180个角度之间的角度差。

bits() int

得到 IC_Residue.pic_flags self的位屏蔽是si、omg、phy、pomg、chiX。

__annotations__ = {}
__firstlineno__ = 4263
__static_attributes__ = ('_dihedral', 'altCB_class', 'h1key', 'h2key', 'hedron1', 'hedron2', 'id3', 'id32', 'needs_update', 'pclass', 'primary', 'reverse')
class Bio.PDB.internal_coords.AtomKey(*args: IC_Residue | Atom | list | dict | str, **kwargs: str)

基类:object

用于引用原子坐标的dict键的类。

AtomKeys一起捕获残留和无序信息,并为.pic文件提供无空白字符串密钥。

支持丰富的比较和多种实例化方式。

AtomKeys包含:

残基位置(respos)、插入码(icode)、1或3字符残基名称(resname)、原子名称(atm)、altloc(altloc)和占用(occ)

使用 AtomKey.fields 要按名称获取感兴趣组件的索引:

从IC_Chain atomArray和atomArrayIndex获取C-alpha原子,使用AtomKeys::

atmNameNdx = internal_coords.AtomKey.fields.atm
CaSelection = [
    atomArrayIndex.get(k)
    for k in atomArrayIndex.keys()
    if k.akl[atmNameNdx] == "CA"
]
AtomArrayCa = atomArray[CaSelection]

将所有苯色素原子聚集在一条链中::

resNameNdx = internal_coords.AtomKey.fields.resname
PheSelection = [
    atomArrayIndex.get(k)
    for k in atomArrayIndex.keys()
    if k.akl[resNameNdx] == "F"
]
AtomArrayPhe = atomArray[PheSelection]

如果是20个标准残基之一,“resName”将是RST 1字母的氨基酸代码,否则是提供的3字母代码。 作为输入提供或从的.rbase属性读取 IC_Residue .

属性:
akl: tuple

AtomKey的所有六个字段

fieldNames: tuple (Class Attribute)

关键索引位置到名称的映射

fields: namedtuple (Class Attribute)

字段名称到索引位置的映射。

id: str

“_”-连接的AtomKey字段,不包括“None”字段

atom_re: compiled regex (Class Attribute)

与键的字符串形式相匹配的已编译的正规运算式

d2h: bool (Class Attribute) default False

如果为True,则在输入时将D原子转换为H;还必须修改 IC_Residue.accept_atoms

missing: bool default False

字符串中的AtomKey __init__' d可能丢失,请设置此标志以记录该问题。 设定 IC_Residue.rak()

ric: IC_Residue default None

If 使用IC_残留初始化,这引用了IC_残留

方法

altloc_match(other)

如果此AtomKey与其他AtomKey(不包括altloc和占用字段)匹配,则返回True

is_backbone()

如果原子是N、CA、C、O或H,则返回True

atm()

返回原子名称,例如N、CA、CB等。

cr_class()

返回等值半径类,例如Csb

atom_re = re.compile('^(?P<respos>-?\\d+)(?P<icode>[A-Za-z])?_(?P<resname>[a-zA-Z]+)_(?P<atm>[A-Za-z0-9]+)(?:_(?P<altloc>\\w))?(?:_(?P<occ>-?\\d\\.\\d+?))?$')

预编译的正规表达式以匹配AtomKey字符串。

fieldNames = ('respos', 'icode', 'resname', 'atm', 'altloc', 'occ')
fields = (0, 1, 2, 3, 4, 5)

使用此命名的tuple来访问AtomKey字段。 看到 AtomKey

d2h = False

设置True将输入时的D Deuterium转换为H氢。

__init__(*args: IC_Residue | Atom | list | dict | str, **kwargs: str) None

使用剩余和原子数据初始化AtomKey。

可接受输入的示例::

(<IC_Residue>, 'CA', ...)    : IC_Residue with atom info
(<IC_Residue>, <Atom>)       : IC_Residue with Biopython Atom
([52, None, 'G', 'CA', ...])  : list of ordered data fields
(52, None, 'G', 'CA', ...)    : multiple ordered arguments
({respos: 52, icode: None, atm: 'CA', ...}) : dict with fieldNames
(respos: 52, icode: None, atm: 'CA', ...) : kwargs with fieldNames
52_G_CA, 52B_G_CA, 52_G_CA_0.33, 52_G_CA_B_0.33  : id strings
__firstlineno__ = 4520
__static_attributes__ = ('_hash', 'akl', 'id', 'missing', 'ric')
__deepcopy__(memo)

AtomKey的深度复制实现。

__repr__() str

从id中重复字符串。

__hash__() int

哈希在初始化时从akl多元组计算。

altloc_match(other: AtomKey) bool

测试AtomKey与其他折扣占用率和altloc的匹配。

is_backbone() bool

如果是N、C、CA、O或H,则返回True。

atm() str

返回原子名称:N、CA、CB、O等。

cr_class() str | None

返回原子或无的原子的原子半径类。

__ne__(other: object) bool

不平等性测试。

__eq__(other: object) bool

平等测试。

__gt__(other: object) bool

测试大于。

__ge__(other: object) bool

测试更大或等于。

__lt__(other: object) bool

测试少于。

__le__(other: object) bool

测试更少或等于。

Bio.PDB.internal_coords.set_accuracy_95(num: float) float

将浮点准确性降低到9.5(xxxx.xxxxx)。

使用 IC_Residue 类编写PIC和SCAD文件。

参数:

num (float) -- 输入数

返回:

具有指定精度的浮动

exception Bio.PDB.internal_coords.HedronMatchError

基类:Exception

无法在给定密钥的剩余中找到面体。

__firstlineno__ = 4950
__static_attributes__ = ()
exception Bio.PDB.internal_coords.MissingAtomError

基类:Exception

缺少面体或二面体的原子坐标。

__firstlineno__ = 4954
__static_attributes__ = ()