From d3ce59a9c25fbe726b05a5655702783af4a3a3d3 Mon Sep 17 00:00:00 2001 From: juergen <juergen@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Thu, 25 Mar 2010 16:12:45 +0000 Subject: [PATCH] heuristic builder: -added GetIspTorsion to API and exports -implemented Omega torsion -added GetOmegaTorsion to API for and exports git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1891 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/conop/src/heuristic_builder.cc | 18 ++++- modules/conop/src/heuristic_connect_table.hh | 80 ++++++++++---------- modules/mol/base/pymod/export_residue.cc | 2 + modules/mol/base/src/impl/residue_impl.cc | 26 +++++++ modules/mol/base/src/impl/residue_impl.hh | 8 +- modules/mol/base/src/residue_base.cc | 12 +++ modules/mol/base/src/residue_base.hh | 11 +++ modules/mol/base/src/residue_handle.hh | 4 +- 8 files changed, 117 insertions(+), 44 deletions(-) diff --git a/modules/conop/src/heuristic_builder.cc b/modules/conop/src/heuristic_builder.cc index a2d59e445..c154c0c11 100644 --- a/modules/conop/src/heuristic_builder.cc +++ b/modules/conop/src/heuristic_builder.cc @@ -25,6 +25,7 @@ #include "heuristic_connect_table.hh" #include <ost/mol/residue_handle.hh> + namespace ost { namespace conop { namespace detail { @@ -172,8 +173,11 @@ HeuristicBuilder::HeuristicBuilder(): tor_nam[cid]="-"; } else if (tor_id[cid]==-3) { tor_nam[cid]="+"; + } else if (tor_id[cid]==-4) { + tor_nam[cid]=":"; } } + entry.AddTors(tor_nam[0],tor_nam[1],tor_nam[2],tor_nam[3],tor_nam2); } @@ -345,7 +349,7 @@ void HeuristicBuilder::AssignTorsionsToResidue(const mol::ResidueHandle& res) flag=true; } } - } else if (tel[ti].a[ahi]=="-") { + } else if (cur_name=="-") { mol::ResidueHandle prev=res.GetPrev(); if (Builder::AreResiduesConsecutive(prev, res)) { centry2=LookupResEntry(prev.GetKey()); @@ -355,6 +359,18 @@ void HeuristicBuilder::AssignTorsionsToResidue(const mol::ResidueHandle& res) flag=true; } } + } else if (cur_name==":") { + mol::ResidueHandle next=res.GetNext(); + if (Builder::AreResiduesConsecutive(res,next)) { + centry2=LookupResEntry(next.GetKey()); + if (centry2.second) { + //force CA since only N can be accessed by using centry2.first.GetNext(); + //TODO refactor using hardcoded torsions from heuristic and place in base class. + cur_name="CA"; + search_in=next; + flag=true; + } + } } else { flag=true; } diff --git a/modules/conop/src/heuristic_connect_table.hh b/modules/conop/src/heuristic_connect_table.hh index 22093c24b..8f22ebcd3 100644 --- a/modules/conop/src/heuristic_connect_table.hh +++ b/modules/conop/src/heuristic_connect_table.hh @@ -44,159 +44,159 @@ CONN_DEF_ENTRY def_entry_table[]={ {"Alanine","ALA",'A', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","OXT"},6, {{-2,1}, {1,2}, {2,3}, {3,4}, {2,5}, {3,-3}, {6, 3}},7, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, - },3, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, + },4, {0, 0, 0, 0, 0, 0},6 }, {"Cystein","CYS",'C', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","SG","OXT"},7, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{3,-3},{8, 3}},8, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"} - },4, + },5, {0, 0, 0, 0, 0, 0, 0},7 }, {"Aspartate","ASP",'D', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","OD1","OD2","OXT"},9, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{6,8},{3,-3},{9, 3}},10, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"} - },5, + },6, {0, 0, 0, 0, 0, 0, 0, 0, 0},9 }, {"Glutamate","GLU",'E', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","CD","OE1","OE2","OXT"},10, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{7,8},{7,9},{3,-3},{10, 3}},11, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"},{5,6,7,8,"CHI3"} - },6, + },7, {0},1 }, {"Phenylalanine","PHE",'F', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","CD1","CD2","CE1","CE2","CZ","OXT"},12, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{6,8},{7,9},{8,10},{9,11},{10,11},{3,-3},{12, 3}},14, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"} - },5, + },6, {0},1 }, {"Glycin","GLY",'G', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","OXT"},5, {{-2,1},{1,2},{2,3},{3,4},{3,-3},{5, 3}},6, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, - },3, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, + },4, {0},1 }, {"Histidine","HIS",'H', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","ND1","CD2","CE1","NE2","OXT"},11, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{6,8},{7,9},{8,10},{9,10},{3,-3},{11, 3}},13, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"} - },5, + },6, {0},1 }, {"Isoleucine","ILE",'I', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG1","CG2","CD1","OXT"},9, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{5,7},{6,8},{3,-3},{9, 3}},10, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,8,"CHI2"} - },5, + },6, {0},1 }, {"Lysin","LYS",'K', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","CD","CE","NZ","OXT"},10, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{7,8},{8,9},{3,-3},{10, 3}},11, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"},{5,6,7,8,"CHI3"},{6,7,8,9,"CHI4"} - },7, + },8, {0},1 }, {"Leucin","LEU",'L', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","CD1","CD2","OXT"},9, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{6,8},{3,-3},{9, 3}},10, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"} - },5, + },6, {0},1 }, {"Methionine","MET",'M', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","SD","CE","OXT"},9, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{7,8},{3,-3},{10, 3}},10, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"},{5,6,7,8,"CHI3"} - },6, + },7, {0},1 }, {"Asparagine","ASN",'N', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","OD1","ND2","OXT"},9, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{6,8},{3,-3},{9, 3}},10, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"} - },5, + },6, {0},1 }, {"Proline","PRO",'P', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","CD","OXT"},8, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{3,-3},{1,7},{8, 3}},10, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"} - },5, + },6, {0},1 }, {"Glutamine","GLN",'Q', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","CD","OE1","NE2","OXT"},10, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{7,8},{7,9},{3,-3},{10, 3}},11, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"},{5,6,7,8,"CHI3"} - },6, + },7, {0},1 }, {"Arginine","ARG",'R', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","CD","NE","CZ","NH1","NH2","OXT"},12, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{7,8},{8,9},{9,10},{9,11},{3,-3},{12, 3}},13, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"},{5,6,7,8,"CHI3"},{6,7,8,9,"CHI4"},{7,8,9,10,"CHI5"} - },8, + },9, {0},1 }, {"Serine","SER",'S', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","OG","OXT"},7, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{3,-3},{7, 3}},8, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"} - },4, + },5, {0},1 }, {"Threonine","THR",'T', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","OG1","CG2","OXT"},8, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{5,7},{3,-3},{8, 3}},9, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"} - },4, + },5, {0},1 }, {"Valine","VAL",'V', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG1","CG2","OXT"},8, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{5,7},{3,-3},{8, 3}},9, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"} - },4, + },5, {0},1 }, {"Tryptophan","TRP",'W', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","CD1","CD2","NE1","CE2","CE3","CZ2","CZ3","CH2","OXT"},15, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{6,8},{7,9},{8,10},{9,10},{8,11},{10,12},{11,13},{12,14},{13,14},{3,-3},{15, 3}},18, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"} - },5, + },6, {0},1 }, {"Tyrosin","TYR",'Y', mol::ChemClass(mol::ChemClass::LPeptideLinking), {"N","CA","C","O","CB","CG","CD1","CD2","CE1","CE2","CZ","OH","OXT"},13, {{-2,1},{1,2},{2,3},{3,4},{2,5},{5,6},{6,7},{6,8},{7,9},{8,10},{9,11},{10,11},{11,12},{3,-3},{13, 3}},15, - {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"}, + {{-2,1,2,3,"PHI"},{1,2,3,-3,"PSI"},{-3,3,2,1,"ISP"},{2,3,-3,-4,"OMEGA"}, {1,2,5,6,"CHI1"},{2,5,6,7,"CHI2"} - },5, + },6, {0},1 }, /* NUCLEIC ACIDS */ diff --git a/modules/mol/base/pymod/export_residue.cc b/modules/mol/base/pymod/export_residue.cc index 77e15ad61..42498a4e1 100644 --- a/modules/mol/base/pymod/export_residue.cc +++ b/modules/mol/base/pymod/export_residue.cc @@ -85,6 +85,8 @@ void export_Residue() .def("SetSecStructure", &ResidueBase::SetSecStructure) .def("GetPhiTorsion", &ResidueBase::GetPhiTorsion) .def("GetPsiTorsion", &ResidueBase::GetPsiTorsion) + .def("GetIspTorsion", &ResidueBase::GetIspTorsion) + .def("GetOmegaTorsion", &ResidueBase::GetOmegaTorsion) .def("IsValid", &ResidueBase::IsValid) .def(self_ns::str(self)) .def("GetOneLetterCode", &ResidueBase::GetOneLetterCode) diff --git a/modules/mol/base/src/impl/residue_impl.cc b/modules/mol/base/src/impl/residue_impl.cc index ccdbe30e5..2fd41b0ba 100644 --- a/modules/mol/base/src/impl/residue_impl.cc +++ b/modules/mol/base/src/impl/residue_impl.cc @@ -306,6 +306,32 @@ TorsionImplP ResidueImpl::FindTorsion(const String& torsion_name) const { return TorsionImplP(); } + +TorsionImplP ResidueImpl::GetOmegaTorsion() const { + ChainImplPtr chain=this->GetChain(); + ResidueImplPtr self=const_cast<ResidueImpl*>(this)->shared_from_this(); + ResidueImplPtr next=chain->GetNext(self); + if (!next || !InSequence(self, next)) + return TorsionImplP(); + + AtomImplPtr calpha=this->FindAtom("CA"); + AtomImplPtr c=this->FindAtom("C"); + AtomImplPtr nne=next->FindAtom("N"); + AtomImplPtr calphane=next->FindAtom("CA"); + TorsionImplList::const_iterator i=torsion_list_.begin(); + + for (;i!=torsion_list_.end(); ++i) { + TorsionImplP t=*i; + if (t->Matches(calpha, c, nne, calphane)) + return t; + } + + LOGN_DUMP("Can't find torsion Omega for " << + this->GetKey() << this->GetNumber()); + return TorsionImplP(); +} + + TorsionImplP ResidueImpl::GetPhiTorsion() const { ChainImplPtr chain=this->GetChain(); ResidueImplPtr self=const_cast<ResidueImpl*>(this)->shared_from_this(); diff --git a/modules/mol/base/src/impl/residue_impl.hh b/modules/mol/base/src/impl/residue_impl.hh index 47a833b56..21b3bcc9c 100644 --- a/modules/mol/base/src/impl/residue_impl.hh +++ b/modules/mol/base/src/impl/residue_impl.hh @@ -103,11 +103,17 @@ public: /// TorsionImplP will be returned. TorsionImplP GetPhiTorsion() const; - /// \brief Get isp torsion between this and the next residue + /// \brief Get isp torsion between this and the prev residue /// /// If no isp torsion has been assigned to this residue an invalid /// TorsionImplP will be returned. TorsionImplP GetIspTorsion() const; + + /// \brief Get omega torsion between this and the prev residue + /// + /// If no isp torsion has been assigned to this residue an invalid + /// TorsionImplP will be returned. + TorsionImplP ResidueImpl::GetOmegaTorsion() const; /// \brief Get psi torsion /// /// If no psi torsion has been assigned to this residue an invalid diff --git a/modules/mol/base/src/residue_base.cc b/modules/mol/base/src/residue_base.cc index 802db679e..dfd4b16fb 100644 --- a/modules/mol/base/src/residue_base.cc +++ b/modules/mol/base/src/residue_base.cc @@ -119,6 +119,18 @@ TorsionHandle ResidueBase::GetPsiTorsion() const return impl_->GetPsiTorsion(); } +TorsionHandle ResidueBase::GetIspTorsion() const +{ + this->CheckValidity(); + return impl_->GetIspTorsion(); +} + +TorsionHandle ResidueBase::GetOmegaTorsion() const +{ + this->CheckValidity(); + return impl_->GetOmegaTorsion(); +} + impl::ResidueImplPtr& ResidueBase::Impl() { return impl_; diff --git a/modules/mol/base/src/residue_base.hh b/modules/mol/base/src/residue_base.hh index 270cce51d..024812ab6 100644 --- a/modules/mol/base/src/residue_base.hh +++ b/modules/mol/base/src/residue_base.hh @@ -122,6 +122,17 @@ public: /// will be returned. TorsionHandle GetPsiTorsion() const; + /// \brief Get isp torsion + /// + /// If no isp torsion has been assigned to this residue an invalid TorsionHandle + /// will be returned. + TorsionHandle GetIspTorsion() const; + + /// \brief Get omega torsion + /// + /// If no omega torsion has been assigned to this residue an invalid TorsionHandle + /// will be returned. + TorsionHandle GetOmegaTorsion() const; char GetOneLetterCode() const; void SetOneLetterCode(char olc); diff --git a/modules/mol/base/src/residue_handle.hh b/modules/mol/base/src/residue_handle.hh index d3c228585..0d85e6e7f 100644 --- a/modules/mol/base/src/residue_handle.hh +++ b/modules/mol/base/src/residue_handle.hh @@ -127,7 +127,7 @@ public: int GetBondCount() const; /// \brief Find torsion by name - /// \note For the PHI and PSI torsions of the backbone use the designated + /// \note For the PHI, ISP and PSI torsions of the backbone use the designated /// GetPhiTorsion and GetPsiTorsion methods, respectively. /// \param torsion_name /// is the name of the torsion you are looking for. Torsions are named @@ -137,7 +137,7 @@ public: /// \sa ResidueBase::GetPhiTorsion, ResidueBase::GetPsiTorsion TorsionHandle FindTorsion(const String& torsion_name) const; - /// \brief Get list of all torsion of this residue + /// \brief Get list of all torsion angles of this residue TorsionHandleList GetTorsionList() const; /// \brief Get position of residue in chain. -- GitLab