pwem.convert.atom_struct module¶
-
class
pwem.convert.atom_struct.
AtomicStructHandler
(fileName=None, permissive=1)[source]¶ Bases:
object
Class that contain utilities to handle pdb/cif files
-
CIF
= 1¶
-
PDB
= 0¶
-
addStruct
(secondPDBfileName, outPDBfileName=None, useModel=False)[source]¶ Join the second structure to the first one. If cheon numes are the same rename them. if outPDBfileName id provided then new struct is saved to a file
-
centerOfMass
(geometric=False)[source]¶ Returns gravity [default] or geometric center of mass of an Entity (anything with a get_atoms function in biopython. Geometric assumes all masses are equal (geometric=True)
-
extractChain
(chainID, start=0, end=-1, modelID='0', filename='output.mmcif')[source]¶ Code for chopping a structure. This module is used internally by the Bio.PDB.extract() function.
-
getBoundingBox
(expand=3)[source]¶ Get bounding box (angstroms) for atom struct. Only alpha carbons are taken into account. parameter: expand.- make box larger addind this factor
-
getFullID
(model_id='0', chain_id=None)[source]¶ assign a label to a sequence obtained from a PDB file :parameter model_id chain_id :return: string with label
-
getModelsChains
()[source]¶ - given an atomic structure returns two dictionaries:
- for all models and respective chains (chainID and length of residues)
- for each chain list of residues
-
getTransformMatrix
(atomStructFn, startId=-1, endId=-1)[source]¶ find matrix that Superimposes two atom structures. this matrix moves atomStructFn to self
-
readFromPDBDatabase
(pdbID, dir=None, type='mmCif')[source]¶ Retrieve structure from PDB :param pdbID: :param dir: save structure in this directory :param type: mmCif or pdb :return: filename with pdb file
-
readLowLevel
(fileName)[source]¶ Return a dictionary with all mmcif fields. you should parse them Example: get the list of the y coordinates of all atoms
dict = readLowLevel(“kk.pdb”) y_list = dict[‘_atom_site.Cartn_y’]
-
renameChains
(structure)[source]¶ Renames chains to be one-letter chains
Existing one-letter chains will be kept. Multi-letter chains will be truncated or renamed to the next available letter of the alphabet.
If more than 62 chains are present in the structure, raises an OutOfChainsError
Returns a map between new and old chain IDs, as well as modifying the input structure
-
transform
(transformation_matrix, sampling=1.0)[source]¶ Geometrical transformation of a PDB structure
Parameters: entity – PDB biopython structure :param transformation_matrix -> 4x4 scipion matrix :param sampling: scipion transform matrix is applied to voxels so
length must be multiplied by samplingRate- internal variables:
- rotation matrix -> numpy.array(
- [[ 0.5, -0.809017, 0.309017],
- [ 0.809017, 0.30917, -0.5 ], [ 0.309017, 0.5, 0.809017]])
translation: translation vector -> numpy.array([1., 0., 0.], ‘d’)
Returns: no return, new data overwrites entity
-