From 704311bb153fc811260d99b988830d5c33e885f2 Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Thu, 12 Jul 2012 08:09:28 +0200 Subject: [PATCH] properly connect DNA/RNA --- modules/conop/src/heuristic_builder.cc | 22 +++++++++++++++----- modules/conop/src/heuristic_builder.hh | 2 ++ modules/conop/src/heuristic_connect_table.hh | 10 ++++----- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/modules/conop/src/heuristic_builder.cc b/modules/conop/src/heuristic_builder.cc index 458370078..07922d6a2 100644 --- a/modules/conop/src/heuristic_builder.cc +++ b/modules/conop/src/heuristic_builder.cc @@ -187,6 +187,7 @@ HeuristicBuilder::HeuristicBuilder(): emap_[def_entry.abbrev]=entry; } } + default_nucleotide_=LookupResEntry("G").first; LOG_DEBUG("done importing internal tables"); } @@ -321,6 +322,10 @@ void ConnectPrevNext(HeuristicBuilder* builder,mol::ResidueHandle res0, res0_ret.first=builder->DefaultPeptide(); res0_ret.second=true; } + if (res0.FindAtom("C3'") && res0.FindAtom("P")) { + res0_ret.first=builder->DefaultNucleotide(); + res0_ret.second=true; + } } if(!res1_ret.second) { @@ -329,6 +334,10 @@ void ConnectPrevNext(HeuristicBuilder* builder,mol::ResidueHandle res0, res1_ret.first=builder->DefaultPeptide(); res1_ret.second=true; } + if (res1.FindAtom("C3'") && res1.FindAtom("P")) { + res1_ret.first=builder->DefaultNucleotide(); + res1_ret.second=true; + } } if(res0_ret.second && res1_ret.second) { @@ -348,16 +357,19 @@ void ConnectPrevNext(HeuristicBuilder* builder,mol::ResidueHandle res0, if(flag) { if (builder->DoesPeptideBondExist(res0_atom, res1_atom)) { editor.Connect(res0_atom,res1_atom); - res0.SetIsProtein(true); - res1.SetIsProtein(true); + if (res0_ret.first.GetChemClass().IsPeptideLinking()) { + res0.SetIsProtein(true); + res1.SetIsProtein(true); + } } } else { if (builder->DoesPeptideBondExist(res1_atom, res0_atom)) { editor.Connect(res1_atom, res0_atom); - res0.SetIsProtein(true); - res1.SetIsProtein(true); + if (res0_ret.first.GetChemClass().IsPeptideLinking()) { + res0.SetIsProtein(true); + res1.SetIsProtein(true); + } } - } } } else { diff --git a/modules/conop/src/heuristic_builder.hh b/modules/conop/src/heuristic_builder.hh index bc3930bca..09a991345 100644 --- a/modules/conop/src/heuristic_builder.hh +++ b/modules/conop/src/heuristic_builder.hh @@ -110,6 +110,7 @@ public: virtual void FillAtomProps(mol::AtomHandle atom); const detail::ConnResEntry& DefaultPeptide() const {return default_peptide_;} + const detail::ConnResEntry& DefaultNucleotide() const {return default_nucleotide_;} protected: void ConnectivityFromAtomNames(const mol::ResidueHandle& res, detail::ConnResEntry& centry, @@ -117,6 +118,7 @@ protected: private: detail::ConnResEntryMap emap_; detail::ConnResEntry default_peptide_; + detail::ConnResEntry default_nucleotide_; }; diff --git a/modules/conop/src/heuristic_connect_table.hh b/modules/conop/src/heuristic_connect_table.hh index aa5c0b651..15e0f1a25 100644 --- a/modules/conop/src/heuristic_connect_table.hh +++ b/modules/conop/src/heuristic_connect_table.hh @@ -267,31 +267,31 @@ CONN_DEF_ENTRY def_entry_table[]={ {{0,0,0,0,""}},1, {0},1 }, - {"Adenosin","A",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), + {"Adenosin","DA",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), {"P","O5'","C5'","C4'","O4'","C3'","O3'","C2'","C1'","O1P","O2P","N9","C8","N7","C5","C6","N6","N1","C2","N3","C4","O2'"},12, {{-2,1},{1,2},{2,3},{3,4},{4,5},{4,6},{6,7},{6,8},{8,9},{5,9},{1,10},{1,11},{8,22},{9,12},{7,-3}},15, {{0,0,0,0,""}},1, {0},1 }, - {"Cytosin","C",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), + {"Cytosin","DC",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), {"P","O5'","C5'","C4'","O4'","C3'","O3'","C2'","C1'","O1P","O2P","O2'"},12, {{-2,1},{1,2},{2,3},{3,4},{4,5},{4,6},{6,7},{6,8},{8,9},{5,9},{1,10},{1,11},{8,12},{7,-3}},14, {{0,0,0,0,""}},1, {0},1 }, - {"Guanidin","G",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), + {"Guanidin","DG",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), {"P","O5'","C5'","C4'","O4'","C3'","O3'","C2'","C1'","O1P","O2P","O2'"},12, {{-2,1},{1,2},{2,3},{3,4},{4,5},{4,6},{6,7},{6,8},{8,9},{5,9},{7,-3},{1,10},{1,11},{8,12}},14, {{0,0,0,0,""}},1, {0},1 }, - {"Thymidin","T",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), + {"Thymidin","DT",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), {"P","O5'","C5'","C4'","O4'","C3'","O3'","C2'","C1'","O1P","O2P","O2'"},12, {{-2,1},{1,2},{2,3},{3,4},{4,5},{4,6},{6,7},{6,8},{8,9},{5,9},{7,-3},{1,10},{8,12},{1,11}},15, {{0,0,0,0,""}},1, {0},1 }, - {"Uracil","U",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), + {"Uracil","DU",'?', mol::ChemClass(mol::ChemClass::DNA_LINKING), {"P","O5'","C5'","C4'","O4'","C3'","O3'","C2'","C1'","O1P","O2P","O2'"},12, {{-2,1},{1,2},{2,3},{3,4},{4,5},{4,6},{6,7},{6,8},{8,9},{5,9},{7,-3},{1,10},{1,11},{8,12}},14, {{0,0,0,0,""}},1, -- GitLab