LocARNA-1.8.11
Public Member Functions | List of all members
LocARNA::Sequence Class Reference

"Sequence View" of multiple alignment as array of column vectors More...

#include <sequence.hh>

Inheritance diagram for LocARNA::Sequence:
Inheritance graph
[legend]
Collaboration diagram for LocARNA::Sequence:
Collaboration graph
[legend]

Public Member Functions

 Sequence ()
 Construct empty.
 
 Sequence (const std::string &name, const std::string &sequence)
 Construct as single sequence. More...
 
AliColumn operator[] (size_type col_index) const
 Access to columns. More...
 
std::vector< std::string > names () const
 names vector (legacy, deprecated) More...
 
- Public Member Functions inherited from LocARNA::MultipleAlignment
 MultipleAlignment ()
 Construct empty.
 
 MultipleAlignment (const std::string &file, FormatType::type format=FormatType::CLUSTAL)
 Construct from file. More...
 
 MultipleAlignment (std::istream &in, FormatType::type format=FormatType::CLUSTAL)
 Construct from stream. More...
 
 MultipleAlignment (const std::string &name, const std::string &sequence)
 Construct as degenerate alignment of one sequence. More...
 
 MultipleAlignment (const std::string &nameA, const std::string &nameB, const std::string &alistringA, const std::string &alistringB)
 Construct as pairwise alignment from names and alignment strings. More...
 
 MultipleAlignment (const Alignment &alignment, bool only_local=false, bool special_gap_symbols=false)
 Construct from Alignment object. More...
 
 MultipleAlignment (const AlignmentEdges &edges, const Sequence &seqA, const Sequence &seqB)
 Construct from alignment edges and sequences. More...
 
virtual ~MultipleAlignment ()
 virtual destructor
 
const Sequenceas_sequence () const
 "cast" multiple alignment to sequence More...
 
void normalize_rna_symbols ()
 normalize rna symbols More...
 
size_type num_of_rows () const
 Number of rows of multiple aligment. More...
 
bool empty () const
 Emptiness check. More...
 
const SequenceAnnotationannotation (const AnnoType::type &annotype) const
 Read access of annotation by prefix. More...
 
void set_annotation (const AnnoType::type &annotype, const SequenceAnnotation &annotation)
 Write access to annotation. More...
 
bool has_annotation (const AnnoType::type &annotype) const
 
bool is_proper () const
 Test whether alignment is proper. More...
 
pos_type length () const
 Length of multiple aligment. More...
 
const_iterator begin () const
 Begin for read-only traversal of name/sequence pairs. More...
 
const_iterator end () const
 End for read-only traversal of name/sequence pairs. More...
 
bool contains (std::string name) const
 Test whether name exists. More...
 
size_type index (const std::string &name) const
 Access index by name. More...
 
const SeqEntryseqentry (size_type index) const
 Access name/sequence pair by index. More...
 
const SeqEntryseqentry (const std::string &name) const
 Access name/sequence pair by name. More...
 
size_type deviation (const MultipleAlignment &ma) const
 Deviation of a multiple alignment from a reference alignment. More...
 
double sps (const MultipleAlignment &ma, bool compalign=true) const
 Sum-of-pairs score between a multiple alignment and a reference alignment. More...
 
double cmfinder_realignment_score (const MultipleAlignment &ma) const
 Cmfinder realignment score of a multiple alignment to a reference alignment. More...
 
double avg_deviation_score (const MultipleAlignment &ma) const
 Average deviation score. More...
 
std::string consensus_sequence () const
 Consensus sequence of multiple alignment. More...
 
AliColumn column (size_type col_index) const
 Access alignment column. More...
 
void append (const SeqEntry &seqentry)
 Append sequence entry. More...
 
void prepend (const SeqEntry &seqentry)
 Prepend sequence entry. More...
 
void operator+= (const AliColumn &c)
 Append a column. More...
 
void operator+= (char c)
 Append the same character to each row. More...
 
void reverse ()
 reverse the multiple alignment
 
std::ostream & write (std::ostream &out, FormatType::type format=MultipleAlignment::FormatType::CLUSTAL) const
 Write alignment to stream. More...
 
std::ostream & write (std::ostream &out, size_t width, FormatType::type format=MultipleAlignment::FormatType::CLUSTAL) const
 Write alignment to stream (wrapped) More...
 
std::ostream & write_name_sequence_line (std::ostream &out, const std::string &name, const std::string &sequence, size_t namewidth) const
 Write formatted line of name and sequence. More...
 
std::ostream & write (std::ostream &out, size_type start, size_type end, FormatType::type format=MultipleAlignment::FormatType::CLUSTAL) const
 Write sub-alignment to stream. More...
 
bool checkAlphabet (const Alphabet< char > &alphabet) const
 check character constraints More...
 
void write_debug (std::ostream &out=std::cout) const
 Print contents of object to stream. More...
 

Additional Inherited Members

- Public Types inherited from LocARNA::MultipleAlignment
typedef size_t size_type
 size type
 
typedef std::vector< SeqEntry >::const_iterator const_iterator
 const iterator of sequence entries
 
- Static Public Member Functions inherited from LocARNA::MultipleAlignment
static size_t num_of_annotypes ()
 number of annotation types More...
 
- Protected Member Functions inherited from LocARNA::MultipleAlignment
void init (const AlignmentEdges &edges, const Sequence &seqA, const Sequence &seqB, bool special_gap_symbols)
 Initialize from alignment edges and sequences. More...
 

Detailed Description

"Sequence View" of multiple alignment as array of column vectors

Note
use MultipleAlignment::as_sequence() to 'convert' from MultipleAlignment to Sequence.
the conceptual relation between Sequence and MultipleAlignent is that the two classes are equivalent views of a multiple alignment. Therefore, casting between both should be free of cost, in particular for references! operator [] is supported, depending on the static type, only for Sequence. There should be a way to expresse this relation in a nicer way.

Constructor & Destructor Documentation

LocARNA::Sequence::Sequence ( const std::string &  name,
const std::string &  sequence 
)
inline

Construct as single sequence.

Parameters
namename of sequence
sequencesequence string

Member Function Documentation

std::vector< std::string > LocARNA::Sequence::names ( ) const

names vector (legacy, deprecated)

Returns
vector of sequence names
Note
deprecated: in place of names()[i], rather use seqentry(i).name()
AliColumn LocARNA::Sequence::operator[] ( size_type  col_index) const
inline

Access to columns.

Parameters
col_indexcolumn index
Returns
alignment column (proxy class)
Note
allows array notation via [] operator; this is the main difference to MultipleAlignment class

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