Rosetta  2020.46
 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]

Public Member Functions

 Sequence ()
 ctor More...
 
 Sequence (std::string const &seq, std::string const &id, core::Size start=1)
 
 Sequence (core::pose::Pose const &pose)
 
 Sequence (Sequence const &src)
 copy constructor. More...
 
 ~Sequence () override
 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 replace_char (core::Size pos, char new_char)
 
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...
 
void spacer_positions (utility::vector1< Size > const &spacer_positions)
 sets spacer_positions 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...
 
utility::vector1< Sizespacer_positions () const
 Returns the spacer positions (chain breaks, e.g., from spaces or commas in original sequence text) 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_
 
utility::vector1< Sizespacer_positions_
 
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)
 

Constructor & Destructor Documentation

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

ctor

Referenced by clone().

core::sequence::Sequence::Sequence ( std::string const &  seq,
std::string const &  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 ( )
overridedefault

dtor

Member Function Documentation

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

Append a character.

References seq_.

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

Append a gap.

References gap_char(), and seq_.

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

References Sequence().

void core::sequence::Sequence::delete_position ( core::Size  pos)
virtual
void core::sequence::Sequence::gap_char ( char  gap_char)

sets gap_char to the given value.

References gap_char_.

Referenced by core::sequence::CompositeSequence::operator=(), and operator=().

char core::sequence::Sequence::gap_char ( ) const

Returns the character used to represent a gap for this object.

References gap_char_.

Referenced by core::sequence::CompositeSequence::add_sequence(), append_gap(), insert_gap(), and core::sequence::CompositeSequence::operator=().

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.

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

References id().

Sequence& core::sequence::Sequence::operator= ( Sequence const &  rhs)
inline
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(), spacer_positions(), and start().

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

Returns the character at the given sequence position.

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

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.

void core::sequence::Sequence::replace_char ( core::Size  pos,
char  new_char 
)
virtual

References length(), and sequence().

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::spacer_positions ( utility::vector1< Size > const &  spacer_positions)

sets spacer_positions to the given value.

References spacer_positions_.

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

utility::vector1< Size > core::sequence::Sequence::spacer_positions ( ) const

Returns the spacer positions (chain breaks, e.g., from spaces or commas in original sequence text)

References spacer_positions_.

Referenced by operator==().

void core::sequence::Sequence::start ( core::Size  new_start)

sets starting index to the given value.

References start_.

Referenced by core::sequence::CompositeSequence::operator=(), operator=(), and operator==().

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

Member Data Documentation

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

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

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

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

std::string core::sequence::Sequence::seq_
private
utility::vector1< Size > core::sequence::Sequence::spacer_positions_
private

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

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

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


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