SeqDes model
The SeqDes model Calcualtors module introduces the possibility to employ part of the work by Huang et al. (see this paper) in ProtoSyn. The SeqDes model, in sum, evaluates the current sequence and chi dihedrals in accordance to a trained model on many natural proteins (but generalizable to de novo sequences).
ProtoSyn.Peptides.Calculators.SeqDes.get_pdb_data — Functionget_pdb_data(pose::Pose, selection::Opt{AbstractSelection} = nothing)Returns all PDB data necessary for calc_seqdes from the given Pose pose. If an AbstractSelection selection is provided, consider only the selected Atom instances (for Residue level data, since the selection is promoted, any Residue with at least 1 selected Atom is considered).
Should return:
- atom_coords: N x 3 Vector (atomic positions)
- atom_data: N x 4 Vector(atomic data):
- [residue_id, bb_ind, atom_type, residue_type], where
residue_idis 0-indexed;bb_indis either 1 or 0, if the corresponding atom is in the protein backbone or not, respectively;atom_typeis the index of the atom element in theCalculators.SeqDes.atom_typesdictionary; andresidue_typeis the index of the residue type in theCalculators.SeqDes.residue_typesdictionary.
- [residue_id, bb_ind, atom_type, residue_type], where
- residue_bb_index: Nr x 4 (atomic index of all backbone atoms + CB)
- [N, CA, C, CB], where all atomic indexes are 0-indexed; for residues without CB, the -1 index is used.
- residue_data: Dict('chain_code' => Nr x 4) (residue data)
- [residue_id, residue_id_code, residue_index, residue_type], where
residue_id_codecan be ignored and set to ' ',residue_indexis 0-indexed andresidue_typeis the index of the residue type in theCalculators.SeqDes.residue_typesdictionary.
- [residue_id, residue_id_code, residue_index, residue_type], where
- residue_label: Nr x 1 (list of residue types)
- chis: Nr x 2 x 4 (chi dihedral angle values)
- [[chi1_v, chi2_v, chi3_v, chi4_v], [chi1, chi2, chi3, chi4]], where
chi1_v,chi2_v, etc is the actual dihedral value (in a 4 element array) andchi1,chi2, etc is either 1 or 0, if the corresponding chi dihedral exists or nor, respectively.
- [[chi1_v, chi2_v, chi3_v, chi4_v], [chi1, chi2, chi3, chi4]], where
N is the number of atoms and Nr is the number of residues. Hydrogens (with symbol H) are always ignored.
See also
Examples
julia> ProtoSyn.Peptides.Calculators.SeqDes.get_pdb_data(pose)
(...)ProtoSyn.Peptides.Calculators.SeqDes.calc_seqdes — Functioncalc_seqdes([::Type{ProtoSyn.CUDA_2}], pose::Pose, selection::Opt{AbstractSelection}, [update_forces::Bool = false]; [use_cuda::Bool = true])Calculates the Pose pose energy in accordance to the SeqDes machine learning model (see https://www.nature.com/articles/s41467-022-28313-9). In sum, this model evaluates the current sequence and chi dihedrals in accordance to a trained model on many natural proteins (but generalizable). If an AbstractSelection selection is given, only the selected Atom instances are considered for the energy calculation. This method does not calculate forces. As such, the update_forces flag has no effect and serves only for standardization purposes between Calculators methods. Currently, this method requires the usage of ProtoSyn.CUDA_2 acceleration type (and setting the use_cuda flag to true). Returns the energy value, nothing (forces), energy per residue and the calculated logits. Note that the calculated logits can be employed in the SeqDes ML model to retrieve rotamers according to the model. Both the energy per residue and logits are returned as PyObject tensors.
See also
Examples
julia> ProtoSyn.Peptides.Calculators.SeqDes.calc_seqdes(pose, nothing)
(13.240120887756348, nothing, PyObject tensor(...), PyObject tensor(...))ProtoSyn.Peptides.Calculators.SeqDes.get_default_seqdes — Functionget_default_seqdes(;[α::T = 1.0]) where {T <: AbstractFloat}Return the default SeqDes energy EnergyFunctionComponent. α sets the component weight (on an EnergyFunction instance, 1.0 by default). This function employs calc_seqdes as the :calc function.
Settings
use_cuda::Bool- Whether to use CUDA acceleration type. Currently, thisEnergyFunctionComponentrequiresuse_cudato betrue.
See also
Examples
```jldoctest julia> ProtoSyn.Peptides.Calculators.SeqDes.getdefaultseqdes() 🞧 Energy Function Component: +–––––––––––––––––––––––––-+ | Name | SeqDesMLModel | | Alpha (α) | 1.0 | | Update forces | false | | Calculator | calcseqdes | +–––––––––––––––––––––––––-+ | +–––––––––––––––––––––––––––––––––––––––––+ ├── ● Settings | Value | | +–––––––––––––––––––––––––––––––––––––––––+ | | usecuda | true | | +–––––––––––––––––––––––––––––––––––––––––+ | └── ○ Selection: nothing