get_component
#
- biotite.structure.io.pdbx.get_component(pdbx_file, data_block=None, use_ideal_coord=True, res_name=None)[source]#
Create an
AtomArray
for a chemical component from thechem_comp_atom
and, if available, thechem_comp_bond
category in a file.- Parameters:
- pdbx_fileCIFFile or CIFBlock or BinaryCIFFile or BinaryCIFBlock
The file object.
- data_blockstr, optional
The name of the data block. Default is the first (and most times only) data block of the file. If the data block object is passed directly to pdbx_file, this parameter is ignored.
- use_ideal_coordbool, optional
If true, the ideal coordinates are read from the file (
pdbx_model_Cartn_<dim>_ideal
fields), typically originating from computations. If set to false, alternative coordinates are read (model_Cartn_<dim>_
fields).- res_namestr
In rare cases the categories may contain rows for multiple components. In this case, the component with the given residue name is read. By default, all rows would be read in this case.
- Returns:
- arrayAtomArray
The parsed chemical component.
Examples
>>> import os.path >>> file = CIFFile.read( ... os.path.join(path_to_structures, "molecules", "TYR.cif") ... ) >>> comp = get_component(file) >>> print(comp) HET 0 TYR N N 1.320 0.952 1.428 HET 0 TYR CA C -0.018 0.429 1.734 HET 0 TYR C C -0.103 0.094 3.201 HET 0 TYR O O 0.886 -0.254 3.799 HET 0 TYR CB C -0.274 -0.831 0.907 HET 0 TYR CG C -0.189 -0.496 -0.559 HET 0 TYR CD1 C 1.022 -0.589 -1.219 HET 0 TYR CD2 C -1.324 -0.102 -1.244 HET 0 TYR CE1 C 1.103 -0.282 -2.563 HET 0 TYR CE2 C -1.247 0.210 -2.587 HET 0 TYR CZ C -0.032 0.118 -3.252 HET 0 TYR OH O 0.044 0.420 -4.574 HET 0 TYR OXT O -1.279 0.184 3.842 HET 0 TYR H H 1.977 0.225 1.669 HET 0 TYR H2 H 1.365 1.063 0.426 HET 0 TYR HA H -0.767 1.183 1.489 HET 0 TYR HB2 H 0.473 -1.585 1.152 HET 0 TYR HB3 H -1.268 -1.219 1.134 HET 0 TYR HD1 H 1.905 -0.902 -0.683 HET 0 TYR HD2 H -2.269 -0.031 -0.727 HET 0 TYR HE1 H 2.049 -0.354 -3.078 HET 0 TYR HE2 H -2.132 0.523 -3.121 HET 0 TYR HH H -0.123 -0.399 -5.059 HET 0 TYR HXT H -1.333 -0.030 4.784