RNA Folding simulation
Functions
rna_folding.hh File Reference

RNA folding algorithm implementation. More...

#include <algorithm>
#include <iostream>
#include <vector>
#include <fstream>
#include "herrlog.hh"
Include dependency graph for rna_folding.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::vector< std::vector< int > > create_matrix (const std::string &rna_sequence, const int &minimal_loop_length=0)
 Function to create the DP matrix for RNA folding. More...
 
int rna_score (const std::string &rna_sequence, const int &minimal_loop_length=0)
 Function to calculate number of bonds (theoretical) in the RNA. More...
 
void traceback (const std::vector< std::vector< int >> &nm, const std::string &rna, std::vector< std::pair< int, int >> &fold, int i, int j)
 Function to traceback DP and get the bonds structure. More...
 
std::string dot_write (const std::string &rna, const std::vector< std::pair< int, int >> &fold)
 Function to create the dot-bracket notation from the bonds. More...
 
void dot_bracket_to_dot (const std::string &sequence, const std::string &structure)
 Creates a DOT script from the RNA sequence and structure and calls graphviz. More...
 

Detailed Description

RNA folding algorithm implementation.

Author
Adarsh Das (saphereye.github.io)

Definition in file rna_folding.hh.

Function Documentation

◆ create_matrix()

std::vector<std::vector<int> > create_matrix ( const std::string &  rna_sequence,
const int &  minimal_loop_length = 0 
)

Function to create the DP matrix for RNA folding.

Parameters
rna_sequence
Returns
int

Definition at line 22 of file rna_folding.hh.

◆ dot_bracket_to_dot()

void dot_bracket_to_dot ( const std::string &  sequence,
const std::string &  structure 
)

Creates a DOT script from the RNA sequence and structure and calls graphviz.

Parameters
sequence
structure

Definition at line 129 of file rna_folding.hh.

◆ dot_write()

std::string dot_write ( const std::string &  rna,
const std::vector< std::pair< int, int >> &  fold 
)

Function to create the dot-bracket notation from the bonds.

Parameters
rna
fold
Returns
std::string

Definition at line 111 of file rna_folding.hh.

◆ rna_score()

int rna_score ( const std::string &  rna_sequence,
const int &  minimal_loop_length = 0 
)

Function to calculate number of bonds (theoretical) in the RNA.

Parameters
rna_sequence
minimal_loop_length
Returns
int

Definition at line 61 of file rna_folding.hh.

◆ traceback()

void traceback ( const std::vector< std::vector< int >> &  nm,
const std::string &  rna,
std::vector< std::pair< int, int >> &  fold,
int  i,
int  j 
)

Function to traceback DP and get the bonds structure.

Parameters
nm
rna
fold
i
j

Definition at line 77 of file rna_folding.hh.