Annotation of a sequence. More...
#include <sequence_annotation.hh>
Public Member Functions | |
SequenceAnnotation (size_type name_length=0) | |
Construct empty. | |
SequenceAnnotation (const std::string &annotation_string) | |
Construct single string. | |
SequenceAnnotation (const std::vector< std::string > &annotation_strings) | |
Construct from vector of strings. | |
SequenceAnnotation (const AlignmentEdges &edges, const SequenceAnnotation &annotationA, const SequenceAnnotation &annotationB) | |
Construct as consensus annotation. | |
size_t | length () const |
Size of the represented range. | |
bool | empty () const |
Check empty. | |
size_t | name_length () const |
Name length. | |
const std::string & | annotation_string (size_t i) const |
std::string | single_string (char sep= '#') const |
bool | is_neutral_pos (size_t i) const |
Test neutral name at a position. | |
std::string | name (size_t i) const |
Access name at position. | |
void | push_back_name (const name_t &name) |
Push back name to the annotation strings in annotation_. | |
bool | duplicate_names () const |
Static Public Member Functions | |
static const SequenceAnnotation & | empty_instance () |
initialize the static member empty_instance | |
static bool | is_neutral_char (char c) |
Test for neutral character. | |
static bool | is_neutral (const name_t &name) |
Test neutral name. | |
static bool | clashing_names (const AlignmentEdges &edges, const SequenceAnnotation &annotationA, const SequenceAnnotation &annotationB) |
Annotation of a sequence.
Defines names for positions from 1..size; allows construct as consensus of two aligned annotation sequences.
LocARNA::SequenceAnnotation::SequenceAnnotation | ( | size_type | name_length = 0 | ) | [inline, explicit] |
Construct empty.
name_length | length of names |
LocARNA::SequenceAnnotation::SequenceAnnotation | ( | const std::string & | annotation_string | ) | [explicit] |
Construct single string.
annotation_string | string of '#'-separated sub-strings |
LocARNA::SequenceAnnotation::SequenceAnnotation | ( | const std::vector< std::string > & | annotation_strings | ) | [explicit] |
Construct from vector of strings.
annotation_strings | vector of annotation strings |
The strings specify names of uniform length. The name of a position i is the string annotation_strings[0][i]+...+annotation_strings[k-1][i], where k=annotation_strings.size()
LocARNA::SequenceAnnotation::SequenceAnnotation | ( | const AlignmentEdges & | edges, |
const SequenceAnnotation & | annotationA, | ||
const SequenceAnnotation & | annotationB | ||
) |
Construct as consensus annotation.
edges | alignment edges between A and B |
annotationA | annotation A |
annotationB | annotation B |
The consensus contains all names that appear in either A or B or both at the position of the corresponding alignment edge.
const std::string& LocARNA::SequenceAnnotation::annotation_string | ( | size_t | i | ) | const [inline] |
Access to annotation strings
i | index; 0-based |
bool LocARNA::SequenceAnnotation::empty | ( | ) | const [inline] |
Check empty.
bool LocARNA::SequenceAnnotation::is_neutral | ( | const name_t & | name | ) | [static] |
Test neutral name.
static bool LocARNA::SequenceAnnotation::is_neutral_char | ( | char | c | ) | [inline, static] |
Test for neutral character.
c |
bool LocARNA::SequenceAnnotation::is_neutral_pos | ( | size_t | i | ) | const |
Test neutral name at a position.
i | position of name |
size_t LocARNA::SequenceAnnotation::length | ( | ) | const [inline] |
Size of the represented range.
std::string LocARNA::SequenceAnnotation::name | ( | size_t | i | ) | const |
Access name at position.
i | position |
size_t LocARNA::SequenceAnnotation::name_length | ( | ) | const [inline] |
Name length.
void LocARNA::SequenceAnnotation::push_back_name | ( | const name_t & | name | ) |
Push back name to the annotation strings in annotation_.
name | Name |
std::string LocARNA::SequenceAnnotation::single_string | ( | char | sep = '#' | ) | const |
Annotation description as single string
sep | separator between annotation strings |