to_protein_blocks#

biotite.structure.alphabet.to_protein_blocks(atoms: AtomArray[N]) tuple[list[ProteinBlocksSequence], ndarray[tuple[K], dtype[integer]]][source]#

Encode each chain in the given structure to the Protein Blocks structural alphabet. [1]

Parameters:
atomsAtomArray

The atom array to encode. May contain multiple chains.

Returns:
sequenceslist of ProteinBlocksSequence, length=n

The encoded Protein Blocks sequence for each peptide chain in the structure.

chain_start_indicesndarray, shape=(n,), dtype=int

The atom index where each chain starts.

References

Examples

>>> sequences, chain_starts = to_protein_blocks(atom_array)
>>> print(sequences[0])
zzmmmmmnopjmnopacdzz