Rosetta
Macros | Functions | Variables
count_cycpep_sequences.cc File Reference

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_INTTYPEfind_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")
 

Detailed Description

An application to count the number of unique sequences for a cyclic peptide given its symmetry.

Author
Vikram K. Mulligan (vmull.nosp@m.igan.nosp@m.@flat.nosp@m.iron.nosp@m.insti.nosp@m.tute.nosp@m..org)
Math from Todd Yeates (yeate.nosp@m.s@mb.nosp@m.i.ucl.nosp@m.a.ed.nosp@m.u).

Macro Definition Documentation

◆ COUNT_CYCPEP_SEQUENCE_INTTYPE

#define COUNT_CYCPEP_SEQUENCE_INTTYPE   signed long long

Function Documentation

◆ copy_asymm_unit_to_other_subunits()

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().

◆ count_analytically()

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().

◆ count_analytically_cyclic()

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().

◆ count_analytically_improper_rotational()

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().

◆ count_numerically()

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().

◆ count_semi_analytically_improper_rotational()

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().

◆ do_cyclic_permutation()

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().

◆ do_options_checks()

void do_options_checks ( )

◆ errmsg()

static const std::string errmsg ( "Error in count_cycpep_sequence application: "  )
static

◆ find_min_permutation()

Circularly permute a vector until the least vector is found.

References do_cyclic_permutation(), and create_a3b_hbs::i.

Referenced by count_numerically().

◆ increment_asymm_unit_recursively()

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.

Returns
False when the vector can no longer be incremented (i.e. all possibilities have been exhausted).

References COUNT_CYCPEP_SEQUENCE_INTTYPE.

Referenced by increment_sequence().

◆ 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.

Returns
False when the vector can no longer be incremented (i.e. all possibilities have been exhausted).

References copy_asymm_unit_to_other_subunits(), and increment_asymm_unit_recursively().

Referenced by count_numerically().

◆ invariants_for_cyclic_permutation()

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().

◆ invert_value()

COUNT_CYCPEP_SEQUENCE_INTTYPE invert_value ( COUNT_CYCPEP_SEQUENCE_INTTYPE const  val,
core::Size const  max_symm_val 
)

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ register_options()

void register_options ( )

References NEW_OPT.

Referenced by main().

◆ set_pattern()

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().

Variable Documentation

◆ TR

basic::Tracer TR("apps.public.cyclic_peptide.count_cycpep_sequences") ( "apps.public.cyclic_peptide.count_cycpep_sequences"  )
static