Rosetta
Classes | Typedefs | Enumerations | Functions
core::io::mmtf Namespace Reference

Classes

class  ExtraDataEnumManager
 Enum string/enum functions for pose extra data we will be storing/retrieving. ALL enums must be defined in mmtf/ExtraDataEnum.hh. More...
 
struct  sd_index
 storage for indicies to something in a mmtf struct this makes it easier to iterate the struct in relation to AtomInformation vectors More...
 
struct  ai_cmp
 simple comparator for AtomInformation when grouping by residue/grp More...
 

Typedefs

typedef utility::pointer::shared_ptr< ExtraDataEnumManagerExtraDataEnumManagerOP
 
typedef utility::pointer::shared_ptr< ExtraDataEnumManager const > ExtraDataEnumManagerCOP
 
typedef utility::vector0< core::io::AtomInformationaiGroup
 
typedef utility::vector0< aiGroupaiChain
 
typedef utility::vector0< aiChainaiPose
 
typedef utility::vector0< aiPoseaiModels
 

Enumerations

enum  ExtraDataEnum {
  pose_cache_string_data = 1 , pose_cache_real_data , pdb_comments , simple_metric_string_data ,
  simple_metric_real_data , simple_metric_composite_string_data , simple_metric_composite_real_data , simple_metric_per_residue_string_data ,
  simple_metric_per_residue_real_data , simple_metric_per_residue_string_output , simple_metric_per_residue_real_output , ExtraDataEnum_total =simple_metric_per_residue_real_output
}
 Enum definitions for pose extra data we will be storing/retrieving. ALL Enums must also have their string equivalents defined in mmtf/ExtraDataEnumManager.cc. More...
 

Functions

template<typename T >
void add_xbond_information (std::map< std::string, utility::vector1< T > > &xbond_map, core::io::AtomInformation const &atm_1, core::io::AtomInformation const &atm_2)
 
template<typename T >
bool sort_xbond_func (T const &lhs, T const &rhs)
 
void add_link_and_ss_information (::mmtf::StructureData const &sd, core::io::StructFileRep &sfr, std::vector< core::io::AtomInformation > const &all_AIs, std::vector< core::Size > const &ai_to_model, core::Size const &current_model)
 This distributes what type of bonds to make based on the mmtf bonds via add_xbond_information. More...
 
core::io::AtomInformation make_atom_information (::mmtf::StructureData const &sd, ::mmtf::GroupType const &group, int const groupAtomIndex, core::Size const atomIndex, core::Size const atomSerial, core::Size const groupIndex, core::Size const chainIndex, utility::vector1< char > &known_chainIDs, core::io::StructFileReaderOptions const &options)
 makes a single AtomInformation from the mmtf data More...
 
std::vector< core::io::AtomInformationmake_all_atom_information (::mmtf::StructureData const &sd, std::vector< core::Size > &model_indexes, std::map< core::Size, core::Size > &model_index_to_starting_index, StructFileReaderOptions const &options)
 makes a linear vector of all AtomInformation from the mmtf data More...
 
void add_bond_information (::mmtf::StructureData const &sd, std::vector< core::io::AtomInformation > &all_AIs, std::map< core::Size, sd_index > const &atom_num_to_sd_map)
 This adds actuals bonds from the mmtf object to connected_indicies/connected_orders. More...
 
void add_ters_via_bonds (std::vector< core::io::AtomInformation > &all_AIs, std::vector< core::Size > const &ai_to_model)
 This adds TERs based on what is bound to the C of each AA. More...
 
core::io::StructFileRepOP create_sfr_from_mmtf_filename (std::string const &mmtf_filename, core::io::StructFileReaderOptions const &options)
 create sfr from create_sfrs_from_mmtf_filename More...
 
template<typename T >
void set_model_index_if_not_empty (core::Size const model_index, std::string const &info_tag, std::vector< T > const &all_model_data, T &target_data)
 set_model_index_if_not_empty does what the name says :p useful for loading various datas from modelProperties More...
 
template<typename T >
void map_decode_from_model (::mmtf::MapDecoder const &md, std::string const &map_key, bool const required, core::Size const model_index, T &target)
 
void read_extra_data (core::io::StructFileRepOP &sfr, ::mmtf::StructureData const &sd, core::Size const model_index)
 
