Rosetta 3.4
Public Member Functions | Friends
core::sequence::Sequence Class Reference

#include <Sequence.hh>

Inheritance diagram for core::sequence::Sequence:
Inheritance graph
[legend]
Collaboration diagram for core::sequence::Sequence:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Sequence ()
 ctor
 Sequence (std::string seq, std::string id, core::Size start=1)
 Sequence (core::pose::Pose const &pose)
 Sequence (Sequence const &src)
 copy constructor.
virtual ~Sequence ()
 dtor
virtual SequenceOP clone () const
 Returns an owning pointer to a copy of this sequence.
virtual void read_from_file (utility::file::FileName const &)
 initializes this sequence object from a file.
virtual core::Size length () const
 Returns the number of characters in this object.
virtual void insert_char (core::Size pos, char new_char)
 Inserts a character at the given position.
virtual void delete_position (core::Size pos)
 Deletes the given position from the Sequence and shifts everything else back by one.
virtual std::string to_string () const
virtual std::string type () const
void sequence (std::string sequence)
 sets sequence to the given value.
void id (std::string new_id)
 sets id to the given value.
void start (core::Size new_start)
 sets starting index to the given value.
void gap_char (char gap_char)
 sets gap_char to the given value.
core::Size ungapped_length () const
 Returns the number of characters in this object, ignoring gaps.
core::Size start () const
 Returns the start of this object.
std::string id () const
 Returns the id of this object.
char gap_char () const
 Returns the character used to represent a gap for this object.
std::string ungapped_sequence () const
 Returns the string representing this sequence without gaps.
std::string sequence () const
 Returns the full sequence, which may include gaps.
Sequenceoperator= (Sequence const &rhs)
 assignment operator.
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().
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.
char operator[] (core::Size pos) const
 Returns the character at the given sequence position.
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.
void append_char (char new_char)
 Append a character.
void append_gap ()
 Append a gap.
bool is_gap (core::Size pos) const
 Returns true if this position in the sequence represents a gap, returns false otherwise.
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:
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.

Friends

std::ostream & operator<< (std::ostream &out, const Sequence &seq)
 Prints the information a given Sequence object to the given std::ostream.
std::ostream & operator<< (std::istream &out, Sequence &seq)
 Prints the information a given Sequence object to the given std::ostream.
std::istream & operator>> (std::istream &in, Sequence &seq)

Constructor & Destructor Documentation

core::sequence::Sequence::Sequence ( ) [inline]

ctor

Referenced by clone().

core::sequence::Sequence::Sequence ( std::string  seq,
std::string  id,
core::Size  start = 1 
) [inline]

References sequence().

core::sequence::Sequence::Sequence ( core::pose::Pose const &  pose)
core::sequence::Sequence::Sequence ( Sequence const &  src) [inline]

copy constructor.

core::sequence::Sequence::~Sequence ( ) [virtual]

dtor


Member Function Documentation

void core::sequence::Sequence::append_char ( char  new_char)

Append a character.

void core::sequence::Sequence::append_gap ( )

Append a gap.

References gap_char().

char core::sequence::Sequence::at ( core::Size  pos) const
SequenceOP core::sequence::Sequence::clone ( ) const [virtual]

Returns an owning pointer to a copy of this sequence.

Reimplemented in core::sequence::ChemicalShiftSequence, core::sequence::CompositeSequence, and core::sequence::SequenceProfile.

References Sequence().

void core::sequence::Sequence::delete_position ( core::Size  pos) [virtual]

Deletes the given position from the Sequence and shifts everything else back by one.

Reimplemented in core::sequence::CompositeSequence, core::sequence::SequenceCoupling, and core::sequence::SequenceProfile.

References length(), and sequence().

void core::sequence::Sequence::gap_char ( char  gap_char)
char core::sequence::Sequence::gap_char ( ) const
void core::sequence::Sequence::id ( std::string  new_id)
std::string core::sequence::Sequence::id ( ) const
virtual void core::sequence::Sequence::insert_char ( core::Size  pos,
char  new_char 
) [virtual]

Inserts a character at the given position.

Reimplemented in core::sequence::CompositeSequence, core::sequence::SequenceCoupling, and core::sequence::SequenceProfile.

Referenced by insert_gap().

void core::sequence::Sequence::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.

References gap_char(), and insert_char().

bool core::sequence::Sequence::is_gap ( core::Size  pos) const

Returns true if this position in the sequence represents a gap, returns false otherwise.

References length().

Referenced by resnum(), and ungapped_sequence().

Size core::sequence::Sequence::length ( ) const [virtual]
bool core::sequence::Sequence::operator< ( const Sequence s) const [inline]

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

References id().

Sequence& core::sequence::Sequence::operator= ( Sequence const &  rhs) [inline]

assignment operator.

References gap_char(), id(), sequence(), and start().

bool core::sequence::Sequence::operator== ( const Sequence s) const [inline]

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.

References id(), sequence(), and start().

char core::sequence::Sequence::operator[] ( core::Size  pos) const

Returns the character at the given sequence position.

void core::sequence::Sequence::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:

  • id
  • start
  • sequence

References make_table_of_pilot_apps::begin, id(), make_table_of_pilot_apps::name, sequence(), and start().

Referenced by core::sequence::operator>>().

void core::sequence::Sequence::read_from_file ( utility::file::FileName const &  ) [virtual]

initializes this sequence object from a file.

Reimplemented in core::sequence::ChemicalShiftSequence, core::sequence::SequenceCoupling, and core::sequence::SequenceProfile.

core::Size core::sequence::Sequence::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.

References is_gap(), length(), and start().

void core::sequence::Sequence::sequence ( std::string  sequence)
string core::sequence::Sequence::sequence ( ) const
void core::sequence::Sequence::start ( core::Size  new_start)
core::Size core::sequence::Sequence::start ( ) const
std::string core::sequence::Sequence::to_string ( ) const [virtual]
std::string core::sequence::Sequence::type ( ) const [virtual]
Size core::sequence::Sequence::ungapped_length ( ) const

Returns the number of characters in this object, ignoring gaps.

References ungapped_sequence().

string core::sequence::Sequence::ungapped_sequence ( ) const

Returns the string representing this sequence without gaps.

References is_gap(), and length().

Referenced by ungapped_length().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const Sequence seq 
) [friend]

Prints the information a given Sequence object to the given std::ostream.

std::ostream& operator<< ( std::istream &  out,
Sequence seq 
) [friend]

Prints the information a given Sequence object to the given std::ostream.

std::istream& operator>> ( std::istream &  in,
Sequence seq 
) [friend]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines