Skip to content

Commit

Permalink
Store chain offset, UniProt ID in RMF, if new enough
Browse files Browse the repository at this point in the history
If we're using a version of RMF that's new enough to
support it, write Chain sequence offset and/or UniProt
accession to RMF files, or read them back.
  • Loading branch information
benmwebb committed Sep 22, 2023
1 parent 8b40639 commit d6f8d04
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/rmf/src/internal/atom_links_static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <RMF/SetCurrentFrame.h>
#include <RMF/NodeHandle.h>
#include <RMF/show_hierarchy.h>
#include <RMF/config.h>
#include <boost/range/iterator_range.hpp>

IMPRMF_BEGIN_INTERNAL_NAMESPACE
Expand Down Expand Up @@ -112,6 +113,10 @@ void HierarchyLoadStatic::setup_particle(RMF::NodeConstHandle nh,
chain.get_chain_id());
imp_chain.set_sequence(chain.get_sequence());
imp_chain.set_chain_type(atom::ChainType(chain.get_chain_type()));
#if RMF_VERSION >= 100600
imp_chain.set_sequence_offset(chain.get_sequence_offset());
imp_chain.set_uniprot_accession(chain.get_uniprot_accession());
#endif
}
if (typed_factory_.get_is_static(nh)) {
IMP_LOG_VERBOSE("typed " << std::endl);
Expand Down Expand Up @@ -217,6 +222,10 @@ void HierarchyLoadStatic::link_particle(RMF::NodeConstHandle nh,
imp_chain.set_id(chain.get_chain_id());
imp_chain.set_sequence(chain.get_sequence());
imp_chain.set_chain_type(atom::ChainType(chain.get_chain_type()));
#if RMF_VERSION >= 100600
imp_chain.set_sequence_offset(chain.get_sequence_offset());
imp_chain.set_uniprot_accession(chain.get_uniprot_accession());
#endif
}
IMP_CHECK_CODE
(
Expand Down Expand Up @@ -316,6 +325,10 @@ void HierarchySaveStatic::setup_node(Model *m, ParticleIndex p,
chain.set_chain_id(d.get_id());
chain.set_sequence(d.get_sequence());
chain.set_chain_type(d.get_chain_type().get_string());
#if RMF_VERSION >= 100600
chain.set_sequence_offset(d.get_sequence_offset());
chain.set_uniprot_accession(d.get_uniprot_accession());
#endif
}
if (atom::Diffusion::get_is_setup(m, p)) {
atom::Diffusion d(m, p);
Expand Down

0 comments on commit d6f8d04

Please sign in to comment.