Annotation of a sequence.
More...
#include <sequence_annotation.hh>
|
typedef std::string | name_t |
| an anchcor name
|
|
Annotation of a sequence.
Defines names for positions from 1..size; allows construct as consensus of two aligned annotation sequences.
◆ SequenceAnnotation() [1/4]
LocARNA::SequenceAnnotation::SequenceAnnotation |
( |
size_type |
name_length = 0 | ) |
|
|
inlineexplicit |
Construct empty.
- Parameters
-
name_length | length of names |
◆ SequenceAnnotation() [2/4]
LocARNA::SequenceAnnotation::SequenceAnnotation |
( |
const std::string & |
annotation_string | ) |
|
|
explicit |
Construct single string.
- Parameters
-
annotation_string | string of '#'-separated sub-strings |
◆ SequenceAnnotation() [3/4]
LocARNA::SequenceAnnotation::SequenceAnnotation |
( |
const std::vector< std::string > & |
annotation_strings | ) |
|
|
explicit |
Construct from vector of strings.
- Parameters
-
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()
◆ SequenceAnnotation() [4/4]
Construct as consensus annotation.
- Parameters
-
edges | alignment edges between A and B |
annotationA | annotation A |
annotationB | annotation B |
- Returns
- consensus annotation of A and B
- Note
- If two different names are aligned (name clash!), the lexicographically smaller name is selected to resolve the conflict
-
If two equal names are not aligned, this can result in duplicate names in the consensus
The consensus contains all names that appear in either A or B or both at the position of the corresponding alignment edge.
- Precondition
- names in annotationA and annotationB must have the same lengths
◆ annotation_string()
const std::string& LocARNA::SequenceAnnotation::annotation_string |
( |
size_t |
i | ) |
const |
|
inline |
Access to annotation strings
- Parameters
-
- Returns
- annotation string with index i
◆ empty()
bool LocARNA::SequenceAnnotation::empty |
( |
| ) |
const |
|
inline |
Check empty.
- Returns
- whether empty
◆ is_neutral()
bool LocARNA::SequenceAnnotation::is_neutral |
( |
const name_t & |
name | ) |
|
|
static |
Test neutral name.
- Returns
- whether name is neutral, i.e. contains no non-neutral characters
◆ is_neutral_char()
static bool LocARNA::SequenceAnnotation::is_neutral_char |
( |
char |
c | ) |
|
|
inlinestatic |
Test for neutral character.
- Parameters
-
- Returns
- whether c is neutral
◆ is_neutral_pos()
bool LocARNA::SequenceAnnotation::is_neutral_pos |
( |
size_t |
i | ) |
const |
Test neutral name at a position.
- Parameters
-
- Returns
- whether name at position i is neutral, i.e. contains no non-neutral characters
◆ length()
size_t LocARNA::SequenceAnnotation::length |
( |
| ) |
const |
|
inline |
Size of the represented range.
- Returns
- size, where represented range of positions is 1..size
◆ name()
std::string LocARNA::SequenceAnnotation::name |
( |
size_t |
i | ) |
const |
Access name at position.
- Parameters
-
- Returns
- name at position i
◆ name_length()
size_t LocARNA::SequenceAnnotation::name_length |
( |
| ) |
const |
|
inline |
Name length.
- Returns
- length of names
◆ push_back_name()
void LocARNA::SequenceAnnotation::push_back_name |
( |
const name_t & |
name | ) |
|
Push back name to the annotation strings in annotation_.
- Parameters
-
◆ single_string()
std::string LocARNA::SequenceAnnotation::single_string |
( |
char |
sep = '#' | ) |
const |
Annotation description as single string
- Parameters
-
sep | separator between annotation strings |
- Returns
- string of annotation strings separated by sep
The documentation for this class was generated from the following files: