OEAtomMatchResidue¶
class OEAtomMatchResidue : public OESystem::OEUnaryPredicate<OEChem::OEAtomBase>
This class represents OEAtomMatchResidue functor
that identifies atoms (OEAtomBase) in residues
(OEResidue
) matching specific pieces, like residue name,
residue number, insertion code, chain ID, and fragment number.
See also
Residue Data Functors section
OEAtomMatchResidueID class
The following methods are publicly inherited from OEUnaryPredicate:
The following methods are publicly inherited from OEUnaryFunction:
Constructors¶
OEAtomMatchResidue(const std::string& resId);
OEAtomMatchResidue(const OEAtomMatchResidueID& resId);
OEAtomMatchResidue(const std::vector<OEAtomMatchResidueID>& resIds);
OEAtomMatchResidue(const OEChem::OEResidue& resId);
OEAtomMatchResidue(const std::vector<OEChem::OEResidue>& resIds);
Constructs the functor with the residue properties specified by a regex string, an OEAtomMatchResidueID or a vector of those, an OEResidue, or a vector of those.
OEAtomMatchResidue(const OEChem::OEMolBase& molA, const OEChem::OEMolBase& molB, const double dist, bool excludeHydrogens=true);
Constructs the functor to match the complete residues in molA that are within the specific distance dist in molB. An option exists to exclude explicit hydrogens to be considered inside the distance threshold, which is on by default.
operator()¶
bool operator()(const OEAtomBase &atom) const
Returns true
, if the residue of the atom (returned by the
OEAtomGetResidue
function) has equivalent
residue properties (i.e. residue name, residue number, insertion
code, chain ID, and fragment number) with which the functor is
constructed.
CreateCopy¶
OESystem::OEUnaryFunction<OEChem::OEAtomBase , bool> *CreateCopy() const
Deep copy constructor that returns a copy of the object. The memory for the returned OEAtomMatchResidue object is dynamically allocated and owned by the caller.
Examples
The examples below demonstrate how to create various predicates that allow to access atoms based on their residue information.
OEAtomMatchResidueID resAla = new OEAtomMatchResidueID();
resAla.SetName("ALA");
OEAtomMatchResidue predAla = new OEAtomMatchResidue(resAla);
System.out.print("Number of atoms matching residue name ALA " + oechem.OECount(mol, predAla));
OEAtomMatchResidueID resChainA = new OEAtomMatchResidueID();
resChainA.SetChainID("A");
OEAtomMatchResidue predChainA = new OEAtomMatchResidue(resChainA);
System.out.print("Number of atoms matching chain A = " + oechem.OECount(mol, predChainA));
OEAtomMatchResidueID resHis = new OEAtomMatchResidueID();
resHis.SetName("HIS");
resHis.SetChainID("A");
resHis.SetResidueNumber("88");
OEAtomMatchResidue predHis = new OEAtomMatchResidue(resHis);
System.out.print("Number of atoms matching residue (HIS A 88) = " + oechem.OECount(mol, predHis));
// alternative way to initialize as regex
OEAtomMatchResidue predHis2 = new OEAtomMatchResidue("HIS:88:.*:A:.*");
System.out.print("Number of atoms matching residue (HIS A 88) = " + oechem.OECount(mol, predHis2));
System.out.print("Backbone atoms of residue (HIS A 88): ");
for(OEAtomBase atom : mol.GetAtoms(new OEAndAtom(predHis, new OEIsBackboneAtom())))
{
OEResidue res = oechem.OEAtomGetResidue(atom);
System.out.print(atom.GetName() + " ");
System.out.println(res.GetName() + " " + res.GetChainID() + " " + res.GetResidueNumber());
}