mirror of
https://github.com/PDB-REDO/libcifpp.git
synced 2026-06-04 13:54:25 +08:00
Fix cleanup_empty_categories
This commit is contained in:
@@ -27,7 +27,7 @@ cmake_minimum_required(VERSION 3.23)
|
||||
# set the project name
|
||||
project(
|
||||
libcifpp
|
||||
VERSION 8.0.0
|
||||
VERSION 8.0.1
|
||||
LANGUAGES CXX)
|
||||
|
||||
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
Version 8.0.1
|
||||
- Fix cif::mm::structure::cleanup_empty_categories, removed too much
|
||||
|
||||
Version 8.0.0
|
||||
- A dictionary is for a datablock and a file can have
|
||||
datablocks with differing dictionaries.
|
||||
|
||||
@@ -2717,9 +2717,12 @@ std::string structure::create_entity_for_branch(branch &branch)
|
||||
|
||||
void structure::cleanup_empty_categories()
|
||||
{
|
||||
|
||||
using namespace literals;
|
||||
|
||||
auto &atomSite = m_db["atom_site"];
|
||||
auto &pdbxPolySeqScheme = m_db["pdbx_poly_seq_scheme"];
|
||||
auto &entityPolySeq = m_db["entity_poly_seq"];
|
||||
|
||||
// Remove chem_comp's for which there are no atoms at all
|
||||
auto &chem_comp = m_db["chem_comp"];
|
||||
@@ -2728,8 +2731,12 @@ void structure::cleanup_empty_categories()
|
||||
for (auto chemComp : chem_comp)
|
||||
{
|
||||
std::string compID = chemComp["id"].as<std::string>();
|
||||
if (atomSite.contains("label_comp_id"_key == compID or "auth_comp_id"_key == compID))
|
||||
if (atomSite.contains("label_comp_id"_key == compID or "auth_comp_id"_key == compID) or
|
||||
pdbxPolySeqScheme.contains("mon_id"_key == compID or "auth_mon_id"_key == compID or "pdb_mon_id"_key == compID) or
|
||||
entityPolySeq.contains("mon_id"_key == compID))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
obsoleteChemComps.push_back(chemComp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user