LocARNA-2.0.0
Public Member Functions | Static 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 MultipleAlignment &ma)=default
 Copy construct.
 
 MultipleAlignment (MultipleAlignment &&ma)=default
 Move construct.
 
MultipleAlignmentoperator= (const MultipleAlignment &ma)=default
 Copy assignment.
 
MultipleAlignmentoperator= (MultipleAlignment &&ma)=default
 Move assignment.
 
virtual ~MultipleAlignment ()
 virtual destructor
 
 MultipleAlignment (const std::string &file, FormatType format=FormatType::CLUSTAL)
 Construct from file. More...
 
 MultipleAlignment (std::istream &in, FormatType 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...
 
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 &annotype) const
 Read access of annotation by prefix. More...
 
void set_annotation (const AnnoType &annotype, const SequenceAnnotation &annotation)
 Write access to annotation. More...
 
bool has_annotation (const AnnoType &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 (const 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 format=MultipleAlignment::FormatType::CLUSTAL) const
 Write alignment to stream. More...
 
std::ostream & write (std::ostream &out, size_t width, FormatType 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 format=MultipleAlignment::FormatType::CLUSTAL) const
 Write sub-alignment to stream. More...
 
template<size_t N>
bool checkAlphabet (const Alphabet< char, N > &alphabet) const
 check character constraints More...
 
void write_debug (std::ostream &out=std::cout) const
 Print contents of object to stream. More...
 

Static Public Member Functions

static Sequenceview (MultipleAlignment &ma)
 Obtain sequence view of multiple alignment. More...
 
static const Sequenceview (const MultipleAlignment &ma)
 Obtain const sequence view of multiple alignment. More...
 
- Static Public Member Functions inherited from LocARNA::MultipleAlignment
static size_t num_of_annotypes ()
 number of annotation types More...
 

Additional Inherited Members

- Public Types inherited from LocARNA::MultipleAlignment
enum class  FormatType { STOCKHOLM , PP , CLUSTAL , FASTA }
 file format type for multiple alignments More...
 
enum class  AnnoType { consensus_structure , structure , fixed_structure , anchors }
 type of sequence annotation. enumerates legal annotation types More...
 
typedef std::vector< SeqEntry >::const_iterator const_iterator
 const iterator of sequence entries
 
typedef std::vector< SeqEntry >::iterator iterator
 iterator of sequence entries
 
using value_type = SeqEntry
 
- Static Public Attributes inherited from LocARNA::MultipleAlignment
static const std::vector< FormatTypeFormatTypes
 collection of the format types More...
 
static const std::vector< AnnoTypeAnnoTypes
 collection of the format 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

Constructor & Destructor Documentation

◆ Sequence()

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

◆ names()

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

◆ operator[]()

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

◆ view() [1/2]

static const Sequence& LocARNA::Sequence::view ( const MultipleAlignment ma)
inlinestatic

Obtain const sequence view of multiple alignment.

Parameters
mamultiple alignemnt
Returns
sequence

◆ view() [2/2]

static Sequence& LocARNA::Sequence::view ( MultipleAlignment ma)
inlinestatic

Obtain sequence view of multiple alignment.

Parameters
mamultiple alignemnt
Returns
sequence

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