Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Types | Private Attributes | Friends | List of all members
core::chemical::AtomRefMapping< FromRef, ToRef > Class Template Reference

A class for mapping ResidueType atom references from one to another. It's intended not only for intra ResidueType mapping, but also for mapping corresponding references from one ResidueType to another. More...

#include <AtomRefMapping.hh>

Inheritance diagram for core::chemical::AtomRefMapping< FromRef, ToRef >:
Inheritance graph
[legend]

Public Types

typedef SubMap::const_iterator const_iterator
 

Public Member Functions

 AtomRefMapping ()
 
 AtomRefMapping (FromRef const &invalid_from, ToRef const &invalid_to)
 Constructor with non-standard invalid values. More...
 
 AtomRefMapping (bool identity)
 Ctor with explicit identity setting. More...
 
template<class F = FromRef, class T = ToRef, typename = typename std::enable_if< !std::is_same< F, core::Size >::value && !std::is_same< T, core::Size >::value, int >::type>
 AtomRefMapping (MutableResidueType const &restype)
 Make an explicit identity mapping for the ResType. More...
 
template<class F = FromRef, class T = ToRef, typename = typename std::enable_if< !std::is_same< F, VD >::value && !std::is_same< T, VD >::value, int >::type>
 AtomRefMapping (ResidueType const &restype)
 Make an explicit identity mapping for the ResType. More...
 
FromRef const & invalid_key () const
 What's the invalid value for the keys? More...
 
ToRef const & invalid_entry () const
 What's the invalid value for the mapped values? More...
 
void identity (bool setting)
 Set the identity flag. More...
 
bool identity () const
 Get the identity setting. More...
 
AtomRefMapping< ToRef, FromRef > reverse () const
 go from an A->B mapping to a B->A mapping More...
 
template<class OToRef >
AtomRefMapping< FromRef, OToRef > downstream_combine (AtomRefMapping< ToRef, OToRef > const &vmap_to_add) const
 Apply a B->C mapping to the current A->B mapping to get an A->C mapping i.e. vmap[j] becomes vmap_to_add[ vmap[j] ]. More...
 
template<class OFromRef >
AtomRefMapping< OFromRef, ToRef > upstream_combine (AtomRefMapping< OFromRef, FromRef > const &vmap_to_add) const
 Apply a C->A mapping to the current A->B mapping to get a C->B mapping i.e. vmap[j] becomes vmap[ vmap_to_add[ j ] ]. More...
 
void show (std::ostream &output) const
 
void clear ()
 Ignore all specializations on this map. More...
 
void erase (FromRef const &in)
 Make in act like the default (pay attention to identity_) More...
 
void invalidate (FromRef const &in)
 Make the key value an invalid to value (Will work even with identity_ == true) More...
 
ToRef const operator[] (FromRef const &in) const
 
ToRef & operator[] (FromRef const &in)
 
FromRef const & reverse_lookup (ToRef const &out) const
 Gets the key which corresponds to the given mapped value, if any. More...
 
bool count (FromRef const &key) const
 Does this map have the given key? More...
 
bool empty () const
 Does this mapping contain any explicit (non-identity) mappings? More...
 
bool operator== (AtomRefMapping< FromRef, ToRef > const &other) const
 Equality operator. More...
 
template<class F = FromRef, class T = ToRef, typename = typename std::enable_if< !std::is_same< F, VD >::value && !std::is_same< T, VD >::value, int >::type>
utility::vector1< core::Sizevectorize (ResidueType const &from_res, ResidueType const &to_res) const
 Make a Size-to-Size vector, indexed by the from, with elements that specify the two entries. More...
 
const_iterator begin () const
 An iterator to std::pair(key,value) pairs for explicit entries. More...
 
const_iterator end () const
 An iterator to std::pair(key,value) pairs for explicit entries. More...
 

Private Types

typedef std::map< FromRef, ToRef > SubMap
 

Private Attributes

SubMap mapping_
 The actual mapping. More...
 
FromRef invalid_from_
 What value to use for invalid from values. More...
 