std::map< core::Size, core::Sizemake_old_to_new_mapping (std::vector< std::vector< core::Size >> const atom_idx_chains, core::Size const starting_index)
 
void update_bond_indices (core::io::StructFileRep &sfr, std::map< core::Size, core::Size > const &old_to_new_idx)
 
utility::vector1< core::io::StructFileRepOPcreate_sfrs_from_mmtf_filename (std::string const &mmtf_filename, core::io::StructFileReaderOptions const &options, utility::vector1< core::Size > const &model_indexes)
 master sfr creator More...
 
void read_extra_data (utility::vector1< core::io::StructFileRepOP > &sfrs, ::mmtf::StructureData const &sd)
 
void load_heterogen_info (::mmtf::MapDecoder const &md, core::io::StructFileRep &sfr, core::Size const model_index)
 load heterogen data: heterogen_names && residue_type_base_names More...
 
void read_extra_data (::mmtf::StructureData &sd, core::io::StructFileRep &sfr)
 Read extra data from StructureData into the SFR. More...
 
bool dump_mmtf (core::pose::Pose const &pose, std::string const &file_name, StructFileRepOptionsCOP options=StructFileRepOptionsCOP(new StructFileRepOptions))
 Dump a MMTF from a pose to a file. Return success or failure. More...
 
core::io::StructFileRepOP dump_mmtf (core::pose::Pose const &pose, std::ostream &out, StructFileRepOptionsCOP options)
 Dump an MMTF from a pose to an ostream. More...
 
core::io::StructFileRepOP dump_mmtf (core::pose::Pose const &pose, std::string const &jd2_job_data, std::ostream &out)
 Dump an MMTF from a pose, optionally extracting extra info. More...
 
bool dump_mmtf (std::string const &file_name, StructFileRepOP sfr, StructFileRepOptions const &options)
 dump_mmtf function. Create the sfr from pose using the PoseToStructFileRepConverter class. Return success or failure. More...
 
void set_mmtf_default_options (core::io::StructFileRepOptions &options)
 Set StructFileRepOptions defauls for mmtf. More...
 
::mmtf::GroupType make_current_group (aiGroup const &ai_group)
 
bool is_in_bondAtomList (std::vector< int32_t > const &bondAtomList, core::Size const lower_atom, core::Size const upper_atom)
 
aiChain make_chain (utility::vector0< AtomInformation > const &chain_atoms)
 group chain_atoms into groups based on chain_id and resseq More...
 
aiPose aiPose_from_sfr (core::io::StructFileRep const &sfr)
 Convert linear sfr to vec0[vec0[vec0[AtomInformation]]]. More...
 
aiModels aiModels_from_sfrs (utility::vector1< core::io::StructFileRepOP > const &sfrs)
 Convert linear sfr to vec0[vec0[vec0[vec0[AtomInformation]]]]. More...
 
void add_bonds_to_sd (::mmtf::StructureData &sd, aiModels const &AIM, std::map< core::Size, sd_index > const &atom_num_to_sd_map)
 
template<typename T >
void add_if_not_empty (std::string const &given_name, T const &content, std::map< std::string, msgpack::object > &target_map, msgpack::zone &zone)
 add_if_not_empty – adds to a sd {string: msgpack::object} templated to allow us to add a variety of containers More...
 
template<typename T >
void resize_and_add_if_not_empty (utility::vector1< core::io::StructFileRepOP > const &sfrs, std::string const &key, std::map< std::string, msgpack::object > &xxxProperties, msgpack::zone &zone, T const &fn)
 
void add_extra_data (::mmtf::StructureData &sd, utility::vector1< core::io::StructFileRepOP > const &sfrs, core::io::StructFileRepOptions const &options)
 Add extra info to the structureData if we are asked to add it includes: heterogen info. More...
 
std::map< std::tuple< core::Size, core::Size, core::Size, core::Size >, core::Sizemake_AIM_to_atom_num (aiModels const &AIM)
 
void dump_mmtf (std::ostream &out, utility::vector1< core::io::StructFileRepOP > sfrs, core::io::StructFileRepOptions const &options)
 dump single mmtf function. More...
 
void dump_mmtf (std::ostream &out, StructFileRepOP sfr, StructFileRepOptions const &options)
 dump single mmtf function. More...
 
