diff --git a/modules/base/tests/test_generic_property.cc b/modules/base/tests/test_generic_property.cc index 9fad50c49e5e876868e995518cf8419975987120..8b946685cbb0da482e024adf87c0901a09217119 100644 --- a/modules/base/tests/test_generic_property.cc +++ b/modules/base/tests/test_generic_property.cc @@ -29,7 +29,7 @@ BOOST_AUTO_TEST_SUITE( base ) BOOST_AUTO_TEST_CASE( test_generic_property ) { EntityHandle eh=CreateEntity(); - XCSEditor editor=eh.RequestXCSEditor(); + XCSEditor editor=eh.EditXCS(); ChainHandle ch=editor.InsertChain("A"); ResidueHandle res = editor.AppendResidue(ch, "X"); AtomHandle atom = editor.InsertAtom(res, "Y",geom::Vec3()); diff --git a/modules/bindings/pymod/tmtools.py b/modules/bindings/pymod/tmtools.py index 9405a31df86e42656ac449db07679968af097928..04db235931de9885850cc2c412cb8ed7038c6399 100644 --- a/modules/bindings/pymod/tmtools.py +++ b/modules/bindings/pymod/tmtools.py @@ -120,10 +120,12 @@ def _RunTmScore(tmscore, tmp_dir): model2_filename=os.path.join(tmp_dir, 'model02.pdb') if platform.system() == "Windows": tmscore_path=settings.Locate('tmscore.exe', explicit_file_name=tmscore) - command="\"%s\" %s %s" %(os.path.normpath(tmscore_path), model1_filename, model2_filename) + command="\"%s\" %s %s" %(os.path.normpath(tmscore_path), model1_filename, + model2_filename) else: tmscore_path=settings.Locate('tmscore', explicit_file_name=tmscore) - command="\"%s\" \"%s\" \"%s\"" %(tmscore_path, model1_filename, model2_filename) + command="\"%s\" \"%s\" \"%s\"" % (tmscore_path, model1_filename, + model2_filename) ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) ps.wait() lines=ps.stdout.readlines() @@ -137,7 +139,7 @@ def TMAlign(model1, model2, tmalign=None): """ tmp_dir_name=_SetupFiles((model1, model2)) result=_RunTmAlign(tmalign, tmp_dir_name) - model1.handle.RequestXCSEditor().ApplyTransform(result.transform) + model1.handle.EditXCS().ApplyTransform(result.transform) _CleanupFiles(tmp_dir_name) return result def TMScore(model1, model2, tmscore=None): @@ -146,6 +148,6 @@ def TMScore(model1, model2, tmscore=None): """ tmp_dir_name=_SetupFiles((model1, model2)) result=_RunTmScore(tmscore, tmp_dir_name) - model1.handle.RequestXCSEditor().ApplyTransform(result.transform) + model1.handle.EditXCS().ApplyTransform(result.transform) _CleanupFiles(tmp_dir_name) return result diff --git a/modules/conop/src/builder.cc b/modules/conop/src/builder.cc index 9fce604d833a0d25508c231360a95642a48e5152..60bf273a5d08b374707c93afdbaccb84741364d9 100644 --- a/modules/conop/src/builder.cc +++ b/modules/conop/src/builder.cc @@ -168,7 +168,7 @@ void Builder::AssignBackBoneTorsionsToResidue(mol::ResidueHandle res) mol::ResidueHandle prev=res.GetPrev(); mol::ResidueHandle next=res.GetNext(); - mol::XCSEditor e=res.GetEntity().RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor e=res.GetEntity().EditXCS(mol::BUFFERED_EDIT); //psi if (next.IsValid() && next.IsPeptideLinking()){ mol::AtomHandle ca_this=res.FindAtom("CA"); @@ -209,7 +209,7 @@ void Builder::AssignBackBoneTorsionsToResidue(mol::ResidueHandle res) void Builder::DistanceBasedConnect(mol::AtomHandle atom) { mol::EntityHandle ent=atom.GetEntity(); - mol::XCSEditor editor=ent.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=ent.EditXCS(mol::BUFFERED_EDIT); mol::AtomHandleList alist = ent.FindWithin(atom.GetPos(),4.0); mol::ResidueHandle res_a=atom.GetResidue(); for (mol::AtomHandleList::const_iterator it=alist.begin(), diff --git a/modules/conop/src/conop.cc b/modules/conop/src/conop.cc index e992fd7d5ca8667afe8b2738e25173e0c120119b..f546f520459dc072f1095fabd2d484da7d1e0b9a 100644 --- a/modules/conop/src/conop.cc +++ b/modules/conop/src/conop.cc @@ -262,7 +262,7 @@ void Conopology::ConnectAll(const BuilderP& b, mol::EntityHandle eh, int flag) { Profile profile_connect("ConnectAll"); LOG_DEBUG("Conopology: ConnectAll: building internal coordinate system"); - mol::XCSEditor xcs_e=eh.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor xcs_e=eh.EditXCS(mol::BUFFERED_EDIT); PropAssigner a(b); eh.Apply(a); LOG_DEBUG("Conopology: ConnectAll: connecting all bonds"); diff --git a/modules/conop/src/heuristic_builder.cc b/modules/conop/src/heuristic_builder.cc index 55f548ae37b97fa43eb564d8a1f93cec8d1da5d7..c808dbd083f43204855c10c9dd24ff768d312508 100644 --- a/modules/conop/src/heuristic_builder.cc +++ b/modules/conop/src/heuristic_builder.cc @@ -195,7 +195,7 @@ void HeuristicBuilder::ConnectivityFromAtomNames(const mol::ResidueHandle& res, mol::AtomHandleList& unknown_atoms) { unknown_atoms.clear(); mol::AtomHandleList atomlist=res.GetAtomList(); - mol::XCSEditor editor=res.GetEntity().RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=res.GetEntity().EditXCS(mol::BUFFERED_EDIT); for (mol::AtomHandleList::iterator it1=atomlist.begin();it1!=atomlist.end();++it1) { if (centry.HasAtom(it1->GetName())) { mol::AtomHandleList::iterator it2=it1; @@ -265,7 +265,7 @@ void ConnectPrevNext(HeuristicBuilder* builder,mol::ResidueHandle res0, { static String fname=flag ? "HeuristicBuilder: ConnectNextXCS" : "HeuristicBuilder: ConnectPrevXCS"; if(!res0) return; // return if invalid - mol::XCSEditor editor=res0.GetEntity().RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=res0.GetEntity().EditXCS(mol::BUFFERED_EDIT); LOG_DEBUG(fname << " on " << res0.GetKey() << " " << res0.GetNumber()); if(!res1) { @@ -333,7 +333,7 @@ void ConnectPrevNext(HeuristicBuilder* builder,mol::ResidueHandle res0, void HeuristicBuilder::AssignTorsionsToResidue(mol::ResidueHandle res) { - mol::XCSEditor editor=res.GetEntity().RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=res.GetEntity().EditXCS(mol::BUFFERED_EDIT); mol::ChainHandle chain=res.GetChain(); std::pair<detail::ConnResEntry,bool> centry2 = LookupResEntry(res.GetKey()); if (centry2.second) { diff --git a/modules/conop/src/rule_based_builder.cc b/modules/conop/src/rule_based_builder.cc index bd7b5cfcade5f2b814f0f5fc4da5bd3e9a399660..03bfb13a25deba48e28b5f24aa46a44a7954b757 100644 --- a/modules/conop/src/rule_based_builder.cc +++ b/modules/conop/src/rule_based_builder.cc @@ -202,7 +202,7 @@ void RuleBasedBuilder::ConnectAtomsOfResidue(mol::ResidueHandle rh) dist_connect(this, rh.GetAtomList()); return; } - mol::XCSEditor e=rh.GetEntity().RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor e=rh.GetEntity().EditXCS(mol::BUFFERED_EDIT); BondSpecList::const_iterator j=last_compound_->GetBondSpecs().begin(); mol::AtomHandleList atoms=rh.GetAtomList(); for(; j!=last_compound_->GetBondSpecs().end(); ++j) { @@ -232,7 +232,7 @@ void RuleBasedBuilder::ConnectResidueToNext(mol::ResidueHandle rh, return; } Compound::Dialect dialect=this->GetDialect()==PDB_DIALECT ? Compound::PDB : Compound::CHARMM; - mol::XCSEditor e=rh.GetEntity().RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor e=rh.GetEntity().EditXCS(mol::BUFFERED_EDIT); CompoundPtr mc=compound_lib_->FindCompound(rh.GetName(), dialect); CompoundPtr nc=compound_lib_->FindCompound(next.GetName(), dialect); if (!(mc && nc)) diff --git a/modules/conop/tests/test_heuristic_builder.cc b/modules/conop/tests/test_heuristic_builder.cc index 473ff46dd7c1addd82403eeebdfd09e15793ccdb..33a1aaa7606a8fcfce335c28102293b83f98b48e 100644 --- a/modules/conop/tests/test_heuristic_builder.cc +++ b/modules/conop/tests/test_heuristic_builder.cc @@ -33,7 +33,7 @@ namespace { ResidueHandle make_arg(ChainHandle chain) { - XCSEditor e=chain.GetEntity().RequestXCSEditor(); + XCSEditor e=chain.GetEntity().EditXCS(); ResidueHandle res = e.AppendResidue(chain, "ARG"); e.InsertAtom(res, "N",geom::Vec3(20.202,33.112,58.011)); e.InsertAtom(res, "CA",geom::Vec3(19.396,31.903,58.033)); @@ -51,7 +51,7 @@ ResidueHandle make_arg(ChainHandle chain) ResidueHandle make_leu(ChainHandle chain) { - XCSEditor e=chain.GetEntity().RequestXCSEditor(); + XCSEditor e=chain.GetEntity().EditXCS(); ResidueHandle res=e.AppendResidue(chain, "LEU"); e.InsertAtom(res, "N", geom::Vec3(19.003,32.473,60.366)); @@ -146,7 +146,7 @@ BOOST_AUTO_TEST_SUITE( conop ) BOOST_AUTO_TEST_CASE(name_based_connect) { EntityHandle e=CreateEntity(); - ChainHandle c=e.RequestXCSEditor().InsertChain("A"); + ChainHandle c=e.EditXCS().InsertChain("A"); ResidueHandle ile=make_leu(c); ResidueHandle arg=make_arg(c); HeuristicBuilder heuristic_builder; @@ -164,7 +164,7 @@ BOOST_AUTO_TEST_CASE(name_based_connect) BOOST_AUTO_TEST_CASE(test_assign_torsions){ EntityHandle e=CreateEntity(); - ChainHandle c=e.RequestXCSEditor().InsertChain("A"); + ChainHandle c=e.EditXCS().InsertChain("A"); ResidueHandle l1=make_leu(c); ResidueHandle a2=make_arg(c); ResidueHandle l3=make_leu(c); @@ -178,7 +178,7 @@ BOOST_AUTO_TEST_CASE(test_assign_torsions){ heuristic_builder.ConnectAtomsOfResidue(l1); heuristic_builder.ConnectAtomsOfResidue(a2); heuristic_builder.ConnectAtomsOfResidue(l3); - XCSEditor edi=e.RequestXCSEditor(); + XCSEditor edi=e.EditXCS(); edi.Connect(l1.FindAtom("C"), a2.FindAtom("N")); edi.Connect(a2.FindAtom("C"), l3.FindAtom("N")); heuristic_builder.AssignTorsions(c); diff --git a/modules/gui/src/file_loader.cc b/modules/gui/src/file_loader.cc index a874742bce365399da8a5c89328fd2d19436a1e3..ac35f1a6a0bc03873dc1bdcebbdcde023b4df2eb 100644 --- a/modules/gui/src/file_loader.cc +++ b/modules/gui/src/file_loader.cc @@ -245,7 +245,7 @@ gfx::GfxObjP FileLoader::TryLoadEntity(const QString& filename, io::EntityIOHand else{ QFileInfo file_info(filename); mol::EntityHandle eh=mol::CreateEntity(); - mol::XCSEditor xcs_lock=eh.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor xcs_lock=eh.EditXCS(mol::BUFFERED_EDIT); handler->Import(eh,filename.toStdString()); if(handler->RequiresBuilder()) { conop::BuilderP builder = conop::Conopology::Instance().GetBuilder(); diff --git a/modules/io/src/mol/entity_io_crd_handler.cc b/modules/io/src/mol/entity_io_crd_handler.cc index 88286b78e628d869a96ee89456c8070374545c53..02817c2a990252481528e0451b88cb9c8df67b0b 100644 --- a/modules/io/src/mol/entity_io_crd_handler.cc +++ b/modules/io/src/mol/entity_io_crd_handler.cc @@ -87,7 +87,7 @@ void CRDReader::Import(mol::EntityHandle& ent) void CRDReader::ParseAndAddAtom(const String& line, mol::EntityHandle& ent) { - mol::XCSEditor editor=ent.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=ent.EditXCS(mol::BUFFERED_EDIT); LOG_TRACE( "line: [" << line << "]" ); @@ -257,7 +257,7 @@ mol::EntityHandle LoadCRD(const String& file_name) conop::BuilderP builder = conop::Conopology::Instance().GetBuilder(); CRDReader reader(file_name); mol::EntityHandle ent=mol::CreateEntity(); - mol::XCSEditor editor=ent.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=ent.EditXCS(mol::BUFFERED_EDIT); reader.Import(ent); conop::Conopology::Instance().ConnectAll(builder,ent); return ent; diff --git a/modules/io/src/mol/entity_io_mae_handler.cc b/modules/io/src/mol/entity_io_mae_handler.cc index f5def7a3e0e6c944fd3bd8652fc376d4e8f9fd0b..b48cdd551bc4279f02668ab682e90a6f346f2f04 100644 --- a/modules/io/src/mol/entity_io_mae_handler.cc +++ b/modules/io/src/mol/entity_io_mae_handler.cc @@ -119,7 +119,7 @@ void MAEReader::Import(mol::EntityHandle& ent) int i_res_num=-1; int i_chain_name=-1; - mol::XCSEditor editor=ent.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=ent.EditXCS(mol::BUFFERED_EDIT); while(std::getline(in_,line)) { line = boost::trim_copy(line); @@ -325,7 +325,7 @@ mol::EntityHandle LoadMAE(const String& file_name) conop::BuilderP builder = conop::Conopology::Instance().GetBuilder(); MAEReader reader(file_name); mol::EntityHandle ent=mol::CreateEntity(); - mol::XCSEditor editor=ent.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=ent.EditXCS(mol::BUFFERED_EDIT); reader.Import(ent); conop::Conopology::Instance().ConnectAll(builder,ent); return ent; diff --git a/modules/io/src/mol/load_entity.cc b/modules/io/src/mol/load_entity.cc index 4eda99b4a01acb435819e0a9f3905e5e01db9a39..f35178546f766148e7d5317a1c1286969ca90198 100644 --- a/modules/io/src/mol/load_entity.cc +++ b/modules/io/src/mol/load_entity.cc @@ -60,7 +60,7 @@ mol::EntityHandle LoadEntity(const String& filename, int flag) { LOG_DEBUG("creating emtpy entity"); mol::EntityHandle eh=mol::CreateEntity(); - mol::XCSEditor xcs_lock=eh.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor xcs_lock=eh.EditXCS(mol::BUFFERED_EDIT); Import(eh,filename,flag); return eh; } diff --git a/modules/io/src/mol/pdb_reader.cc b/modules/io/src/mol/pdb_reader.cc index 969d9ffa158269e26a8e885b64d3b37121b4fbc3..b3059d49f3ac9f01a39e1c4a3ec082b3712488b4 100644 --- a/modules/io/src/mol/pdb_reader.cc +++ b/modules/io/src/mol/pdb_reader.cc @@ -411,7 +411,7 @@ void PDBReader::ParseAndAddAtom(const StringRef& line, int line_num, if (!this->EnsureLineLength(line, 54)) { return; } - mol::XCSEditor editor=ent.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=ent.EditXCS(mol::BUFFERED_EDIT); char alt_loc=0; String chain_name; StringRef res_name, atom_name; diff --git a/modules/io/src/mol/sdf_reader.cc b/modules/io/src/mol/sdf_reader.cc index a7f70c916adf46b04133aca145d0809b721c3836..09dea4696191fd9e0c7878b20776d3ba8aaf6cfa 100644 --- a/modules/io/src/mol/sdf_reader.cc +++ b/modules/io/src/mol/sdf_reader.cc @@ -54,7 +54,7 @@ SDFReader::SDFReader(std::istream& instream) void SDFReader::Import(mol::EntityHandle& ent) { String line; - mol::XCSEditor editor=ent.RequestXCSEditor(mol::BUFFERED_EDIT); + mol::XCSEditor editor=ent.EditXCS(mol::BUFFERED_EDIT); while (std::getline(instream_,line)) { ++line_num; diff --git a/modules/io/tests/test_io_pdb.cc b/modules/io/tests/test_io_pdb.cc index fe1abe329fcb5b408dbcc397583cd462ff119a88..292495a1de60d07b195da26d54a81e132c3e6eb5 100644 --- a/modules/io/tests/test_io_pdb.cc +++ b/modules/io/tests/test_io_pdb.cc @@ -221,7 +221,7 @@ BOOST_AUTO_TEST_CASE(write_atom) PDBWriter writer(out); mol::EntityHandle ent=mol::CreateEntity(); - mol::XCSEditor edi=ent.RequestXCSEditor(); + mol::XCSEditor edi=ent.EditXCS(); mol::ChainHandle ch=edi.InsertChain("A"); mol::ResidueHandle r=edi.AppendResidue(ch, "GLY"); @@ -242,7 +242,7 @@ BOOST_AUTO_TEST_CASE(write_hetatom) PDBWriter writer(out); mol::EntityHandle ent=mol::CreateEntity(); - mol::XCSEditor edi=ent.RequestXCSEditor(); + mol::XCSEditor edi=ent.EditXCS(); mol::ChainHandle ch=edi.InsertChain("A"); mol::ResidueHandle r=edi.AppendResidue(ch, "CA"); mol::AtomHandle a=edi.InsertAtom(r, "CA", geom::Vec3(32.0, -128.0, -2.5), @@ -380,7 +380,7 @@ BOOST_AUTO_TEST_CASE(res_name_too_long) PDBWriter writer(out); mol::EntityHandle ent=mol::CreateEntity(); - mol::XCSEditor edi=ent.RequestXCSEditor(); + mol::XCSEditor edi=ent.EditXCS(); mol::ChainHandle ch=edi.InsertChain("A"); mol::ResidueHandle r=edi.AppendResidue(ch, "CALCIUM"); mol::AtomHandle a=edi.InsertAtom(r, "CA", geom::Vec3(32.0, -128.0, -2.5)); @@ -393,7 +393,7 @@ BOOST_AUTO_TEST_CASE(chain_name_too_long) PDBWriter writer(out); mol::EntityHandle ent=mol::CreateEntity(); - mol::XCSEditor edi=ent.RequestXCSEditor(); + mol::XCSEditor edi=ent.EditXCS(); mol::ChainHandle ch=edi.InsertChain("AB"); mol::ResidueHandle r=edi.AppendResidue(ch, "CA"); mol::AtomHandle a=edi.InsertAtom(r, "CA", geom::Vec3(32.0, -128.0, -2.5)); @@ -406,7 +406,7 @@ BOOST_AUTO_TEST_CASE(atom_name_too_long) PDBWriter writer(out); mol::EntityHandle ent=mol::CreateEntity(); - mol::XCSEditor edi=ent.RequestXCSEditor(); + mol::XCSEditor edi=ent.EditXCS(); mol::ChainHandle ch=edi.InsertChain("A"); mol::ResidueHandle r=edi.AppendResidue(ch, "CA"); mol::AtomHandle a=edi.InsertAtom(r, "CALCIUM", geom::Vec3(32.0, -128.0, -2.5)); diff --git a/modules/mol/alg/src/local_dist_test.cc b/modules/mol/alg/src/local_dist_test.cc index bd88902b0e181bb29f62da86ae41367137b23ded..cea1ea47d1e37140b7920814e27e5aa830388457 100644 --- a/modules/mol/alg/src/local_dist_test.cc +++ b/modules/mol/alg/src/local_dist_test.cc @@ -121,7 +121,7 @@ Real LocalDistTest(const EntityView& mdl, const EntityView& ref, // Residues with symmetric side-chains require special treatment as there are // two possible ways to name the atoms. We calculate the overlap with the // fixed atoms and take the solution that gives bigger scores. - XCSEditor edi=ref.GetHandle().RequestXCSEditor(BUFFERED_EDIT); + XCSEditor edi=ref.GetHandle().EditXCS(BUFFERED_EDIT); for (ResidueViewList::iterator i=ref_residues.begin(), e=ref_residues.end(); i!=e; ++i) { const String rname=i->GetName(); diff --git a/modules/mol/alg/src/svd_superpose.cc b/modules/mol/alg/src/svd_superpose.cc index 191871a9c888eca76ef2672def7d08e71281523c..90b6a8c04a6adbddbcd63cc9859ea579ad95d374 100644 --- a/modules/mol/alg/src/svd_superpose.cc +++ b/modules/mol/alg/src/svd_superpose.cc @@ -354,7 +354,7 @@ SuperpositionResult SuperposeAtoms(const mol::AtomViewList& atoms1, res.ncycles=1; mol::AtomView jv=atoms1.front(); if (apply_transform){ - mol::XCSEditor ed=jv.GetResidue().GetChain().GetEntity().GetHandle().RequestXCSEditor(); + mol::XCSEditor ed=jv.GetResidue().GetChain().GetEntity().GetHandle().EditXCS(); ed.ApplyTransform(res.transformation); } return res; @@ -381,7 +381,7 @@ SuperpositionResult SuperposeSVD(const mol::EntityView& ev1, //save rmsd info res.rmsd=CalculateRMSD(ev1, ev2, res.transformation); if (apply_transform){ - mol::XCSEditor ed=ev1.GetHandle().RequestXCSEditor(); + mol::XCSEditor ed=ev1.GetHandle().EditXCS(); ed.ApplyTransform(res.transformation); } return res; @@ -457,7 +457,7 @@ SuperpositionResult IterativeSuperposition(mol::EntityView& ev1, result.entity_view2=CreateViewFromAtomList(atoms_b); if (apply_transform){ - mol::XCSEditor ed=ev1.GetHandle().RequestXCSEditor(); + mol::XCSEditor ed=ev1.GetHandle().EditXCS(); ed.ApplyTransform(result.transformation); } return result; diff --git a/modules/mol/alg/tests/test_superposition.cc b/modules/mol/alg/tests/test_superposition.cc index 599e0e31ca8461a1302b6f9ec8b77131a66cbcb6..0d18b1aa8cb623655c332a7305de485307112d5a 100644 --- a/modules/mol/alg/tests/test_superposition.cc +++ b/modules/mol/alg/tests/test_superposition.cc @@ -34,7 +34,7 @@ struct Fixture { Fixture() { e=CreateEntity(); - XCSEditor ed=e.RequestXCSEditor(); + XCSEditor ed=e.EditXCS(); c=ed.InsertChain("A"); r=ed.AppendResidue(c, "XXX"); ab=ed.InsertAtom(r, "A", geom::Vec3(-5,-5,-5), "C"); @@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE(superposition_svd) { Fixture f1, f2; EntityView ev1 = f1.e.CreateFullView(); - XCSEditor ed=f1.e.RequestXCSEditor(); + XCSEditor ed=f1.e.EditXCS(); EntityView ev2 = f2.e.CreateFullView(); ChainHandle ch1=f1.e.GetChainList()[0]; ResidueHandleIter rit=ch1.ResiduesBegin(); diff --git a/modules/mol/base/doc/entity.rst b/modules/mol/base/doc/entity.rst index e6bebee7c94e7f83b8fba0c83685cc930e039002..8099919ae73b3c596c77256d0a746d5d3edabf33 100644 --- a/modules/mol/base/doc/entity.rst +++ b/modules/mol/base/doc/entity.rst @@ -143,7 +143,7 @@ The Handle Classes See :attr:`atoms` - .. method:: RequestXCSEditor([edit_mode=mol.EditMode.BUFFERED_EDIT]) + .. method:: EditXCS([edit_mode=mol.EditMode.BUFFERED_EDIT]) Request :class:`XCSEditor` for editing the external coordinate system. This call will fail when there are pending changes of the internal coordinate @@ -156,7 +156,7 @@ The Handle Classes :returns: :class:`XCSEditor` - .. method:: RequestICSEditor([edit_mode=mol.EditMode.BUFFERED_EDIT]) + .. method:: EditICS([edit_mode=mol.EditMode.BUFFERED_EDIT]) Request :class:`ICSEditor` for editing the internal coordinate system, such as torsions, bond lengths and angle between two bonds. This call will fail diff --git a/modules/mol/base/pymod/export_editors.cc b/modules/mol/base/pymod/export_editors.cc index 91926f2e797135940d00faeb1f544b07b0d89542..8c485cb7f0d2c52bbf08ea99c92d6d7d9fb1f39a 100644 --- a/modules/mol/base/pymod/export_editors.cc +++ b/modules/mol/base/pymod/export_editors.cc @@ -59,12 +59,7 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_insert_atom_overloads, } void export_Editors() -{ - enum_<EditMode>("EditMode") - .value("BUFFERED_EDIT", BUFFERED_EDIT) - .value("UNBUFFERED_EDIT", UNBUFFERED_EDIT) - ; - +{ class_<EditorBase>("EditorBase", no_init) .def("InsertChain", &EditorBase::InsertChain) .def("InsertAtom", &EditorBase::InsertAtom, diff --git a/modules/mol/base/pymod/export_entity.cc b/modules/mol/base/pymod/export_entity.cc index b0df16c0c9065f8084127b48a1055cd29090d849..b8fcff8a959679f64573b905cb9880737d703549 100644 --- a/modules/mol/base/pymod/export_entity.cc +++ b/modules/mol/base/pymod/export_entity.cc @@ -49,11 +49,20 @@ StringMethod select_string=&EntityHandle::Select; Real (EntityHandle::*get_angle1)(const AtomHandle&, const AtomHandle&, const AtomHandle&) const = &EntityHandle::GetAngle; Real (EntityHandle::*get_angle2)(const AtomView&, const AtomView&, const AtomView&) const = &EntityHandle::GetAngle; + +XCSEditor depr_request_xcs_editor(EntityHandle e, EditMode m) +{ + WARN_DEPRECATED("EntityHandle::RequestXCSEditor is deprecated. Use " + "EntityHandle::EditXCS instead"); + return e.EditXCS(m); +} -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_xcs_editor_overloads, - EntityHandle::RequestXCSEditor, 0, 1) -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_ics_editor_overloads, - EntityHandle::RequestICSEditor, 0, 1) +ICSEditor depr_request_ics_editor(EntityHandle e, EditMode m) +{ + WARN_DEPRECATED("EntityHandle::RequestICSEditor is deprecated. Use " + "EntityHandle::EditICS instead"); + return e.EditICS(m); +} } @@ -121,10 +130,11 @@ void export_Entity() .add_property("transform", make_function(&EntityHandle::GetTransformationMatrix, return_value_policy<copy_const_reference>())) - .def("RequestICSEditor", &EntityHandle::RequestICSEditor, - X_ics_editor_overloads(args("mode"))) - .def("RequestXCSEditor", &EntityHandle::RequestXCSEditor, - X_xcs_editor_overloads(args("mode"))) + + .def("EditXCS", &EntityHandle::EditXCS, arg("mode")=UNBUFFERED_EDIT) + .def("EditICS", &EntityHandle::EditICS, arg("mode")=UNBUFFERED_EDIT) + .def("RequestXCSEditor", &depr_request_xcs_editor, arg("mode")=UNBUFFERED_EDIT) + .def("RequestICSEditor", &depr_request_ics_editor, arg("mode")=UNBUFFERED_EDIT) .def("IsTransformationIdentity",&EntityHandle::IsTransformationIdentity) .def(self==self) .def(self!=self) diff --git a/modules/mol/base/pymod/wrap_mol.cc b/modules/mol/base/pymod/wrap_mol.cc index 6885a79020eb5a667a498766a7ae6c07df7c54e8..800af3a1ce108e979faaa9f50180b4f5fa0f0740 100644 --- a/modules/mol/base/pymod/wrap_mol.cc +++ b/modules/mol/base/pymod/wrap_mol.cc @@ -18,6 +18,7 @@ //------------------------------------------------------------------------------ #include <boost/python.hpp> #include <ost/mol/transform.hh> +#include <ost/mol/editor_base.hh> #include <ost/info/info.hh> using namespace boost::python; @@ -44,6 +45,10 @@ void export_QueryViewWrapper(); void export_EntityPropertyMapper(); BOOST_PYTHON_MODULE(_mol) { + enum_<EditMode>("EditMode") + .value("BUFFERED_EDIT", BUFFERED_EDIT) + .value("UNBUFFERED_EDIT", UNBUFFERED_EDIT) + ; export_Entity(); export_Surface(); export_Query(); diff --git a/modules/mol/base/src/atom_base.cc b/modules/mol/base/src/atom_base.cc index 6de12176fc090aa013d084ecf1bd178153778011..a8719ab960b8e367aca7be53590d025f182de08b 100644 --- a/modules/mol/base/src/atom_base.cc +++ b/modules/mol/base/src/atom_base.cc @@ -188,7 +188,7 @@ void AtomBase::SetCharge(Real charge) void AtomBase::SetRadius(Real radius) { this->CheckValidity(); - Impl()->SetCharge(radius); + Impl()->SetRadius(radius); } const geom::Mat3& AtomBase::GetAnisou() const diff --git a/modules/mol/base/src/chain_handle.hh b/modules/mol/base/src/chain_handle.hh index 6337818deeebc8356c1a08421173edc39da076ee..514188612bd03e31fea1556dfa4856924223f046 100644 --- a/modules/mol/base/src/chain_handle.hh +++ b/modules/mol/base/src/chain_handle.hh @@ -46,7 +46,7 @@ namespace ost { namespace mol { /// the residue numbers are in ascending order. /// /// New residues are inserted via one of the editors obtained from -/// EntityHandle::RequestXCSEditor() or EntityHandle::RequestICSEditor(). To +/// EntityHandle::EditXCS() or EntityHandle::EditICS(). To /// append a residue to the C-terminal end, use EditorBase::AppendResidue, to /// insert after or before a specific residue, EditorBase::InsertResidueAfter /// and ditorBase::InsertResidueABefore will do the job, respectively. diff --git a/modules/mol/base/src/chem_class.hh b/modules/mol/base/src/chem_class.hh index f9c0f8279666df6fee4f2370b2ed40ba29432203..43bdef9a85cbcfc623c95eda4de7314071378fbc 100644 --- a/modules/mol/base/src/chem_class.hh +++ b/modules/mol/base/src/chem_class.hh @@ -18,16 +18,13 @@ //------------------------------------------------------------------------------ #ifndef OST_BASE_CHEM_CLASS_HI #define OST_BASE_CHEM_CLASS_HI -#include <vector> - -#include <boost/shared_ptr.hpp> #include <ost/mol/module_config.hh> namespace ost { namespace mol { -struct ChemClass { +struct DLLEXPORT ChemClass { const static char PeptideLinking ='P'; const static char DPeptideLinking ='D'; const static char LPeptideLinking ='L'; diff --git a/modules/mol/base/src/coord_source.cc b/modules/mol/base/src/coord_source.cc index 37d1fbd91cf9ce4dba16bb3614909cf77f064111..db02718fd5bec7c2721ddf11ec3eca4bc55e0932 100644 --- a/modules/mol/base/src/coord_source.cc +++ b/modules/mol/base/src/coord_source.cc @@ -63,7 +63,7 @@ void CoordSource::CopyFrame(uint frame_id) return; } assert(frame->size()==atoms_.size()); - XCSEditor edi=atoms_.front().GetEntity().RequestXCSEditor(BUFFERED_EDIT); + XCSEditor edi=atoms_.front().GetEntity().EditXCS(BUFFERED_EDIT); CoordFrame::const_iterator c=frame->begin(); for (AtomHandleList::iterator i=atoms_.begin(), e=atoms_.end(); i!=e; ++i, ++c) { diff --git a/modules/mol/base/src/editor_base.hh b/modules/mol/base/src/editor_base.hh index e8a11272657de25b909201a73eca6fb2bb42e64e..c0ee9135024a7b0cfb28d3e15ab0f3784c7c6727 100644 --- a/modules/mol/base/src/editor_base.hh +++ b/modules/mol/base/src/editor_base.hh @@ -39,8 +39,8 @@ namespace ost { namespace mol { /// Editors are usually used as one of the concrete subclasses of EditorBase: /// XCSEditor and ICSEditor. The former operates on the external carthesian /// coordinate system while the latter operates on the internal coordinate -/// system. To create a new editor, use EntityHandle::RequestXCSEditor() and -/// EntityHandle::RequestICSEditor(), respectively. +/// system. To create a new editor, use EntityHandle::EditXCS() and +/// EntityHandle::EditICS(), respectively. /// /// For an introduction to the concept of editors go \ref editors "here" class DLLEXPORT_OST_MOL EditorBase { diff --git a/modules/mol/base/src/entity_handle.cc b/modules/mol/base/src/entity_handle.cc index 17c47cd81112c92ef308c598cf7c03202a1c6648..1de8bff483b9d256e0784fc68b054c31d30010e7 100644 --- a/modules/mol/base/src/entity_handle.cc +++ b/modules/mol/base/src/entity_handle.cc @@ -304,13 +304,13 @@ AtomHandleIter EntityHandle::AtomsEnd() const impl::end(r.back()->GetAtomList()), ent, false); } -XCSEditor EntityHandle::RequestXCSEditor(EditMode mode) const +XCSEditor EntityHandle::EditXCS(EditMode mode) const { this->CheckValidity(); return XCSEditor(*this, mode); } -ICSEditor EntityHandle::RequestICSEditor(EditMode mode) const +ICSEditor EntityHandle::EditICS(EditMode mode) const { this->CheckValidity(); Impl()->EnableICS(); diff --git a/modules/mol/base/src/entity_handle.hh b/modules/mol/base/src/entity_handle.hh index 540425c70219e49396c29ce19ef54850712edd70..d67d9c754d20d22ddb67ec156315388fef76be6d 100644 --- a/modules/mol/base/src/entity_handle.hh +++ b/modules/mol/base/src/entity_handle.hh @@ -263,12 +263,12 @@ public: /// \brief Get editor for external coordinate system to manipulate atom /// positions /// \sa editors - XCSEditor RequestXCSEditor(EditMode mode=UNBUFFERED_EDIT) const; + XCSEditor EditXCS(EditMode mode=UNBUFFERED_EDIT) const; /// \brief Get editor for the internal coordinate system to manipulate /// torsions bond lengths and angles between bonds /// \sa editors - ICSEditor RequestICSEditor(EditMode mode=UNBUFFERED_EDIT) const; + ICSEditor EditICS(EditMode mode=UNBUFFERED_EDIT) const; /// \brief get this handle /// diff --git a/modules/mol/base/src/impl/atom_impl.hh b/modules/mol/base/src/impl/atom_impl.hh index 90507b1029575ad86c811d68a07c7142a514d438..f13b729cba5c4ccfe00f98da5f340c05ef96dbf1 100644 --- a/modules/mol/base/src/impl/atom_impl.hh +++ b/modules/mol/base/src/impl/atom_impl.hh @@ -119,7 +119,7 @@ public: prop_=impl::AtomProp::GetDefaultProps(element_); } } - + bool HasDefaultProps() const { return prop_->is_default; } void SetAnisou(const geom::Mat3& anisou) { if (prop_->is_default && prop_->anisou!=anisou) { diff --git a/modules/mol/base/src/impl/chain_impl.cc b/modules/mol/base/src/impl/chain_impl.cc index 77948203633cb010a0a81da80dd582643f6cf327..64fed74185c0efa3759a64780c6634035232eeea 100644 --- a/modules/mol/base/src/impl/chain_impl.cc +++ b/modules/mol/base/src/impl/chain_impl.cc @@ -66,6 +66,7 @@ ResidueImplPtr ChainImpl::AppendResidue(const ResidueImplPtr& res) dst_res->SetOneLetterCode(res->GetOneLetterCode()); dst_res->SetSecStructure(res->GetSecStructure()); dst_res->SetChemClass(res->GetChemClass()); + dst_res->SetProtein(res->IsProtein()); return dst_res; } diff --git a/modules/mol/base/src/impl/residue_impl.cc b/modules/mol/base/src/impl/residue_impl.cc index ef6ffd7291e2cf513c20d2047d4e9fe01478b996..1f2fe7faf12ffed48227845659186bc20e02c7f7 100644 --- a/modules/mol/base/src/impl/residue_impl.cc +++ b/modules/mol/base/src/impl/residue_impl.cc @@ -61,8 +61,19 @@ AtomImplPtr ResidueImpl::InsertAtom(const AtomImplPtr& atom) AtomImplPtr dst_atom=this->InsertAtom(atom->GetName(), atom->GetPos(), atom->GetElement()); + dst_atom->Assign(*atom.get()); dst_atom->SetState(atom->GetState()); + dst_atom->SetBFactor(atom->GetBFactor()); + dst_atom->SetOccupancy(atom->GetOccupancy()); + dst_atom->SetHetAtom(atom->IsHetAtom()); + + if (!atom->HasDefaultProps()) { + dst_atom->SetRadius(atom->GetRadius()); + dst_atom->SetCharge(atom->GetCharge()); + dst_atom->SetMass(atom->GetMass()); + dst_atom->SetAnisou(atom->GetAnisou()); + } return dst_atom; } diff --git a/modules/mol/base/src/residue_handle.hh b/modules/mol/base/src/residue_handle.hh index 83890f3afb5741bf410bbc9e9fc126aac67e609a..3dc7e85def436e2327f6058c6cd5d7ca645c46fb 100644 --- a/modules/mol/base/src/residue_handle.hh +++ b/modules/mol/base/src/residue_handle.hh @@ -49,7 +49,7 @@ namespace ost { namespace mol { /// EditorBase::InsertAtom() or EditorBase::InsertAltAtom() /// /// \code -/// XCSEditor edi=residue.GetEntity().RequestXCSEditor(); +/// XCSEditor edi=residue.GetEntity().EditXCS(); /// edi.InsertAtom(residue, "CA", geom.Vec3(1.0, 0.0, 0.0)); /// \endcode class DLLEXPORT_OST_MOL ResidueHandle : public ResidueBase { diff --git a/modules/mol/base/tests/dummy_ent.hh b/modules/mol/base/tests/dummy_ent.hh index c4689027302ae8c21ab863058134c6e7e6f376d9..8e00291764489e2afc301f82dc88c4767e5a0413 100644 --- a/modules/mol/base/tests/dummy_ent.hh +++ b/modules/mol/base/tests/dummy_ent.hh @@ -28,7 +28,7 @@ namespace ost { namespace test { struct DummyEnt { DummyEnt() { e=CreateEntity(); - XCSEditor editor=e.RequestXCSEditor(); + XCSEditor editor=e.EditXCS(); c=editor.InsertChain("A"); r=editor.AppendResidue(c, "XXX"); aa=editor.InsertAtom(r, "A", geom::Vec3()); diff --git a/modules/mol/base/tests/test_atom_groups.cc b/modules/mol/base/tests/test_atom_groups.cc index 01e3510ff365c0336fe5ce1532005884e4cbd6f7..b1ed9118e4a1ef910ab800c6ddf9f1db369cd27e 100644 --- a/modules/mol/base/tests/test_atom_groups.cc +++ b/modules/mol/base/tests/test_atom_groups.cc @@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(switch_pos) geom::Vec3 y=geom::Vec3(0.0, 1.0, 0.0); geom::Vec3 z=geom::Vec3(0.0, 0.0, 1.0); // Should throw, since aa has no alt-location set. - XCSEditor editor=ent.e.RequestXCSEditor(); + XCSEditor editor=ent.e.EditXCS(); BOOST_CHECK_THROW(editor.AddAltAtomPos("B", ent.aa, y), Error); AtomHandle xx=editor.InsertAltAtom(ent.r, "ZZ", "A", y); @@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(switch_pos) BOOST_AUTO_TEST_CASE(delete_atom) { test::DummyEnt ent; - XCSEditor editor=ent.e.RequestXCSEditor(); + XCSEditor editor=ent.e.EditXCS(); AtomHandle xx=editor.InsertAltAtom(ent.r, "ZZ", "A", geom::Vec3()); AtomHandle zz=editor.InsertAltAtom(ent.r, "XX", "A", geom::Vec3()); @@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(atom_group_triv) BOOST_CHECK(ent.r.HasAltAtomGroup("")==false); std::vector<String> names=ent.r.GetAltAtomGroupNames(); BOOST_CHECK(names.empty()); - XCSEditor editor=ent.e.RequestXCSEditor(); + XCSEditor editor=ent.e.EditXCS(); AtomHandle xx=editor.InsertAltAtom(ent.r, "A", "ZZ", geom::Vec3(0.0,1.0,0.0)); editor.AddAltAtomPos("B", xx, geom::Vec3(1.0, 0.0, 0.0)); BOOST_CHECK(ent.r.HasAltAtoms()==true); diff --git a/modules/mol/base/tests/test_chain.cc b/modules/mol/base/tests/test_chain.cc index e03c588a5b0a83ed7b959d02e99e8b386b0381f4..2e42ea77184ab789a659abff5857cef576950f76 100644 --- a/modules/mol/base/tests/test_chain.cc +++ b/modules/mol/base/tests/test_chain.cc @@ -46,7 +46,7 @@ void no_find_res(ChainHandle chain, const ResNum& n) { void test_res_pos() { EntityHandle eh=CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle ch1=e.InsertChain("A"); e.AppendResidue(ch1, "A"); e.AppendResidue(ch1, "B"); @@ -76,7 +76,7 @@ BOOST_AUTO_TEST_SUITE( mol_base ) BOOST_AUTO_TEST_CASE(test_comparison) { EntityHandle eh=CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle ch1=e.InsertChain("A"); ChainHandle ch2=e.InsertChain("B"); ChainHandle cc=ch1; @@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE(test_comparison) BOOST_AUTO_TEST_CASE(res_pos) { EntityHandle eh=CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle ch1=e.InsertChain("A"); e.AppendResidue(ch1, "A"); e.AppendResidue(ch1, "B"); @@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(res_pos) BOOST_AUTO_TEST_CASE(res_pos_with_insertion_code) { EntityHandle eh=CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle ch1=e.InsertChain("A"); e.AppendResidue(ch1, "A"); e.AppendResidue(ch1, "B"); @@ -148,7 +148,7 @@ BOOST_AUTO_TEST_CASE(res_pos_with_insertion_code) BOOST_AUTO_TEST_CASE(prev_next) { EntityHandle eh=CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle ch1=e.InsertChain("A"); e.AppendResidue(ch1, "A"); e.AppendResidue(ch1, "B"); diff --git a/modules/mol/base/tests/test_conn.cc b/modules/mol/base/tests/test_conn.cc index b36e5f754e453cba393920adc8c0852b81059b84..0c81d6900611ee77b826af1faaa74d7808a3fa9a 100644 --- a/modules/mol/base/tests/test_conn.cc +++ b/modules/mol/base/tests/test_conn.cc @@ -31,7 +31,7 @@ BOOST_AUTO_TEST_SUITE( mol_base ) BOOST_AUTO_TEST_CASE(connect) { EntityHandle e=CreateEntity(); - XCSEditor editor=e.RequestXCSEditor(); + XCSEditor editor=e.EditXCS(); ChainHandle c=editor.InsertChain("A"); ResidueHandle r=editor.AppendResidue(c, "GLY"); diff --git a/modules/mol/base/tests/test_coord_group.cc b/modules/mol/base/tests/test_coord_group.cc index f2012b9983cd652d373cb68b813fea65cd460aa6..cce3eb4873336242739b2cae689e8d18073a742b 100644 --- a/modules/mol/base/tests/test_coord_group.cc +++ b/modules/mol/base/tests/test_coord_group.cc @@ -33,7 +33,7 @@ BOOST_AUTO_TEST_SUITE( io ) BOOST_AUTO_TEST_CASE(coord_group) { EntityHandle e=CreateEntity(); - XCSEditor editor=e.RequestXCSEditor(); + XCSEditor editor=e.EditXCS(); ChainHandle c=editor.InsertChain("A"); ResidueHandle r=editor.AppendResidue(c, "XXX"); AtomHandle aa=editor.InsertAtom(r, "A", geom::Vec3(0,1,2)); diff --git a/modules/mol/base/tests/test_delete.cc b/modules/mol/base/tests/test_delete.cc index c117f5d9ae50dfd0d26a41c665627b957d3dd751..56d78f0a016d1671292ad091a849ddd13403871b 100644 --- a/modules/mol/base/tests/test_delete.cc +++ b/modules/mol/base/tests/test_delete.cc @@ -42,7 +42,7 @@ public: struct Fixture { Fixture() { e=CreateEntity(); - XCSEditor editor=e.RequestXCSEditor(); + XCSEditor editor=e.EditXCS(); c=editor.InsertChain("A"); r=editor.AppendResidue(c, "XXX"); aa=editor.InsertAtom(r, "A", geom::Vec3()); @@ -71,7 +71,7 @@ BOOST_AUTO_TEST_SUITE( mol_base ) BOOST_AUTO_TEST_CASE(atom_delete) { Fixture f; - XCSEditor e=f.e.RequestXCSEditor(); + XCSEditor e=f.e.EditXCS(); e.DeleteAtom(f.ab); E ev; BOOST_CHECK_NO_THROW(f.e.Apply(ev)); diff --git a/modules/mol/base/tests/test_entity.cc b/modules/mol/base/tests/test_entity.cc index 0504422946e34546f0c3dee532bb05de4fbd232a..93114774015661befd2dca50f2e94eacea521ab3 100644 --- a/modules/mol/base/tests/test_entity.cc +++ b/modules/mol/base/tests/test_entity.cc @@ -19,6 +19,8 @@ /* * Authors: Marco Biasini, Juergen Haas */ + +#include <ost/mol/chem_class.hh> #include <ost/mol/mol.hh> #include <cmath> #define BOOST_TEST_DYN_LINK @@ -42,10 +44,12 @@ using namespace ost; using namespace ost::mol; + + EntityHandle make_test_entity() { EntityHandle eh = CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle chain = e.InsertChain("A"); ResidueHandle res1 = e.AppendResidue(chain, "MET"); @@ -83,7 +87,7 @@ BOOST_AUTO_TEST_CASE(entity_creator) eh.SetName("TestEntity"); BOOST_CHECK(eh.GetName()=="TestEntity"); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle chain = e.InsertChain("C"); BOOST_CHECK(chain.GetName()=="C"); @@ -118,7 +122,7 @@ BOOST_AUTO_TEST_CASE(entity_creator) BOOST_AUTO_TEST_CASE(spatial_organizer) { EntityHandle eh=CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle chain = e.InsertChain("A"); ResidueHandle res = e.AppendResidue(chain, "X"); @@ -139,7 +143,7 @@ BOOST_AUTO_TEST_CASE(spatial_organizer) BOOST_AUTO_TEST_CASE(transformation) { EntityHandle eh = CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle chain = e.InsertChain("A"); ResidueHandle res = e.AppendResidue(chain, "X"); @@ -240,7 +244,7 @@ BOOST_AUTO_TEST_CASE(transformation) BOOST_CHECK(bond1.GetLength()==1.5); BOOST_CHECK(bond2.GetLength()==2.0); - ICSEditor i = eh.RequestICSEditor(); + ICSEditor i = eh.EditICS(); i.SetBondLength(bond1,1.0); i.SetBondLength(bond2,3.0); @@ -325,4 +329,54 @@ BOOST_AUTO_TEST_CASE(copy) BOOST_CHECK(r2.GetPhiTorsion()); } +BOOST_AUTO_TEST_CASE(copy_residue_props) +{ + EntityHandle ent=mol::CreateEntity(); + XCSEditor edi=ent.EditXCS(); + ChainHandle ch=edi.InsertChain("A"); + ResidueHandle res=edi.AppendResidue(ch, "DUMMY", mol::ResNum(666, '6')); + res.SetOneLetterCode('X'); + res.SetIsProtein(true); + ChemClass cl(ChemClass::LPeptideLinking); + res.SetSecStructure(SecStructure(SecStructure::ALPHA_HELIX)); + res.SetChemClass(cl); + EntityHandle copy=ent.Copy(); + ResidueHandle res2=copy.GetResidueList()[0]; + BOOST_CHECK_EQUAL(res2.GetName(), String("DUMMY")); + BOOST_CHECK_EQUAL(res2.GetOneLetterCode(), 'X'); + + BOOST_CHECK_EQUAL(res2.GetChemClass(), cl); + BOOST_CHECK_EQUAL(res.GetSecStructure(), SecStructure::ALPHA_HELIX); + BOOST_CHECK(res2.IsProtein()==true); + BOOST_CHECK_EQUAL(res2.GetNumber(), ResNum(666, '6')); +} + +BOOST_AUTO_TEST_CASE(copy_atom_props) +{ + EntityHandle ent=mol::CreateEntity(); + XCSEditor edi=ent.EditXCS(); + ChainHandle ch=edi.InsertChain("A"); + ResidueHandle res=edi.AppendResidue(ch, "DUMMY"); + AtomHandle atom=edi.InsertAtom(res, "X", geom::Vec3(1,2,3), "C"); + atom.SetMass(100.0); + atom.SetBFactor(200.0); + atom.SetOccupancy(300.0); + atom.SetHetAtom(true); + atom.SetRadius(500); + atom.SetCharge(800); + atom.SetAnisou(geom::Mat3(100,200,300)); + EntityHandle copy=ent.Copy(); + AtomHandle atom2=copy.GetAtomList()[0]; + BOOST_CHECK_EQUAL(atom2.GetPos(), geom::Vec3(1,2,3)); + BOOST_CHECK_EQUAL(atom2.GetName(), String("X")); + BOOST_CHECK_EQUAL(atom2.GetElement(), String("C")); + BOOST_CHECK_EQUAL(atom2.GetMass(), Real(100.0)); + BOOST_CHECK_EQUAL(atom2.GetCharge(), Real(800.0)); + BOOST_CHECK_EQUAL(atom2.GetBFactor(), Real(200.0)); + BOOST_CHECK_EQUAL(atom2.IsHetAtom(), true); + BOOST_CHECK_EQUAL(atom2.GetAnisou(), geom::Mat3(100,200,300)); + BOOST_CHECK_EQUAL(atom2.GetRadius(), Real(500.0)); +} + + BOOST_AUTO_TEST_SUITE_END() diff --git a/modules/mol/base/tests/test_ics.cc b/modules/mol/base/tests/test_ics.cc index 37955909398b208a556a3a9feaf4c7f1f8c48ba0..d577f8ca9dd60a720ea1f780b5f3922e311e4993 100644 --- a/modules/mol/base/tests/test_ics.cc +++ b/modules/mol/base/tests/test_ics.cc @@ -36,7 +36,7 @@ struct Structure { Structure() { e=CreateEntity(); - ICSEditor editor=e.RequestICSEditor(); + ICSEditor editor=e.EditICS(); c=editor.InsertChain("A"); r=editor.AppendResidue(c, "ANGELIN"); a1=editor.InsertAtom(r, "CC", geom::Vec3(-1.0, 0.0, 0.0)); @@ -76,7 +76,7 @@ BOOST_AUTO_TEST_SUITE( mol_base ) BOOST_AUTO_TEST_CASE(ics_angle_trivia) { Structure s; - ICSEditor e=s.e.RequestICSEditor(); + ICSEditor e=s.e.EditICS(); BOOST_CHECK(!e.SetAngle(s.a1, s.a3, s.a2, 0)); BOOST_CHECK(!e.SetAngle(s.a2, s.a3, s.a1, 0)); BOOST_CHECK(e.SetAngle(s.a1, s.a2, s.a3, 0)); @@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(ics_set_angle_sec) { Structure s; // test for set angle of two secondary connectors - ICSEditor e=s.e.RequestICSEditor(); + ICSEditor e=s.e.EditICS(); geom::Plane p(s.a3.GetPos(), s.a2.GetPos(), s.a4.GetPos()); e.SetAngle(s.a3, s.a2, s.a4, M_PI/4); e.UpdateXCS(); @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(ics_set_angle_prim) { Structure s; // test for set angle of two secondary connectors - ICSEditor e=s.e.RequestICSEditor(); + ICSEditor e=s.e.EditICS(); e.SetAngle(s.a1, s.a2, s.a4, M_PI/4); e.UpdateXCS(); geom::Plane p(s.a1.GetPos(), s.a2.GetPos(), s.a4.GetPos()); diff --git a/modules/mol/base/tests/test_iterators.cc b/modules/mol/base/tests/test_iterators.cc index 8dfc0dca0f1215b730a6e637cd98f36b0b2b59d0..0c2900571e9e4482f03dce839eb4c19b593649fe 100644 --- a/modules/mol/base/tests/test_iterators.cc +++ b/modules/mol/base/tests/test_iterators.cc @@ -140,7 +140,7 @@ BOOST_AUTO_TEST_SUITE( mol_base ) BOOST_AUTO_TEST_CASE(chain_handle_iterator) { EntityHandle ent=CreateEntity(); - XCSEditor editor=ent.RequestXCSEditor(); + XCSEditor editor=ent.EditXCS(); ChainHandle ch1=editor.InsertChain("A"); ChainHandle ch2=editor.InsertChain("B"); ChainHandle ch3=editor.InsertChain("C"); @@ -161,7 +161,7 @@ BOOST_AUTO_TEST_CASE(chain_handle_iterator) BOOST_AUTO_TEST_CASE(test_res_handle_iterator) { EntityHandle eh=CreateEntity(); - XCSEditor editor=eh.RequestXCSEditor(); + XCSEditor editor=eh.EditXCS(); ChainHandle ch1=editor.InsertChain("A"); editor.AppendResidue(ch1, "A"); editor.AppendResidue(ch1, "B"); @@ -197,7 +197,7 @@ BOOST_AUTO_TEST_CASE(test_empty_iterators) BOOST_CHECK(eh.ChainsBegin()==eh.ChainsEnd()); BOOST_CHECK(eh.ResiduesBegin()==eh.ResiduesEnd()); BOOST_CHECK(eh.AtomsBegin()==eh.AtomsEnd()); - XCSEditor editor=eh.RequestXCSEditor(); + XCSEditor editor=eh.EditXCS(); ChainHandle ch1=editor.InsertChain("A"); BOOST_CHECK(ch1.ResiduesBegin()==ch1.ResiduesEnd()); BOOST_CHECK(ch1.AtomsBegin()==ch1.AtomsEnd()); @@ -205,7 +205,7 @@ BOOST_AUTO_TEST_CASE(test_empty_iterators) BOOST_CHECK(r1.AtomsBegin()==r1.AtomsEnd()); eh=CreateEntity(); - editor=eh.RequestXCSEditor(); + editor=eh.EditXCS(); ch1=editor.InsertChain("A"); r1=editor.AppendResidue(ch1, "A"); ResidueHandle r2=editor.AppendResidue(ch1, "B"); @@ -229,7 +229,7 @@ BOOST_AUTO_TEST_CASE(test_empty_iterators) BOOST_AUTO_TEST_CASE(test_atom_handle_iterator) { EntityHandle eh=CreateEntity(); - XCSEditor editor=eh.RequestXCSEditor(); + XCSEditor editor=eh.EditXCS(); ChainHandle ch1=editor.InsertChain("A"); ResidueHandle r1=editor.AppendResidue(ch1, "A"); ResidueHandle r2=editor.AppendResidue(ch1, "B"); diff --git a/modules/mol/base/tests/test_query.cc b/modules/mol/base/tests/test_query.cc index c3f779a872aac92060c96572378458c090598b38..6e603a16adf42d60671bf2b916d4cfc29f0dbee1 100644 --- a/modules/mol/base/tests/test_query.cc +++ b/modules/mol/base/tests/test_query.cc @@ -31,7 +31,7 @@ using namespace ost::mol; EntityHandle make_query_test_entity() { EntityHandle eh = CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle chain = e.InsertChain("A"); chain.SetFloatProp("testprop_c", 1.0); ResidueHandle res = e.AppendResidue(chain, "MET"); diff --git a/modules/mol/base/tests/test_residue.cc b/modules/mol/base/tests/test_residue.cc index 332d60edd6534837b9511314b4a3aecceadbffae..d6cc11f4a447e4d62a0a2f82f867f3173e18f8b3 100644 --- a/modules/mol/base/tests/test_residue.cc +++ b/modules/mol/base/tests/test_residue.cc @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_SUITE( mol_base ) BOOST_AUTO_TEST_CASE(test_in_sequence) { EntityHandle eh=CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle ch1=e.InsertChain("A"); ResidueHandle rA = e.AppendResidue(ch1, "A"); ResidueHandle rB = e.AppendResidue(ch1, "B"); @@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE(test_in_sequence) BOOST_AUTO_TEST_CASE(test_res_index) { EntityHandle eh=CreateEntity(); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); ChainHandle ch1=e.InsertChain("A"); ResidueHandle rA = e.AppendResidue(ch1, "A"); ResidueHandle rB = e.AppendResidue(ch1, "B"); diff --git a/modules/mol/base/tests/test_view.cc b/modules/mol/base/tests/test_view.cc index 26399e10e1c240182d87f59a453a605d69dd3902..3f60928d627552a50450a62a6b89cb0de31c7ae8 100644 --- a/modules/mol/base/tests/test_view.cc +++ b/modules/mol/base/tests/test_view.cc @@ -30,7 +30,7 @@ using namespace ost::mol; struct Fixture { Fixture() { e=CreateEntity(); - XCSEditor editor=e.RequestXCSEditor(); + XCSEditor editor=e.EditXCS(); c=editor.InsertChain("A"); r=editor.AppendResidue(c, "ANGELIN"); aa=editor.InsertAtom(r, "X1", geom::Vec3( 0.0, 0.0, 0.0)); diff --git a/modules/mol/base/tests/test_view_op.cc b/modules/mol/base/tests/test_view_op.cc index f589bf2107638956d21663a4db196044c020c610..fb9d8ffda7b0fd210268a4ae3e5a6f3eb7074875 100644 --- a/modules/mol/base/tests/test_view_op.cc +++ b/modules/mol/base/tests/test_view_op.cc @@ -31,7 +31,7 @@ EntityHandle mk_test_ent() { EntityHandle ent=CreateEntity(); ent.SetName("TestEntity"); - XCSEditor edi=ent.RequestXCSEditor(); + XCSEditor edi=ent.EditXCS(); ChainHandle chain_a=edi.InsertChain("A"); ResidueHandle res_a=edi.AppendResidue(chain_a, "A"); AtomHandle atom_a=edi.InsertAtom(res_a, "A", geom::Vec3()); @@ -334,7 +334,8 @@ BOOST_AUTO_TEST_CASE(test_intersection_b) bonds)); } -BOOST_AUTO_TEST_CASE(entity_from_view) { +BOOST_AUTO_TEST_CASE(entity_from_view) +{ EntityHandle ent=mk_test_ent(); EntityView v1=ent.Select("aname=B,C,F,G"); EntityHandle ent_fv=mol::CreateEntityFromView(v1, false); @@ -347,5 +348,54 @@ BOOST_AUTO_TEST_CASE(entity_from_view) { } +BOOST_AUTO_TEST_CASE(ent_from_view_residue_props) +{ + EntityHandle ent=mol::CreateEntity(); + XCSEditor edi=ent.EditXCS(); + ChainHandle ch=edi.InsertChain("A"); + ResidueHandle res=edi.AppendResidue(ch, "DUMMY", mol::ResNum(666, '6')); + res.SetOneLetterCode('X'); + res.SetIsProtein(true); + ChemClass cl(ChemClass::LPeptideLinking); + res.SetSecStructure(SecStructure(SecStructure::ALPHA_HELIX)); + res.SetChemClass(cl); + EntityHandle copy=mol::CreateEntityFromView(ent.Select(""), false); + ResidueHandle res2=copy.GetResidueList()[0]; + BOOST_CHECK_EQUAL(res2.GetName(), String("DUMMY")); + BOOST_CHECK_EQUAL(res2.GetOneLetterCode(), 'X'); + + BOOST_CHECK_EQUAL(res2.GetChemClass(), cl); + BOOST_CHECK_EQUAL(res.GetSecStructure(), SecStructure::ALPHA_HELIX); + BOOST_CHECK(res2.IsProtein()==true); + BOOST_CHECK_EQUAL(res2.GetNumber(), ResNum(666, '6')); +} + +BOOST_AUTO_TEST_CASE(ent_from_view_atom_props) +{ + EntityHandle ent=mol::CreateEntity(); + XCSEditor edi=ent.EditXCS(); + ChainHandle ch=edi.InsertChain("A"); + ResidueHandle res=edi.AppendResidue(ch, "DUMMY"); + AtomHandle atom=edi.InsertAtom(res, "X", geom::Vec3(1,2,3), "C"); + atom.SetMass(100.0); + atom.SetBFactor(200.0); + atom.SetOccupancy(300.0); + atom.SetHetAtom(true); + atom.SetRadius(500); + atom.SetCharge(800); + atom.SetAnisou(geom::Mat3(100,200,300)); + EntityHandle copy=mol::CreateEntityFromView(ent.Select(""), false); + AtomHandle atom2=copy.GetAtomList()[0]; + BOOST_CHECK_EQUAL(atom2.GetPos(), geom::Vec3(1,2,3)); + BOOST_CHECK_EQUAL(atom2.GetName(), String("X")); + BOOST_CHECK_EQUAL(atom2.GetElement(), String("C")); + BOOST_CHECK_EQUAL(atom2.GetMass(), Real(100.0)); + BOOST_CHECK_EQUAL(atom2.GetCharge(), Real(800.0)); + BOOST_CHECK_EQUAL(atom2.GetBFactor(), Real(200.0)); + BOOST_CHECK_EQUAL(atom2.IsHetAtom(), true); + BOOST_CHECK_EQUAL(atom2.GetAnisou(), geom::Mat3(100,200,300)); + BOOST_CHECK_EQUAL(atom2.GetRadius(), Real(500.0)); +} + BOOST_AUTO_TEST_SUITE_END() diff --git a/modules/seq/alg/pymod/renumber.py b/modules/seq/alg/pymod/renumber.py index 39ea9fb489949845fb65681ac1cbb6f000f4e56e..f6d7d128f115dc499d2ded3ad2f265114227a9ad 100644 --- a/modules/seq/alg/pymod/renumber.py +++ b/modules/seq/alg/pymod/renumber.py @@ -25,7 +25,7 @@ def Renumber(seq_handle): changed_residue_count=0 renumberingFlag = False ent_n=mol.CreateEntity() - ed=ent_n.RequestXCSEditor() + ed=ent_n.EditXCS() c=ed.InsertChain(" ") for pos in range(len(seq_handle)): if seq_handle[pos]!='-': diff --git a/modules/seq/base/tests/test_aligned_column.cc b/modules/seq/base/tests/test_aligned_column.cc index f76573df3c883f7f91b076442dae9900e0c5a42e..757c8d8cb5496119324f0e666388b390b7ee2929 100644 --- a/modules/seq/base/tests/test_aligned_column.cc +++ b/modules/seq/base/tests/test_aligned_column.cc @@ -43,7 +43,7 @@ struct Fixture { Fixture() { eh = CreateEntity(); eh.SetName("TestEntity"); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); chain = e.InsertChain("A"); res1 = e.AppendResidue(chain, "ARG"); e.InsertAtom(res1, "CA",geom::Vec3(1,0,0)); diff --git a/modules/seq/base/tests/test_alignment.cc b/modules/seq/base/tests/test_alignment.cc index 0491f7d35c124c846b5ddd48cee8965e77492025..516c966a487dc92979034befd7f89ec12a994f81 100644 --- a/modules/seq/base/tests/test_alignment.cc +++ b/modules/seq/base/tests/test_alignment.cc @@ -38,7 +38,7 @@ struct Fixture { Fixture() { eh = CreateEntity(); eh.SetName("TestEntity"); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); chain = e.InsertChain("A"); res1 = e.AppendResidue(chain, "ARG"); e.InsertAtom(res1, "CA",geom::Vec3(1,0,0)); diff --git a/modules/seq/base/tests/test_seq.py b/modules/seq/base/tests/test_seq.py index 26abba6896e53f32f19ef43cb4d44e5999bb6c2f..80f13e364c07e3ba9665f34e62a462af79ae79ec 100644 --- a/modules/seq/base/tests/test_seq.py +++ b/modules/seq/base/tests/test_seq.py @@ -6,7 +6,7 @@ from ost import seq def fixture(): e=mol.CreateEntity() - ede=e.RequestXCSEditor() + ede=e.EditXCS() chain=ede.InsertChain('A') for res in 'ABCDEFGH': r=ede.AppendResidue(chain, res) diff --git a/modules/seq/base/tests/test_sequence.cc b/modules/seq/base/tests/test_sequence.cc index e787aafb7c3de95e8d93c2b55de8b3b9bba7c8f4..264a902ea81455dcdeb994893536d24c9c9f9455 100644 --- a/modules/seq/base/tests/test_sequence.cc +++ b/modules/seq/base/tests/test_sequence.cc @@ -34,7 +34,7 @@ struct Fixture { Fixture() { eh = CreateEntity(); eh.SetName("TestEntity"); - XCSEditor e=eh.RequestXCSEditor(); + XCSEditor e=eh.EditXCS(); chain = e.InsertChain("A"); res1 = e.AppendResidue(chain, "ARG"); e.InsertAtom(res1, "CA",geom::Vec3(1,0,0));