Rosetta
|
An application to count the number of unique sequences for a cyclic peptide given its symmetry. More...
#include <devel/init.hh>
#include <core/types.hh>
#include <utility/excn/Exceptions.hh>
#include <basic/Tracer.hh>
#include <basic/options/option.hh>
#include <basic/options/keys/OptionKeys.hh>
#include <basic/options/option_macros.hh>
#include <boost/integer/common_factor_rt.hpp>
#include <cmath>
Macros | |
#define | COUNT_CYCPEP_SEQUENCE_INTTYPE signed long long |
Functions | |
static const std::string | errmsg ("Error in count_cycpep_sequence application: ") |
void | register_options () |
void | do_options_checks () |
Check that the user has set options sensibly. More... | |
void | do_cyclic_permutation (utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > &vect) |
Circularly permute a vector by one. More... | |
utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > | find_min_permutation (utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > const &input_vector) |
Circularly permute a vector until the least vector is found. More... | |
bool | increment_asymm_unit_recursively (utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > &cursequence, core::Size const curindex, bool const mirror_symm, core::Size const maxval, core::Size const minval_if_symmetric) |
Increment the asymmetric unit. More... | |
COUNT_CYCPEP_SEQUENCE_INTTYPE | invert_value (COUNT_CYCPEP_SEQUENCE_INTTYPE const val, core::Size const max_symm_val) |
void | copy_asymm_unit_to_other_subunits (utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > &cursequence, core::Size const asymm_unit_size, bool const mirror_symm, core::Size const minval_if_symmetric) |
Copy the first M residues, making up the asymmetric unit, to the other lobes of the peptide, mirroring appropriately if we're considering mirror symmetry. More... | |
bool | increment_sequence (utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > &cursequence, core::Size const asymm_unit_size, bool const mirror_symm, core::Size const maxval, core::Size const minval_if_symmetric) |
Increment a vector, preserving symmetry. More... | |
core::Size | count_numerically (core::Size const fold_symmetry, bool const mirror_symm, core::Size const nresidue, core::Size const noptions, core::Size const noptions_achiral, bool const print_all_sequences) |
Compute the number of sequences numerically. More... | |
bool | set_pattern (utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > &pattern, core::Size const lobesize, core::Size const index, core::Size const setting, core::Size const offset) |
Attempts to set a given entry in the pattern to a given value. Returns false if unsuccessful (the pattern becomes inconsistent), true otherwise. More... | |
core::Size | invariants_for_cyclic_permutation (core::Size const asymm_unit_size, core::Size const offset) |
Figure out how many possible sequences there are which are invariant on a given cyclic permutation, given SN symmetry. More... | |
core::Size | count_analytically_cyclic (core::Size const fold_symmetry, core::Size const nresidue, core::Size const noptions) |
Determine the number of sequences analytically, using expressions derived from Burnside's lemma by Todd Yeates. This version is for cyclic symmetry. More... | |
core::Size | count_semi_analytically_improper_rotational (core::Size const fold_symmetry, core::Size const nresidue, core::Size const noptions) |
Determine the number of sequences analytically, using expressions derived from Burnside's lemma by Todd Yeates. This version is for improper rotational symmetry. More... | |
core::Size | count_analytically_improper_rotational (core::Size const fold_symmetry, core::Size const nresidue, core::Size const noptions) |
Determine the number of sequences analytically, using expressions derived from Burnside's lemma by Todd Yeates. This version is for improper rotational symmetry. More... | |
core::Size | count_analytically (core::Size const fold_symmetry, bool const mirror_symm, bool const improper_rotational_semi_analytical, core::Size const nresidue, core::Size const noptions, core::Size const noptions_achiral) |
Determine the number of sequences analytically, using expressions derived from Burnside's lemma by Todd Yeates. More... | |
int | main (int argc, char *argv[]) |
Entry point for program execution. More... | |
Variables | |
static basic::Tracer | TR ("apps.public.cyclic_peptide.count_cycpep_sequences") |
An application to count the number of unique sequences for a cyclic peptide given its symmetry.
#define COUNT_CYCPEP_SEQUENCE_INTTYPE signed long long |
void copy_asymm_unit_to_other_subunits | ( | utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > & | cursequence, |
core::Size const | asymm_unit_size, | ||
bool const | mirror_symm, | ||
core::Size const | minval_if_symmetric | ||
) |
Copy the first M residues, making up the asymmetric unit, to the other lobes of the peptide, mirroring appropriately if we're considering mirror symmetry.
References demo.D060_Folding::counter, debug_assert, create_a3b_hbs::i, and invert_value().
Referenced by increment_sequence().
core::Size count_analytically | ( | core::Size const | fold_symmetry, |
bool const | mirror_symm, | ||
bool const | improper_rotational_semi_analytical, | ||
core::Size const | nresidue, | ||
core::Size const | noptions, | ||
core::Size const | noptions_achiral | ||
) |
Determine the number of sequences analytically, using expressions derived from Burnside's lemma by Todd Yeates.
References count_analytically_cyclic(), count_analytically_improper_rotational(), count_semi_analytically_improper_rotational(), basic::options::TR, and basic::Tracer::Warning.
Referenced by main().
core::Size count_analytically_cyclic | ( | core::Size const | fold_symmetry, |
core::Size const | nresidue, | ||
core::Size const | noptions | ||
) |
Determine the number of sequences analytically, using expressions derived from Burnside's lemma by Todd Yeates. This version is for cyclic symmetry.
References errmsg(), numeric::gcd(), create_a3b_hbs::i, ObjexxFCL::pow(), runtime_assert, basic::options::TR, and utility_exit_with_message.
Referenced by count_analytically().
core::Size count_analytically_improper_rotational | ( | core::Size const | fold_symmetry, |
core::Size const | nresidue, | ||
core::Size const | noptions | ||
) |
Determine the number of sequences analytically, using expressions derived from Burnside's lemma by Todd Yeates. This version is for improper rotational symmetry.
This version uses a fully analytic expression for the number of sequences compatible with a given cyclic permutation.
References debug_assert, create_a3b_hbs::first, numeric::gcd(), create_a3b_hbs::i, ObjexxFCL::pow(), runtime_assert, and basic::options::TR.
Referenced by count_analytically().
core::Size count_numerically | ( | core::Size const | fold_symmetry, |
bool const | mirror_symm, | ||
core::Size const | nresidue, | ||
core::Size const | noptions, | ||
core::Size const | noptions_achiral, | ||
bool const | print_all_sequences | ||
) |
Compute the number of sequences numerically.
References count, debug_assert, find_min_permutation(), create_a3b_hbs::i, increment_sequence(), runtime_assert, set(), and basic::options::TR.
Referenced by main().
core::Size count_semi_analytically_improper_rotational | ( | core::Size const | fold_symmetry, |
core::Size const | nresidue, | ||
core::Size const | noptions | ||
) |
Determine the number of sequences analytically, using expressions derived from Burnside's lemma by Todd Yeates. This version is for improper rotational symmetry.
This version does some manual counting of the number of sequences compatible with a given cyclic permutation.
References errmsg(), create_a3b_hbs::first, create_a3b_hbs::i, invariants_for_cyclic_permutation(), ObjexxFCL::pow(), runtime_assert, basic::options::TR, and utility_exit_with_message.
Referenced by count_analytically().
void do_cyclic_permutation | ( | utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > & | vect | ) |
Circularly permute a vector by one.
Assumes vector is more than zero units long.
References COUNT_CYCPEP_SEQUENCE_INTTYPE, and create_a3b_hbs::i.
Referenced by find_min_permutation().
void do_options_checks | ( | ) |
Check that the user has set options sensibly.
References errmsg(), basic::options::option, runtime_assert_string_msg, basic::options::TR, basic::options::OptionKeys::inout::dbms::user, value, and basic::Tracer::Warning.
Referenced by main().
|
static |
Referenced by count_analytically_cyclic(), count_semi_analytically_improper_rotational(), do_options_checks(), and main().
utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > find_min_permutation | ( | utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > const & | input_vector | ) |
Circularly permute a vector until the least vector is found.
References do_cyclic_permutation(), and create_a3b_hbs::i.
Referenced by count_numerically().
bool increment_asymm_unit_recursively | ( | utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > & | cursequence, |
core::Size const | curindex, | ||
bool const | mirror_symm, | ||
core::Size const | maxval, | ||
core::Size const | minval_if_symmetric | ||
) |
Increment the asymmetric unit.
If mirror symmetric, uses negative index values (excludes zero) for symmetric possibilities. Uses positive exclusively otherwise.
References COUNT_CYCPEP_SEQUENCE_INTTYPE.
Referenced by increment_sequence().
bool increment_sequence | ( | utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > & | cursequence, |
core::Size const | asymm_unit_size, | ||
bool const | mirror_symm, | ||
core::Size const | maxval, | ||
core::Size const | minval_if_symmetric | ||
) |
Increment a vector, preserving symmetry.
Increments the asymmetric unit, then copies result to all other symmetry copies.
References copy_asymm_unit_to_other_subunits(), and increment_asymm_unit_recursively().
Referenced by count_numerically().
core::Size invariants_for_cyclic_permutation | ( | core::Size const | asymm_unit_size, |
core::Size const | offset | ||
) |
Figure out how many possible sequences there are which are invariant on a given cyclic permutation, given SN symmetry.
References debug_assert, create_a3b_hbs::i, offset, legacy_score_vs_rmsd::pattern, runtime_assert, and set_pattern().
Referenced by count_semi_analytically_improper_rotational().
COUNT_CYCPEP_SEQUENCE_INTTYPE invert_value | ( | COUNT_CYCPEP_SEQUENCE_INTTYPE const | val, |
core::Size const | max_symm_val | ||
) |
References COUNT_CYCPEP_SEQUENCE_INTTYPE.
Referenced by copy_asymm_unit_to_other_subunits().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Entry point for program execution.
References argv, count_analytically(), count_numerically(), utility::io::oc::cout, do_options_checks(), test.T009_Exceptions::e, errmsg(), basic::init(), basic::options::option, register_options(), runtime_assert_string_msg, basic::options::TR, and value.
bool set_pattern | ( | utility::vector1< COUNT_CYCPEP_SEQUENCE_INTTYPE > & | pattern, |
core::Size const | lobesize, | ||
core::Size const | index, | ||
core::Size const | setting, | ||
core::Size const | offset | ||
) |
Attempts to set a given entry in the pattern to a given value. Returns false if unsuccessful (the pattern becomes inconsistent), true otherwise.
References create_a3b_hbs::i, offset, and legacy_score_vs_rmsd::pattern.
Referenced by invariants_for_cyclic_permutation().
|
static |