::mmtf::StructureData sfr_to_sd (core::io::StructFileRepOP sfr, core::io::StructFileRepOptions const &options)
 
::mmtf::StructureData sfrs_to_sd (utility::vector1< core::io::StructFileRepOP > sfrs, core::io::StructFileRepOptions const &options)
 
template<typename T >
void resize_and_add_if_not_empty (T const &data, std::vector< T > &destination, core::Size const &data_index, core::Size const &max_size)
 resize_add_if_not_empty – adds T to std::vector< T > if T isn't empty templated to allow us to add a variety of containers More...
 
std::ostream & operator<< (std::ostream &os, sd_index const &sd_i)
 
std::map< core::Size, sd_indexmake_atom_num_to_sd_map (::mmtf::StructureData const &sd)
 use the sd_index struct to make iterating StructureData easier More...
 

Typedef Documentation

◆ aiChain

typedef utility::vector0<aiGroup> core::io::mmtf::aiChain

◆ aiGroup

◆ aiModels

typedef utility::vector0<aiPose> core::io::mmtf::aiModels

◆ aiPose

typedef utility::vector0<aiChain> core::io::mmtf::aiPose

◆ ExtraDataEnumManagerCOP

typedef utility::pointer::shared_ptr< ExtraDataEnumManager const > core::io::mmtf::ExtraDataEnumManagerCOP

◆ ExtraDataEnumManagerOP

typedef utility::pointer::shared_ptr< ExtraDataEnumManager > core::io::mmtf::ExtraDataEnumManagerOP

Enumeration Type Documentation

◆ ExtraDataEnum

Enum definitions for pose extra data we will be storing/retrieving. ALL Enums must also have their string equivalents defined in mmtf/ExtraDataEnumManager.cc.

Enumerator
pose_cache_string_data 
pose_cache_real_data 
pdb_comments 
simple_metric_string_data 
simple_metric_real_data 
simple_metric_composite_string_data 
simple_metric_composite_real_data 
simple_metric_per_residue_string_data 
simple_metric_per_residue_real_data 
simple_metric_per_residue_string_output 
simple_metric_per_residue_real_output 
ExtraDataEnum_total 

Function Documentation

◆ add_bond_information()

void core::io::mmtf::add_bond_information ( ::mmtf::StructureData const &  sd,
std::vector< core::io::AtomInformation > &  all_AIs,
std::map< core::Size, sd_index > const &  atom_num_to_sd_map 
)

This adds actuals bonds from the mmtf object to connected_indicies/connected_orders.

A warning for this function: mmtf has following bond order options Bond-order Resonance Explanation -1 1 kekulized form is unavailable, but resonance is known 1(or 2,3,4) 1 kekulized form is known, and resonance is known and exists 1(or 2,3,4) 0 kekulized form is known, but resonance is nonexistant 1(or 2,3,4) -1 kekulized form is known, but resonance is not known -Warning pt 2- mmtf supports up to 4 bonds, rosetta only up to 3 i set 4x bonds to be 0 (unk) in rosetta

References core::io::AtomInformation::connected_indices, core::io::AtomInformation::connected_orders, core::io::mmtf::sd_index::group_atom_index, core::io::mmtf::sd_index::group_index, and core::chemical::UnknownBond.

Referenced by create_sfrs_from_mmtf_filename().

◆ add_bonds_to_sd()

void core::io::mmtf::add_bonds_to_sd ( ::mmtf::StructureData &  sd,
aiModels const &  AIM,
std::map< core::Size, sd_index > const &  atom_num_to_sd_map 
)

◆ add_extra_data()

void core::io::mmtf::add_extra_data ( ::mmtf::StructureData &  sd,
utility::vector1< core::io::StructFileRepOP > const &  sfrs,
core::io::StructFileRepOptions const &  options 
)

◆ add_if_not_empty()

template<typename T >
void core::io::mmtf::add_if_not_empty ( std::string const &  given_name,
T const &  content,
std::map< std::string, msgpack::object > &  target_map,
msgpack::zone &  zone 
)

add_if_not_empty – adds to a sd {string: msgpack::object} templated to allow us to add a variety of containers

Parameters
given_nameThe name to use in the data map if not empty
contentThe content to add if not empty
target_mapWhere to add the content if it's not empty
zoneRequired zone to keep msgpack happy

◆ add_link_and_ss_information()

void core::io::mmtf::add_link_and_ss_information ( ::mmtf::StructureData const &  sd,
core::io::StructFileRep sfr,
std::vector< core::io::AtomInformation > const &  all_AIs,
std::vector< core::Size > const &  ai_to_model,
core::Size const &  current_model 
)

◆ add_ters_via_bonds()

void core::io::mmtf::add_ters_via_bonds ( std::vector< core::io::AtomInformation > &  all_AIs,
std::vector< core::Size > const &  ai_to_model 
)

This adds TERs based on what is bound to the C of each AA.

References protocols::loops::chainID, protocols::loops::resSeq, and protocols::denovo_design::set_difference().

Referenced by create_sfrs_from_mmtf_filename().

◆ add_xbond_information()

template<typename T >
void core::io::mmtf::add_xbond_information ( std::map< std::string, utility::vector1< T > > &  xbond_map,
core::io::AtomInformation const &  atm_1,
core::io::AtomInformation const &  atm_2 
)
inline

◆ aiModels_from_sfrs()

aiModels core::io::mmtf::aiModels_from_sfrs ( utility::vector1< core::io::StructFileRepOP > const &  sfrs)

Convert linear sfr to vec0[vec0[vec0[vec0[AtomInformation]]]].

Parameters
core::io::StructFileRepconst& to build aiModels from

References aiPose_from_sfr().

Referenced by sfrs_to_sd().

◆ aiPose_from_sfr()

aiPose core::io::mmtf::aiPose_from_sfr ( core::io::StructFileRep const &  sfr)

Convert linear sfr to vec0[vec0[vec0[AtomInformation]]].

Parameters
core::io::StructFileRepconst& to build aiPodel from

References core::io::StructFileRep::chains(), and make_chain().

Referenced by aiModels_from_sfrs().

◆ create_sfr_from_mmtf_filename()

core::io::StructFileRepOP core::io::mmtf::create_sfr_from_mmtf_filename ( std::string const &  mmtf_filename,
StructFileReaderOptions const &  options 
)

create sfr from create_sfrs_from_mmtf_filename

References create_sfrs_from_mmtf_filename().

Referenced by core::import_pose::pose_from_file().

◆ create_sfrs_from_mmtf_filename()

utility::vector1< core::io::StructFileRepOP > core::io::mmtf::create_sfrs_from_mmtf_filename ( std::string const &  mmtf_filename,
core::io::StructFileReaderOptions const &  options,
utility::vector1< core::Size > const &  model_indexes 
)

master sfr creator

Note
: mmtf format requires us to iterate completely because order doesn't matter. So it makes more sense to iterate over all and then trim back your selection at the end.

References add_bond_information(), add_link_and_ss_information(), add_ters_via_bonds(), core::io::AtomInformation::chainID, make_all_atom_information(), make_atom_num_to_sd_map(), make_old_to_new_mapping(), read_extra_data(), core::io::StructFileReaderOptions::read_pdb_header(), core::io::TR(), and update_bond_indices().

Referenced by create_sfr_from_mmtf_filename().

◆ dump_mmtf() [1/6]

StructFileRepOP core::io::mmtf::dump_mmtf ( core::pose::Pose const &  pose,
std::ostream &  out,
StructFileRepOptionsCOP  options 
)

Dump an MMTF from a pose to an ostream.

Dump mmtf to an outstream, optionally passing options and returning a StructFileRep for further processing.

References dump_mmtf(), core::io::pose_to_sfr::PoseToStructFileRepConverter::init_from_pose(), core::conformation::membrane::out, and core::io::pose_to_sfr::PoseToStructFileRepConverter::sfr().

◆ dump_mmtf() [2/6]

bool core::io::mmtf::dump_mmtf ( core::pose::Pose const &  pose,
std::string const &  file_name,
StructFileRepOptionsCOP  options 
)

◆ dump_mmtf() [3/6]

StructFileRepOP core::io::mmtf::dump_mmtf ( core::pose::Pose const &  pose,
std::string const &  jd2_job_data,
std::ostream &  out 
)

Dump an MMTF from a pose, optionally extracting extra info.

Dump a MMTF from a pose, optionally extracting extra info. NOTE: DEPRECATED. LEGACY JD2 function to use JOB data, which we no longer use in JD3.

References dump_mmtf(), core::io::pose_to_sfr::PoseToStructFileRepConverter::init_from_pose(), core::conformation::membrane::out, and core::io::pose_to_sfr::PoseToStructFileRepConverter::sfr().

◆ dump_mmtf() [4/6]

void core::io::mmtf::dump_mmtf ( std::ostream &  out,
StructFileRepOP  sfr,
StructFileRepOptions const &  options 
)

dump single mmtf function.

Note
We sadly have to use this to call the function that dumps a vector of SFRs due to the mmtf file format. It only makes sense because of the compression scheme used.

References core::conformation::membrane::out, and sfr_to_sd().

◆ dump_mmtf() [5/6]

void core::io::mmtf::dump_mmtf ( std::ostream &  out,
utility::vector1< core::io::StructFileRepOP sfrs,
core::io::StructFileRepOptions const &  options 
)

dump single mmtf function.

Note
We sadly have to use this to call the function that dumps a vector of SFRs due to the mmtf file format. It only makes sense because of the compression scheme used.

References core::conformation::membrane::out, and sfrs_to_sd().

◆ dump_mmtf() [6/6]

bool core::io::mmtf::dump_mmtf ( std::string const &  file_name,
StructFileRepOP  sfr,
StructFileRepOptions const &  options 
)

dump_mmtf function. Create the sfr from pose using the PoseToStructFileRepConverter class. Return success or failure.

Parameters
file_nameThe file name to write the mmtf to
sfrThe StructFileRepOP to build the mmtf from
optionsThe StructFileRepOptions used to build the sfr

References dump_mmtf(), core::conformation::membrane::out, and core::io::TR().

◆ is_in_bondAtomList()

bool core::io::mmtf::is_in_bondAtomList ( std::vector< int32_t > const &  bondAtomList,
core::Size const  lower_atom,
core::Size const  upper_atom 
)

◆ load_heterogen_info()

void core::io::mmtf::load_heterogen_info ( ::mmtf::MapDecoder const &  md,
core::io::StructFileRep sfr,
core::Size const  model_index 
)

load heterogen data: heterogen_names && residue_type_base_names

◆ make_AIM_to_atom_num()

std::map<std::tuple<core::Size, core::Size, core::Size, core::Size>, core::Size> core::io::mmtf::make_AIM_to_atom_num ( aiModels const &  AIM)

◆ make_all_atom_information()

std::vector< core::io::AtomInformation > core::io::mmtf::make_all_atom_information ( ::mmtf::StructureData const &  sd,
std::vector< core::Size > &  model_indexes,
std::map< core::Size, core::Size > &  model_index_to_starting_index,
StructFileReaderOptions const &  options 
)

makes a linear vector of all AtomInformation from the mmtf data

References make_atom_information().

Referenced by create_sfrs_from_mmtf_filename().

◆ make_atom_information()

core::io::AtomInformation core::io::mmtf::make_atom_information ( ::mmtf::StructureData const &  sd,
::mmtf::GroupType const &  group,
int const  groupAtomIndex,
core::Size const  atomIndex,
core::Size const  atomSerial,
core::Size const  groupIndex,
core::Size const  chainIndex,
utility::vector1< char > &  known_chainIDs,
core::io::StructFileReaderOptions const &  options 
)

◆ make_atom_num_to_sd_map()

std::map< core::Size, sd_index > core::io::mmtf::make_atom_num_to_sd_map ( ::mmtf::StructureData const &  sd)

use the sd_index struct to make iterating StructureData easier

Referenced by create_sfrs_from_mmtf_filename(), and sfrs_to_sd().

◆ make_chain()

aiChain core::io::mmtf::make_chain ( utility::vector0< AtomInformation > const &  chain_atoms)

group chain_atoms into groups based on chain_id and resseq

Warning
groups (aka residues) are made by grouping together identical ai.{chain,resSeq,resName,iCode} I don't think there's a better way than that.

References core::io::AtomInformation::chainID, core::io::AtomInformation::iCode, core::io::AtomInformation::resName, and core::io::AtomInformation::resSeq.

