Skip to content
Snippets Groups Projects
Commit 43e0abc2 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

Delete residues/chains that don't contain atoms after molck cleanup by default

parent 2f14bd97
No related branches found
No related tags found
No related merge requests found
...@@ -1877,7 +1877,7 @@ API ...@@ -1877,7 +1877,7 @@ API
The API here is set such that the functions modify the passed structure *ent* The API here is set such that the functions modify the passed structure *ent*
in-place. If this is not ok, please work on a copy of the structure. in-place. If this is not ok, please work on a copy of the structure.
.. function:: Molck(ent, lib, settings) .. function:: Molck(ent, lib, settings, [prune=True])
Runs Molck on provided entity. Runs Molck on provided entity.
...@@ -1887,6 +1887,10 @@ API ...@@ -1887,6 +1887,10 @@ API
:type lib: :class:`~ost.conop.CompoundLib` :type lib: :class:`~ost.conop.CompoundLib`
:param settings: Molck settings :param settings: Molck settings
:type settings: :class:`MolckSettings` :type settings: :class:`MolckSettings`
:param prune: Whether to remove residues/chains that don't contain atoms
anymore after Molck cleanup
:type prune: `bool`
.. function:: MapNonStandardResidues(ent, lib) .. function:: MapNonStandardResidues(ent, lib)
......
...@@ -133,5 +133,5 @@ void export_Molck() ...@@ -133,5 +133,5 @@ void export_Molck()
def("CleanUpElementColumn", &CleanUpElementColumn, (arg("ent"), arg("lib"))); def("CleanUpElementColumn", &CleanUpElementColumn, (arg("ent"), arg("lib")));
def("Molck", &Molck, (arg("ent"), arg("lib"), arg("settings"))); def("Molck", &Molck, (arg("ent"), arg("lib"), arg("settings"), arg("prune")=true));
} }
...@@ -174,7 +174,8 @@ void CleanUpElementColumn(EntityHandle& ent, CompoundLibPtr lib){ ...@@ -174,7 +174,8 @@ void CleanUpElementColumn(EntityHandle& ent, CompoundLibPtr lib){
void Molck(ost::mol::EntityHandle& ent, void Molck(ost::mol::EntityHandle& ent,
ost::conop::CompoundLibPtr lib, ost::conop::CompoundLibPtr lib,
const MolckSettings& settings = MolckSettings()){ const MolckSettings& settings,
bool prune) {
if(!lib) { if(!lib) {
throw ost::Error("Require valid compound library!"); throw ost::Error("Require valid compound library!");
...@@ -193,7 +194,12 @@ void Molck(ost::mol::EntityHandle& ent, ...@@ -193,7 +194,12 @@ void Molck(ost::mol::EntityHandle& ent,
settings.colored); settings.colored);
if (settings.assign_elem) { if (settings.assign_elem) {
CleanUpElementColumn(ent, lib); CleanUpElementColumn(ent, lib);
} }
if(prune) {
ost::mol::XCSEditor edi = ent.EditXCS();
edi.Prune();
}
} }
}}} // ns }}} // ns
\ No newline at end of file
...@@ -97,7 +97,8 @@ void CleanUpElementColumn(ost::mol::EntityHandle& ent, ...@@ -97,7 +97,8 @@ void CleanUpElementColumn(ost::mol::EntityHandle& ent,
void Molck(ost::mol::EntityHandle& ent, void Molck(ost::mol::EntityHandle& ent,
ost::conop::CompoundLibPtr lib, ost::conop::CompoundLibPtr lib,
const MolckSettings& settings); const MolckSettings& settings,
bool prune = true);
}}} // namespace }}} // namespace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment