rna_copy.h 1.52 KB

#ifndef DEF_RNA
#define DEF_RNA

#include <vector>
#include <string>

#include "fa.h"
#include "coord.h"


typedef std::vector<int> VI;
typedef std::vector<VI> VVI;
typedef std::vector<std::pair<int,int> > VII;
typedef std::vector<float> VF;
typedef std::vector<VF> VVF;

class Rna{

public:
    Rna();

    Rna(std::string name, std::string seq, int id);

    Rna (const char * file);

    Rna (Fasta * fasta);

    Fasta get_fasta();

    int get_n_();

    std::string get_name_();

    std::string get_nameFasta();

    std::string get_path();

    std::string get_seq_();

    VVI get_type_();

    int get_type(int i, int j);

    int get_type(int i);

    Coord get_coord_();

    std::pair< int,int > get_coord(int i);

    int get_coordF(int i);

    int get_coordS(int i);

    int find_coord(std::pair< int,int >);

    VVF get_pij_();

    float get_pij(int i, int j);

    float get_pij(int i);

    int get_err_();

    int get_nBP_();

    int get_id_();

    void set_name_(const std::string name);

    void set_id_(const int id);

    void init(int id);

    static bool check_seq(const std::string seq);



private:
    Fasta *fasta_;
    std::string name_; /*name of the rna given by the user*/
    std::string seq_;
    int n_; /*length of the rna*/
    VVI type_;  /*vector of base pair types*/
    Coord coord_; /*vector of base pair coordinates*/
    VVF pij_; /*vector of probabilities*/
    int err_; /*if any error in sequence, != 0*/
    int nBP_; /*number of possible base pair*/
    int id_;


    void format();
};



#endif