Protein structure representation.
| 730 | |
| 731 | @dataclasses.dataclass() |
| 732 | class FDProtein: |
| 733 | """Protein structure representation.""" |
| 734 | |
| 735 | # The first entry stores amino acid sequence in letter representation. |
| 736 | # The second entry stores a 0-1 mask for observed standard residues. |
| 737 | # Non-standard residues are mapped to <mask> to interact with protein language models. |
| 738 | letter_sequences: List[Tuple[str, str, np.ndarray]] |
| 739 | |
| 740 | # Cartesian coordinates of atoms in angstroms. The atom types correspond to |
| 741 | # residue_constants.atom_types, i.e. the first three are N, CA, CB. |
| 742 | atom_positions: np.ndarray # [num_res, atom_type_num, 3] |
| 743 | |
| 744 | # Amino-acid type for each residue represented as an integer between 0 and |
| 745 | # 20, where 20 is 'X'. |
| 746 | aatype: np.ndarray # [num_res] |
| 747 | |
| 748 | # Added |
| 749 | # Integer for atom type. |
| 750 | atomtypes: np.ndarray # [num_res, element_type_num] |
| 751 | |
| 752 | # Binary float mask to indicate presence of a particular atom. 1.0 if an atom |
| 753 | # is present and 0.0 if not. This should be used for loss masking. |
| 754 | atom_mask: np.ndarray # [num_res, atom_type_num] |
| 755 | |
| 756 | # Residue index as used in PDB. It is not necessarily continuous or 0-indexed. |
| 757 | residue_index: np.ndarray # [num_res] |
| 758 | |
| 759 | # 0-indexed number corresponding to the chain in the protein that this residue |
| 760 | # belongs to. |
| 761 | chain_index: np.ndarray # [num_res] |
| 762 | |
| 763 | # B-factors, or temperature factors, of each residue (in sq. angstroms units), |
| 764 | # representing the displacement of the residue from its ground truth mean |
| 765 | # value. |
| 766 | b_factors: np.ndarray # [num_res, atom_type_num] |
| 767 | |
| 768 | def __post_init__(self): |
| 769 | if len(np.unique(self.chain_index)) > PDB_MAX_CHAINS: |
| 770 | raise ValueError( |
| 771 | f"Cannot build an instance with more than {PDB_MAX_CHAINS} chains " |
| 772 | "because these cannot be written to PDB format." |
| 773 | ) |
| 774 | |
| 775 | |
| 776 | @beartype |
no outgoing calls
no test coverage detected