ToRef invalid_to_
 What value to use for invalid to values. More...
 
bool identity_
 Should non-explicitly stated atoms be treated like an identity relation? Only meaningful if the two types are the same. More...
 

Friends

template<class Foo , class Bar >
class AtomRefMapping
 

Detailed Description

template<class FromRef, class ToRef>
class core::chemical::AtomRefMapping< FromRef, ToRef >

A class for mapping ResidueType atom references from one to another. It's intended not only for intra ResidueType mapping, but also for mapping corresponding references from one ResidueType to another.

This is a templated class to cut down on combinitorial complexity.

Member Typedef Documentation

template<class FromRef, class ToRef>
typedef SubMap::const_iterator core::chemical::AtomRefMapping< FromRef, ToRef >::const_iterator
template<class FromRef, class ToRef>
typedef std::map< FromRef, ToRef > core::chemical::AtomRefMapping< FromRef, ToRef >::SubMap
private

Constructor & Destructor Documentation

template<class FromRef, class ToRef>
core::chemical::AtomRefMapping< FromRef, ToRef >::AtomRefMapping ( )
inline
template<class FromRef, class ToRef>
core::chemical::AtomRefMapping< FromRef, ToRef >::AtomRefMapping ( FromRef const &  invalid_from,
ToRef const &  invalid_to 
)
inline

Constructor with non-standard invalid values.

template<class FromRef, class ToRef>
core::chemical::AtomRefMapping< FromRef, ToRef >::AtomRefMapping ( bool  identity)
inline

Ctor with explicit identity setting.

template<class FromRef, class ToRef>
template<class F = FromRef, class T = ToRef, typename = typename std::enable_if< !std::is_same< F, core::Size >::value && !std::is_same< T, core::Size >::value, int >::type>
core::chemical::AtomRefMapping< FromRef, ToRef >::AtomRefMapping ( MutableResidueType const &  restype)
inline

Make an explicit identity mapping for the ResType.

Not availible if either ref is a core::Size

template<class FromRef, class ToRef>
template<class F = FromRef, class T = ToRef, typename = typename std::enable_if< !std::is_same< F, VD >::value && !std::is_same< T, VD >::value, int >::type>
core::chemical::AtomRefMapping< FromRef, ToRef >::AtomRefMapping ( ResidueType const &  restype)
inline

Make an explicit identity mapping for the ResType.

Not availible if either ref is a VD

Member Function Documentation

template<class FromRef, class ToRef>
const_iterator core::chemical::AtomRefMapping< FromRef, ToRef >::begin ( ) const
inline

An iterator to std::pair(key,value) pairs for explicit entries.

template<class FromRef, class ToRef>
void core::chemical::AtomRefMapping< FromRef, ToRef >::clear ( )
inline
template<class FromRef, class ToRef>
bool core::chemical::AtomRefMapping< FromRef, ToRef >::count ( FromRef const &  key) const
inline
template<class FromRef, class ToRef>
template<class OToRef >
AtomRefMapping<FromRef,OToRef> core::chemical::AtomRefMapping< FromRef, ToRef >::downstream_combine ( AtomRefMapping< ToRef, OToRef > const &  vmap_to_add) const
inline

Apply a B->C mapping to the current A->B mapping to get an A->C mapping i.e. vmap[j] becomes vmap_to_add[ vmap[j] ].

Referenced by core::chemical::combine(), and core::chemical::AtomRefMapping< VD, core::Size >::upstream_combine().

template<class FromRef, class ToRef>
bool core::chemical::AtomRefMapping< FromRef, ToRef >::empty ( ) const
inline

Does this mapping contain any explicit (non-identity) mappings?

Referenced by core::chemical::rdkit::find_mapping().

template<class FromRef, class ToRef>
const_iterator core::chemical::AtomRefMapping< FromRef, ToRef >::end ( ) const
inline

An iterator to std::pair(key,value) pairs for explicit entries.

template<class FromRef, class ToRef>
void core::chemical::AtomRefMapping< FromRef, ToRef >::erase ( FromRef const &  in)
inline

