Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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/keys/in.OptionKeys.gen.hh>
#include <basic/options/option.hh>
#include <basic/options/keys/OptionKeys.hh>
#include <utility/options/OptionCollection.hh>
#include <basic/options/option_macros.hh>
#include <boost/math/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")
 

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

#define COUNT_CYCPEP_SEQUENCE_INTTYPE   signed long long

Referenced by do_cyclic_permutation().

Function Documentation

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, 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(), 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, assign_charges::first, numeric::gcd(), 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 clean_pdb_keep_ligand::count, debug_assert, find_min_permutation(), increment_sequence(), runtime_assert, 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(), assign_charges::first, 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.

Referenced by find_min_permutation().

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

Circularly permute a vector until the least vector is found.

References do_cyclic_permutation().

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.

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

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.

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

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, 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 
)
int main ( int  argc,
char *  argv[] 
)
void register_options ( )

References NEW_OPT, and options.

Referenced by main().

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 ObjexxFCL::index().

Referenced by invariants_for_cyclic_permutation().

Variable Documentation

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