Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | Friends | List of all members
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]

Public Member Functions

 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 SequenceOP clone () const
 Returns an owning pointer to a copy of this sequence. More...
 
virtual void read_from_file (utility::file::FileName const &)
 initializes this sequence object from a file. More...
 
virtual core::Size length () const
 Returns the number of characters in this object. 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 to_string () const
 
virtual std::string type () 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...
 
Sequenceoperator= (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 Attributes

std::string id_
 
core::Size start_
 
char gap_char_
 
std::string seq_
 

Friends

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

Detailed Description

Definition at line 39 of file Sequence.hh.

Constructor & Destructor Documentation

core::sequence::Sequence::Sequence ( )
inline

ctor

Definition at line 44 of file Sequence.hh.

Referenced by clone().

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

Definition at line 45 of file Sequence.hh.

References sequence().

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

copy constructor.

Definition at line 56 of file Sequence.hh.

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

dtor

Definition at line 53 of file Sequence.cc.

Member Function Documentation

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

Append a character.

Definition at line 156 of file Sequence.cc.

References seq_.

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

Append a gap.

Definition at line 160 of file Sequence.cc.

References gap_char(), and seq_.

char core::sequence::Sequence::at ( core::Size  pos) const

Definition at line 123 of file Sequence.cc.

SequenceOP core::sequence::Sequence::clone ( ) const
virtual

Returns an owning pointer to a copy of this sequence.

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

Definition at line 55 of file Sequence.cc.

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::SequenceProfile, core::sequence::SequenceCoupling, and core::sequence::CompositeSequence.

Definition at line 142 of file Sequence.cc.

References length(), and sequence().

Referenced by core::sequence::CompositeSequence::delete_position(), and core::sequence::SequenceProfile::delete_position().

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
void core::sequence::Sequence::insert_char ( core::Size  pos,
char  new_char 
)
virtual
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.

Definition at line 152 of file Sequence.cc.

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.

Definition at line 164 of file Sequence.cc.

References gap_char_, and 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().

Definition at line 134 of file Sequence.hh.

References id().

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

assignment operator.

Definition at line 119 of file Sequence.hh.

References gap_char(), gap_char_, id(), id_, seq_, sequence(), start(), 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.

Definition at line 141 of file Sequence.hh.

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

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

Returns the character at the given sequence position.

Definition at line 117 of file Sequence.cc.

References seq_.

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

Definition at line 185 of file Sequence.cc.

References id(), 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::SequenceProfile, core::sequence::ChemicalShiftSequence, and core::sequence::SequenceCoupling.

Definition at line 61 of file Sequence.cc.

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.

Definition at line 171 of file Sequence.cc.

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.

Definition at line 100 of file Sequence.cc.

References ungapped_sequence().

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

Returns the string representing this sequence without gaps.

Definition at line 104 of file Sequence.cc.

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.

Definition at line 196 of file Sequence.cc.

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

Definition at line 205 of file Sequence.cc.

Member Data Documentation

char core::sequence::Sequence::gap_char_
private

Definition at line 197 of file Sequence.hh.

Referenced by gap_char(), is_gap(), and operator=().

std::string core::sequence::Sequence::id_
private

Definition at line 195 of file Sequence.hh.

Referenced by id(), operator=(), and Sequence().

std::string core::sequence::Sequence::seq_
private

Definition at line 199 of file Sequence.hh.

Referenced by append_char(), append_gap(), length(), operator=(), operator[](), and sequence().

core::Size core::sequence::Sequence::start_
private

Definition at line 196 of file Sequence.hh.

Referenced by operator=(), and start().


The documentation for this class was generated from the following files: