Rosetta Core  2014.35
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
core::chemical::ResidueTypeSet Class Reference

A collection of ResidueType defined. More...

#include <ResidueTypeSet.hh>

Public Types

typedef std::list< AA >
::const_iterator 
AAsIter
 
typedef std::map< std::string,
ResidueTypeCOP >
::const_iterator 
const_residue_iterator
 

Public Member Functions

 ResidueTypeSet ()
 default c-tor More...
 
 ResidueTypeSet (std::string const &name, std::string const &directory, std::vector< std::string > const &extra_res_param_files=std::vector< std::string >(), std::vector< std::string > const &extra_patch_files=std::vector< std::string >())
 constructor from directory More...
 
virtual ~ResidueTypeSet ()
 
std::string const & name () const
 name of the residue type set More...
 
AtomTypeSetCAP atom_type_set () const
 
ElementSetCAP element_set () const
 
MMAtomTypeSetCAP mm_atom_type_set () const
 
orbitals::OrbitalTypeSetCAP orbital_type_set () const
 
void atom_type_set (AtomTypeSetCAP atom_types)
 
void element_set (ElementSetCAP elements)
 
void mm_atom_type_set (MMAtomTypeSetCAP mm_atom_types)
 
void orbital_type_set (orbitals::OrbitalTypeSetCAP orbital_types)
 
void read_list_of_residues (std::string const &list_filename)
 read a list of residue types More...
 
void read_files (utility::vector1< std::string > const &filenames)
 
void apply_patches (utility::vector1< std::string > const &filenames)
 
void place_adducts ()
 apply patches to base ResidueType to generate variant ResidueTyes More...
 
void add_residue_type (ResidueTypeOP new_type)
 adds a new residue type to the set More...
 
void add_residue_type (std::string const &filename)
 
void remove_residue_type (std::string const &name)
 delete a residue type from the set (Use with care) More...
 
void create_adduct_combinations (ResidueType const &rsd, std::map< std::string, int > ref_map, std::map< std::string, int > count_map, utility::vector1< bool > add_mask, utility::vector1< Adduct >::const_iterator work_iter)
 Create correct combinations of adducts for a residue type. More...
 
ResidueTypeCOPs const & interchangeability_group_map (std::string const &name) const
 query ResidueTypes by their interchangeability-group name More...
 
ResidueTypeCOPs const & name3_map (std::string const &name) const
 query ResidueTypes by their 3-letter name More...
 
ResidueType const & name_map (std::string const &name) const
 query ResidueType by its unique residue id. More...
 
bool has_name (std::string const &name) const
 query if a ResidueType of the unique residue id (name) is present. More...
 
bool has_name3 (std::string const &name3) const
 query if any ResidueTypes in the set have a "name3" tat matches the input name3 More...
 
ResidueType const & get_residue_type_with_variant_added (ResidueType const &init_rsd, VariantType const &new_type) const
 query a variant ResidueType by its base ResidueType and VariantType More...
 
ResidueType const & get_residue_type_with_variant_removed (ResidueType const &init_rsd, VariantType const &old_type) const
 return the residuetype we get from variant rsd type after removing the desired variant type More...
 
ResidueTypeCOPs const & aa_map (AA const &aa) const
 query ResidueTypes by their AA enum type More...
 
void select_residues (ResidueSelector const &selector, ResidueTypeCOPs &matches) const
 select a set of ResidueTypes give certain criteria More...
 
std::list< AA >::const_iterator aas_defined_begin () const
 beginning of aas_defined_ list More...
 
std::list< AA >::const_iterator aas_defined_end () const
 end of aas_defined_ list More...
 
const_residue_iterator all_residues_begin () const
 
const_residue_iterator all_residues_end () const
 
ResidueTypeCOPs const & residue_types () const
 alternate access to all residuetypes as vector More...
 
std::string const & database_directory () const
 accessor for database_directory More...
 

Private Member Functions

void clear_residue_maps ()
 clear residue maps More...
 
void update_residue_maps ()
 update residue maps More...
 
void add_residue_type_to_maps (ResidueTypeOP rsd)
 