Referenced by aiPose_from_sfr().

◆ make_current_group()

::mmtf::GroupType core::io::mmtf::make_current_group ( aiGroup const &  ai_group)

◆ make_old_to_new_mapping()

std::map<core::Size, core::Size> core::io::mmtf::make_old_to_new_mapping ( std::vector< std::vector< core::Size >> const  atom_idx_chains,
core::Size const  starting_index 
)

◆ map_decode_from_model()

template<typename T >
void core::io::mmtf::map_decode_from_model ( ::mmtf::MapDecoder const &  md,
std::string const &  map_key,
bool const  required,
core::Size const  model_index,
T &  target 
)

Warning. This might be inefficient! time will tell We access and decode map_key for every model... that could be expensive... but maybe it's not that bad! otherwise we have to find a way to decode all at once....

Referenced by read_extra_data().

◆ operator<<()

std::ostream & core::io::mmtf::operator<< ( std::ostream &  os,
sd_index const &  sd_i 
)

◆ read_extra_data() [1/3]

void core::io::mmtf::read_extra_data ( ::mmtf::StructureData &  sd,
core::io::StructFileRep sfr 
)

Read extra data from StructureData into the SFR.

SD non-const as the decode method of mmTF is NOT CONST!

◆ read_extra_data() [2/3]

void core::io::mmtf::read_extra_data ( core::io::StructFileRepOP sfr,
::mmtf::StructureData const &  sd,
core::Size const  model_index 
)

◆ read_extra_data() [3/3]

void core::io::mmtf::read_extra_data ( utility::vector1< core::io::StructFileRepOP > &  sfrs,
::mmtf::StructureData const &  sd 
)

◆ resize_and_add_if_not_empty() [1/2]

template<typename T >
void core::io::mmtf::resize_and_add_if_not_empty ( T const &  data,
std::vector< T > &  destination,
core::Size const &  data_index,
core::Size const &  max_size 
)

resize_add_if_not_empty – adds T to std::vector< T > if T isn't empty templated to allow us to add a variety of containers

Parameters
dataThe data to add to destination, if !data.empty()
destinationThe destination of the content if !empty
data_indexWhere to add the content if !empty (will resize destination)

◆ resize_and_add_if_not_empty() [2/2]

template<typename T >
void core::io::mmtf::resize_and_add_if_not_empty ( utility::vector1< core::io::StructFileRepOP > const &  sfrs,
std::string const &  key,
std::map< std::string, msgpack::object > &  xxxProperties,
msgpack::zone &  zone,
T const &  fn 
)

Referenced by add_extra_data().

◆ set_mmtf_default_options()

void core::io::mmtf::set_mmtf_default_options ( core::io::StructFileRepOptions options)

Set StructFileRepOptions defauls for mmtf.

Parameters
core::io::StructFileRepOptions&options to modify for mmtf

References core::io::StructFileRepOptions::set_write_all_connect_info(), and core::io::StructFileRepOptions::set_write_pdb_link_records().

Referenced by dump_mmtf(), and protocols::jd2::mmtfJobOutputter::dump_pose().

◆ set_model_index_if_not_empty()

template<typename T >
void core::io::mmtf::set_model_index_if_not_empty ( core::Size const  model_index,
std::string const &  info_tag,
std::vector< T > const &  all_model_data,
T &  target_data 
)

set_model_index_if_not_empty does what the name says :p useful for loading various datas from modelProperties

◆ sfr_to_sd()

mmtf::StructureData core::io::mmtf::sfr_to_sd ( core::io::StructFileRepOP  sfr,
core::io::StructFileRepOptions const &  options 
)

References sfrs_to_sd().

Referenced by dump_mmtf().

◆ sfrs_to_sd()

::mmtf::StructureData core::io::mmtf::sfrs_to_sd ( utility::vector1< core::io::StructFileRepOP sfrs,
core::io::StructFileRepOptions const &  options 
)

◆ sort_xbond_func()

template<typename T >
bool core::io::mmtf::sort_xbond_func ( T const &  lhs,
T const &  rhs 
)

◆ update_bond_indices()

void core::io::mmtf::update_bond_indices ( core::io::StructFileRep sfr,
std::map< core::Size, core::Size > const &  old_to_new_idx 
)