Stores information about an RNA molecule: the sequence string containing
bases in a sequence, and the dot bracket structure, which contains
information about how the bases pair up.
struct Sequence
std::string rnaSequence: String containing the RNA
sequence.
std::string rnaDotBracket: String containing the dot
bracket structure.
include/rnaFold.h
Reads the input sequence file and uses the ViennaRNA package to compute
the dot bracket structure for the RNA sequence.
FILE* getRnaFoldOutput()
Reads the input file containing the RNA sequence. Runs the RNAfold command.
Parameters: (none) Return: FILE* - the file stream variable.
Extracts the RNA sequence and the dot bracket structure from the output of
the getRnaFoldOutput() function and creates a struct instance to store
that information.
Parameters
FILE* pipe: a file stream opened by popen to execute a
command (RNAfold) with the specified input file.
Return: struct Sequence - the instance of the Sequence
struct conataining the sequence string and the dot bracket structure.
struct Sequence getSequenceDetails()
Calls getSequenceAndDotStructure(FILE*) and returns the struct instance.
Parameters: (none) Return: struct Sequence : the instance of the Sequence
struct conataining the sequence string and the dot bracket structure.
include/predictStructure.h
Takes an RNA sequence as input and calculates the maximum number of pairs
that are possible such that there are no sharp turns or knots.
void solve(const std::string& str)
Computes the maximum number of matching base pairs in an RNA sequence
using dynamic programming. The function updates a DP table based on valid
RNA base pair matches (A-U, U-A, G-C, C-G).
Parameters
std::string str: RNA sequence string to be processed.
Return: (none)
void makePairs(int i, int j)
Recursively reconstructs the matching base pairs from the DP table and
stores them in a list of pairs.
Parameters
int i: Starting index of the subsequence.
int j: Ending index of the subsequence.
Return: (none)
void predict(struct Sequence seq)
Calls solve to fill the table, and makePairs to reconstruct the pairings,
and finally outputs the results.
Parameters
struct Sequence seq: RNA sequence read from the input
sequence file.
Return: (none)
include/visualization.h
Produces a URL as an output to which the user can navigate to for
visualizing the secondary structure of the RNA sequence.
std::string dotEncode(const std::string& value)
Converts the dot bracket structure into an encoded form that can be passed
over a URL.
Parameters
std::string value: a dot bracket structure containing
the characters '.', '(', and ')'.
Return: std::string - the encoded dot bracket string.