diff --git a/modules/conop/doc/compoundlib.rst b/modules/conop/doc/compoundlib.rst index 3e0e70d41bc5484965f7e2e0fed8e9870c6e7186..bf14500361e7aafcb2060df321e8592fd8054fff 100644 --- a/modules/conop/doc/compoundlib.rst +++ b/modules/conop/doc/compoundlib.rst @@ -6,7 +6,7 @@ The compound library Compound libraries contain information on chemical compounds, such as their connectivity, chemical class and one-letter-code. The compound library has several uses, but the most important one is to provide the connectivy -information for the :class:`rule-based builder <RuleBasedBuilder>`. +information for the :class:`rule-based processor <RuleBasedBuilder>`. The compound definitions for standard PDB files are taken from the components.cif dictionary provided by the PDB. The dictionary is updated with diff --git a/modules/conop/doc/connectivity.rst b/modules/conop/doc/connectivity.rst index 9df7cc40b1fc59b603751f24cd460b8a68717fdc..64a43bfd2e4060b6e8ce731242b5dbfcda484fd1 100644 --- a/modules/conop/doc/connectivity.rst +++ b/modules/conop/doc/connectivity.rst @@ -36,30 +36,6 @@ of erroneous structures. The clients of the conop module can specify how the Processor should treat unknown amino acids, missing atoms and chemically infeasible bonds. -The high-level interface --------------------------------------------------------------------------------- - - -.. autofunction:: ConnectAll() - - - -A call to :func:`ConnectAll` is sufficient to assign residue and atoms -properties as well as to connect atoms with bonds. - - -.. code-block:: python - - # Suppose that BuildRawModel is a function that returns a protein structure - # with no atom properties assigned and no bonds formed. - ent=BuildRawModel(...) - print ent.bonds # will return an empty list - # Call ConnectAll() to assign properties/connect atoms - conop.ConnectAll(ent) - print ent.bonds # will print a list containing many bonds - -For a more fine-grained control, consider using the :class:`Processor` interface. - Processors -------------------------------------------------------------------------------- diff --git a/modules/conop/doc/conop.dox b/modules/conop/doc/conop.dox index c59b5a5b1a78ec2a90b48bdda556c29dd8042e27..ee071624521fdfb5a308abcf38001fd3fca7226c 100644 --- a/modules/conop/doc/conop.dox +++ b/modules/conop/doc/conop.dox @@ -40,7 +40,7 @@ Builder should treat unknown amino acids, missing atoms and chemically infeasible bonds. So far, two classes implement the Builder interface: A heuristic and a -rule-based builder. The builders mainly differ in the source of their +rule-based processor. The builders mainly differ in the source of their connectivity information. The HeuristicBuilder uses a hard-coded heuristic connectivity table for the 20 standard amino acids as well as nucleotides. For other compounds such as ligands the HeuristicBuilder runs a distance-based @@ -63,7 +63,7 @@ conop.Conopology.Instance().SetDefaultBuilder('rbb') All subsequent calls to io::LoadEntity will make use of the RuleBasedBuilder instead of the heuristic builder. See \ref convert_mmcif "here" for more -information on how to create the neccessary files to use the rule-based builder. +information on how to create the neccessary files to use the rule-based processor. \subsection connecting_atoms Connecting atoms diff --git a/modules/conop/pymod/__init__.py b/modules/conop/pymod/__init__.py index 9f4a7b010deb424af0d570ab30356a8e5d21737d..3b7856fe1634cd5d9ec3dfb7e22218618ae2655e 100644 --- a/modules/conop/pymod/__init__.py +++ b/modules/conop/pymod/__init__.py @@ -29,56 +29,11 @@ STANDARD_AMINOACIDS=( 'HIS', 'PHE', ) -def ConnectAll(ent): - ''' - Uses the current default builder to connect the atoms of the entity, assign - torsions, and fill in missing or correct erroneous information such as the - chemical class of the residues and the atom's element. - - :param ent: A valid entity - :type ent: :class:`~ost.mol.EntityHandle` - ''' - conop_inst=Conopology.Instance() - conop_inst.ConnectAll(conop_inst.GetBuilder("DEFAULT"), ent, 0) - -def GetBuilder(name='DEFAULT'): - ''' - Get registered builder by name - - :param name: The name of the builder - - :returns: The builder or None, if the builder doesn't exist - ''' - return Conopology.Instance().GetBuilder(name) - -def RegisterBuilder(builder, name): - ''' - Register builder to OpenStructure - - :param builder: A instance of :class:`Builder` - - :param name: The name of the builder - ''' - conop_inst=Conopology.Instance() - conop_inst.RegisterBuilder(builder, name) - -def SetDefaultBuilder(builder_name): - ''' - Set the builder with the given name as the default. You will have to register - a builder with :func:`RegisterBuilder` before you will be able to set it as - the default. - - :raises: :exc:`RuntimeError` when trying to set a builder as the default that - has not been registered yet. - ''' - conop_inst=Conopology.Instance() - conop_inst.SetDefaultBuilder(builder_name) - def SetDefaultLib(compound_lib): ''' Set the default compound library. The compound library is used by various functions of the framework that requires knowledge of naming and - connectivity of residues.j + connectivity of residues. ''' conop_inst=Conopology.Instance() conop_inst.SetDefaultLib(compound_lib) diff --git a/modules/conop/pymod/export_conop.cc b/modules/conop/pymod/export_conop.cc index f617adaae70babd193888612098d2802f176bb60..39f006b45f96fc41a83403ab9363c7e5568cbd20 100644 --- a/modules/conop/pymod/export_conop.cc +++ b/modules/conop/pymod/export_conop.cc @@ -28,13 +28,8 @@ using namespace ost::conop; void export_Conop() { class_<Conopology, boost::noncopyable>("Conopology", no_init) .def("Instance", &Conopology::Instance, return_value_policy<reference_existing_object>()).staticmethod("Instance") - //.def("ConnectAll", &Conopology::ConnectAll) .def("SetDefaultLib", &Conopology::SetDefaultLib) .def("GetDefaultLib", &Conopology::GetDefaultLib) - //.def("GetBuilder", &Conopology::GetBuilder) - //.def("ConnectAll", &Conopology::ConnectAll) - //.def("RegisterBuilder", &Conopology::RegisterBuilder) - //.def("SetDefaultBuilder", &Conopology::SetDefaultBuilder) ; diff --git a/modules/conop/src/conop.cc b/modules/conop/src/conop.cc index ee9cbea237b0e95563208a774858650aef880b77..58fc349b6df596e1bfc3de56396169ce2649eeef 100644 --- a/modules/conop/src/conop.cc +++ b/modules/conop/src/conop.cc @@ -32,10 +32,8 @@ Conopology& Conopology::Instance() return impl; } -Conopology::Conopology()//:builder_map_() +Conopology::Conopology() { - //builder_map_["HEURISTIC"]=BuilderP(new HeuristicBuilder()); - //builder_map_["DEFAULT"]=builder_map_["HEURISTIC"]; known_elements_.insert("AC"); known_elements_.insert("AG"); @@ -149,148 +147,7 @@ Conopology::Conopology()//:builder_map_() known_elements_.insert("ZN"); known_elements_.insert("ZR"); } -#if 0 -void Conopology::RegisterBuilder(const BuilderP& b, const String& name) { - if (!GetBuilder(name)) - builder_map_[name]=b; -} - -void Conopology::SetDefaultBuilder(const String& default_name) { - BuilderP builder=GetBuilder(default_name); - if (builder) - builder_map_["DEFAULT"]=builder; - else - throw ost::Error("trying to set unknown builder '"+ - default_name+"' as the default"); -} - -BuilderP Conopology::GetBuilder(const String& name) -{ - BuilderMap::iterator it=builder_map_.find(name); - if (it!=builder_map_.end()){ - return (*it).second; - } - return BuilderP(); -} - -namespace { - -class PropAssigner: public mol::EntityVisitor { -public: - PropAssigner(const BuilderP& builder): builder_(builder) {} - - virtual bool VisitResidue(const mol::ResidueHandle& res) - { - String key=builder_->IdentifyResidue(res); - if (key=="UNK" && res.GetKey()!="UNK" && res.GetKey()!="UNL") { - unk_res_[res.GetKey()]+=1; - } - builder_->FillResidueProps(res); - return true; - } - - virtual bool VisitAtom(const mol::AtomHandle& atom) - { - builder_->FillAtomProps(atom); - return false; - } - - virtual void OnExit() - { - for (std::map<String, int>::iterator i=unk_res_.begin(), - e=unk_res_.end(); i!=e; ++i) { - if (i->second>1) { - LOG_WARNING("structure contains unknown residues with name " << i->first - << " ("<< i->second << "x)"); - } else { - LOG_WARNING("structure contains unknown residue with name " << i->first); - } - - } - } -private: - BuilderP builder_; - std::map<String, int> unk_res_; -}; - -class ChemClassAssigner : public mol::EntityVisitor { -public: - ChemClassAssigner(BuilderP b): builder(b) { } - virtual bool VisitResidue(const mol::ResidueHandle& res) - { - if (res.GetChemClass()==mol::ChemClass()) { - builder->GuessChemClass(res); - } - return false; - } -private: - BuilderP builder; -}; -class Connector: public mol::EntityVisitor -{ -public: - Connector(const BuilderP& b, bool peptide_bonds): - builder_(b), - prev_(), - peptide_bonds_(peptide_bonds) - {} - - virtual bool VisitChain(const mol::ChainHandle& chain) { - prev_=mol::ResidueHandle(); // reset prev - return true; - } - - virtual bool VisitResidue(const mol::ResidueHandle& res) { - builder_->ConnectAtomsOfResidue(res); - if (peptide_bonds_ && prev_) { - builder_->ConnectResidueToPrev(res,prev_); - } - prev_=res; - return false; - } - -private: - BuilderP builder_; - mol::ResidueHandle prev_; - bool peptide_bonds_; -}; - -class TorsionMaker: public mol::EntityVisitor -{ -public: - TorsionMaker(const BuilderP& b): - builder_(b) - {} - - virtual bool VisitChain(const mol::ChainHandle& chain) { - builder_->AssignTorsions(chain); - return false; - } - -private: - BuilderP builder_; -}; -} // ns - -void Conopology::ConnectAll(const BuilderP& b, mol::EntityHandle eh, int flags) -{ - Profile profile_connect("ConnectAll"); - LOG_DEBUG("Conopology: ConnectAll: building internal coordinate system"); - mol::XCSEditor xcs_e=eh.EditXCS(mol::BUFFERED_EDIT); - PropAssigner a(b); - eh.Apply(a); - ChemClassAssigner cca(b); - eh.Apply(cca); - LOG_DEBUG("Conopology: ConnectAll: connecting all bonds"); - Connector connector(b, !(flags & NO_PEPTIDE_BONDS)); - eh.Apply(connector); - - LOG_DEBUG("Conopology: ConnectAll: assigning all torsions"); - TorsionMaker tmaker(b); - eh.Apply(tmaker); -} -#endif bool Conopology::IsValidElement(const String& ele) const { String upper_ele=ele; diff --git a/modules/conop/src/conop.hh b/modules/conop/src/conop.hh index 4c7d4633c557794e41157af1ede50152134a8cf3..34f58e080f97384df0bfc9ca7db6ee2ab3f6220c 100644 --- a/modules/conop/src/conop.hh +++ b/modules/conop/src/conop.hh @@ -33,9 +33,6 @@ typedef enum { class DLLEXPORT_OST_CONOP Conopology { - //typedef std::map<String,BuilderP> BuilderMap; - typedef std::map<String,ProcessorPtr> ProcessorMap; - public: // singleton static Conopology& Instance(); @@ -44,42 +41,13 @@ public: CompoundLibPtr GetDefaultLib() const { return lib_; } void SetDefaultLib(const CompoundLibPtr& lib) { lib_ = lib; } - // retrieve a builder by name - //BuilderP GetBuilder(const String& name="DEFAULT"); - - /* - convenience function, connect all atoms with given coordinates, - such as after coordinate file import, based on a given builder - - does this need to live within Conopology ? - */ - //void ConnectAll(const BuilderP& b, mol::EntityHandle eh, - // int flags=0); - - //void RegisterBuilder(const BuilderP& b, const String& name); - //void SetDefaultBuilder(const String& default_name); - bool IsValidElement(const String& element) const; - void RegisterProcessor(const String& name, - const ProcessorPtr& processor) { - proc_map_[name] = processor; - } - - ProcessorPtr GetProcessor(const String& name) const { - ProcessorMap::const_iterator i = proc_map_.find(name); - if (i != proc_map_.end() ) { - return i->second; - } - return ProcessorPtr(); - } private: Conopology(); Conopology(const Conopology&) {} Conopology& operator=(const Conopology&) {return *this;} - //BuilderMap builder_map_; - ProcessorMap proc_map_;; std::set<String> known_elements_; CompoundLibPtr lib_; }; diff --git a/modules/gui/pymod/dng/init.py b/modules/gui/pymod/dng/init.py index 5468b7cd9b358f5a5ec7e08ed89b8ed48dd59386..1b7ed8043bdce2c426565f1a4dee2435a163a218 100644 --- a/modules/gui/pymod/dng/init.py +++ b/modules/gui/pymod/dng/init.py @@ -32,7 +32,7 @@ def _my_exit(code): sys._exit=sys.exit sys.exit=_my_exit -def _InitRuleBasedBuilder(): +def _InitRuleBasedProcessor(): compound_lib_path=os.path.join(ost.GetSharedDataPath(), 'compounds.chemlib') if os.path.exists(compound_lib_path): conop_inst=conop.Conopology.Instance() @@ -40,9 +40,9 @@ def _InitRuleBasedBuilder(): conop_inst.SetDefaultLib(compound_lib) io.profiles['DEFAULT'].processor = conop.RuleBasedProcessor(compound_lib) -# switch to rule-based builder for high fidelity if compounds.chemlib is +# switch to rule-based processor for high fidelity if compounds.chemlib is # available -_InitRuleBasedBuilder() +_InitRuleBasedProcessor() def _CheckRestore(): settings = QtCore.QSettings() @@ -165,8 +165,8 @@ parser.add_option("-v", "--verbosity_level", action="store", type="int", dest="v help="sets the verbosity level [default: %default]") parser.add_option("-s", "--script", action="callback", default=[], dest="script", type="string", callback=parse_script_option, help="executes a script (syntax: -s SCRIPT [options] [args]) Anything that follows this option is passed to the script") parser.add_option("-p", "--pdb_id", dest="pdb_ids", default=[],action="append", help="PDB file ID. The file will be retrieved from PDB") -parser.add_option("-b", "--builder", dest="builder", default="HEURISTIC", help="Type of builder used by the progam (either RULE_BASED or HEURISTIC) [default: %default]") -parser.add_option("-c", "--compound_library", dest="complib", default="compounds.chemlib", help="Compound library for the RULE_BASED builder (only used if --builder option is set to RULE_BASED, otherwise ignored [default: %default]") +parser.add_option("-b", "--processor", dest="processor", default="HEURISTIC", help="Type of processor used by the progam (either RULE_BASED or HEURISTIC) [default: %default]") +parser.add_option("-c", "--compound_library", dest="complib", default="compounds.chemlib", help="Compound library for the RULE_BASED processor (only used if --processor option is set to RULE_BASED, otherwise ignored [default: %default]") parser.add_option("-q", "--query", dest="query", default="", help="Selection query to be highlighted automatically upon loading (only used together with -p option or when a PDB file is loaded, otherwise ignored [default: None]") parser.add_option("-S","--stereo", dest="try_stereo", default=False, action="store_true",help="try to get a quad-buffer stereo visual") parser.disable_interspersed_args() @@ -184,12 +184,12 @@ if len(parser.rargs)!=0: if len(options.script)!=0: script_argv=options.script -if options.builder=="RULE_BASED": +if options.processor=="RULE_BASED": from ost import conop - compound_lib=conop.CompoundLib.Load(options.complib) - rbb=conop.RuleBasedBuilder(compound_lib) - conop.Conopology.Instance().RegisterBuilder(rbb,'rbb') - conop.Conopology.Instance().SetDefaultBuilder('rbb') + if os.path.exists(options.complib): + compound_lib=conop.CompoundLib.Load(options.complib) + conop.SetDefaultLib(compound_lib) + io.profiles['DEFAULT'].processor = conop.RuleBasedProcessor(compound_lib) home = os.getenv('HOME') or os.getenv('USERPROFILE') _ostrc=os.path.join(home, '.ostrc') diff --git a/modules/gui/src/file_loader.cc b/modules/gui/src/file_loader.cc index 890dec0beeeb85f7e025229334435850a6d2b6ab..0c84be5731aa00e420ceac34a951997c0c8dc6af 100644 --- a/modules/gui/src/file_loader.cc +++ b/modules/gui/src/file_loader.cc @@ -252,7 +252,7 @@ gfx::GfxObjP FileLoader::TryLoadEntity(const QString& filename, io::EntityIOHand mol::EntityHandle eh=mol::CreateEntity(); mol::XCSEditor xcs_lock=eh.EditXCS(mol::BUFFERED_EDIT); handler->Import(eh,filename.toStdString()); - if(handler->RequiresBuilder()) { + if(handler->RequiresProcessor()) { io::IOProfile& prof = io::IOProfileRegistry::Instance().GetDefault(); if (prof.processor) { prof.processor->Process(eh); diff --git a/modules/io/doc/mmcif.rst b/modules/io/doc/mmcif.rst index 38934cc7943df2c6d1cec5f40dd43c34485368e6..0db17e2cf70cd825732b2f0103a7f430859e9554 100644 --- a/modules/io/doc/mmcif.rst +++ b/modules/io/doc/mmcif.rst @@ -528,8 +528,7 @@ of the annotation available. Since this function is at the moment mainly used to create biounits from mmCIF files to be saved as PDBs, the function assumes that the - :ref:`ChainType` properties are set correctly. :func:`ost.conop.ConnectAll` - is used to derive connectivity. + :ref:`ChainType` properties are set correctly. :param asu: Asymmetric unit to work on. Should be created from a mmCIF file. @@ -828,7 +827,7 @@ of the annotation available. :type: :class:`str` -.. LocalWords: cas isbn pubmed asu seqres conop ConnectAll casp COMPND OBSLTE +.. LocalWords: cas isbn pubmed asu seqres conop casp COMPND OBSLTE .. LocalWords: SPRSDE pdb func autofunction exptl attr pdbx oper conf spr dif .. LocalWords: biounits biounit uniprot UNP seqs AddMMCifPDBChainTr cif asym .. LocalWords: auth GetMMCifPDBChainTr AddPDBCMMCifhainTr GetPDBMMCifChainTr diff --git a/modules/io/src/mol/entity_io_crd_handler.cc b/modules/io/src/mol/entity_io_crd_handler.cc index d16358cc8029dd6b9dad17cf5e7beb039d159dd3..3d858fcc6243f21e7125234548e43e297892763c 100644 --- a/modules/io/src/mol/entity_io_crd_handler.cc +++ b/modules/io/src/mol/entity_io_crd_handler.cc @@ -346,8 +346,8 @@ bool CRDWriter::VisitAtom(const mol::AtomHandle& atom) return true; } -/// \brief CHARMM file format requires builder -bool EntityIOCRDHandler::RequiresBuilder() const +/// \brief CHARMM file format requires processor +bool EntityIOCRDHandler::RequiresProcessor() const { return true; } diff --git a/modules/io/src/mol/entity_io_crd_handler.hh b/modules/io/src/mol/entity_io_crd_handler.hh index c0d625a804258e7bd8b16d547d228bf5589ed6d2..3781fcda4e3305307c7bf61b6fb65f38ed27736a 100644 --- a/modules/io/src/mol/entity_io_crd_handler.hh +++ b/modules/io/src/mol/entity_io_crd_handler.hh @@ -99,7 +99,7 @@ public: const String& format="auto"); static bool ProvidesExport(const boost::filesystem::path& loc, const String& format="auto"); - virtual bool RequiresBuilder() const; + virtual bool RequiresProcessor() const; static String GetFormatName() { return String("Crd"); } static String GetFormatDescription() { return String("CARD format file used by the Charmm software package"); } diff --git a/modules/io/src/mol/entity_io_handler.hh b/modules/io/src/mol/entity_io_handler.hh index c65137e185e017ad01ec1d629c1b4dd88b453c0c..709b0762317192d4c6488534b1a52d03f3c6fd56 100644 --- a/modules/io/src/mol/entity_io_handler.hh +++ b/modules/io/src/mol/entity_io_handler.hh @@ -57,7 +57,7 @@ public: // export data from entity view to provided stream virtual void Export(const mol::EntityView& ent, std::ostream& stream) const=0; - virtual bool RequiresBuilder() const=0; + virtual bool RequiresProcessor() const=0; }; typedef boost::shared_ptr<EntityIOHandler> EntityIOHandlerP; diff --git a/modules/io/src/mol/entity_io_mae_handler.cc b/modules/io/src/mol/entity_io_mae_handler.cc index 3c68d9964323a2b37df8636320d797f88fb93751..ca9590169c4b69e2399183a6fade389665789184 100644 --- a/modules/io/src/mol/entity_io_mae_handler.cc +++ b/modules/io/src/mol/entity_io_mae_handler.cc @@ -330,7 +330,7 @@ void MAEReader::parse_and_add_atom(mol::EntityHandle ent, -bool EntityIOMAEHandler::RequiresBuilder() const +bool EntityIOMAEHandler::RequiresProcessor() const { return true; } @@ -380,7 +380,6 @@ bool EntityIOMAEHandler::ProvidesExport(const boost::filesystem::path& loc, 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.EditXCS(mol::BUFFERED_EDIT); diff --git a/modules/io/src/mol/entity_io_mae_handler.hh b/modules/io/src/mol/entity_io_mae_handler.hh index 8f09c375e7b3021073cc599ed524bda130c59900..7f923d3453ed60090a615b14fa2d44c20996d817 100644 --- a/modules/io/src/mol/entity_io_mae_handler.hh +++ b/modules/io/src/mol/entity_io_mae_handler.hh @@ -73,7 +73,7 @@ public: const String& format="auto"); static bool ProvidesExport(const boost::filesystem::path& loc, const String& format="auto"); - virtual bool RequiresBuilder() const; + virtual bool RequiresProcessor() const; static String GetFormatName() { return String("Mae"); } static String GetFormatDescription() { return String("MAEstro coordinate file format"); } diff --git a/modules/io/src/mol/entity_io_mmcif_handler.cc b/modules/io/src/mol/entity_io_mmcif_handler.cc index 23e9ff3c52a1fd2652b1bbf7c1b7995eac487a11..a86d1dcebda7cc5ec73791d706b482bd6ecdb9e7 100644 --- a/modules/io/src/mol/entity_io_mmcif_handler.cc +++ b/modules/io/src/mol/entity_io_mmcif_handler.cc @@ -38,7 +38,7 @@ namespace ost { namespace io { using boost::format; -bool EntityIOMMCIFHandler::RequiresBuilder() const +bool EntityIOMMCIFHandler::RequiresProcessor() const { return true; } diff --git a/modules/io/src/mol/entity_io_mmcif_handler.hh b/modules/io/src/mol/entity_io_mmcif_handler.hh index 2fa262156d4867f665a8fc3f4d5ea8e71877f16f..e55a409b850f5ceae92f3b62830a8e895c0f4930 100644 --- a/modules/io/src/mol/entity_io_mmcif_handler.hh +++ b/modules/io/src/mol/entity_io_mmcif_handler.hh @@ -42,7 +42,7 @@ public: const String& format="auto"); static bool ProvidesExport(const boost::filesystem::path& loc, const String& format="auto"); - virtual bool RequiresBuilder() const; + virtual bool RequiresProcessor() const; static String GetFormatName() { return String("mmCIF"); } static String GetFormatDescription() { diff --git a/modules/io/src/mol/entity_io_pdb_handler.cc b/modules/io/src/mol/entity_io_pdb_handler.cc index fe70388346cf08c24c84bdb705774ec2cf4420b7..69e466a23b0c092aef483c7e1c62e18b719d2a2b 100644 --- a/modules/io/src/mol/entity_io_pdb_handler.cc +++ b/modules/io/src/mol/entity_io_pdb_handler.cc @@ -39,7 +39,7 @@ namespace ost { namespace io { using boost::format; -bool EntityIOPDBHandler::RequiresBuilder() const +bool EntityIOPDBHandler::RequiresProcessor() const { return true; } diff --git a/modules/io/src/mol/entity_io_pdb_handler.hh b/modules/io/src/mol/entity_io_pdb_handler.hh index 3ceea37f79a88fc7eac60a31e06e28adbcf93b4c..07bfca81e49714d6aaa5b5440820b30815baf1f0 100644 --- a/modules/io/src/mol/entity_io_pdb_handler.hh +++ b/modules/io/src/mol/entity_io_pdb_handler.hh @@ -45,7 +45,7 @@ public: const String& format="auto"); static bool ProvidesExport(const boost::filesystem::path& loc, const String& format="auto"); - virtual bool RequiresBuilder() const; + virtual bool RequiresProcessor() const; static String GetFormatName() { return String("Pdb"); } static String GetFormatDescription() { return String("Protein Data Bank file format"); } diff --git a/modules/io/src/mol/entity_io_sdf_handler.cc b/modules/io/src/mol/entity_io_sdf_handler.cc index 5a81405682952a05dd5452ddbae1c11e13af2fc7..31ba544b0214906993ae1fced35ebf1cbd6feffb 100644 --- a/modules/io/src/mol/entity_io_sdf_handler.cc +++ b/modules/io/src/mol/entity_io_sdf_handler.cc @@ -29,7 +29,7 @@ namespace ost { namespace io { -bool EntityIOSDFHandler::RequiresBuilder() const +bool EntityIOSDFHandler::RequiresProcessor() const { return false; } diff --git a/modules/io/src/mol/entity_io_sdf_handler.hh b/modules/io/src/mol/entity_io_sdf_handler.hh index 66333e8d3c687fea30ad870ae7218e01ec40a9ec..55c20fc9675ed0df36494b11c456e7e8e4b49e0b 100644 --- a/modules/io/src/mol/entity_io_sdf_handler.hh +++ b/modules/io/src/mol/entity_io_sdf_handler.hh @@ -40,7 +40,7 @@ public: static bool ProvidesExport(const boost::filesystem::path& loc, const String& format="auto"); - virtual bool RequiresBuilder() const; + virtual bool RequiresProcessor() const; static String GetFormatName() { return String("Sdf"); } static String GetFormatDescription() { return String("Structure-data format from Molecular Design Limited"); } diff --git a/modules/io/src/mol/load_entity.cc b/modules/io/src/mol/load_entity.cc index c1322367cc6e188f4a51c4801e0278dc4b37fe95..98eea40f861a728340b8ad97b79997800bbd6119 100644 --- a/modules/io/src/mol/load_entity.cc +++ b/modules/io/src/mol/load_entity.cc @@ -43,7 +43,7 @@ void Import(mol::EntityHandle& eh, const String& filename, int flag) LOG_DEBUG("running conopology"); - if(ent_io->RequiresBuilder()) { + if(ent_io->RequiresProcessor()) { IOProfile& prof = IOProfileRegistry::Instance().GetDefault(); if (prof.processor) { prof.processor->Process(eh); diff --git a/modules/io/tests/test_io_pdb.cc b/modules/io/tests/test_io_pdb.cc index 111d797981ad92135fd7ac4d3320113e4d496f63..33e08b19af7b3ac3fd08eae0f6705c32c8b2d8f6 100644 --- a/modules/io/tests/test_io_pdb.cc +++ b/modules/io/tests/test_io_pdb.cc @@ -855,7 +855,7 @@ BOOST_AUTO_TEST_CASE(seqres_import) char * ost_root=getenv("OST_ROOT"); if(!ost_root){ std::cout << "WARNING: skipping SEQRES import unit test. " - << "Rule-based builder is required" << std::endl; + << "Rule-based processor is required" << std::endl; return; } SetPrefixPath(ost_root); diff --git a/modules/io/tests/test_mmcif_reader.cc b/modules/io/tests/test_mmcif_reader.cc index 9ae371699a9dba2da8da18ae5bca795951def935..4c4c7cf2c572a2cafa4318b55b827b4fe3827ed1 100644 --- a/modules/io/tests/test_mmcif_reader.cc +++ b/modules/io/tests/test_mmcif_reader.cc @@ -141,7 +141,7 @@ BOOST_AUTO_TEST_CASE(mmcif_convert_seqres) char * ost_root=getenv("OST_ROOT"); if(!ost_root){ std::cout << "WARNING: skipping SEQRES import unit test. " - << "Rule-based builder is required" << std::endl; + << "Rule-based processor is required" << std::endl; return; } SetPrefixPath(ost_root); @@ -404,7 +404,7 @@ BOOST_AUTO_TEST_CASE(mmcif_entity_poly_tests) char * ost_root=getenv("OST_ROOT"); if(!ost_root){ std::cout << "WARNING: skipping SEQRES import unit test. " - << "Rule-based builder is required" << std::endl; + << "Rule-based processor is required" << std::endl; return; } SetPrefixPath(ost_root); diff --git a/modules/seq/alg/pymod/renumber.py b/modules/seq/alg/pymod/renumber.py index f715f0bd6f1ef9dbbc60b3afc316502a9d462398..092850f2a356c4b240f3afe9f42ebab730c60b70 100644 --- a/modules/seq/alg/pymod/renumber.py +++ b/modules/seq/alg/pymod/renumber.py @@ -45,7 +45,9 @@ def Renumber(seq_handle, sequence_number_with_attached_view=1): if renumberingFlag == True: err = 'Warning: %s residues have been renumbered!' %changed_residue_count LogInfo(err) - conop.ConnectAll(ent_n) + + # FIXME: BZDNG-416 + #conop.ConnectAll(ent_n) return ent_n elif isinstance(seq_handle, seq.AlignmentHandle): @@ -80,6 +82,7 @@ def Renumber(seq_handle, sequence_number_with_attached_view=1): if renumberingFlag == True: err = 'Warning: %s residues have been renumbered!' %changed_residue_count LogInfo(err) - conop.ConnectAll(ent_n) + # FIXME: BZDNG-416 + #conop.ConnectAll(ent_n) return ent_n diff --git a/scripts/init_cl.py b/scripts/init_cl.py index 88068214d34d73573a89e1ed1808e9602187867b..e9251dc9b0363710c25f77606e737ae8979d1ff1 100644 --- a/scripts/init_cl.py +++ b/scripts/init_cl.py @@ -36,16 +36,16 @@ from ost import * import ost ost.SetPrefixPath(os.getenv('DNG_ROOT')) -def _InitRuleBasedBuilder(): + +def _InitRuleBasedProcessor(): compound_lib_path=os.path.join(ost.GetSharedDataPath(), 'compounds.chemlib') if os.path.exists(compound_lib_path): compound_lib=conop.CompoundLib.Load(compound_lib_path) conop.SetDefaultLib(compound_lib) io.profiles['DEFAULT'].processor = conop.RuleBasedProcessor(compound_lib) -# switch to rule-based builder for high fidelity if compounds.chemlib is -# available -_InitRuleBasedBuilder() +# switch to rule-based processor, if compound library is available +_InitRuleBasedProcessor() import os.path HistoryFile=os.path.expanduser('~/.ost_history')