Ymir  .9
Fast\C++toolforcomputationofassemblingprobabilities,statisticalinferenceofassemblingstatisticalmodelandgenerationofartificialsequencesofT-cellreceptorsdata.
Public Member Functions | Protected Attributes | Friends | List of all members
ymir::MAAG Class Reference

Multi-Alignment Assembly Graph - basic class for representing all possible generation scenarios of a nucleotide or amino acid sequence of an immune receptor. More...

#include <maag.h>

Inheritance diagram for ymir::MAAG:
ymir::MultiMatrixChain< _Scalar > ymir::MAAGBuilder

Public Member Functions

 MAAG ()
 Default constructor.
 
 MAAG (const MAAG &other)
 
 MAAG (MAAG &&other)
 
virtual ~MAAG ()
 Special swap constructor for MAAGs that will be used only for computation of the full probability. More...
 
MAAGoperator= (const MAAG &other)
 
MAAGoperator= (MAAG &&other)
 
seq_len_t position (seq_len_t i) const
 
bool has_events () const
 
bool has_errors () const
 
prob_t error_prob () const
 
const std::string & sequence () const
 
seq_len_t n_poses () const
 
SequenceType sequence_type () const
 
dim_t rows (node_ind_t node_i) const
 
dim_t cols (node_ind_t node_i) const
 
prob_t fullProbability (event_ind_t v_index, event_ind_t j_index) const
 Compute and return the full assembling probability of this sequence (i.e., with all gene segments alignments). More...
 
prob_t fullProbability (event_ind_t v_index, event_ind_t d_index, event_ind_t j_index) const
 
prob_t fullProbability (MAAGComputeProbAction action=SUM_PROBABILITY) const
 
event_ind_t nVar () const
 Get the number of aligned gene segments. More...
 
event_ind_t nJoi () const
 
event_ind_t nDiv () const
 
prob_t event_probability (node_ind_t node_i, matrix_ind_t mat_i, dim_t row, dim_t col) const
 Access to event indices, event probabilities and mismatches in the underlying matrices of the MAAG. More...
 
event_ind_t event_index (node_ind_t node_i, matrix_ind_t mat_i, dim_t row, dim_t col) const
 
error_num_t errors (node_ind_t node_i, matrix_ind_t mat_i, dim_t row, dim_t col) const
 
bool save (const std::string &filepath) const
 Save the graph to the harddrive and load a previously saved graph. More...
 
bool save (std::ostream &stream) const
 
bool load (const std::string &filepath)
 
bool load (std::istream &stream)
 
Recombination recombination () const
 
bool is_vj () const
 
bool is_vdj () const
 

Protected Attributes

prob_t _err_prob
 
pEventIndMMC _events
 
pErrMMC _errors
 
unique_ptr< seq_len_t[]> _seq_poses
 
unique_ptr< sequence_t > _sequence
 
SequenceType _seq_type
 
Recombination _recomb
 
seq_len_t _n_poses
 
- Protected Attributes inherited from ymir::MultiMatrixChain< _Scalar >
std::vector< Node_chain
 
std::vector< _Scalar > _values
 

Friends

class MAAGForwardBackwardAlgorithm
 
class MAAGBuilder
 

Additional Inherited Members

- Protected Types inherited from ymir::MultiMatrixChain< _Scalar >
typedef uint8_t node_ind_t
 Node index type.
 
typedef uint8_t matrix_ind_t
 Matrix index type.
 
typedef seq_len_t dim_t
 Type of dimensions of matrices (rows and columns).
 
typedef Matrix< _Scalar, dim_tmatrix_t
 Type of matrices in the chain.
 
- Protected Member Functions inherited from ymir::MultiMatrixChain< _Scalar >
void resize (node_ind_t n_nodes)
 
node_ind_t chainSize () const
 
void initNode (node_ind_t node_i, matrix_ind_t n_matrices, dim_t rows, dim_t cols)
 
void swap (MultiMatrixChain &other)
 
void finish ()
 
void fill (node_ind_t node, matrix_ind_t mat, _Scalar val=0)
 
matrix_t matrix (node_ind_t node, matrix_ind_t mat) const
 
_Scalar operator[] (size_t index) const
 
size_t values_size () const
 
matrix_ind_t nodeSize (node_ind_t node_i) const
 
dim_t nodeRows (node_ind_t node_i) const
 
dim_t nodeColumns (node_ind_t node_i) const
 
_Scalar & operator() (node_ind_t node_i, matrix_ind_t mat_i, dim_t row, dim_t col)
 Access element with specified indices at specified matrix. More...
 
_Scalar operator() (node_ind_t node_i, matrix_ind_t mat_i, dim_t row, dim_t col) const
 
_Scalar & at (node_ind_t node_i, matrix_ind_t mat_i, dim_t row, dim_t col)
 
_Scalar at (node_ind_t node_i, matrix_ind_t mat_i, dim_t row, dim_t col) const
 
node_ind_t addNode ()
 Add new node with pattern matrix.
 
node_ind_t addNode (matrix_ind_t n_matrices, dim_t rows, dim_t cols)
 

Detailed Description

Multi-Alignment Assembly Graph - basic class for representing all possible generation scenarios of a nucleotide or amino acid sequence of an immune receptor.

Constructor & Destructor Documentation

virtual ymir::MAAG::~MAAG ( )
inlinevirtual

Special swap constructor for MAAGs that will be used only for computation of the full probability.

Special swap constructor for MAAGs that will be used for statistical inference.

Member Function Documentation

prob_t ymir::MAAG::event_probability ( node_ind_t  node_i,
matrix_ind_t  mat_i,
dim_t  row,
dim_t  col 
) const
inline

Access to event indices, event probabilities and mismatches in the underlying matrices of the MAAG.

Parameters
node_iIndex of the node.
mat_iIndex of the matrix in the node.
rowWhich row to choose.
colWhich column to choose.
Returns
Event probability, event index or is mismatch. In the second case zero will be returned if no event chain matrix is stored in this MAAG.
prob_t ymir::MAAG::fullProbability ( event_ind_t  v_index,
event_ind_t  j_index 
) const
inline

Compute and return the full assembling probability of this sequence (i.e., with all gene segments alignments).

Parameters
v_indexWhich aligned Variable gene segment to choose.
d_indexWhich aligned Diversity gene segment to choose.
j_indexWhich aligned Joining gene segment to choose.
action
Returns
Full assembling probability. Returns 0 if wrong recombination function is used.
event_ind_t ymir::MAAG::nVar ( ) const
inline

Get the number of aligned gene segments.

Returns
Number of the aligned specific gene segments.
bool ymir::MAAG::save ( const std::string &  filepath) const
inline

Save the graph to the harddrive and load a previously saved graph.

Parameters
filepathPath to the file with a saved graph for loading and new file for saving.
streamAn output / input stream, from that read the graph or save the graph.

Member Data Documentation

pErrMMC ymir::MAAG::_errors
protected

Matrix of indices of events for each edge.

pEventIndMMC ymir::MAAG::_events
protected

Probability of a error.

unique_ptr<seq_len_t[]> ymir::MAAG::_seq_poses
protected

Matrix of number of errors for each scenario event position.

SequenceType ymir::MAAG::_seq_type
protected

Nucleotide or amino acid CDR3 sequence.

unique_ptr<sequence_t> ymir::MAAG::_sequence
protected

Vector of the initial clonotype sequence's positions for each vertex.


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