void remove_residue_type_from_maps (ResidueTypeOP rsd)
 
 ResidueTypeSet (ResidueTypeSet const &)
 
ResidueTypeSet const & operator= (ResidueTypeSet const &)
 

Private Attributes

std::string name_
 What does the ChemicalManager call this ResidueTypeSet? More...
 
AtomTypeSetCAP atom_types_
 
ElementSetCAP elements_
 
MMAtomTypeSetCAP mm_atom_types_
 
orbitals::OrbitalTypeSetCAP orbital_types_
 
ResidueTypeOPs residue_types_
 the residues More...
 
ResidueTypeCOPs residue_types_const_
 for handing out More...
 
ResidueTypeCOPs empty_residue_list_
 null list of residues when query fails More...
 
std::map< AA, ResidueTypeCOPsaa_map_
 map to ResidueType pointers by AA enum More...
 
std::map< std::string,
ResidueTypeCOPs
interchangeability_group_map_
 map between ResidueType's interchangeability group string and a vector of ResidueTypeCOPs More...
 
std::map< std::string,
ResidueTypeCOPs
name3_map_
 map to ResidueType pointers by 3-letter string name More...
 
std::map< std::string,
ResidueTypeCOP
name_map_
 map to ResidueType pointers by unique residue id More...
 
std::map< std::string,
ResidueTypeOP
nonconst_name_map_
 map to ResidueType pointers by unique residue id, for nonconst access More...
 
std::list< AAaas_defined_
 list of AA types defined More...
 
const std::string database_directory_
 the database directory of the generating files —> allows to use cached dunbrack libs More...
 

Detailed Description

A collection of ResidueType defined.

One thing that is not nailed down is whether a single ResidueSet can have ResidueType's with different AtomTypeSets. I've left open this possibility currently although there isnt any code for this yet (PB-07/07)

Member Typedef Documentation

Constructor & Destructor Documentation

core::chemical::ResidueTypeSet::ResidueTypeSet ( )

default c-tor

core::chemical::ResidueTypeSet::ResidueTypeSet ( std::string const &  name,
std::string const &  directory,
std::vector< std::string > const &  extra_res_param_files = std::vector< std::string >(),
std::vector< std::string > const &  extra_patch_files = std::vector< std::string >() 
)
core::chemical::ResidueTypeSet::~ResidueTypeSet ( )
virtual
core::chemical::ResidueTypeSet::ResidueTypeSet ( ResidueTypeSet const &  )
private

Member Function Documentation

ResidueTypeCOPs const & core::chemical::ResidueTypeSet::aa_map ( AA const &  aa) const

query ResidueTypes by their AA enum type

similar to name3_map, return all matched residue types or an empty list.

References aa_map_, and empty_residue_list_.

Referenced by core::coarse::CoarseEtable::dump_oldstyle_type_table(), core::fragment::make_pose_from_sequence_(), and core::pose::residue_types_from_sequence().

std::list< AA >::const_iterator core::chemical::ResidueTypeSet::aas_defined_begin ( ) const

beginning of aas_defined_ list

References aas_defined_.

std::list< AA >::const_iterator core::chemical::ResidueTypeSet::aas_defined_end ( ) const

end of aas_defined_ list

References aas_defined_.

void core::chemical::ResidueTypeSet::add_residue_type ( ResidueTypeOP  new_type)
void core::chemical::ResidueTypeSet::add_residue_type ( std::string const &  filename)
void core::chemical::ResidueTypeSet::add_residue_type_to_maps ( ResidueTypeOP  rsd)
private
const_residue_iterator core::chemical::ResidueTypeSet::all_residues_begin ( ) const
inline

References name_map_.

const_residue_iterator core::chemical::ResidueTypeSet::all_residues_end ( ) const
inline

References name_map_.

void core::chemical::ResidueTypeSet::apply_patches ( utility::vector1< std::string > const &  filenames)
AtomTypeSetCAP core::chemical::ResidueTypeSet::atom_type_set ( ) const
inline

References atom_types_.

void core::chemical::ResidueTypeSet::atom_type_set ( AtomTypeSetCAP  atom_types)
inline

References atom_types_, and runtime_assert.

void core::chemical::ResidueTypeSet::clear_residue_maps ( )
private
void core::chemical::ResidueTypeSet::create_adduct_combinations ( ResidueType const &  rsd,
std::map< std::string, int ref_map,
std::map< std::string, int count_map,
utility::vector1< bool add_mask,
utility::vector1< Adduct >::const_iterator  work_iter 
)

Create correct combinations of adducts for a residue type.

References core::chemical::apply_adducts_to_residue(), core::chemical::ResidueType::defined_adducts(), and residue_types_.

Referenced by place_adducts().

std::string const& core::chemical::ResidueTypeSet::database_directory ( ) const
inline

accessor for database_directory

References database_directory_.

ElementSetCAP core::chemical::ResidueTypeSet::element_set ( ) const
inline

References elements_.

void core::chemical::ResidueTypeSet::element_set ( ElementSetCAP  elements)
inline

References elements_, and runtime_assert.

ResidueType const & core::chemical::ResidueTypeSet::get_residue_type_with_variant_added ( ResidueType const &  init_rsd,
VariantType const &  new_type 
) const

query a variant ResidueType by its base ResidueType and VariantType

Note
currently, this will not work for variant types defined as alternate base residues (ie different params files)

return the first match with both base ResidueType id and variant_type name. Abort if there is no match

Note
currently, this will not work for variant types defined as alternate base residues (ie different params files)

References core::chemical::ResidueType::has_variant_type(), match, core::chemical::ResidueType::name(), name_map_, core::chemical::residue_type_base_name(), residue_types_, utility_exit_with_message, and core::chemical::ResidueType::variant_types().

ResidueType const & core::chemical::ResidueTypeSet::get_residue_type_with_variant_removed ( ResidueType const &  init_rsd,
VariantType const &  old_type 
) const

return the residuetype we get from variant rsd type after removing the desired variant type

Note
currently, this will not work for variant types defined as alternate base residues (ie different params files)

References core::chemical::ResidueType::has_variant_type(), match, core::chemical::ResidueType::name(), name_map_, core::chemical::residue_type_base_name(), residue_types_, utility_exit_with_message, and core::chemical::ResidueType::variant_types().

bool core::chemical::ResidueTypeSet::has_name ( std::string const &  name) const
bool core::chemical::ResidueTypeSet::has_name3 ( std::string const &  name3) const

query if any ResidueTypes in the set have a "name3" tat matches the input name3

References name3_map_.

ResidueTypeCOPs const & core::chemical::ResidueTypeSet::interchangeability_group_map ( std::string const &  name) const

query ResidueTypes by their interchangeability-group name

References empty_residue_list_, and interchangeability_group_map_.

Referenced by core::pack::task::ResidueLevelTask_::allow_noncanonical_aa(), and core::pack::task::NC::residue_action().

MMAtomTypeSetCAP core::chemical::ResidueTypeSet::mm_atom_type_set ( ) const
inline

References mm_atom_types_.

void core::chemical::ResidueTypeSet::mm_atom_type_set ( MMAtomTypeSetCAP  mm_atom_types)
inline

References mm_atom_types_, and runtime_assert.

std::string const& core::chemical::ResidueTypeSet::name ( ) const
inline
ResidueTypeCOPs const & core::chemical::ResidueTypeSet::name3_map ( std::string const &  name) const

query ResidueTypes by their 3-letter name

3-letter name is not unique to each ResidueType for example, 3-letter name "HIS" matches both his tautomers, HIS and HIS_D. Return an empty list if no match is found.

References empty_residue_list_, and name3_map_.

Referenced by core::util::add_covalent_linkage_helper(), core::scoring::rna::data::RNA_DMS_Potential::add_probe_to_pose(), and core::io::pdb::build_pose_as_is1().

ResidueType const & core::chemical::ResidueTypeSet::name_map ( std::string const &  name_in) const
ResidueTypeSet const& core::chemical::ResidueTypeSet::operator= ( ResidueTypeSet const &  )
private
orbitals::OrbitalTypeSetCAP core::chemical::ResidueTypeSet::orbital_type_set ( ) const
inline

References orbital_types_.

void core::chemical::ResidueTypeSet::orbital_type_set ( orbitals::OrbitalTypeSetCAP  orbital_types)
inline

References orbital_types_, and runtime_assert.

void core::chemical::ResidueTypeSet::place_adducts ( )
void core::chemical::ResidueTypeSet::read_files ( utility::vector1< std::string > const &  filenames)
void core::chemical::ResidueTypeSet::read_list_of_residues ( std::string const &  list_filename)

read a list of residue types

the file contains a list of names of residue type parameter files stored in the database path

References basic::database::full_name(), getline(), and read_files().

void core::chemical::ResidueTypeSet::remove_residue_type ( std::string const &  name)

delete a residue type from the set (Use with care)

References has_name(), nonconst_name_map_, remove_residue_type_from_maps(), residue_types_, and utility_exit_with_message.

void core::chemical::ResidueTypeSet::remove_residue_type_from_maps ( ResidueTypeOP  rsd)
private
ResidueTypeCOPs const& core::chemical::ResidueTypeSet::residue_types ( ) const
inline

alternate access to all residuetypes as vector

References residue_types_const_.

Referenced by place_adducts(), and core::chemical::ResidueSelector::select().

void core::chemical::ResidueTypeSet::select_residues ( ResidueSelector const &  selector,
ResidueTypeCOPs matches 
) const

select a set of ResidueTypes give certain criteria

selection done by ResidueSelector class

References residue_types_.

void core::chemical::ResidueTypeSet::update_residue_maps ( )
private

update residue maps

check that residue id map should be unique, sort the aas_defined list and make its membe unique

References aas_defined_, add_residue_type_to_maps(), clear_residue_maps(), residue_types_, and residue_types_const_.

Referenced by apply_patches(), place_adducts(), read_files(), and ResidueTypeSet().

Member Data Documentation

std::map< AA, ResidueTypeCOPs > core::chemical::ResidueTypeSet::aa_map_
private
std::list< AA > core::chemical::ResidueTypeSet::aas_defined_
private
AtomTypeSetCAP core::chemical::ResidueTypeSet::atom_types_
private
const std::string core::chemical::ResidueTypeSet::database_directory_
private

the database directory of the generating files —> allows to use cached dunbrack libs

Referenced by database_directory().

ElementSetCAP core::chemical::ResidueTypeSet::elements_
private
ResidueTypeCOPs core::chemical::ResidueTypeSet::empty_residue_list_
private

null list of residues when query fails

Referenced by aa_map(), interchangeability_group_map(), and name3_map().

std::map< std::string, ResidueTypeCOPs > core::chemical::ResidueTypeSet::interchangeability_group_map_
private

map between ResidueType's interchangeability group string and a vector of ResidueTypeCOPs

Referenced by add_residue_type_to_maps(), interchangeability_group_map(), and remove_residue_type_from_maps().

MMAtomTypeSetCAP core::chemical::ResidueTypeSet::mm_atom_types_
private
std::map< std::string, ResidueTypeCOPs > core::chemical::ResidueTypeSet::name3_map_
private
std::string core::chemical::ResidueTypeSet::name_
private

What does the ChemicalManager call this ResidueTypeSet?

Referenced by name().

std::map< std::string, ResidueTypeCOP > core::chemical::ResidueTypeSet::name_map_
private
std::map< std::string, ResidueTypeOP > core::chemical::ResidueTypeSet::nonconst_name_map_
private

map to ResidueType pointers by unique residue id, for nonconst access

Referenced by add_residue_type_to_maps(), clear_residue_maps(), remove_residue_type(), and remove_residue_type_from_maps().

orbitals::OrbitalTypeSetCAP core::chemical::ResidueTypeSet::orbital_types_
private
ResidueTypeOPs core::chemical::ResidueTypeSet::residue_types_
private
ResidueTypeCOPs core::chemical::ResidueTypeSet::residue_types_const_
private

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