Make in act like the default (pay attention to identity_)

Referenced by core::chemical::rdkit::RDMolToRestype::generate_restype().

template<class FromRef, class ToRef>
void core::chemical::AtomRefMapping< FromRef, ToRef >::identity ( bool  setting)
inline

Set the identity flag.

template<class FromRef, class ToRef>
bool core::chemical::AtomRefMapping< FromRef, ToRef >::identity ( ) const
inline

Get the identity setting.

template<class FromRef, class ToRef>
ToRef const& core::chemical::AtomRefMapping< FromRef, ToRef >::invalid_entry ( ) const
inline

What's the invalid value for the mapped values?

Referenced by core::chemical::rdkit::RestypeToRDMol::Mol().

template<class FromRef, class ToRef>
FromRef const& core::chemical::AtomRefMapping< FromRef, ToRef >::invalid_key ( ) const
inline

What's the invalid value for the keys?

template<class FromRef, class ToRef>
void core::chemical::AtomRefMapping< FromRef, ToRef >::invalidate ( FromRef const &  in)
inline

Make the key value an invalid to value (Will work even with identity_ == true)

template<class FromRef, class ToRef>
bool core::chemical::AtomRefMapping< FromRef, ToRef >::operator== ( AtomRefMapping< FromRef, ToRef > const &  other) const
inline

Equality operator.

template<class FromRef, class ToRef>
ToRef const core::chemical::AtomRefMapping< FromRef, ToRef >::operator[] ( FromRef const &  in) const
inline
template<class FromRef, class ToRef>
ToRef& core::chemical::AtomRefMapping< FromRef, ToRef >::operator[] ( FromRef const &  in)
inline
template<class FromRef, class ToRef>
AtomRefMapping< ToRef, FromRef > core::chemical::AtomRefMapping< FromRef, ToRef >::reverse ( ) const
inline

go from an A->B mapping to a B->A mapping

Referenced by core::chemical::rdkit::find_mapping().

template<class FromRef, class ToRef>
FromRef const& core::chemical::AtomRefMapping< FromRef, ToRef >::reverse_lookup ( ToRef const &  out) const
inline

Gets the key which corresponds to the given mapped value, if any.

template<class FromRef, class ToRef>
void core::chemical::AtomRefMapping< FromRef, ToRef >::show ( std::ostream &  output) const
inline
template<class FromRef, class ToRef>
template<class OFromRef >
AtomRefMapping<OFromRef, ToRef> core::chemical::AtomRefMapping< FromRef, ToRef >::upstream_combine ( AtomRefMapping< OFromRef, FromRef > const &  vmap_to_add) const
inline

Apply a C->A mapping to the current A->B mapping to get a C->B mapping i.e. vmap[j] becomes vmap[ vmap_to_add[ j ] ].

template<class FromRef, class ToRef>
template<class F = FromRef, class T = ToRef, typename = typename std::enable_if< !std::is_same< F, VD >::value && !std::is_same< T, VD >::value, int >::type>
utility::vector1< core::Size > core::chemical::AtomRefMapping< FromRef, ToRef >::vectorize ( ResidueType const &  from_res,
ResidueType const &  to_res 
) const
inline

Make a Size-to-Size vector, indexed by the from, with elements that specify the two entries.

Friends And Related Function Documentation

template<class FromRef, class ToRef>
template<class Foo , class Bar >
friend class AtomRefMapping
friend

Member Data Documentation

template<class FromRef, class ToRef>
bool core::chemical::AtomRefMapping< FromRef, ToRef >::identity_
private
template<class FromRef, class ToRef>
FromRef core::chemical::AtomRefMapping< FromRef, ToRef >::invalid_from_
private
template<class FromRef, class ToRef>
ToRef core::chemical::AtomRefMapping< FromRef, ToRef >::invalid_to_
private
template<class FromRef, class ToRef>
SubMap core::chemical::AtomRefMapping< FromRef, ToRef >::mapping_
private

The documentation for this class was generated from the following file: