biotite.structure.spread_residue_wise

biotite.structure.spread_residue_wise(array, input_data)[source]

Expand residue-wise data to atom-wise data.

Each value in the residue-wise input is assigned to all atoms of this residue:

output_data[i] = input_data[j], i is incremented from atom to atom, j is incremented every residue change.

Parameters
arrayAtomArray or AtomArrayStack

The atom array (stack) to determine the residues from.

input_datandarray

The data to be spread. The length of axis=0 must be equal to the amount of different residue IDs in array.

Returns
output_datandarray

Residue-wise spread input_data. Length is the same as array_length() of array.

Examples

Spread secondary structure annotation to every atom of a 20 residue peptide (with 304 atoms).

>>> sse = annotate_sse(atom_array, "A")
>>> print(len(sse))
20
>>> print(sse)
['c' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c'
 'c' 'c']
>>> atom_wise_sse = spread_residue_wise(atom_array, sse)
>>> print(len(atom_wise_sse))
304
>>> print(atom_wise_sse)
['c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'a' 'a'
 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a'
 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a'
 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a'
 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a'
 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a'
 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a'
 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' '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