本文整理汇总了C++中protein类的典型用法代码示例。如果您正苦于以下问题:C++ protein类的具体用法?C++ protein怎么用?C++ protein使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了protein类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add_structure_to_store
void add_structure_to_store(T &arg_store, ///< TODOCUMENT
const index_type &arg_structure_index, ///< TODOCUMENT
const protein &arg_protein, ///< TODOCUMENT
const scan_policy<KPs...> &arg_scan_policy, ///< TODOCUMENT
const scan_role &arg_scan_role ///< TODOCUMENT
) {
const auto &the_keyer = arg_scan_policy.get_keyer();
// BOOST_LOG_TRIVIAL( warning ) << "Keyer is : " << the_keyer;
const auto roled_stride = roled_scan_stride{ arg_scan_role, arg_scan_policy.get_scan_stride() };
const auto num_residues = debug_unwarned_numeric_cast<index_type>( arg_protein.get_length() );
const auto from_rep_strider = get_this_from_strider( roled_stride );
const auto to_rep_strider = get_this_to_strider ( roled_stride );
for (const auto &from_rep_index : get_rep_indices_range( from_rep_strider, num_residues ) ) {
// BOOST_LOG_TRIVIAL( warning ) << "\tFrom rep " << from_rep_index;
for (const auto &to_rep_index : get_rep_indices_range( to_rep_strider, num_residues ) ) {
if ( from_rep_index != to_rep_index ) {
const auto the_res_pair = make_multi_struc_res_rep_pair(
arg_protein.get_residue_ref_of_index( get_index_of_rep_index( from_rep_strider, from_rep_index ) ),
arg_protein.get_residue_ref_of_index( get_index_of_rep_index( to_rep_strider, to_rep_index ) ),
arg_structure_index,
from_rep_index,
to_rep_index
);
// BOOST_LOG_TRIVIAL( warning ) << "\t\tTo rep " << to_rep_index << " - the rep : " << the_res_pair;
arg_store.push_back_entry_to_cell( the_keyer.make_key( the_res_pair ), the_res_pair );
}
}
}
}
示例2: irange
/// \brief TODOCUMENT
///
/// Things for investigation:
/// * raw/final score from alignment
/// * expected raw/final score
/// * top categorised reasons by raw score
/// * repeat for varying scan_stride (can just be called by nmnf fn)
alignment_scan_comparison check_scan_on_final_alignment::do_check(const alignment &arg_alignment, ///< TODOCUMENT
const protein &arg_protein_a, ///< TODOCUMENT
const protein &arg_protein_b, ///< TODOCUMENT
const quad_criteria &arg_criteria, ///< TODOCUMENT
const scan_stride &arg_scan_stride ///< TODOCUMENT
) const {
const auto aln_range = irange( 0_z, arg_alignment.length() );
cerr << "SHOULD THE RANGE BE 7.0 RATHER THAN SQRT(40.0)????\n";
return accumulate(
cross( aln_range, aln_range ),
alignment_scan_comparison{},
[&] (alignment_scan_comparison x, const size_size_tpl &y) {
const size_t aln_from_ctr = get<0>( y );
const size_t aln_to_ctr = get<1>( y );
const bool from_alns_both = has_both_positions_of_index( arg_alignment, aln_from_ctr );
const bool to_alns_both = has_both_positions_of_index( arg_alignment, aln_to_ctr );
if ( from_alns_both && to_alns_both ) {
const auto a_from = get_a_position_of_index( arg_alignment, aln_from_ctr );
const auto b_from = get_b_position_of_index( arg_alignment, aln_from_ctr );
const auto a_to = get_a_position_of_index( arg_alignment, aln_to_ctr );
const auto b_to = get_b_position_of_index( arg_alignment, aln_to_ctr );
const bool a_included = difference( a_from, a_to ) > NUM_EXCLUDED_ON_SIDES;
const bool b_included = difference( b_from, b_to ) > NUM_EXCLUDED_ON_SIDES;
if ( a_included && b_included ) {
const auto the_distance = distance_between_points(
view_vector_of_residue_pair(
arg_protein_a.get_residue_ref_of_index( a_from ),
arg_protein_a.get_residue_ref_of_index( a_to )
),
view_vector_of_residue_pair(
arg_protein_b.get_residue_ref_of_index( b_from ),
arg_protein_b.get_residue_ref_of_index( b_to )
)
);
// const auto score = ( the_distance >= 7.0 ) ? 0.0 : ( 1.0 - the_distance / 7.0 );
const auto score = ( the_distance >= sqrt( 40.0 ) ) ? 0.0 : ( 1.0 - the_distance / 7.0 );
if ( score > 0.0 ) {
const auto scan_result = quad_and_rep_criteria_result_of(
arg_protein_a,
arg_protein_b,
arg_criteria,
arg_scan_stride,
numeric_cast<index_type>( a_from ),
numeric_cast<index_type>( a_to ),
numeric_cast<index_type>( b_from ),
numeric_cast<index_type>( b_to )
);
x += make_pair( scan_result, score );
}
}
}
return x;
}
);
}
示例3: do_get_length
/// \brief TODOCUMENT
size_t geometric_mean_length_getter::do_get_length(const protein &arg_protein_a, ///< TODOCUMENT
const protein &arg_protein_b ///< TODOCUMENT
) const {
const size_t length_a = arg_protein_a.get_length();
const size_t length_b = arg_protein_b.get_length();
const double geom_mean_doub = sqrt( numeric_cast<double>( length_a * length_b ) );
return numeric_cast<size_t>( round( geom_mean_doub ) );
}
示例4: to_psi_angle_difference
/// \brief Get the (wrapped) difference between the two pairs' to_residue psi angles
inline angle_type to_psi_angle_difference(const size_size_pair &arg_indices_a, ///< The indices of the from/to residues in the first protein
const size_size_pair &arg_indices_b, ///< The indices of the from/to residues in the second protein
const protein &arg_protein_a, ///< The first protein
const protein &arg_protein_b ///< The second protein
) {
const residue &to_a_res = arg_protein_a.get_residue_ref_of_index( arg_indices_a.second );
const residue &to_b_res = arg_protein_b.get_residue_ref_of_index( arg_indices_b.second );
const angle_type &to_psi_a = geom::make_angle_from_radians<angle_base_type>( angle_in_radians( to_a_res.get_psi_angle() ) );
const angle_type &to_psi_b = geom::make_angle_from_radians<angle_base_type>( angle_in_radians( to_b_res.get_psi_angle() ) );
return wrapped_difference( to_psi_a, to_psi_b );
}
示例5: from_psi_angle_difference
/// \brief Get the (wrapped) difference between the two pairs' from_residue psi angles
inline angle_type from_psi_angle_difference(const size_size_pair &arg_indices_a, ///< The indices of the from/to residues in the first protein
const size_size_pair &arg_indices_b, ///< The indices of the from/to residues in the second protein
const protein &arg_protein_a, ///< The first protein
const protein &arg_protein_b ///< The second protein
) {
const residue &from_a_res = arg_protein_a.get_residue_ref_of_index( arg_indices_a.first );
const residue &from_b_res = arg_protein_b.get_residue_ref_of_index( arg_indices_b.first );
const auto from_psi_a = geom::convert_angle_type<angle_base_type>( from_a_res.get_psi_angle() );
const auto from_psi_b = geom::convert_angle_type<angle_base_type>( from_b_res.get_psi_angle() );
return wrapped_difference( from_psi_a, from_psi_b );
}
示例6: get_from_rep_of_indices
/// \brief TODOCUMENT
///
/// Provide functions that allow this function to be expressed slightly more tightly
quad_criteria_result check_scan_on_final_alignment::rep_quad_criteria_result_of(const protein &arg_query_protein, ///< TODOCUMENT
const protein &arg_index_protein, ///< TODOCUMENT
const quad_criteria &arg_criteria, ///< TODOCUMENT
const scan_stride &arg_scan_stride, ///< TODOCUMENT
const index_type &arg_query_from_index, ///< TODOCUMENT
const index_type &arg_query_to_index, ///< TODOCUMENT
const index_type &arg_index_from_index, ///< TODOCUMENT
const index_type &arg_index_to_index ///< TODOCUMENT
) {
const auto from_rep_indices = get_from_rep_of_indices( arg_scan_stride, arg_query_from_index, arg_index_from_index );
const auto to_rep_indices = get_to_rep_of_indices ( arg_scan_stride, arg_query_to_index, arg_index_to_index );
if ( ! from_rep_indices || ! to_rep_indices ) {
return quad_criteria_result::HAS_NO_REP;
}
const auto query_from_rep_index = from_rep_indices->first;
const auto query_to_rep_index = to_rep_indices->first;
const auto index_from_rep_index = from_rep_indices->second;
const auto index_to_rep_index = to_rep_indices->second;
const auto query_res_pair = make_multi_struc_res_rep_pair(
arg_query_protein.get_residue_ref_of_index( get_index_of_rep_index( arg_scan_stride.get_query_from_strider(), query_from_rep_index ) ),
arg_query_protein.get_residue_ref_of_index( get_index_of_rep_index( arg_scan_stride.get_query_to_strider (), query_to_rep_index ) ),
0,
query_from_rep_index,
query_to_rep_index
);
const auto index_res_pair = make_multi_struc_res_rep_pair(
arg_index_protein.get_residue_ref_of_index( get_index_of_rep_index( arg_scan_stride.get_index_from_strider(), index_from_rep_index ) ),
arg_index_protein.get_residue_ref_of_index( get_index_of_rep_index( arg_scan_stride.get_index_to_strider (), index_to_rep_index ) ),
0,
index_from_rep_index,
index_to_rep_index
);
const auto result = criteria_result_of( arg_criteria, query_res_pair, index_res_pair );
// if ( result != quad_criteria_result::PASS && result != quad_criteria_result::QUERY_FAILS_SINGLE_CHECKS && result != quad_criteria_result::INDEX_FAILS_SINGLE_CHECKS ) {
// quad_criteria_result::PASS;
cerr << "Quad: [(" << setw( 2 ) << right << arg_query_from_index
<< "," << setw( 2 ) << right << arg_index_from_index
<< ")->(" << setw( 2 ) << right << arg_query_to_index
<< "," << setw( 2 ) << right << arg_index_to_index
<< ")], Rep[(" << setw( 2 ) << right << query_from_rep_index
<< "," << setw( 2 ) << right << index_from_rep_index
<< ")->(" << setw( 2 ) << right << query_to_rep_index
<< "," << setw( 2 ) << right << index_to_rep_index
<< ")]=" << setw( 25 ) << right << result
// << ",A/" << query_res_pair
// << ",B/" << index_res_pair
<< "\n";
// }
return result;
}
示例7: squared_distance
/// \brief Calculate the squared distance between the views of the two residue pairs
///
/// Each view is the location of the to_residue's carbon-beta atom as seen from
/// the coordinate frame of the from_residue
inline double squared_distance(const size_size_pair &arg_indices_a, ///< The indices of the from/to residues in the first protein
const size_size_pair &arg_indices_b, ///< The indices of the from/to residues in the second protein
const protein &arg_protein_a, ///< The first protein
const protein &arg_protein_b ///< The second protein
) {
const residue &from_a_res = arg_protein_a.get_residue_ref_of_index( arg_indices_a.first );
const residue &to_a_res = arg_protein_a.get_residue_ref_of_index( arg_indices_a.second );
const residue &from_b_res = arg_protein_b.get_residue_ref_of_index( arg_indices_b.first );
const residue &to_b_res = arg_protein_b.get_residue_ref_of_index( arg_indices_b.second );
const geom::coord view_a = view_vector_of_residue_pair( from_a_res, to_a_res );
const geom::coord view_b = view_vector_of_residue_pair( from_b_res, to_b_res );
return squared_distance_between_points( view_a, view_b );
}
示例8: print_highlight_rep_pymol_commands
/// \brief TODOCUMENT
///
/// \relates
void cath::scan::detail::print_highlight_rep_pymol_commands(ostream &arg_os, ///< TODOCUMENT
const check_scan_on_final_alignment &arg_csofa, ///< TODOCUMENT
const protein &arg_protein, ///< TODOCUMENT
const roled_scan_stride &arg_roled_scan_stride ///< TODOCUMENT
) {
print_highlight_rep_pymol_commands( arg_os, arg_protein.get_title(), arg_csofa.get_rep_name_lists( arg_protein, arg_roled_scan_stride ) );
}
示例9: build_rep_sets
/// \brief TODOCUMENT
inline single_struc_res_pair_list_vec build_rep_sets(const protein &arg_protein, ///< TODOCUMENT
const roled_scan_stride &arg_roled_scan_stride ///< TODOCUMENT
) {
const auto num_residues = debug_unwarned_numeric_cast<index_type>( arg_protein.get_length() );
const auto &all_single_res_pairs = build_single_rep_pairs( arg_protein );
const auto from_range = get_indices_range( get_this_from_strider( arg_roled_scan_stride ), num_residues );
const auto to_range = get_indices_range( get_this_to_strider ( arg_roled_scan_stride ), num_residues );
single_struc_res_pair_list_vec results;
results.reserve( from_range.size() * to_range.size() );
for (const auto &x : common::cross( from_range, to_range ) ) {
// std::cerr << "Building rep: [" << std::get<0>( x ) << ", " << std::get<1>( x ) << "]\n";
results.emplace_back();
detail::add_stride_neighbours(
results.back(),
num_residues,
all_single_res_pairs,
std::get<0>( x ),
std::get<1>( x ),
from_co_stride( arg_roled_scan_stride ),
to_co_stride ( arg_roled_scan_stride )
);
}
return results;
}
示例10: build_single_rep_pairs
/// \brief TODOCUMENT
inline single_struc_res_pair_vec build_single_rep_pairs(const protein &arg_protein ///< TODOCUMENT
) {
const auto num_residues = debug_unwarned_numeric_cast<index_type>( arg_protein.get_length() );
const auto scan_phi_angles = make_scan_phi_angles ( arg_protein );
const auto scan_psi_angles = make_scan_psi_angles ( arg_protein );
const auto scan_view_coords = make_scan_view_coords ( arg_protein );
const auto scan_frames = make_scan_frame_quat_rots( arg_protein );
single_struc_res_pair_vec results;
results.reserve( num_residues * num_residues );
const auto all_residues_range = boost::irange<index_type>( 0, num_residues );
for (const auto &x : common::cross( all_residues_range, all_residues_range ) ) {
const auto &from_res_index = std::get<0>( x );
const auto &to_res_index = std::get<1>( x );
results.emplace_back(
rotate_copy(
scan_frames [ from_res_index ],
scan_view_coords[ to_res_index ] - scan_view_coords[ from_res_index ]
),
rotation_between_rotations(
scan_frames[ from_res_index ],
scan_frames[ to_res_index ]
),
scan_phi_angles[ from_res_index ],
scan_psi_angles[ from_res_index ],
scan_phi_angles[ to_res_index ],
scan_psi_angles[ to_res_index ],
from_res_index,
to_res_index
);
}
return results;
}
示例11: make_scan_frame_quat_rots
/// \brief TODOCUMENT
inline frame_quat_rot_vec make_scan_frame_quat_rots(const protein &arg_protein ///< TODOCUMENT
) {
frame_quat_rot_vec results;
results.reserve( arg_protein.get_length() );
for (const auto &x : arg_protein) {
results.emplace_back( geom::make_quat_rot_from_rotation<frame_quat_rot_type>( x.get_frame() ) );
}
return results;
}
示例12: make_scan_view_coords
/// \brief TODOCUMENT
inline view_type_vec make_scan_view_coords(const protein &arg_protein ///< TODOCUMENT
) {
view_type_vec results;
results.reserve( arg_protein.get_length() );
for (const auto &x : arg_protein) {
results.emplace_back( x.get_carbon_beta_coord() );
}
return results;
}
示例13: make_scan_psi_angles
/// \brief TODOCUMENT
inline angle_type_vec make_scan_psi_angles(const protein &arg_protein ///< TODOCUMENT
) {
angle_type_vec results;
results.reserve( arg_protein.get_length() );
for (const auto &x : arg_protein) {
results.emplace_back( geom::convert_angle_type<angle_base_type>( x.get_psi_angle() ) );
}
return results;
}
示例14: view_frame
/// \brief Calculate the view_frame of the pair
/// (ie the coordinate frame of the to_residue's atoms in terms of the coordinate from of the from_residue's atoms)
inline cath::geom::rotation view_frame(const protein &arg_protein, ///< The protein containing the two residues
const size_t &arg_from_index, ///< The index of the from_residue
const size_t &arg_to_index ///< The index of the to_residue
) {
return view_frame(
arg_protein.get_residue_ref_of_index( arg_from_index ),
arg_protein.get_residue_ref_of_index( arg_to_index )
);
}
示例15: read_wolf
/// \brief TODOCUMENT
void cath::test::dssp_wolf_file_test_suite_fixture::compare_residue_frames_from_pdb_vs_wolf(const string &arg_example_id ///< TODOCUMENT
) {
ostringstream build_prot_warn_stream;
const wolf_file the_wolf_file = read_wolf( wolf_file_of_example_id( arg_example_id ) );
const pdb the_pdb_file = read_pdb_file( pdb_file_of_example_id( arg_example_id ) );
const protein pdb_prot = build_protein_of_pdb( the_pdb_file, reference_wrapper<ostream>{ build_prot_warn_stream });
const wolf_file::size_type num_wolf_residues = the_wolf_file.get_num_residues();
const size_t num_pdb_residues = pdb_prot.get_length();
BOOST_CHECK_EQUAL( build_prot_warn_stream.str(), "" );
BOOST_REQUIRE_EQUAL(num_pdb_residues, num_wolf_residues);
doub_angle_vec angles_between_frame_pairs;
for (size_t residue_ctr = 0; residue_ctr < num_pdb_residues; ++residue_ctr) {
const residue &wolf_residue = the_wolf_file.get_residue_of_index( residue_ctr );
const residue &pdb_prot_residue = pdb_prot.get_residue_ref_of_index( residue_ctr );
BOOST_REQUIRE_EQUAL( pdb_prot_residue.get_pdb_residue_id(), wolf_residue.get_pdb_residue_id() );
const rotation raw_wolf_frame = wolf_residue.get_frame();
const rotation wolf_frame = tidy_copy(raw_wolf_frame, 0.001);
const rotation pdb_frame = pdb_prot_residue.get_frame();
const doub_angle the_angle = angle_between_rotations( wolf_frame, pdb_frame );
angles_between_frame_pairs.push_back( the_angle );
}
BOOST_REQUIRE_GT( angles_between_frame_pairs.size(), 0_z );
// Sort the list of angles in ascending order
sort( angles_between_frame_pairs );
// Check that around 95% of the way through the list of angles, the values are still
// less than 3 degrees (in radians)
const size_t ninety_fifth_perc_index = numeric_cast<size_t>(
round( 0.95 * numeric_cast<double>( angles_between_frame_pairs.size() ) )
);
BOOST_CHECK_LT(
angles_between_frame_pairs[ ninety_fifth_perc_index ],
make_angle_from_degrees<double>( 3.0 )
);
}