diff --git a/include/cando/chem/mol2.h b/include/cando/chem/mol2.h index ac3bd7cb..280968cc 100644 --- a/include/cando/chem/mol2.h +++ b/include/cando/chem/mol2.h @@ -87,7 +87,7 @@ string mol2AtomType(Atom_sp a); core::HashTable_sp assignSybylTypes(Matter_sp matter); -void mol2WriteAggregateStream( Aggregate_sp agg, std::ostream &out, core::HashTable_sp atom_types ); +core::HashTableEql_sp mol2WriteAggregateStream( Aggregate_sp agg, std::ostream &out, core::HashTable_sp atom_types ); void mol2WriteAggregateToFileName( Aggregate_sp a, core::T_sp sFileName, core::HashTable_sp atom_types ); void mol2WriteDumbAggregateToFileName( Aggregate_O& a, core::T_sp sFileName, core::HashTable_sp atom_types ); diff --git a/src/chem/candoScript.cc b/src/chem/candoScript.cc index 55ab5350..fdbf8e74 100644 --- a/src/chem/candoScript.cc +++ b/src/chem/candoScript.cc @@ -253,7 +253,7 @@ CL_DEFUN core::T_sp chem__save_mol2(Matter_sp matter, core::T_sp destDesig, bool CL_LAMBDA(matter &optional use-sybyl-types atom-types); DOCGROUP(cando); -CL_DEFUN std::string chem__aggregate_as_mol2_string(Aggregate_sp matter, bool useSybylTypes, core::T_sp atom_types) +CL_DEFUN core::SimpleBaseString_mv chem__aggregate_as_mol2_string(Aggregate_sp matter, bool useSybylTypes, core::T_sp atom_types) { core::HashTable_sp ht; if (useSybylTypes) { @@ -262,8 +262,11 @@ CL_DEFUN std::string chem__aggregate_as_mol2_string(Aggregate_sp matter, bool us ht = gc::As(atom_types); } stringstream ss; - mol2WriteAggregateStream(matter,ss,ht); - return ss.str(); + core::T_sp res_atom_map = mol2WriteAggregateStream(matter,ss,ht); + if(res_atom_map.nilp()) { + SIMPLE_ERROR("mol2WriteAggregateStream did not return a res-atom-map"); + } + return Values(core::SimpleBaseString_O::make(ss.str()),res_atom_map); } CL_LAMBDA(matter &optional use-sybyl-types atom-types); diff --git a/src/chem/mol2.cc b/src/chem/mol2.cc index 7f832fc5..cb214c58 100644 --- a/src/chem/mol2.cc +++ b/src/chem/mol2.cc @@ -693,7 +693,7 @@ core::HashTable_sp assignSybylTypes( Matter_sp matter) { return atom_types; } -void mol2WriteAggregateStream( Aggregate_sp agg, std::ostream &out, core::HashTable_sp atom_types ) +core::HashTableEql_sp mol2WriteAggregateStream( Aggregate_sp agg, std::ostream &out, core::HashTable_sp atom_types ) { Loop loop, lRes; uint atomCount, bondCount, residueCount; @@ -916,6 +916,7 @@ void mol2WriteAggregateStream( Aggregate_sp agg, std::ostream &out, core::HashTa id++; } LOG("Returning" ); + return ht; } diff --git a/src/lisp/cando-widgets/show.lisp b/src/lisp/cando-widgets/show.lisp index c267866d..df1e9cfb 100644 --- a/src/lisp/cando-widgets/show.lisp +++ b/src/lisp/cando-widgets/show.lisp @@ -534,6 +534,8 @@ agg)) (defmethod show-on-pane (pane-instance (object chem:aggregate) &rest rest &key &allow-other-keys) + (apply #'ngl-show-on-pane pane-instance object rest) + #+(or) (let ((rev-molecules nil)) (chem:do-molecules (mol object) (push mol rev-molecules))