LocARNA-2.0.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
LocARNA::Alignment Class Reference

Represents a structure-annotated sequence alignment. More...

#include <alignment.hh>

Public Types

typedef EdgeEnd edge_end_t
 edge end
 
using edge_ends_t = std::vector< EdgeEnd >
 edge ends
 
using edge_end_pair_t = std::pair< EdgeEnd, EdgeEnd >
 
using pos_pair_t = std::pair< pos_type, pos_type >
 
using edges_t = AlignmentEdges
 description of alignment edges
 

Public Member Functions

 Alignment (const Sequence &seqA, const Sequence &seqB)
 
 ~Alignment ()
 
 Alignment (const Sequence &seqA, const Sequence &seqB, const edges_t &edges)
 Construct alignment from sequences and alignment strings. More...
 
 Alignment (const Alignment &alignment)
 copy constructor More...
 
Alignmentoperator= (const Alignment &alignment)
 assignment operator More...
 
void set_consensus_structure (const RnaStructure &structure)
 Set consensus structure of the alignment. More...
 
void set_structures (const RnaStructure &structureA, const RnaStructure &structureB)
 Set structures of the alignment. More...
 
void clear ()
 
void append (edge_end_t i, edge_end_t j)
 Append an alignment edge. More...
 
void add_basepairA (int i, int j)
 Add a basepair to the structure of A.
 
void add_basepairB (int i, int j)
 Add a basepair to the structure of B.
 
void add_deleted_basepairA (int i, int j)
 Add a basepair to the structure of A.
 
void add_deleted_basepairB (int i, int j)
 Add a basepair to the structure of B.
 
const edges_t alignment_edges (bool only_local) const
 All alignment edges. More...
 
pos_pair_t start_positions () const
 
pos_pair_t end_positions () const
 
std::string dot_bracket_structureA (bool only_local) const
 Structure A. More...
 
std::string dot_bracket_structureB (bool only_local) const
 Structure B. More...
 
const SequenceseqA () const
 read access seqA More...
 
const SequenceseqB () const
 read access seqB More...
 
bool empty () const
 

Static Public Member Functions

static edges_t alistrs_to_edges (const std::string &alistrA, const std::string &alistrB)
 convert alignemnt string to edge end vector More...
 

Detailed Description

Represents a structure-annotated sequence alignment.

Supports construction of the alignment during traceback.

Constructor & Destructor Documentation

◆ Alignment() [1/3]

LocARNA::Alignment::Alignment ( const Sequence seqA,
const Sequence seqB 
)

Construct empty alignment from sequences

Parameters
seqAFirst sequence
seqBSecond sequence

◆ ~Alignment()

LocARNA::Alignment::~Alignment ( )

Destructor

◆ Alignment() [2/3]

LocARNA::Alignment::Alignment ( const Sequence seqA,
const Sequence seqB,
const edges_t edges 
)

Construct alignment from sequences and alignment strings.

Parameters
seqAFirst sequence
seqBSecond sequence
edgesalignment edges

◆ Alignment() [3/3]

LocARNA::Alignment::Alignment ( const Alignment alignment)

copy constructor

Parameters
alignmentobject to be copied Copies implementation object (not only pointer)

Member Function Documentation

◆ alignment_edges()

const Alignment::edges_t LocARNA::Alignment::alignment_edges ( bool  only_local) const

All alignment edges.

Parameters
only_localif true, return only local edges
Returns
vector of alignment edges

If !only_local, the returned vector contains all positions of the sequence. We distinguish different gaps, in particular locality gaps, which are paired with positions that are not aligned at all (i.e. they are not part of the local alignment).

If only_local, the vector does not contain non-local edges, i.e. edges with locality gaps.

Edges are sorted (ascendingly).

◆ alistrs_to_edges()

Alignment::edges_t LocARNA::Alignment::alistrs_to_edges ( const std::string &  alistrA,
const std::string &  alistrB 
)
static

convert alignemnt string to edge end vector

Parameters
alistralignment string
Returns
vector of edge ends corresponding to alistr

◆ append()

void LocARNA::Alignment::append ( edge_end_t  i,
edge_end_t  j 
)

Append an alignment edge.

Parameters
ifirst position of edge (or -1 for gap)
jsecond position of edge (or -1 for gap) Edges have to be appended in ascending order

◆ clear()

void LocARNA::Alignment::clear ( )

Delete the alignment edges and reset structure

◆ dot_bracket_structureA()

std::string LocARNA::Alignment::dot_bracket_structureA ( bool  only_local) const

Structure A.

Parameters
only_localif true, construct string only for aligned subsequence
Returns
dot bracket string for structure A with gaps

◆ dot_bracket_structureB()

std::string LocARNA::Alignment::dot_bracket_structureB ( bool  only_local) const

Structure B.

Parameters
only_localif true, construct string only for aligned subsequence
Returns
dot bracket string for structure B with gaps

◆ empty()

bool LocARNA::Alignment::empty ( ) const

check for empty alignment

Returns
whether alignment is empty

◆ end_positions()

Alignment::pos_pair_t LocARNA::Alignment::end_positions ( ) const

get pair of last positions in the alignment

See also
local_start()

◆ operator=()

Alignment & LocARNA::Alignment::operator= ( const Alignment alignment)

assignment operator

Parameters
alignmentobject to be assigned Assigns implementation object (not only pointer)

◆ seqA()

const Sequence & LocARNA::Alignment::seqA ( ) const

read access seqA

Returns
sequence A

◆ seqB()

const Sequence & LocARNA::Alignment::seqB ( ) const

read access seqB

Returns
sequence B

◆ set_consensus_structure()

void LocARNA::Alignment::set_consensus_structure ( const RnaStructure structure)

Set consensus structure of the alignment.

Parameters
structureconsensus structure

◆ set_structures()

void LocARNA::Alignment::set_structures ( const RnaStructure structureA,
const RnaStructure structureB 
)

Set structures of the alignment.

Parameters
structureAstructure A
structureBstructure B

◆ start_positions()

Alignment::pos_pair_t LocARNA::Alignment::start_positions ( ) const

get pair of first positions in the alignment

Note
if the alignment starts with a gap, this does not return an edge of the alignment!

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