![]() |
Rosetta Core
2014.35
|
#include <SequenceProfile.hh>
Public Member Functions | |
SequenceProfile () | |
ctors More... | |
SequenceProfile (FileName const &fn) | |
SequenceProfile (utility::vector1< utility::vector1< core::Real > > prof, std::string const &sequence, std::string const &id, Size start=1, bool negative_better=false) | |
SequenceProfile (SequenceProfile const &src) | |
copy ctor More... | |
SequenceProfile & | operator= (SequenceProfile const &rhs) |
assignment operator. More... | |
~SequenceProfile () | |
dtor More... | |
virtual SequenceOP | clone () const |
Returns an owning pointer to a new SequenceProfile object, with data that is a deep copy of the information in this object. More... | |
virtual void | read_from_file (FileName const &fn) |
Read an profile matrix from the given filename using the NCBI PSSM format for a position-specific scoring matrix. More... | |
virtual void | generate_from_sequence (Sequence const &seq, std::string matrix="BLOSUM62") |
Generate the profile matrix from a sequence and a given substitution matrix. More... | |
void | rescale (core::Real factor=1) |
Multiply all profile weights by factor. More... | |
void | convert_profile_to_probs (core::Real temp=1.0) |
Use boltzman scaling on a per-residue basis to convert the current profile values to probabilities ( range 0.0-1.0 ) More... | |
void | global_auto_rescale () |
Use linear rescaling (with a fixed zero) to fit the values within the range -1.0 to 1.0. More... | |
void | read_from_checkpoint (FileName const &fn, bool negative_better=true) |
Read profile matrix from the given filename using the NNMAKE .checkpoint format. For compatability, negative_better defaults to true. Set manually if necessary. More... | |
void | read_from_binary_chk (FileName const &fn) |
Read profile matrix from the given filename in the legacy BLAST binary format. More... | |
utility::vector1 < utility::vector1< Real > > const & | profile () const |
Returns the 2D vector1 of Real values representing this profile. More... | |
utility::vector1 < utility::vector1< Real > > const & | occurrence_data () const |
Returns the 2D vector1 of Real values of the probabilties of each aa. More... | |
void | profile (utility::vector1< utility::vector1< Real > > const &new_profile) |
Sets the 2D vector1 of Real values representing this profile. More... | |
void | occurrence_data (utility::vector1< utility::vector1< Real > > const &new_occurrence_data) |
Sets the 2D vector1 of Real values of the probabilties of each aa. More... | |
virtual void | insert_char (core::Size pos, char new_char) |
Inserts a character at the given position. More... | |
virtual void | delete_position (core::Size pos) |
Deletes the given position from the Sequence and shifts everything else back by one. More... | |
virtual std::string | type () const |
Size | width () const |
Returns the number of distinct values at each position in this profile. More... | |
utility::vector1< Real > const & | prof_row (Size pos) const |
Returns the vector1 of values at this position. More... | |
utility::vector1< Real > const & | probability_row (Size pos) const |
Returns the vector1 of values at this position. More... | |
void | prof_row (utility::vector1< Real > const &new_prof_row, core::Size pos) |
Sets the 1D vector1 of Real values representing this profile at pos X. More... | |
void | probabilty_row (utility::vector1< Real > const &new_prob_row, core::Size pos) |
Size | size () const |
bool | negative_better () const |
Returns true if negative values are better identities. More... | |
void | negative_better (bool negbet) |
Set whether negative identities are better. More... | |
core::Real | temp () const |
returns the temperature used in computing profile probabilities More... | |
utility::vector1< std::string > | alphabet () const |
Return the alphabet used by this sequence profile. This is an N-dimensional vector1 where N is the width of the profile, and the ith entry of any row in the profile represents the probability of ith character at that row in the sequence. More... | |
void | alphabet (utility::vector1< std::string > new_alphabet) |
![]() | |
Sequence () | |
ctor More... | |
Sequence (std::string seq, std::string id, core::Size start=1) | |
Sequence (core::pose::Pose const &pose) | |
Sequence (Sequence const &src) | |
copy constructor. More... | |
virtual | ~Sequence () |
dtor More... | |
virtual core::Size | length () const |
Returns the number of characters in this object. More... | |
virtual std::string | to_string () const |
void | sequence (std::string sequence) |
sets sequence to the given value. More... | |
void | id (std::string new_id) |
sets id to the given value. More... | |
void | start (core::Size new_start) |
sets starting index to the given value. More... | |
void | gap_char (char gap_char) |
sets gap_char to the given value. More... | |
core::Size | ungapped_length () const |
Returns the number of characters in this object, ignoring gaps. More... | |
core::Size | start () const |
Returns the start of this object. More... | |
std::string | id () const |
Returns the id of this object. More... | |
char | gap_char () const |
Returns the character used to represent a gap for this object. More... | |
std::string | ungapped_sequence () const |
Returns the string representing this sequence without gaps. More... | |
std::string | sequence () const |
Returns the full sequence, which may include gaps. More... | |
Sequence & | operator= (Sequence const &rhs) |
assignment operator. More... | |
bool | operator< (const Sequence &s) const |
Returns true if this Sequence object's id is lexicographically less than the given Sequence object's id, returns false otherwise. Uses C++ string < operator to compare this Sequence object's id() to the given Sequence object's id(). More... | |
bool | operator== (const Sequence &s) const |
Returns true if the given Sequence object is equal to this Sequence object. Tests for string equality of id(), start(), and sequence(), and returns false if any of these are not equal. More... | |
char | operator[] (core::Size pos) const |
Returns the character at the given sequence position. More... | |
char | at (core::Size pos) const |
void | insert_gap (core::Size pos) |
Inserts a gap at the given position, where insert_gap( 0 ) inserts the character at the beginning of the sequence, and insert_gap( length() ) inserts the character at the end of the sequence. More... | |
void | append_char (char new_char) |
Append a character. More... | |
void | append_gap () |
Append a gap. More... | |
bool | is_gap (core::Size pos) const |
Returns true if this position in the sequence represents a gap, returns false otherwise. More... | |
void | read_data (std::istream &in) |
Initializes the information in this sequence from the given std::istream. The istream should yield three pieces of information in the following order: More... | |
core::Size | resnum (core::Size idx) const |
Returns the index of the given sequence position, which is the position in the sequence minus any gaps that occur earlier in the sequence. For example, if the sequence is —AT, resnum(5) will return 2. Returns 0 for unaligned positions. More... | |
Private Types | |
typedef std::string | string |
typedef utility::file::FileName | FileName |
Private Member Functions | |
void | scores_to_probs_ (utility::vector1< core::Real > &scores, core::Real kT, bool negative_better=false) const |
converts a vector1 of arbitrary scores to values using Bolztmann averaging at a given kT. Scores should follow the convention that more positive -> better score. If not, set negative_better to true. More... | |
bool | check_internals_ () const |
Internal consistency check. Returns true if passed, causes a runtime_assertion failure if not. More... | |
Private Attributes | |
utility::vector1< std::string > | alphabet_ |
utility::vector1 < utility::vector1< Real > > | profile_ |
utility::vector1 < utility::vector1< Real > > | occurrence_data_ |
core::Real | temp_ |
temp used to convert arbitrary scores to/from probabilities More... | |
bool | negative_better_ |
The orientation of the values. Are negative values better than zero/positive ones? More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const SequenceProfile &p) |
Print this SequenceProfile object to the given std::ostream. More... | |
|
private |
|
inline |
ctors
Referenced by clone().
|
inline |
References read_from_file().
|
inline |
References core::sequence::Sequence::length(), profile(), and size().
|
inline |
copy ctor
|
inline |
dtor
|
inline |
Return the alphabet used by this sequence profile. This is an N-dimensional vector1 where N is the width of the profile, and the ith entry of any row in the profile represents the probability of ith character at that row in the sequence.
References alphabet_.
Referenced by operator=().
|
inline |
References alphabet_.
|
private |
Internal consistency check. Returns true if passed, causes a runtime_assertion failure if not.
References alphabet_, core::sequence::Sequence::length(), profile_, runtime_assert, and size().
Referenced by width().
|
inlinevirtual |
Returns an owning pointer to a new SequenceProfile object, with data that is a deep copy of the information in this object.
Reimplemented from core::sequence::Sequence.
Reimplemented in core::sequence::ChemicalShiftSequence.
References SequenceProfile().
void core::sequence::SequenceProfile::convert_profile_to_probs | ( | core::Real | temp = 1.0 | ) |
Use boltzman scaling on a per-residue basis to convert the current profile values to probabilities ( range 0.0-1.0 )
References negative_better_, prof_row(), profile(), scores_to_probs_(), temp(), and temp_.
|
virtual |
Deletes the given position from the Sequence and shifts everything else back by one.
Reimplemented from core::sequence::Sequence.
Reimplemented in core::sequence::SequenceCoupling.
References core::sequence::Sequence::delete_position(), core::sequence::Sequence::length(), profile(), runtime_assert, and core::sequence::Sequence::start().
Referenced by core::sequence::SequenceCoupling::delete_position().
|
virtual |
Generate the profile matrix from a sequence and a given substitution matrix.
References core::sequence::end, core::sequence::Sequence::length(), negative_better_, core::chemical::num_canonical_aas, prof_row(), profile(), core::sequence::MatrixScoringScheme::read_from_database(), core::sequence::Sequence::sequence(), and core::sequence::MatrixScoringScheme::values_for_aa().
void core::sequence::SequenceProfile::global_auto_rescale | ( | ) |
|
virtual |
Inserts a character at the given position.
Reimplemented from core::sequence::Sequence.
Reimplemented in core::sequence::SequenceCoupling.
References core::sequence::Sequence::insert_char(), core::sequence::Sequence::length(), profile(), and width().
Referenced by core::sequence::SequenceCoupling::insert_char().
|
inline |
Returns true if negative values are better identities.
The "default" use case is for storing log likelihood values where positive is better. If you're using this class to store energy-like values, set negative_better to true.
References negative_better_.
Referenced by read_from_checkpoint().
|
inline |
Set whether negative identities are better.
References negative_better_.
utility::vector1< utility::vector1< Real > > const & core::sequence::SequenceProfile::occurrence_data | ( | ) | const |
Returns the 2D vector1 of Real values of the probabilties of each aa.
References occurrence_data_.
void core::sequence::SequenceProfile::occurrence_data | ( | utility::vector1< utility::vector1< Real > > const & | new_occurrence_data | ) |
Sets the 2D vector1 of Real values of the probabilties of each aa.
|
inline |
assignment operator.
References alphabet(), core::sequence::Sequence::gap_char(), core::sequence::Sequence::id(), negative_better_, profile(), core::sequence::Sequence::sequence(), core::sequence::Sequence::start(), and temp_.
utility::vector1< Real > const & core::sequence::SequenceProfile::probability_row | ( | Size | pos | ) | const |
Returns the vector1 of values at this position.
References occurrence_data_, and runtime_assert.
Referenced by read_from_file().
void core::sequence::SequenceProfile::probabilty_row | ( | utility::vector1< Real > const & | new_prob_row, |
core::Size | pos | ||
) |
References occurrence_data_.
utility::vector1< Real > const & core::sequence::SequenceProfile::prof_row | ( | Size | pos | ) | const |
Returns the vector1 of values at this position.
References profile_, and runtime_assert.
Referenced by convert_profile_to_probs(), generate_from_sequence(), core::sequence::operator<<(), read_from_binary_chk(), read_from_checkpoint(), core::sequence::ChemicalShiftSequence::read_from_file(), and read_from_file().
void core::sequence::SequenceProfile::prof_row | ( | utility::vector1< Real > const & | new_prof_row, |
core::Size | pos | ||
) |
Sets the 1D vector1 of Real values representing this profile at pos X.
References profile_.
utility::vector1< utility::vector1< Real > > const & core::sequence::SequenceProfile::profile | ( | ) | const |
Returns the 2D vector1 of Real values representing this profile.
Returns the 2D vector1 of Real-values representing this profile.
References profile_.
Referenced by core::sequence::ChemicalShiftSequence::check_internals_(), core::sequence::ChemicalShiftSequence::ChemicalShiftSequence(), convert_profile_to_probs(), delete_position(), core::sequence::SequenceCoupling::edgePotBetween(), generate_from_sequence(), insert_char(), core::sequence::SequenceCoupling::operator=(), core::sequence::ChemicalShiftSequence::operator=(), operator=(), read_from_checkpoint(), core::sequence::ChemicalShiftSequence::read_from_file(), rescale(), and SequenceProfile().
void core::sequence::SequenceProfile::profile | ( | utility::vector1< utility::vector1< Real > > const & | new_profile | ) |
Sets the 2D vector1 of Real values representing this profile.
void core::sequence::SequenceProfile::read_from_binary_chk | ( | FileName const & | fn | ) |
Read profile matrix from the given filename in the legacy BLAST binary format.
References core::chemical::aa_from_oneletter_code(), utility::file::FileName::name(), prof_row(), profile_, seq, core::sequence::tr, and utility_exit_with_message.
void core::sequence::SequenceProfile::read_from_checkpoint | ( | FileName const & | fn, |
bool | negative_better = true |
||
) |
Read profile matrix from the given filename using the NNMAKE .checkpoint format. For compatability, negative_better defaults to true. Set manually if necessary.
References core::chemical::aa_from_oneletter_code(), alphabet_, getline(), negative_better(), negative_better_, core::chemical::oneletter_code_from_aa(), prof_row(), profile(), core::sequence::Sequence::sequence(), size(), utility::split_whitespace(), utility::to_string(), core::sequence::tr, and utility_exit_with_message.
|
virtual |
Read an profile matrix from the given filename using the NCBI PSSM format for a position-specific scoring matrix.
Reimplemented from core::sequence::Sequence.
Reimplemented in core::sequence::ChemicalShiftSequence, and core::sequence::SequenceCoupling.
References core::chemical::aa_from_oneletter_code(), alphabet_, core::sequence::end, getline(), core::sequence::Sequence::id(), negative_better_, occurrence_data_, core::chemical::oneletter_code_from_aa(), basic::options::option, probability_row(), prof_row(), profile_, score, seq, core::sequence::Sequence::sequence(), utility::to_string(), core::sequence::tr, basic::options::OptionKeys::out::file::use_occurrence_data, and utility_exit_with_message.
Referenced by SequenceProfile().
void core::sequence::SequenceProfile::rescale | ( | core::Real | factor = 1 | ) |
Multiply all profile weights by factor.
References begin, core::sequence::end, negative_better_, profile(), profile_, and core::sequence::tr.
Referenced by global_auto_rescale().
|
private |
converts a vector1 of arbitrary scores to values using Bolztmann averaging at a given kT. Scores should follow the convention that more positive -> better score. If not, set negative_better to true.
References core::sequence::end.
Referenced by convert_profile_to_probs().
|
inline |
|
inline |
returns the temperature used in computing profile probabilities
References temp_.
Referenced by convert_profile_to_probs().
|
inlinevirtual |
Reimplemented from core::sequence::Sequence.
Reimplemented in core::sequence::SequenceCoupling.
Size core::sequence::SequenceProfile::width | ( | ) | const |
Returns the number of distinct values at each position in this profile.
References check_internals_(), and profile_.
Referenced by insert_char(), and core::sequence::operator<<().
|
friend |
Print this SequenceProfile object to the given std::ostream.
|
private |
Referenced by alphabet(), check_internals_(), read_from_checkpoint(), and read_from_file().
|
private |
The orientation of the values. Are negative values better than zero/positive ones?
Referenced by convert_profile_to_probs(), generate_from_sequence(), negative_better(), operator=(), read_from_checkpoint(), read_from_file(), and rescale().
|
private |
Referenced by occurrence_data(), probability_row(), probabilty_row(), and read_from_file().
|
private |
Referenced by check_internals_(), global_auto_rescale(), prof_row(), profile(), read_from_binary_chk(), read_from_file(), rescale(), size(), and width().
|
private |
temp used to convert arbitrary scores to/from probabilities
Referenced by convert_profile_to_probs(), operator=(), and temp().