complexe.h 3.3 KB
#ifndef DEF_HCOMP
#define DEF_HCOMP

#include <vector>
#include <string>
#include <tuple>

#include "Motifs/helix.h"
#include "structure.h"
#include "solinteraction.h"

class Complexe
{
public:

    Complexe(const std::vector< unsigned int > &rnaList, const std::vector< std::string > &rnaName,
             const std::vector< std::string > &seqList,
             const std::vector < std::pair < std::pair < unsigned int, unsigned int >, std::pair < unsigned int, unsigned int > > > &listBP,
             std::vector < float > obj);

    Complexe();

    ~Complexe();

    void loadListsBP_();

    std::vector< unsigned int > get_rnaList_() const;

    std::vector< std::string > get_rnaName_() const;

    std::vector< std::string > get_seqList_() const;

    std::vector < float > get_obj_() const;

    std::vector < std::pair < std::pair < unsigned int, unsigned int > , std::pair < unsigned int, unsigned int > > > get_listBP_() const;

    std::vector < std::vector < std::pair < std::pair < unsigned int, unsigned int > , std::pair < unsigned int, unsigned int > > > > get_listsBP_() const;

    void set_obj_(std::vector < float > obj);

    void set_rnaList_(const std::vector< unsigned int > &rnaList);

    void set_rnaName_(const std::vector< std::string > &rnaName);

    void set_seqList_(const std::vector< std::string > &seqList);

    std::vector< std::vector < std::vector < int > > >  permutation(std::vector< std::vector < std::vector < int > > > oldLevel, std::vector< std::vector < std::vector < int > > > combi, int max) const;

    void make_listBP2_();
    
    std::string convToDP();

    char get_closing_char(char openChar);

    std::string to_string();

    std::string to_Json();

    std::string to_forna();

    std::string to_graph(uint index);

    bool operator<(const Complexe &c);

    bool operator<(const Complexe &c) const;

    bool operator>(const Complexe &c);

    bool operator>(const Complexe &c) const;

    bool operator<=(const Complexe &c);

    bool operator<=(const Complexe &c) const;

    bool operator>=(const Complexe &c);

    bool operator>=(const Complexe &c) const;

    bool operator==(const Complexe &c);

    bool operator==(const Complexe &c) const;

    bool operator!=(const Complexe &c);

    bool operator!=(const Complexe &c) const;

    std::pair < std::pair < int, int > , std::pair < int, int > > invert(std::pair < std::pair < int, int > , std::pair < int, int > > pair) const;

    static bool isEquivalent(const Complexe &c1, const Complexe &c2);

private:

    std::vector < unsigned int > rnaList_;   //vector to store the rna

    std::vector < std::string > rnaName_;   //vector to store the name of the rna

    std::vector < std::string > seqList_;   //vector to store the sequences

    std::vector < std::pair < std::pair < unsigned int, unsigned int > , std::pair < unsigned int, unsigned int > > > listBP_;  //store the base pairs

    std::vector < std::pair < std::tuple < unsigned int, unsigned int, unsigned int >, std::tuple < unsigned int, unsigned int, unsigned int > > > listBP2_; // base pairs with positions in rna and in complex

    std::vector < std::vector < std::pair < std::pair < unsigned int, unsigned int > , std::pair < unsigned int, unsigned int > > > > listsBP_;     //store id base pair if there are identical sequences of rna

    std::vector < float > obj_;

};


#endif